ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
SelectorBase< Derived > Class Template Reference

#include <SelectorBase.h>

Inheritance diagram for SelectorBase< Derived >:
Collaboration diagram for SelectorBase< Derived >:

Public Member Functions

 SelectorBase (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~SelectorBase ()
 
virtual StatusCode initialize ()
 
virtual StatusCode userExecute ()
 
StatusCode execute ()
 
virtual StatusCode finalize ()
 
bool pt_eta_range (double pt, double eta)
 
const std::string & getInputKey ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

std::string m_inputKey
 
std::string m_inselectedKey
 
std::string m_selectedKey
 
std::string m_inlinksKey
 
std::string m_linksKey
 
bool m_all
 
bool m_nogood
 
bool m_inSel
 
bool m_inLink
 
bool m_gensel
 
bool m_genlink
 
double m_ptmin
 
double m_ptmax
 
double m_etamin
 
double m_etamax
 
double m_absetamax
 
double m_absetamin
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

template<class Derived>
class SelectorBase< Derived >

Definition at line 36 of file SelectorBase.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ SelectorBase()

template<class Derived >
SelectorBase< Derived >::SelectorBase ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 78 of file SelectorBase.h.

79  : AthAlgorithm(name, pSvcLocator),
80  m_gensel(false),
81  m_genlink(false)
82 {
83  declareProperty("InputKey", m_inputKey = "NONE");
84  declareProperty("InSelectedParticlesKey", m_inselectedKey = "NONE");
85  declareProperty("OutSelectedParticlesKey", m_selectedKey = "NONE");
86  declareProperty("InParticleLinksKey", m_inlinksKey = "NONE");
87  declareProperty("OutParticleLinksKey", m_linksKey = "NONE");
88  declareProperty("PtMin",m_ptmin = 15.0*CLHEP::GeV);
89  declareProperty("PtMax",m_ptmax = 10000.0*CLHEP::GeV);
90  declareProperty("EtaMax",m_etamax = 2.5);
91  declareProperty("EtaMin",m_etamin = -2.5);
92  declareProperty("AbsEtaMax",m_absetamax = 2.5);
93  declareProperty("AbsEtaMin",m_absetamin =0);
94  declareProperty("SelectAll",m_all =false);
95  m_nogood=false;
96  m_inSel=false;
97  m_inLink=false;
98 }

◆ ~SelectorBase()

template<class Derived >
virtual SelectorBase< Derived >::~SelectorBase ( )
inlinevirtual

Definition at line 55 of file SelectorBase.h.

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

template<class Derived >
StatusCode SelectorBase< Derived >::execute

Definition at line 138 of file SelectorBase.h.

139 {
140  typedef typename Derived::Container Container;
141  //typedef typename Derived::Contained Contained;
142  typedef typename Derived::Links Links;
143 
144  ATH_MSG_DEBUG(std::endl );
145  ATH_MSG_DEBUG("Executing Selector " <<name() );
146  ATH_CHECK( userExecute() );
147  const Container* particles = 0;
148  const SelectedParticles* inselparts=0;
149  const Links* inlinks=0;
150  if(m_inSel){
151  ATH_CHECK( evtStore()->retrieve(inselparts,m_inselectedKey) );
152  }
153  if(m_inLink){
154  ATH_CHECK( evtStore()->retrieve(inlinks,m_inlinksKey) );
155  }
156 
158  int npart=particles->size();
159  ATH_MSG_DEBUG(" >>>> got Container, no. of particles="<<npart );
160 
161  SelectedParticles* selparts=0;
162  if(m_gensel){
163  // SelectedParticles option
164  selparts=new SelectedParticles();
165  ATH_MSG_DEBUG(" >>>> Generate SelectedParticles" );
166  ATH_CHECK(evtStore()->record(selparts,m_selectedKey) );
167  typename Container::const_iterator ipItr = particles->begin();
168  typename Container::const_iterator ipEnd = particles->end();
169  int npart=particles->size();
170  selparts->SetMaxBits(npart);
171  unsigned ipart=0;
172  if(!m_inLink){
173  if(m_inSel) ATH_MSG_DEBUG(" using InSelectedParticles("<<m_inselectedKey
174  <<"), no. particles="<<inselparts->numGood()
175  <<" <<<" );
176  else ATH_MSG_DEBUG(" looping over whole Container <<<" );
177  for(; ipItr != ipEnd; ++ipItr) {
178  if(m_inSel && !inselparts->isGood(ipart)){
179  ATH_MSG_DEBUG(" rejected ipart="<<ipart );
180  ipart++;
181  continue;
182  }
183  if( m_all || static_cast<Derived*>(this)->accept(*ipItr)){
184  selparts->SetBit(ipart);
185  ATH_MSG_DEBUG(" accepted ipart="<<ipart );
186  }else ATH_MSG_DEBUG(" rejected ipart="<<ipart );
187  ipart++;
188  }
189  }else{
190  // loop over input links
191  typename Links::const_iterator ilItr = inlinks->begin();
192  typename Links::const_iterator ilEnd = inlinks->end();
193  ATH_MSG_DEBUG(" using input ParticleLinks ("<<m_inlinksKey<<"), no. of particles="
194  <<inlinks->size()<<" <<<<<" );
195  int ipart=0;
196  for(; ilItr != ilEnd; ++ilItr) {
197  ipart=(*ilItr).index();
198  //const Contained* cpart=(*inlinks)[ipart];
199  //Contained* part=const_cast<Contained *>(cpart);
200  if( m_all || static_cast<Derived*>(this)->accept(*ilItr) ){
201  selparts->SetBit(ipart);
202  ATH_MSG_DEBUG(" accepted ipart="<<ipart );
203  }else ATH_MSG_DEBUG(" rejected ipart="<<ipart );
204  }
205  }
206  ATH_MSG_DEBUG(" SelectedParticles bits: "<<selparts->displayBits() );
207  } // end of SelectedParticles option
208 
209  // ParticleLinks option
210  if(m_genlink){
211  ATH_MSG_DEBUG(" >>>> Generate ParticleLinks" );
212  Links* links=new Links();
213  ATH_CHECK( evtStore()->record(links,m_linksKey) );
214 
215  if(m_gensel){
216  // selection already done, selparts filled
217  typename Container::const_iterator ipItr = particles->begin();
218  typename Container::const_iterator ipEnd = particles->end();
219  unsigned ipart=0;
220  for(; ipItr != ipEnd; ++ipItr) {
221  if(selparts->isGood(ipart)){
223  links->push_back(el);
224  }
225  ipart++;
226  }
227  return StatusCode::SUCCESS;
228  }
229  if(m_inLink){
230  typename Links::const_iterator ilItr = inlinks->begin();
231  typename Links::const_iterator ilEnd = inlinks->end();
232  ATH_MSG_DEBUG(" using input ParticleLinks ("<<m_inlinksKey<<"), no. of particles="
233  <<inlinks->size()<<" <<<<<" );
234  unsigned ipart=0;
235  for(; ilItr != ilEnd; ++ilItr) {
236  ipart=(*ilItr).index();
237  //const Contained* cpart=(*inlinks)[ipart];
238  //Contained* part=const_cast<Contained *>(cpart);
239  if( m_all || static_cast<Derived*>(this)->accept(*ilItr) ){
240  links->push_back(*ilItr);
241  ATH_MSG_DEBUG(" accepted ipart="<<ipart );
242  }else ATH_MSG_DEBUG(" rejected ipart="<<ipart );
243  }
244  }else{
245  if(m_inSel) ATH_MSG_DEBUG(" using InSelectedParticles("<<m_inselectedKey
246  <<"), no. particles="<<inselparts->numGood()
247  <<" <<<" );
248  else ATH_MSG_DEBUG(" looping over whole Container <<<" );
249  typename Container::const_iterator ipItr = particles->begin();
250  typename Container::const_iterator ipEnd = particles->end();
251  unsigned ipart=0;
252  for(; ipItr != ipEnd; ++ipItr) {
253  if(m_inSel && !inselparts->isGood(ipart)){
254  ATH_MSG_DEBUG(" rejected ipart="<<ipart );
255  ipart++;
256  continue;
257  }
258  if( m_all || static_cast<Derived*>(this)->accept(*ipItr) ){
260  links->push_back(el);
261  ATH_MSG_DEBUG(" accepted ipart="<<ipart<<", pt="<<(*el)->pt()/Athena::Units::GeV );
262  }else ATH_MSG_DEBUG(" rejected ipart="<<ipart );
263  ipart++;
264  }
265  }
266  } // end of ParticleLinks option
267  return StatusCode::SUCCESS;
268 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

template<class Derived >
StatusCode SelectorBase< Derived >::finalize
virtual

Definition at line 271 of file SelectorBase.h.

271  {
272 
273  ATH_MSG_INFO( "Finalizing Selector " << name() );
274 
275  return StatusCode::SUCCESS;
276 }

◆ getInputKey()

template<class Derived >
const std::string& SelectorBase< Derived >::getInputKey ( )
inline

Definition at line 66 of file SelectorBase.h.

◆ initialize()

template<class Derived >
StatusCode SelectorBase< Derived >::initialize
virtual

Definition at line 100 of file SelectorBase.h.

101 {
102  m_genlink=true;
103  m_gensel=true;
104  ATH_MSG_INFO("Initializing Selector " <<name() );
105  if(m_inputKey==std::string("NONE")) m_nogood=true;
106  if(m_selectedKey==std::string("NONE")) m_gensel=false;
107  if(m_inselectedKey!=std::string("NONE")) m_inSel=true;
108  if(m_linksKey==std::string("NONE") ) m_genlink=false;
109  if(m_inlinksKey!=std::string("NONE")) m_inLink=true;
110 
111  ATH_MSG_INFO( "InputKey="<<m_inputKey.c_str()<<", OutSelectedParticlesKey="<<m_selectedKey.c_str()
112  <<", InSelectedParticlesKey="<<m_inselectedKey.c_str()
113  <<", InParticlesLinksKey="<<m_inlinksKey.c_str()
114  <<", OutParticleLinksKey="<<m_linksKey.c_str() );
115  ATH_MSG_INFO(", PtMin="<<m_ptmin
116  << MSG::INFO<<", PtMax="<<m_ptmax
117  << MSG::INFO<<", EtaMin="<<m_etamin
118  << MSG::INFO<<", EtaMax="<<m_etamax
119  << MSG::INFO<<", AbsEtaMin="<<m_absetamin
120  << MSG::INFO<<", AbsEtaMax="<<m_absetamax
121  << MSG::INFO<<", SelectAll="<<m_all );
122  if(m_all) ATH_MSG_INFO(" All items will be accepted" );
123 
124  m_nogood=m_nogood && (!m_genlink && !m_gensel);
125  if(m_nogood){
126  ATH_MSG_FATAL( "Must supply names for InputKey, OutSelectedParticlesKey and/or OutParticleLinksKey" );
127  }
129  if(m_nogood){
130  ATH_MSG_FATAL( "Cannot have both InSelectedParticlesKey and InParticlesLinksKey, must chose one" );
131  }
132 
133  ATH_MSG_INFO("Done Initializing " <<name() );
134  return StatusCode::SUCCESS;
135 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ pt_eta_range()

template<class Derived >
bool SelectorBase< Derived >::pt_eta_range ( double  pt,
double  eta 
)

Definition at line 279 of file SelectorBase.h.

279  {
280  if(pt<m_ptmin) return false;
281  if(pt>m_ptmax) return false;
282  if(fabs(eta)>m_absetamax) return false;
283  if(fabs(eta)<m_absetamin) return false;
284  if(eta>m_etamax) return false;
285  if(eta<m_etamin) return false;
286  return true;
287  }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ userExecute()

template<class Derived >
virtual StatusCode SelectorBase< Derived >::userExecute ( )
inlinevirtual

Definition at line 57 of file SelectorBase.h.

Member Data Documentation

◆ m_absetamax

template<class Derived >
double SelectorBase< Derived >::m_absetamax
protected

Definition at line 85 of file SelectorBase.h.

◆ m_absetamin

template<class Derived >
double SelectorBase< Derived >::m_absetamin
protected

Definition at line 86 of file SelectorBase.h.

◆ m_all

template<class Derived >
bool SelectorBase< Derived >::m_all
protected

Definition at line 75 of file SelectorBase.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_etamax

template<class Derived >
double SelectorBase< Derived >::m_etamax
protected

Definition at line 84 of file SelectorBase.h.

◆ m_etamin

template<class Derived >
double SelectorBase< Derived >::m_etamin
protected

Definition at line 83 of file SelectorBase.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_genlink

template<class Derived >
bool SelectorBase< Derived >::m_genlink
protected

Definition at line 80 of file SelectorBase.h.

◆ m_gensel

template<class Derived >
bool SelectorBase< Derived >::m_gensel
protected

Definition at line 79 of file SelectorBase.h.

◆ m_inLink

template<class Derived >
bool SelectorBase< Derived >::m_inLink
protected

Definition at line 78 of file SelectorBase.h.

◆ m_inlinksKey

template<class Derived >
std::string SelectorBase< Derived >::m_inlinksKey
protected

Definition at line 73 of file SelectorBase.h.

◆ m_inputKey

template<class Derived >
std::string SelectorBase< Derived >::m_inputKey
protected

Definition at line 70 of file SelectorBase.h.

◆ m_inSel

template<class Derived >
bool SelectorBase< Derived >::m_inSel
protected

Definition at line 77 of file SelectorBase.h.

◆ m_inselectedKey

template<class Derived >
std::string SelectorBase< Derived >::m_inselectedKey
protected

Definition at line 71 of file SelectorBase.h.

◆ m_linksKey

template<class Derived >
std::string SelectorBase< Derived >::m_linksKey
protected

Definition at line 74 of file SelectorBase.h.

◆ m_nogood

template<class Derived >
bool SelectorBase< Derived >::m_nogood
protected

Definition at line 76 of file SelectorBase.h.

◆ m_ptmax

template<class Derived >
double SelectorBase< Derived >::m_ptmax
protected

Definition at line 82 of file SelectorBase.h.

◆ m_ptmin

template<class Derived >
double SelectorBase< Derived >::m_ptmin
protected

Definition at line 81 of file SelectorBase.h.

◆ m_selectedKey

template<class Derived >
std::string SelectorBase< Derived >::m_selectedKey
protected

Definition at line 72 of file SelectorBase.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following file:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
SelectorBase::m_inselectedKey
std::string m_inselectedKey
Definition: SelectorBase.h:71
SelectorBase::m_inSel
bool m_inSel
Definition: SelectorBase.h:77
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SelectorBase::m_all
bool m_all
Definition: SelectorBase.h:75
SelectedParticles::SetBit
void SetBit(unsigned i, bool good=true)
Definition: SelectedParticles.cxx:19
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SelectorBase::m_gensel
bool m_gensel
Definition: SelectorBase.h:79
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SelectedParticles::SetMaxBits
void SetMaxBits(unsigned maxbits)
Definition: SelectedParticles.cxx:39
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
test_pyathena.pt
pt
Definition: test_pyathena.py:11
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
SelectorBase::m_inLink
bool m_inLink
Definition: SelectorBase.h:78
SelectorBase::m_linksKey
std::string m_linksKey
Definition: SelectorBase.h:74
SelectedParticles::isGood
bool isGood(unsigned i) const
Definition: SelectedParticles.cxx:84
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Container
storage of the time histories of all the cells
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
SelectorBase::m_genlink
bool m_genlink
Definition: SelectorBase.h:80
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DMTest::links
links
Definition: CLinks_v1.cxx:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
SelectorBase::m_absetamin
double m_absetamin
Definition: SelectorBase.h:86
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SelectorBase::m_ptmax
double m_ptmax
Definition: SelectorBase.h:82
SelectorBase::m_selectedKey
std::string m_selectedKey
Definition: SelectorBase.h:72
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
SelectorBase::m_etamax
double m_etamax
Definition: SelectorBase.h:84
SelectorBase::m_absetamax
double m_absetamax
Definition: SelectorBase.h:85
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SelectorBase::m_inlinksKey
std::string m_inlinksKey
Definition: SelectorBase.h:73
SelectorBase::userExecute
virtual StatusCode userExecute()
Definition: SelectorBase.h:57
SelectorBase::m_etamin
double m_etamin
Definition: SelectorBase.h:83
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
SelectedParticles
Definition: SelectedParticles.h:54
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SelectedParticles::displayBits
std::string displayBits() const
Definition: SelectedParticles.cxx:49
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
SelectorBase::m_inputKey
std::string m_inputKey
Definition: SelectorBase.h:70
SelectedParticles::numGood
unsigned numGood() const
Definition: SelectedParticles.cxx:112
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
SelectorBase::m_ptmin
double m_ptmin
Definition: SelectorBase.h:81
ServiceHandle< ICondSvc >
SelectorBase::m_nogood
bool m_nogood
Definition: SelectorBase.h:76