ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
IParticleSelector Class Reference

A Selector class with IParticleContainer. More...

#include <IParticleSelector.h>

Inheritance diagram for IParticleSelector:
Collaboration diagram for IParticleSelector:

Public Types

typedef IParticleContainer Container
 
typedef IParticle Contained
 
typedef IParticleLinks Links
 
typedef IParticleLink Link
 

Public Member Functions

 IParticleSelector (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Gaudi algorithm constructor. More...
 
virtual StatusCode initialize ()
 Standard Gaudi initialize() method. More...
 
bool accept (const IParticleLink &link)
 Test to see if a particle passes the selection. More...
 
bool accept (const Contained *part)
 Test to see if a particle passes the selection. More...
 
virtual StatusCode userExecute ()
 
StatusCode execute ()
 
virtual StatusCode finalize ()
 
bool pt_eta_range (double pt, double eta)
 
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

ToolHandleArray< ISelectorm_selectorHandles
 Property: List of additional selection tools. More...
 
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

A Selector class with IParticleContainer.

The behavior of this class comes mainly from the SelectorBase class.

This class filters an IParticleContainer and produces as output a SelectedParticles object (essentially a bitmask of the entries that pass) and/or a ParticleLinks<IParticleContainer> object (essentially a vector of ElementLink's to IParticle objects).

As input, we need the StoreGate key of an IParticleContainer. We may also get either a SelectedParticles or a ParticleLinks<IParticleContainer> object (but not both), representing a selection to apply before doing our own.

This class implements basic kinematic selections. Additional selections may be made my adding ISelector tools. The default configuration does no selection.

Properties: InputKey: SG key of the input IParticleContainer object. InSelectedParticlesKey SG key for a SelectedParticles object. If specified, it is applied as a selection to the input objects before making our own selection. InParticleLinksKey SG key for a ParticleLinks<IParticleContainer> object. If specified, it is applied as a selection to the input objects before making our own selection. OutSelectedParticlesKey SG key for the SelectedParticles object to make containing the result of the selection. OutParticleLinksKey SG key for the ParticleLinks<IParticleContainer> object to make containing the result of the selection. SelectAll If true, don't apply the selections below. PtMin Minimum pt for selection. (default: -1e10) PtMax Maximum pt for selection. (default: 1e10) EtaMin Minimum eta for selection. (default: -1e10) EtaMax Maximum eta for selection. (default: 1e10) AbsEtaMin Minimum abs(eta) for selection. (default: 0) AbsEtaMax: Maximum abs(eta) for selection. (default: 1e10) Selectors List of ISelector tools to call for each particle. All must accept it to accept the particle for the selection.

Definition at line 70 of file IParticleSelector.h.

Member Typedef Documentation

◆ Contained

Definition at line 74 of file IParticleSelector.h.

◆ Container

Definition at line 73 of file IParticleSelector.h.

◆ Link

Definition at line 76 of file IParticleSelector.h.

◆ Links

Definition at line 75 of file IParticleSelector.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ IParticleSelector()

IParticleSelector::IParticleSelector ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Gaudi algorithm constructor.

Parameters
nameThe algorithm name.
svclocThe service locator.

Definition at line 23 of file IParticleSelector.cxx.

26 {
27  declareProperty("Selectors",m_selectorHandles,"The Selectors");
28 
29  // Set defaults to do no selection.
30  m_ptmin = -1e10;
31  m_ptmax = 1e10;
32  m_etamin = -1e10;
33  m_etamax = 1e10;
34  m_absetamin = 0;
35  m_absetamax = 1e10;
36 }

Member Function Documentation

◆ accept() [1/2]

bool IParticleSelector::accept ( const Contained part)

Test to see if a particle passes the selection.

Parameters
partThe particle

Definition at line 64 of file IParticleSelector.cxx.

65 {
66  // Apply basic kinematic selection.
67  if(!pt_eta_range(part->pt(),part->eta())) return false;
68 
69  // Apply additional selection tools.
70  for (size_t i = 0; i < m_selectorHandles.size(); i++) {
71  // FIXME: ISelector::accept should take a const pointer!
72  if (!m_selectorHandles[i]->getTool()->accept (const_cast<Contained*>(part)))
73  return false;
74  }
75 
76  return true;
77 }

◆ accept() [2/2]

bool IParticleSelector::accept ( const IParticleLink link)

Test to see if a particle passes the selection.

Parameters
linkLink to the particle.

Definition at line 54 of file IParticleSelector.cxx.

55 {
56  return accept (*link);
57 }

◆ 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()

StatusCode SelectorBase< IParticleSelector >::execute
inherited

Definition at line 58 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()

StatusCode SelectorBase< IParticleSelector >::finalize
virtualinherited

Definition at line 59 of file SelectorBase.h.

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

◆ getInputKey()

std::string SelectorBase< IParticleSelector >::getInputKey
inlineinherited

Definition at line 66 of file SelectorBase.h.

◆ initialize()

StatusCode IParticleSelector::initialize ( )
virtual

Standard Gaudi initialize() method.

Standard Gaudi initialize method.

Reimplemented from SelectorBase< IParticleSelector >.

Definition at line 42 of file IParticleSelector.cxx.

43 {
45  CHECK( m_selectorHandles.retrieve() );
46  return StatusCode::SUCCESS;
47 }

◆ 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()

bool SelectorBase< IParticleSelector >::pt_eta_range ( double  pt,
double  eta 
)
inherited

Definition at line 60 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()

virtual StatusCode SelectorBase< IParticleSelector >::userExecute
inlinevirtualinherited

Definition at line 57 of file SelectorBase.h.

Member Data Documentation

◆ m_absetamax

double SelectorBase< IParticleSelector >::m_absetamax
protectedinherited

Definition at line 85 of file SelectorBase.h.

◆ m_absetamin

double SelectorBase< IParticleSelector >::m_absetamin
protectedinherited

Definition at line 86 of file SelectorBase.h.

◆ m_all

bool SelectorBase< IParticleSelector >::m_all
protectedinherited

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

double SelectorBase< IParticleSelector >::m_etamax
protectedinherited

Definition at line 84 of file SelectorBase.h.

◆ m_etamin

double SelectorBase< IParticleSelector >::m_etamin
protectedinherited

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

bool SelectorBase< IParticleSelector >::m_genlink
protectedinherited

Definition at line 80 of file SelectorBase.h.

◆ m_gensel

bool SelectorBase< IParticleSelector >::m_gensel
protectedinherited

Definition at line 79 of file SelectorBase.h.

◆ m_inLink

bool SelectorBase< IParticleSelector >::m_inLink
protectedinherited

Definition at line 78 of file SelectorBase.h.

◆ m_inlinksKey

std::string SelectorBase< IParticleSelector >::m_inlinksKey
protectedinherited

Definition at line 73 of file SelectorBase.h.

◆ m_inputKey

std::string SelectorBase< IParticleSelector >::m_inputKey
protectedinherited

Definition at line 70 of file SelectorBase.h.

◆ m_inSel

bool SelectorBase< IParticleSelector >::m_inSel
protectedinherited

Definition at line 77 of file SelectorBase.h.

◆ m_inselectedKey

std::string SelectorBase< IParticleSelector >::m_inselectedKey
protectedinherited

Definition at line 71 of file SelectorBase.h.

◆ m_linksKey

std::string SelectorBase< IParticleSelector >::m_linksKey
protectedinherited

Definition at line 74 of file SelectorBase.h.

◆ m_nogood

bool SelectorBase< IParticleSelector >::m_nogood
protectedinherited

Definition at line 76 of file SelectorBase.h.

◆ m_ptmax

double SelectorBase< IParticleSelector >::m_ptmax
protectedinherited

Definition at line 82 of file SelectorBase.h.

◆ m_ptmin

double SelectorBase< IParticleSelector >::m_ptmin
protectedinherited

Definition at line 81 of file SelectorBase.h.

◆ m_selectedKey

std::string SelectorBase< IParticleSelector >::m_selectedKey
protectedinherited

Definition at line 72 of file SelectorBase.h.

◆ m_selectorHandles

ToolHandleArray< ISelector > IParticleSelector::m_selectorHandles
private

Property: List of additional selection tools.

Definition at line 106 of file IParticleSelector.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 files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
SelectorBase< IParticleSelector >::m_inselectedKey
std::string m_inselectedKey
Definition: SelectorBase.h:71
SelectorBase< IParticleSelector >::m_inSel
bool m_inSel
Definition: SelectorBase.h:77
SelectorBase< IParticleSelector >::m_all
bool m_all
Definition: SelectorBase.h:75
SelectedParticles::SetBit
void SetBit(unsigned i, bool good=true)
Definition: SelectedParticles.cxx:19
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
IParticleSelector::Contained
IParticle Contained
Definition: IParticleSelector.h:74
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
IParticleSelector::accept
bool accept(const IParticleLink &link)
Test to see if a particle passes the selection.
Definition: IParticleSelector.cxx:54
SelectorBase< IParticleSelector >::m_gensel
bool m_gensel
Definition: SelectorBase.h:79
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
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
SelectorBase< IParticleSelector >
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< IParticleSelector >::m_inLink
bool m_inLink
Definition: SelectorBase.h:78
SelectorBase< IParticleSelector >::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
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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< IParticleSelector >::m_genlink
bool m_genlink
Definition: SelectorBase.h:80
lumiFormat.i
int i
Definition: lumiFormat.py:92
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< IParticleSelector >::m_absetamin
double m_absetamin
Definition: SelectorBase.h:86
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SelectorBase< IParticleSelector >::m_ptmax
double m_ptmax
Definition: SelectorBase.h:82
SelectorBase< IParticleSelector >::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< IParticleSelector >::m_etamax
double m_etamax
Definition: SelectorBase.h:84
SelectorBase< IParticleSelector >::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:195
SelectorBase< IParticleSelector >::m_inlinksKey
std::string m_inlinksKey
Definition: SelectorBase.h:73
SelectorBase< IParticleSelector >::userExecute
virtual StatusCode userExecute()
Definition: SelectorBase.h:57
SelectorBase< IParticleSelector >::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:616
SelectorBase< IParticleSelector >::m_inputKey
std::string m_inputKey
Definition: SelectorBase.h:70
SelectedParticles::numGood
unsigned numGood() const
Definition: SelectedParticles.cxx:112
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
SelectorBase< IParticleSelector >::pt_eta_range
bool pt_eta_range(double pt, double eta)
Definition: SelectorBase.h:279
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
IParticleSelector::m_selectorHandles
ToolHandleArray< ISelector > m_selectorHandles
Property: List of additional selection tools.
Definition: IParticleSelector.h:106
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
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< IParticleSelector >::m_ptmin
double m_ptmin
Definition: SelectorBase.h:81
ServiceHandle< ICondSvc >