diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AANTTreeMap.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AANTTreeMap.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisCombination.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisCombination.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisLooper.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisLooper.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisMisc.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisMisc.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisPermutation.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisPermutation.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisSelection.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/AnalysisSelection.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/Categories.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/Categories.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/CategoryIdFilter.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/CategoryIdFilter.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ChargeFilter.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ChargeFilter.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/CombinatoricsOdometer.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/CombinatoricsOdometer.h deleted file mode 100755 index 2264fac8a658811dbb2522d1e6649bd7ce115aaf..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/CombinatoricsOdometer.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// Dear emacs, this is -*-c++-*- -#ifndef ANALYSISUTILS_COMBINATORICSODOMETER_H -#define ANALYSISUTILS_COMBINATORICSODOMETER_H - -/***************************************************************************** - * @Project: D2PDMaker - * - * @class CombinatoricsOdometer - * - * @author Steven Sekula <Stephen.Jacob.Sekula@cernSPAMNOT.ch> - * @author Karsten Koeneke <karsten.koeneke@cernSPAMNOT.ch> - * - * @date January 2010 - * - * @brief Helper class for particle combinatorics of several lists. - * -Based 100% on (i.e., this is pretty much a copy with the option to remove -the original from its current place): -NAME: EVComboHelper.h -PACKAGE: offline/PhysicsAnalysis/EventViewBuilder/EventViewCombiners/ - -AUTHORS: Akira Shibata (ashibata@cern.ch) -CREATED: Feb 2006 - -Methods used in combiner tools. The problem is to generate unique -set of N indeces from M containers in a general way. For eg, suppose -there are three containers each containing 3, 4, 5 elements respectively: -one way to solve it is to construct an "odometer" each digit going up -to the number of elements. Of cource, uniqueness of each combinations -should be ensured. The problem is that some digits of the odometer -may come from the same container. For the problem to be solved by odometer -approach (is a useful approach to be able to specify a combination by -["jet" "jet" "lepton"] etc), digits that come from the same container -always have smaller number on the left. - -eg. if the combination is ["jet", "jet", "lepton", "bjet", "lepton"] -(problem is simplified if repeated labels always come together but -this cannot be assumed) -and "jet" container has 4 elements, "lepton" 2, and "bjet" 2, then -00000 is not acceptable since two jets and leptons chosen are the same. -01001 is the smallest acceptable number. -01101 is not acceptable since leptons are the same -01100 is not acceptable since the lepton digits 21 an 12 are indifferent - in terms of combination and 01102 has already been counted. -01102 won't be counted since there's only two leptons. - -********************************************************************/ - -#include <map> -#include <set> -#include <string> -#include <iostream> -#include <vector> -#include "DataModel/DataVector.h" - -//flexible digit class, maximum number as specified, knows about -//another digit typicaly the next digit -class FlexDigit -{ -public: - FlexDigit(int , FlexDigit* =0); - ~FlexDigit(){}; - void setNext( FlexDigit* next ); - FlexDigit* next(); - int digit() const; - void setDigit( int digit ); - bool isAtMax(); - bool isFirstDigit(); - FlexDigit operator++( int ); - -private: - int m_digit; - int m_digitMax; - FlexDigit* m_nextDigit; -}; - -inline void FlexDigit::setNext( FlexDigit* next ){ m_nextDigit=next; } -inline FlexDigit* FlexDigit::next(){ return m_nextDigit; } -inline int FlexDigit::digit() const { return m_digit; } -inline void FlexDigit::setDigit( int digit ){ m_digit = digit; } -inline bool FlexDigit::isAtMax(){ return m_digit >= m_digitMax; } -inline bool FlexDigit::isFirstDigit(){ return !m_nextDigit; } - -//vector of pointers to flexible digits. -class FlexDigits : public DataVector<FlexDigit> -{ -public: - FlexDigits(std::vector<std::string>& labels, std::map<std::string, int>& digitMax); - FlexDigits(int numDigits, int digitMax); - virtual ~FlexDigits(); - virtual bool increment(); - virtual void push_back(FlexDigit*); - virtual void print(); - bool isZero(); - virtual FlexDigits& operator++( int ); - bool hasStarted(); - void setStarted(); - -private: - bool m_started; -}; - -inline bool FlexDigits::hasStarted(){ return m_started; } -inline void FlexDigits::setStarted(){ m_started = true; } - - -class OdoMeter : public FlexDigits -{ -public: - OdoMeter(std::vector<std::string>& labels, std::map<std::string, int>& numObj); - OdoMeter(int numDigits, int digitMax); - virtual ~OdoMeter(); - std::vector<int> getVector(); - std::pair<int,int> getPair(); - virtual bool increment(); - bool nextPair(); - bool isUnique(bool doCheck); - bool hasOnlySingleEntry(bool doCheck); -private: - bool m_onlyUnique; - bool m_onlySingleEntry; //allow two same ones from the same container? - int m_numLabels; - OdoMeter* m_pairMeter; - std::map<std::string, std::set<int> > m_digitAssoc; - std::set<std::string> m_labels; -}; - - -class PairMeter : public OdoMeter -{ -public: - PairMeter(int numDigits); - virtual ~PairMeter(); - virtual bool increment(); -private: -}; - -#endif diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ContainerFilter.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ContainerFilter.h index 278f452cb5082997be3150c201edc0cd7bd07bbe..dde7f8214022e6b5bc6a7dfc16148fb88c66cac8 100644 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ContainerFilter.h +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ContainerFilter.h @@ -19,7 +19,7 @@ public: const IInterface* parent ) : AthAlgTool( type, name, parent ), AraAlgToolWrapper< ContainerFilterCore > ( type, name, parent ) - {AthAlgTool::declareInterface< ContainerFilterCore >(this); }; + {/*AthAlgTool::declareInterface< ContainerFilterCore >(this);*/} }; diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ElectronIDSelector.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ElectronIDSelector.h index 2b37deaca5e8636d19ef1a6a5d8c680a4dd3b094..e1dde2b010090be935c8f8d63dcdddd792d5949d 100644 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ElectronIDSelector.h +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ElectronIDSelector.h @@ -32,7 +32,7 @@ public: const IInterface* parent ) : AthAlgTool( type, name, parent ), AraAlgToolWrapper< ElectronIDSelectorCore > ( type, name, parent ) - {AthAlgTool::declareInterface< ElectronIDSelectorCore >(this); }; + {/*AthAlgTool::declareInterface< ElectronIDSelectorCore >(this);*/} }; diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/FilterRange.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/FilterRange.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IFilter.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IFilter.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IFilterCuts.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IFilterCuts.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IFilterUtils.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IFilterUtils.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IIParticleFilter.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IIParticleFilter.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IParticleFilter.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/IParticleFilter.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ISelector.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ISelector.h index 4cee74a7e221cdbfe22948ef681de3ee1f580862..34c5575fada504b6ec5bbb5a45c10be5e26b1df6 100644 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ISelector.h +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ISelector.h @@ -32,7 +32,7 @@ public: const IInterface* parent ) : AthAlgTool( type, name, parent ), AraAlgToolWrapper< ISelectorCore > ( type, name, parent ) - {AthAlgTool::declareInterface< ISelectorCore >(this); }; + {/*AthAlgTool::declareInterface< ISelectorCore >(this);*/} }; diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/KinematicSelector.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/KinematicSelector.h index 99a9402168e82529b449ffe4048bfad52a40b156..b6e2557ff315aa25ce2dda85a0a9504bdaa88323 100644 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/KinematicSelector.h +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/KinematicSelector.h @@ -33,7 +33,7 @@ public: const IInterface* parent ) : AthAlgTool( type, name, parent ), AraAlgToolWrapper< KinematicSelectorCore > ( type, name, parent ) - {AthAlgTool::declareInterface< KinematicSelectorCore >(this); }; + {/*AthAlgTool::declareInterface< KinematicSelectorCore >(this);*/} }; diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/MomentumFilter.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/MomentumFilter.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ParticleCandidateList.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ParticleCandidateList.h old mode 100755 new mode 100644 index a5ab9d23e2c825bc965006e02dda7e356c6ec76d..0617634f88d53a9c17dd240c79a4586df9577763 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ParticleCandidateList.h +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/ParticleCandidateList.h @@ -41,7 +41,7 @@ class ParticleCandidateList ///\name list typedefs: it behaves like a std::list<PDG::pidType> //@{ typedef PDG::pidType& reference; - typedef const reference const_reference; + typedef const PDG::pidType& const_reference; typedef std::list<PDG::pidType>::iterator iterator; typedef std::list<PDG::pidType>::const_iterator const_iterator; typedef std::list<PDG::pidType>::size_type size_type; diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/PdgIdFilter.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/PdgIdFilter.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/PhiFilterRange.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/PhiFilterRange.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/Private.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/Private.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/SelectorBase.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/SelectorBase.h index 80b4bb19bce214b94bd9c1cde17412e0505b91a8..b1944fb6560ce83f4babdda20fe38d1d826bb25e 100644 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/SelectorBase.h +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/AnalysisUtils/SelectorBase.h @@ -24,6 +24,7 @@ NOTE: Derived class for container XXXContainer must define #include "AthenaBaseComps/AthAlgorithm.h" #include "StoreGate/StoreGateSvc.h" +#include "AthenaKernel/Units.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/AlgTool.h" #include "GaudiKernel/ToolHandle.h" @@ -52,8 +53,6 @@ class SelectorBase : public AthAlgorithm { protected: - StoreGateSvc* m_pSG; - MsgStream* mLog; std::string m_inputKey; std::string m_inselectedKey; std::string m_selectedKey; @@ -79,8 +78,6 @@ class SelectorBase : public AthAlgorithm { template<class Derived> SelectorBase<Derived>::SelectorBase(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), - m_pSG(0), - mLog(0), m_gensel(false), m_genlink(false) { @@ -103,51 +100,38 @@ template<class Derived> template<class Derived> StatusCode SelectorBase<Derived>::initialize() { - mLog=new MsgStream(messageService(), name()); m_genlink=true; m_gensel=true; - (*mLog) <<MSG::INFO <<"Initializing Selector " <<name() <<endreq; + ATH_MSG_INFO("Initializing Selector " <<name() ); if(m_inputKey==std::string("NONE")) m_nogood=true; if(m_selectedKey==std::string("NONE")) m_gensel=false; if(m_inselectedKey!=std::string("NONE")) m_inSel=true; if(m_linksKey==std::string("NONE") ) m_genlink=false; if(m_inlinksKey!=std::string("NONE")) m_inLink=true; - (*mLog) << MSG::INFO << "InputKey="<<m_inputKey.c_str()<<", OutSelectedParticlesKey="<<m_selectedKey.c_str() - <<", InSelectedParticlesKey="<<m_inselectedKey.c_str() - <<", InParticlesLinksKey="<<m_inlinksKey.c_str() - <<", OutParticleLinksKey="<<m_linksKey.c_str()<<endreq; - (*mLog)<< MSG::INFO<<", PtMin="<<m_ptmin; - (*mLog)<< MSG::INFO<<", PtMax="<<m_ptmax; - (*mLog)<< MSG::INFO<<", EtaMin="<<m_etamin; - (*mLog)<< MSG::INFO<<", EtaMax="<<m_etamax; - (*mLog)<< MSG::INFO<<", AbsEtaMin="<<m_absetamin; - (*mLog)<< MSG::INFO<<", AbsEtaMax="<<m_absetamax; - (*mLog)<< MSG::INFO<<", SelectAll="<<m_all; - if(m_all) (*mLog)<< MSG::INFO<<" All items will be accepted"; - (*mLog)<< MSG::INFO<<endreq; + ATH_MSG_INFO( "InputKey="<<m_inputKey.c_str()<<", OutSelectedParticlesKey="<<m_selectedKey.c_str() + <<", InSelectedParticlesKey="<<m_inselectedKey.c_str() + <<", InParticlesLinksKey="<<m_inlinksKey.c_str() + <<", OutParticleLinksKey="<<m_linksKey.c_str() ); + ATH_MSG_INFO(", PtMin="<<m_ptmin + << MSG::INFO<<", PtMax="<<m_ptmax + << MSG::INFO<<", EtaMin="<<m_etamin + << MSG::INFO<<", EtaMax="<<m_etamax + << MSG::INFO<<", AbsEtaMin="<<m_absetamin + << MSG::INFO<<", AbsEtaMax="<<m_absetamax + << MSG::INFO<<", SelectAll="<<m_all ); + if(m_all) ATH_MSG_INFO(" All items will be accepted" ); m_nogood=m_nogood && (!m_genlink && !m_gensel); if(m_nogood){ - (*mLog) << MSG::FATAL << "Must supply names for InputKey, OutSelectedParticlesKey and/or OutParticleLinksKey" - << endreq; + ATH_MSG_FATAL( "Must supply names for InputKey, OutSelectedParticlesKey and/or OutParticleLinksKey" ); } m_nogood=m_inSel && m_inLink; if(m_nogood){ - (*mLog) << MSG::FATAL << "Cannot have both InSelectedParticlesKey and InParticlesLinksKey, must chose one" - << endreq; + ATH_MSG_FATAL( "Cannot have both InSelectedParticlesKey and InParticlesLinksKey, must chose one" ); } - // Get a SG pointer: - if (StatusCode::FAILURE == service("StoreGateSvc", m_pSG) ) { - (*mLog) << MSG::ERROR << "Could not find StoreGateSvc" << endreq; - return StatusCode::FAILURE; - } - - if(m_nogood) return StatusCode::FAILURE; - - (*mLog) << MSG::INFO << "Created StoreGate pointer m_pSG" << endreq; - (*mLog) <<MSG::INFO <<"Done Initializing " <<name() <<endreq; + ATH_MSG_INFO("Done Initializing " <<name() ); return StatusCode::SUCCESS; } @@ -158,80 +142,57 @@ template<class Derived> //typedef typename Derived::Contained Contained; typedef typename Derived::Links Links; - StatusCode sc; - - (*mLog) <<MSG::DEBUG <<std::endl <<endreq; - (*mLog) <<MSG::DEBUG <<"Executing Selector " <<name() <<endreq; - sc=userExecute(); - if( sc.isFailure()) return sc; + ATH_MSG_DEBUG(std::endl ); + ATH_MSG_DEBUG("Executing Selector " <<name() ); + ATH_CHECK( userExecute() ); const Container* particles = 0; const SelectedParticles* inselparts=0; const Links* inlinks=0; if(m_inSel){ - sc = m_pSG->retrieve(inselparts,m_inselectedKey); - if( sc.isFailure()) { - (*mLog) << MSG::ERROR - << "Could not retrieve InSelectedParticles with name " - << m_inselectedKey << endreq; - return sc; - } + ATH_CHECK( evtStore()->retrieve(inselparts,m_inselectedKey) ); } if(m_inLink){ - sc = m_pSG->retrieve(inlinks,m_inlinksKey); - if( sc.isFailure()) { - (*mLog) << MSG::ERROR - << "Could not retrieve InParticleLinks with name " - << m_inlinksKey - << endreq; - return sc; - } + ATH_CHECK( evtStore()->retrieve(inlinks,m_inlinksKey) ); } - sc = m_pSG->retrieve(particles,m_inputKey); - if( sc.isFailure() || particles==0) { - (*mLog) << MSG::ERROR - << "Could not retrieve Container with name " - << m_inputKey - << endreq; - return sc; - } + ATH_CHECK( evtStore()->retrieve(particles,m_inputKey) ); int npart=particles->size(); - (*mLog)<< MSG::DEBUG<<" >>>> got Container, no. of particles="<<npart<<endreq; + ATH_MSG_DEBUG(" >>>> got Container, no. of particles="<<npart ); SelectedParticles* selparts=0; if(m_gensel){ // SelectedParticles option selparts=new SelectedParticles(); - (*mLog)<< MSG::DEBUG<<" >>>> Generate SelectedParticles"; - if(m_pSG->record(selparts,m_selectedKey).isFailure()) return StatusCode::FAILURE; + ATH_MSG_DEBUG(" >>>> Generate SelectedParticles" ); + ATH_CHECK(evtStore()->record(selparts,m_selectedKey) ); typename Container::const_iterator ipItr = particles->begin(); typename Container::const_iterator ipEnd = particles->end(); int npart=particles->size(); selparts->SetMaxBits(npart); unsigned ipart=0; if(!m_inLink){ - if(m_inSel) (*mLog)<< MSG::DEBUG<<" using InSelectedParticles("<<m_inselectedKey - <<"), no. particles="<<inselparts->numGood() - <<" <<<"<<endreq; - else (*mLog)<< MSG::DEBUG<<" looping over whole Container <<<"<<endreq; + if(m_inSel) ATH_MSG_DEBUG(" using InSelectedParticles("<<m_inselectedKey + <<"), no. particles="<<inselparts->numGood() + <<" <<<" ); + else ATH_MSG_DEBUG(" looping over whole Container <<<" ); for(; ipItr != ipEnd; ++ipItr) { if(m_inSel && !inselparts->isGood(ipart)){ - (*mLog) << MSG::DEBUG<<" rejected ipart="<<ipart<<endreq; + ATH_MSG_DEBUG(" rejected ipart="<<ipart ); ipart++; continue; } if( m_all || static_cast<Derived*>(this)->accept(*ipItr)){ selparts->SetBit(ipart); - (*mLog)<< MSG::DEBUG<<" accepted ipart="<<ipart<<endreq; - }else (*mLog) << MSG::DEBUG<<" rejected ipart="<<ipart<<endreq; + ATH_MSG_DEBUG(" accepted ipart="<<ipart ); + }else ATH_MSG_DEBUG(" rejected ipart="<<ipart ); ipart++; } }else{ // loop over input links typename Links::const_iterator ilItr = inlinks->begin(); typename Links::const_iterator ilEnd = inlinks->end(); - (*mLog)<< MSG::DEBUG<<" using input ParticleLinks ("<<m_inlinksKey<<"), no. of particles=" - <<inlinks->size()<<" <<<<<"<<endreq; + ATH_MSG_DEBUG(" using input ParticleLinks ("<<m_inlinksKey<<"), no. of particles=" + <<inlinks->size()<<" <<<<<" ); int ipart=0; for(; ilItr != ilEnd; ++ilItr) { ipart=(*ilItr).index(); @@ -239,18 +200,18 @@ template<class Derived> //Contained* part=const_cast<Contained *>(cpart); if( m_all || static_cast<Derived*>(this)->accept(*ilItr) ){ selparts->SetBit(ipart); - (*mLog)<< MSG::DEBUG<<" accepted ipart="<<ipart<<endreq; - }else (*mLog) << MSG::DEBUG<<" rejected ipart="<<ipart<<endreq; + ATH_MSG_DEBUG(" accepted ipart="<<ipart ); + }else ATH_MSG_DEBUG(" rejected ipart="<<ipart ); } } - (*mLog)<< MSG::DEBUG<<" SelectedParticles bits: "<<selparts->displayBits()<<endreq; + ATH_MSG_DEBUG(" SelectedParticles bits: "<<selparts->displayBits() ); } // end of SelectedParticles option // ParticleLinks option if(m_genlink){ - (*mLog)<< MSG::DEBUG<<" >>>> Generate ParticleLinks"; + ATH_MSG_DEBUG(" >>>> Generate ParticleLinks" ); Links* links=new Links(); - if(m_pSG->record(links,m_linksKey).isFailure()) return StatusCode::FAILURE; + ATH_CHECK( evtStore()->record(links,m_linksKey) ); if(m_gensel){ // selection already done, selparts filled @@ -264,13 +225,13 @@ template<class Derived> } ipart++; } - return sc; + return StatusCode::SUCCESS; } if(m_inLink){ typename Links::const_iterator ilItr = inlinks->begin(); typename Links::const_iterator ilEnd = inlinks->end(); - (*mLog)<< MSG::DEBUG<<" using input ParticleLinks ("<<m_inlinksKey<<"), no. of particles=" - <<inlinks->size()<<" <<<<<"<<endreq; + ATH_MSG_DEBUG(" using input ParticleLinks ("<<m_inlinksKey<<"), no. of particles=" + <<inlinks->size()<<" <<<<<" ); unsigned ipart=0; for(; ilItr != ilEnd; ++ilItr) { ipart=(*ilItr).index(); @@ -278,40 +239,39 @@ template<class Derived> //Contained* part=const_cast<Contained *>(cpart); if( m_all || static_cast<Derived*>(this)->accept(*ilItr) ){ links->push_back(*ilItr); - (*mLog)<< MSG::DEBUG<<" accepted ipart="<<ipart<<endreq; - }else (*mLog) << MSG::DEBUG<<" rejected ipart="<<ipart<<endreq; + ATH_MSG_DEBUG(" accepted ipart="<<ipart ); + }else ATH_MSG_DEBUG(" rejected ipart="<<ipart ); } }else{ - if(m_inSel) (*mLog)<< MSG::DEBUG<<" using InSelectedParticles("<<m_inselectedKey - <<"), no. particles="<<inselparts->numGood() - <<" <<<"<<endreq; - else (*mLog)<< MSG::DEBUG<<" looping over whole Container <<<"<<endreq; + if(m_inSel) ATH_MSG_DEBUG(" using InSelectedParticles("<<m_inselectedKey + <<"), no. particles="<<inselparts->numGood() + <<" <<<" ); + else ATH_MSG_DEBUG(" looping over whole Container <<<" ); typename Container::const_iterator ipItr = particles->begin(); typename Container::const_iterator ipEnd = particles->end(); unsigned ipart=0; for(; ipItr != ipEnd; ++ipItr) { if(m_inSel && !inselparts->isGood(ipart)){ - (*mLog) << MSG::DEBUG<<" rejected ipart="<<ipart<<endreq; + ATH_MSG_DEBUG(" rejected ipart="<<ipart ); ipart++; continue; } if( m_all || static_cast<Derived*>(this)->accept(*ipItr) ){ ElementLink<Container> el(*particles,ipart); links->push_back(el); - //(*mLog)<< MSG::DEBUG<<" accepted ipart="<<ipart<<", pt="<<(*particles)[ipart]->pt()/1000.<<endreq; - (*mLog)<< MSG::DEBUG<<" accepted ipart="<<ipart<<", pt="<<(*el)->pt()/1000.0<<endreq; - }else (*mLog) << MSG::DEBUG<<" rejected ipart="<<ipart<<endreq; + ATH_MSG_DEBUG(" accepted ipart="<<ipart<<", pt="<<(*el)->pt()/Athena::Units::GeV ); + }else ATH_MSG_DEBUG(" rejected ipart="<<ipart ); ipart++; } } } // end of ParticleLinks option - return sc; + return StatusCode::SUCCESS; } template<class Derived> StatusCode SelectorBase<Derived>::finalize() { - (*mLog) << MSG::INFO << "Finalizing Selector " << name() << endreq; + ATH_MSG_INFO( "Finalizing Selector " << name() ); return StatusCode::SUCCESS; } diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..95b6f97db580d35f60fc26721154b7b775496fef --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/CMakeLists.txt @@ -0,0 +1,51 @@ +################################################################################ +# Package: AnalysisUtils +################################################################################ + +# Declare the package name: +atlas_subdir( AnalysisUtils ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Control/AthenaBaseComps + Control/AthenaKernel + Control/CxxUtils + Control/DataModel + Control/StoreGate + Event/EventKernel + Event/NavFourMom + GaudiKernel + PhysicsAnalysis/AnalysisCommon/ParticleEvent + PhysicsAnalysis/AraTool + PhysicsAnalysis/TruthParticleID/McParticleEvent + PRIVATE + Reconstruction/Particle + Reconstruction/egamma/egammaEvent ) + +# External dependencies: +find_package( Boost COMPONENTS filesystem thread system ) +find_package( CLHEP ) +find_package( HepPDT ) +find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) + +# Component(s) in the package: +atlas_add_library( AnalysisUtilsLib + src/*.cxx + PUBLIC_HEADERS AnalysisUtils + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + DEFINITIONS ${CLHEP_DEFINITIONS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils DataModel EventKernel NavFourMom GaudiKernel ParticleEvent AraTool McParticleEvent StoreGateLib SGtests + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} Particle egammaEvent ) + +atlas_add_component( AnalysisUtils + src/components/*.cxx + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils DataModel StoreGateLib SGtests EventKernel NavFourMom GaudiKernel ParticleEvent AraTool McParticleEvent Particle egammaEvent AnalysisUtilsLib ) + +atlas_add_dictionary( AnalysisUtilsDict + AnalysisUtils/AnalysisUtilsDict.h + AnalysisUtils/selection.xml + INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${Boost_LIBRARIES} ${HEPPDT_LIBRARIES} ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel CxxUtils DataModel StoreGateLib SGtests EventKernel NavFourMom GaudiKernel ParticleEvent AraTool McParticleEvent Particle egammaEvent AnalysisUtilsLib ) + diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/cmt/requirements b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/cmt/requirements old mode 100755 new mode 100644 index b66a6faac36c5073eac849211007ae56d632cae1..a740fa0d43042676dedf56bc381126a3b7421043 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/cmt/requirements +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/cmt/requirements @@ -36,6 +36,6 @@ use Particle Particle-* Reconstruction use egammaEvent egammaEvent-* Reconstruction/egamma use AtlasReflex AtlasReflex-* External -no_auto_imports -apply_pattern lcgdict dict=AnalysisUtils selectionfile=selection.xml headerfiles="..\/AnalysisUtils/AnalysisUtilsDict.h" +apply_pattern lcgdict dict=AnalysisUtils selectionfile=selection.xml headerfiles="../AnalysisUtils/AnalysisUtilsDict.h" end_private diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/doc/mainpage.h b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/doc/mainpage.h old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/AANTTreeMap.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/AANTTreeMap.cxx old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/CombinatoricsOdometer.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/CombinatoricsOdometer.cxx deleted file mode 100755 index 39b8879a4f948834921475c348792504e1e690bf..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/CombinatoricsOdometer.cxx +++ /dev/null @@ -1,377 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/***************************************************************************** - * @Project: AnalysisUtils - * - * @class CombinatoricsOdometer - * - * @author Steven Sekula <Stephen.Jacob.Sekula@cernSPAMNOT.ch> - * @author Karsten Koeneke <karsten.koeneke@cernSPAMNOT.ch> - * - * @date January 2010 - * - * @brief Helper class for particle combinatorics of several lists. - * - * Based completely on: - * NAME: EVComboHelper.h - * PACKAGE: offline/PhysicsAnalysis/EventViewBuilder/EventViewCombiners/ - * AUTHORS: Akira Shibata (ashibata@cern.ch) - * CREATED: Feb 2006 -********************************************************************/ - -#include "AnalysisUtils/CombinatoricsOdometer.h" - -//////////////////////FlexDigit -FlexDigit::FlexDigit( int digitMax, FlexDigit* nextDigit ) -{ - m_digit=0; - m_digitMax=digitMax-1; - m_nextDigit=nextDigit; -} - - -FlexDigit FlexDigit::operator++( int ) -{ - if(this->isAtMax()) - { - this->setDigit( 0 ); - if(!this->isFirstDigit()) (*(this->next()))++; - } - else - { - this->setDigit( this->digit()+1 ); - } - return *this; -} - - -//////////////////////FlexDigits -FlexDigits::FlexDigits( std::vector<std::string>& labels, std::map<std::string, int>& digitMax ) : - DataVector<FlexDigit>(SG::OWN_ELEMENTS) -{ - m_started=false; - this->reserve(labels.size()); - for( std::vector<std::string>::const_iterator label_itr=labels.begin(); - label_itr != labels.end(); - label_itr++ ) - { - FlexDigit* temp = new FlexDigit(digitMax[*label_itr]); - this->push_back(temp); - } -} - - -FlexDigits::FlexDigits( int numDigits, int digitMax ) : - DataVector<FlexDigit>(SG::OWN_ELEMENTS) -{ - m_started=false; - this->reserve(numDigits); - for( int i=0; i<numDigits; i++ ) - { - FlexDigit* temp = new FlexDigit(digitMax); - this->push_back(temp); - } -} - - -FlexDigits::~FlexDigits() -{ -} - - -//overloaded vector method, need to tell each digit which one -//is next to it -void FlexDigits::push_back( FlexDigit* aDigit ) -{ - if(this->size()) - { - aDigit->setNext(this->back()); - } - this->DataVector<FlexDigit>::push_back(aDigit); -} - -//just increment by one, no uniqueness check etc (overloaded in OdoMeter) -bool FlexDigits::increment() -{ - if(m_started && this->isZero()) - { - return false; - } - else - { - m_started = true; - } - (*this)++; - return true; -} - - -//for debugging -void FlexDigits::print() -{ - std::cout<<"current State of digits: "; - for( FlexDigits::iterator digit_itr=this->begin(); - digit_itr!= this->end(); - digit_itr++ ) - { - std::cout<<"|"<<(*digit_itr)->digit()<<"|"; - } - std::cout<<std::endl; -} - - -//if the whole digits are 0 -bool FlexDigits::isZero() -{ - bool isZero=true; - for( FlexDigits::iterator digit_itr=this->begin(); - digit_itr != this->end(); - digit_itr++ ) - { - isZero = isZero && !(*digit_itr)->digit(); - } - return isZero; -} - - -//only ++ operaor defined (only thing needed for now) -FlexDigits& FlexDigits::operator++( int ) -{ - if( this->size() ) - { - (*(this->back()))++; - } - return *this; -} - - -//////////////////////OdoMeter -//somewhat specific constructor for label and number of paritlces -//in each container with the label -OdoMeter::OdoMeter( std::vector<std::string>& labels, std::map<std::string, int>& digitMax ) - : FlexDigits( labels, digitMax ), - m_pairMeter(0) -{ - m_onlyUnique = true; - m_onlySingleEntry = true; - m_numLabels = labels.size(); - int counter = 0; - for( ;counter < m_numLabels; counter++ ) - { - m_digitAssoc[labels[counter]].insert(counter); - m_labels.insert(labels[counter]); - } -} - - -//this constructor is for the case when you want to combine -//M objects (numDigits) from one single list of n (digitMax) -OdoMeter::OdoMeter( int numDigits, int digitMax ) - : FlexDigits( numDigits, digitMax ), - m_pairMeter(0) -{ - m_onlyUnique = true; - m_onlySingleEntry = true; - m_numLabels = numDigits; - int counter = 0; - for( ;counter < m_numLabels; counter++ ) - { - m_digitAssoc["dummy"].insert(counter); - m_labels.insert("dummy"); - } -} - - -OdoMeter::~OdoMeter() -{ - delete m_pairMeter; - m_pairMeter = NULL; -} - - - -//this function make sure that there's no double counting, should be used in combination -//with hasOnlySingleEntry as isUnique will pass the ones with same entries from one container -bool OdoMeter::isUnique( bool doCheck ) -{ - if(!doCheck) - { - return true; - } - for( std::set<std::string>::const_iterator label_itr = m_labels.begin(); - label_itr != m_labels.end(); - label_itr++ ) - { - int leftDigit = -1; - for( std::set<int>::const_iterator digit_itr = m_digitAssoc[*label_itr].begin(); - digit_itr!=m_digitAssoc[*label_itr].end(); - digit_itr++ ) - { - if(leftDigit <= (*this)[*digit_itr]->digit()) - { - leftDigit=(*this)[*digit_itr]->digit(); - } - else - { - return false; - } - } - } - return true; -} - - -//this function make sure that two same entries from single container do not exist -//the method uses the notion of std::set which does not allow two same entries. -bool OdoMeter::hasOnlySingleEntry( bool doCheck ) -{ - if(!doCheck) - { - return true; - } - for( std::set<std::string>::const_iterator label_itr = m_labels.begin(); - label_itr != m_labels.end(); - label_itr++ ) - { - std::set<int> digitsForLabel; - for( std::set<int>::const_iterator digit_itr = m_digitAssoc[*label_itr].begin(); - digit_itr!=m_digitAssoc[*label_itr].end(); - digit_itr++ ) - { - digitsForLabel.insert((*this)[*digit_itr]->digit()); - } - if (digitsForLabel.size()!=m_digitAssoc[*label_itr].size()) - { - return false; - } - } - return true; -} - - -//increment the meter by one and check uniqueness. if not unique, -//call itself again (recursive) -bool OdoMeter::increment() -{ - if(this->hasStarted() && this->isZero()) - { - return false; - } - else if(!this->hasStarted()) - { - this->setStarted() ; - } - (*this)++; - bool found = true; - if(!isUnique(m_onlyUnique)) - { - found=false; - } - if(! hasOnlySingleEntry(m_onlySingleEntry)) - { - found=false; - } - if(!found) - { - return this->increment(); - } - else - { - delete m_pairMeter; - m_pairMeter = new PairMeter(m_numLabels); - return true; - } -} - - -//output the digit in the form of vector<int> -std::vector<int> OdoMeter::getVector() -{ - std::vector<int> digitsVector; - for( OdoMeter::const_iterator fdigit_itr = (*this).begin(); - fdigit_itr != (*this).end(); - fdigit_itr++) - { - digitsVector.push_back((*fdigit_itr)->digit()); - } - return digitsVector; -} - - -//increment() for pairMeter -bool OdoMeter::nextPair() -{ - if(m_pairMeter) - { - if( m_pairMeter->increment()) - { - return true; - } - else - { - delete m_pairMeter; - m_pairMeter = NULL; - } - } - return false; -} - - -//get unique pairs out of the combined particles (useful for overlap check -std::pair<int,int> OdoMeter::getPair() -{ - if(m_pairMeter) - { - return std::make_pair( (*m_pairMeter)[0]->digit(), (*m_pairMeter)[1]->digit() ); - } - else - { - return std::make_pair( 0,0 ); - } -} - - -//////////////////////PairMeter -PairMeter::PairMeter( int digitMax ) - :OdoMeter( 2, digitMax ) -{ -} - - -PairMeter::~PairMeter() -{ -} - - -bool PairMeter::increment() -{ - if(this->hasStarted() && this->isZero()) - { - return false; - } - else if(!this->hasStarted()) - { - this->setStarted() ; - } - (*this)++; - bool found = true; - if(!isUnique(true)) - { - found=false; - } - if(!hasOnlySingleEntry(true)) - { - found=false; - } - if(!found) - { - return this->increment(); - } - else - { - return true; - } -} - diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/FilterRange.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/FilterRange.cxx old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/IParticleFilter.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/IParticleFilter.cxx old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/ParticleBaseSelector.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/ParticleBaseSelector.cxx index c8285ff5439b21ebd4ecb48fd97822ffdd244a91..b238a83c472b3135004d64d211dc9228a65cfc9e 100644 --- a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/ParticleBaseSelector.cxx +++ b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/ParticleBaseSelector.cxx @@ -3,8 +3,9 @@ */ #include "AnalysisUtils/ParticleBaseSelector.h" +#include "AthenaKernel/Units.h" -using CLHEP::GeV; +using Athena::Units::GeV; using namespace std; ParticleBaseSelector::ParticleBaseSelector(const std::string& name, ISvcLocator* pSvcLocator): @@ -18,12 +19,12 @@ ParticleBaseSelector::ParticleBaseSelector(const std::string& name, ISvcLocator StatusCode ParticleBaseSelector::initialize() { // print parameters in SelectorBase - StatusCode sc = SelectorBase<ParticleBaseSelector>::initialize(); + ATH_CHECK( SelectorBase<ParticleBaseSelector>::initialize() ); // print parameters in ParticleBaseSelector - (*mLog)<< MSG::INFO<<", PtMin="<<m_Emin; - (*mLog)<< MSG::INFO<<", PtMax="<<m_Emax; - return sc; + ATH_MSG_INFO(", PtMin="<<m_Emin ); + ATH_MSG_INFO(", PtMax="<<m_Emax ); + return StatusCode::SUCCESS; } bool ParticleBaseSelector::accept(const ParticleBaseLink& link){ diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/ParticleCandidateList.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/ParticleCandidateList.cxx old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/PhiFilterRange.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/src/PhiFilterRange.cxx old mode 100755 new mode 100644 diff --git a/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/test/AnalysisUtilsTest.cxx b/PhysicsAnalysis/AnalysisCommon/AnalysisUtils/test/AnalysisUtilsTest.cxx old mode 100755 new mode 100644