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

#include <McVtxFilterTool.h>

Inheritance diagram for McVtxFilterTool:
Collaboration diagram for McVtxFilterTool:

Classes

struct  VtxType
 

Public Member Functions

 McVtxFilterTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor with parameters: More...
 
virtual ~McVtxFilterTool ()
 Destructor: More...
 
virtual StatusCode initialize ()
 Athena Algorithm's Hooks. More...
 
virtual StatusCode execute ()
 
void displayOptions () const
 Display the decay pattern of each McVtxFilter this Tool is embedding. More...
 
void stats () const
 Display the statistics for each McVtxFilter this Tool is embedding. More...
 
virtual bool isAccepted (const HepMC::ConstGenVertexPtr &vtx) const
 Return true if one of the McVtxFilters accept this GenVertex. More...
 
virtual void filterMcEventCollection (const McEventCollection *mcCollection, McEventCollection *filterColl)
 Filter the McEventCollection according to the list of McVtxFilter embedded in this AlgTool, and fill the output McEventCollection. 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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 I/O operators. More...
 

Protected Member Functions

 McVtxFilterTool ()
 Default constructor: More...
 
void addVertex (const HepMC::ConstGenVertexPtr &vtx, HepMC::GenEvent *evt, const VtxType::Flag vtxType=VtxType::IsNotRootVertex, bool isSignal=false) const
 Add the vertex to the event : nothing very special, just to factorize code Input GenVertex is const because we add a copy of it to the GenEvent. More...
 
bool keepParticle (const VtxType::Flag vtxType, const HepMC::ConstGenParticlePtr &p) const
 Helper function: return true if we are at a root vertex (i.e., a vertex that satisfies one of the chosen decay modes) and if the PDG of the particle is in the m_particles list (or the m_particle list is empty). More...
 
void setupFilters (Gaudi::Details::PropertyBase &decayPatterns)
 Callback method to ensure consistency of filters. More...
 
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

StringProperty m_mcEventsName
 Location of the McEventCollection to be filtered. More...
 
StringProperty m_mcEventsOutputName
 Output McEventCollection location (filtered from the McEventCollection) More...
 
StringArrayProperty m_decayPatterns
 Patterns of the decays to look for (ex: "23 -> -5 + 5" ) More...
 
BooleanArrayProperty m_matchSigns
 Booleans to setup each of the McVtxFilter::matchSign. More...
 
BooleanArrayProperty m_matchBranches
 Booleans to setup each of the McVtxFilter::matchBranch. More...
 
DataVector< McVtxFilterm_filters
 Filters. More...
 
std::vector< double > m_counter
 Stores the total number of filtered vertices for each McVtxFilter. More...
 
BooleanProperty m_doSignalProcessVtx
 Switch to include or not the signal_process_vertex into the McEventCollection (default = true) More...
 
BooleanProperty m_fillTree
 Switch to fill the entire tree from a decay vertex. More...
 
LongArrayProperty m_particles
 List of outgoing particles from the decay vertex to include. More...
 

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

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

AlgTool which filters an input McEventCollection and outputs a new one from the decay patterns it has been setup with. The decay patterns describe the decay vertices one is looking for and are modeled via a simple std::string. One can specify multiple decay patterns and modify them at the jobOption level via the property "DecayPatterns". One can also explicitly specify to record the signal process vertex of the input McEventCollection into the new one, even if it does not satisfy a single decay pattern in the list of decay vertices to look for.

Note that the real work of the filtering is performed by the McVtxFilter class which is located in the AnalysisUtils package.

Added new properties:

ex. suppose have processes like:
u + ubar -> gluon(->jet(s)) + photon(->e+/e- + bremsstrahlung photons)

and want to filter out only the jet(s) from the gluon. Use these jobOptions

DecayPatterns = [ "-2+2 -> 21 + 22" ] # select the process
ParticlesToKeep = [ 21 ] # only keep outgoing gluon
FillTree = True # keep all decay products of the gluon


Definition at line 71 of file McVtxFilterTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ McVtxFilterTool() [1/2]

McVtxFilterTool::McVtxFilterTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor with parameters:

Public methods:

Constructors

Definition at line 34 of file McVtxFilterTool.cxx.

36  :
38 {
39  //
40  // Property declaration
41  //
42  //declareProperty( "Property", m_nProperty );
43 
44  declareProperty( "McEvents",
45  m_mcEventsName = "TruthEvent",
46  "Location of the McEventCollection to be filtered" );
47 
48  declareProperty( "McEventsOutput",
49  m_mcEventsOutputName = "GEN_AOD",
50  "Output McEventCollection location (filtered from the "
51  "McEventCollection)" );
52 
53  declareProperty( "DecayPatterns",
55  "List of decay patterns the tool will try to match. \n\t"
56  "ex: 23 -> -5 + 5 to select Z bosons into bbbar pairs" );
57 
58  m_decayPatterns.declareUpdateHandler( &McVtxFilterTool::setupFilters,
59  this );
60 
61  declareProperty( "MatchSigns",
63  "List of booleans with which the tool will setup "
64  "McVtxFilters. This will setup the McVtxFilter::matchSign "
65  "data member." );
66  m_matchSigns.declareUpdateHandler( &McVtxFilterTool::setupFilters,
67  this );
68 
69  declareProperty( "MatchBranches",
71  "List of booleans with which the tool will setup "
72  "McVtxFilters. This will setup the "
73  "McVtxFilter::matchBranches data member." );
74 
75  m_matchBranches.declareUpdateHandler( &McVtxFilterTool::setupFilters,
76  this );
77 
78  declareProperty( "DoSignalProcessVtx",
79  m_doSignalProcessVtx = true,
80  "Switch to include or not the signal_process_vertex into "
81  "the McEventCollection (default = true).\n"
82  "Note that this is close to useless as the HEPEVT structure"
83  " does not hold this kind of informations..." );
84 
85  declareProperty( "FillTree",
86  m_fillTree = false,
87  "Switch to fill the entire decay tree from a decay "
88  "vertex.\n"
89  "This can be usefull to record for example the whole shower "
90  "from a gluon or a quark. In that case, you may want to add "
91  "the according PDG ids into the list of particles to keep" );
92 
93  declareProperty( "ParticlesToKeep",
95  "List of outgoing particles from the decay vertex to "
96  "include. This property has to be configured in sync. with "
97  "the 'FillTree' one." );
98 
99  declareInterface<IMcVtxFilterTool>(this);
100 }

◆ ~McVtxFilterTool()

McVtxFilterTool::~McVtxFilterTool ( )
virtual

Destructor:

Destructor.

Definition at line 104 of file McVtxFilterTool.cxx.

105 {
106  ATH_MSG_DEBUG("Calling destructor");
107 }

◆ McVtxFilterTool() [2/2]

McVtxFilterTool::McVtxFilterTool ( )
protected

Default constructor:

Member Function Documentation

◆ addVertex()

void McVtxFilterTool::addVertex ( const HepMC::ConstGenVertexPtr vtx,
HepMC::GenEvent *  evt,
const VtxType::Flag  vtxType = VtxType::IsNotRootVertex,
bool  isSignal = false 
) const
protected

Add the vertex to the event : nothing very special, just to factorize code Input GenVertex is const because we add a copy of it to the GenEvent.

Const methods:

The last parameter is used here to add (or not) the whole decay tree at a given vertex. (Default: just add the vertex, not the whole tree of children)

Fill the parent branch

Fill the children branch

Definition at line 271 of file McVtxFilterTool.cxx.

274 {
275  ATH_MSG_VERBOSE("In McVtxFilterTool::addVertex( vtxType= "<<vtxType<< " )");
276 #ifdef HEPMC3
277  HepMC::GenVertexPtr vtx = (evt == srcVtx->parent_event()) ? std::const_pointer_cast<HepMC3::GenVertex>(srcVtx) : nullptr ;
278  if ( !vtx ) {
279  vtx = HepMC::newGenVertexPtr();
280  evt->add_vertex(vtx);
281  vtx->set_position( srcVtx->position() );
282  vtx->set_status( srcVtx->status() );
283  HepMC::suggest_barcode(vtx, HepMC::barcode(srcVtx) );
284  vtx->add_attribute("weights",srcVtx->attribute<HepMC3::VectorDoubleAttribute> ("weights"));
285  }
286  if (isSignal) HepMC::set_signal_process_vertex(evt, vtx );
288  for ( const auto& parent: srcVtx->particles_in()) {
289  HepMC::GenParticlePtr mother = (evt == parent->parent_event()) ? std::const_pointer_cast<HepMC3::GenParticle>(parent) : nullptr ;
290  if ( ! mother ) {
291  mother = HepMC::newGenParticlePtr();
292  vtx->add_particle_in( mother );
293  mother->set_momentum( parent->momentum() );
294  mother->set_generated_mass( parent->generated_mass() );
295  mother->set_pdg_id( parent->pdg_id() );
296  mother->set_status( parent->status() );
297  HepMC::set_flow(mother, HepMC::flow(parent) );
300 
301  } else {
302  // set the mother's decay to our (new) vertex
303  vtx->add_particle_in( mother );
304  }
305  }//> loop over ingoing particles
306 
308  for ( const auto& child: srcVtx->particles_out()) {
309  HepMC::GenParticlePtr daughter = (evt == child->parent_event()) ? std::const_pointer_cast<HepMC3::GenParticle>(child) : nullptr ;
310  if ( !daughter ) {
311  if ( !keepParticle( vtxType, child ) ) {
312  // only include selected particles via the "ParticlesToKeep" property
313  ATH_MSG_VERBOSE("Skipping outgoing particle id|particle: ["
314  << child->pdg_id() << "|"
315  << child << "]");
316  } else {
317  daughter = HepMC::newGenParticlePtr();
318  // set the daughter's production vertex to our new vertex
319  vtx->add_particle_out( daughter );
320  daughter->set_momentum( child->momentum() );
321  daughter->set_generated_mass( child->generated_mass() );
322  daughter->set_pdg_id( child->pdg_id() );
323  daughter->set_status( child->status() );
324  HepMC::set_flow(daughter, HepMC::flow(child) );
325  HepMC::set_polarization(daughter, HepMC::polarization(child) );
326  HepMC::suggest_barcode(daughter,HepMC::barcode(child) );
327 
328  }
329  }
330 
331  if ( m_fillTree && keepParticle( vtxType, child ) ) {
332  auto decayVertex = child->end_vertex();
333  if ( decayVertex ) {
334  // recursively fill the tree with all decay vertices and final state
335  // particles of selected outgoing particles lines
336  // => We are no longer sitting at the decay vertex so we tell it
337  // via the IsNotRootVertex flag
338  addVertex( decayVertex, evt, VtxType::IsNotRootVertex );
339  }
340  }
341  }//> loop over outgoing particles
342 #else
343  HepMC::GenVertex * vtx = evt->barcode_to_vertex(srcVtx->barcode());
344  if ( 0 == vtx ) {
345  vtx = HepMC::newGenVertexPtr();
346  vtx->set_position( srcVtx->position() );
347  vtx->set_id( srcVtx->id() );
348  vtx->suggest_barcode( srcVtx->barcode() );
349  vtx->weights() = srcVtx->weights();
350  evt->add_vertex(vtx);
351  }
352  if (isSignal) HepMC::set_signal_process_vertex(evt, vtx );
354  for ( HepMC::GenVertex::particles_in_const_iterator parent = srcVtx->particles_in_const_begin();
355  parent != srcVtx->particles_in_const_end();
356  ++parent ) {
357  HepMC::GenParticle * mother = evt->barcode_to_particle( (*parent)->barcode() );
358  if ( 0 == mother ) {
359  mother = HepMC::newGenParticlePtr();
360  mother->set_momentum( (*parent)->momentum() );
361  mother->set_generated_mass( (*parent)->generated_mass() );
362  mother->set_pdg_id( (*parent)->pdg_id() );
363  mother->set_status( (*parent)->status() );
364  mother->set_flow( (*parent)->flow() );
365  mother->set_polarization( (*parent)->polarization() );
366  mother->suggest_barcode( (*parent)->barcode() );
367 
368  }
369  // set the mother's decay to our (new) vertex
370  vtx->add_particle_in( mother );
371 
372  }//> loop over ingoing particles
373 
375  for ( HepMC::GenVertex::particles_out_const_iterator child = srcVtx->particles_out_const_begin();
376  child != srcVtx->particles_out_const_end();
377  ++child ) {
378  HepMC::GenParticle * daughter = evt->barcode_to_particle( (*child)->barcode() );
379  if ( 0 == daughter ) {
380  if ( !keepParticle( vtxType, *child ) ) {
381  // only include selected particles via the "ParticlesToKeep" property
382  ATH_MSG_VERBOSE("Skipping outgoing particle : "<< (*child));
383  } else {
384  daughter = HepMC::newGenParticlePtr();
385  daughter->set_momentum( (*child)->momentum() );
386  daughter->set_generated_mass( (*child)->generated_mass() );
387  daughter->set_pdg_id( (*child)->pdg_id() );
388  daughter->set_status( (*child)->status() );
389  daughter->set_flow( (*child)->flow() );
390  daughter->set_polarization( (*child)->polarization() );
391  daughter->suggest_barcode( (*child)->barcode() );
392 
393  }
394  }
395  if ( daughter ) {
396  // set the daughter's production vertex to our new vertex
397  vtx->add_particle_out( daughter );
398  }
399 
400  if ( m_fillTree && keepParticle( vtxType, *child ) ) {
401  const HepMC::GenVertex * decayVertex = (*child)->end_vertex();
402  if ( 0 != decayVertex ) {
403  // recursively fill the tree with all decay vertices and final state
404  // particles of selected outgoing particles lines
405  // => We are no longer sitting at the decay vertex so we tell it
406  // via the IsNotRootVertex flag
407  addVertex( decayVertex, evt, VtxType::IsNotRootVertex );
408  }
409  }
410  }//> loop over outgoing particles
411 #endif
412 
413  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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; }

◆ displayOptions()

void McVtxFilterTool::displayOptions ( ) const
virtual

Display the decay pattern of each McVtxFilter this Tool is embedding.

Const methods:

Implements IMcVtxFilterTool.

Definition at line 162 of file McVtxFilterTool.cxx.

163 {
164  msg(MSG::INFO)
165  << "Options for " << name() << " :" << endmsg
166  << "\tDecay Patterns: [ ";
167  for (const auto & itr : m_decayPatterns.value()) {
168  msg(MSG::INFO) << itr << "; ";
169  }
170  msg(MSG::INFO) << "]" << endmsg;
171 
172  msg(MSG::INFO) << "Particles to keep: [";
173  for (long itr : m_particles.value()) {
174  msg(MSG::INFO) << itr << ", ";
175  }
176  msg(MSG::INFO) << "]" << endmsg;
177 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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 McVtxFilterTool::execute ( )
virtual

Implements IMcVtxFilterTool.

Definition at line 126 of file McVtxFilterTool.cxx.

127 {
128  StatusCode sc = StatusCode::SUCCESS;
129 
130  ATH_MSG_DEBUG("Executing " << name() << "...");
131 
132  ATH_MSG_VERBOSE("Retrieve the McEventCollection to be filtered for");
133  const McEventCollection * mcColl = nullptr;
134  sc = evtStore()->retrieve( mcColl, m_mcEventsName );
135 
136  if ( sc.isFailure() || nullptr == mcColl ) {
137  msg(MSG::ERROR)
138  << "Failed to retrieve McEventCollection at : "
139  << m_mcEventsName
140  << endmsg
141  << "because : sc= " << ( sc.isFailure() ? "FAILURE" : "OK" )
142  << " and mcEvent= " << mcColl
143  << endmsg;
144  return StatusCode::SUCCESS;
145  }
146 
147  ATH_MSG_VERBOSE("Create a new McEventCollection which will hold the "\
148  "filtered GenEvent");
149  McEventCollection * filteredColl = new McEventCollection;
150  sc = evtStore()->record(filteredColl, m_mcEventsOutputName, true);
151  sc = evtStore()->setConst(filteredColl);
152  ATH_MSG_VERBOSE("Recorded and locked in StoreGate");
153 
154  filterMcEventCollection( mcColl, filteredColl );
155  return sc;
156 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ filterMcEventCollection()

void McVtxFilterTool::filterMcEventCollection ( const McEventCollection mcCollection,
McEventCollection filterColl 
)
virtual

Filter the McEventCollection according to the list of McVtxFilter embedded in this AlgTool, and fill the output McEventCollection.

Non-const methods:

Create a set with ids of copied vertices.

Local copy of the GenEvent from StoreGate

Create the event container, with Signal Process and event number from the GenEvent source

Handling the signal_process_vertex stuff Signal_process_vertex pointer is not set by all generators, but in case it has been set up, one should keep this usefull information, shouldn't we ? So first we check it is present in the original GenEvent, and then we check if it as not already added by any previous McVtxFilter (by chance or because it was just meant to be)

Implements IMcVtxFilterTool.

Definition at line 205 of file McVtxFilterTool.cxx.

207 {
208  if ( nullptr == mcColl ) {
209  ATH_MSG_ERROR("McEventCollection is NULL pointer !!");
210  return;
211  }
212 
214  std::set<int> bcToFullVtx;
215 
217  const HepMC::GenEvent * evtSrc = (*mcColl->begin());
218 
221  HepMC::GenEvent * evt = HepMC::copyemptyGenEvent(evtSrc);
222  for ( const auto& itrPart: *evtSrc) {
223  auto dcyVtx = itrPart->end_vertex();
224  if ( !dcyVtx ) continue;
225  int vtxBC = HepMC::barcode_or_id(dcyVtx);
226  if (bcToFullVtx.count(vtxBC)!=0) continue;
227  ATH_MSG_VERBOSE("Doing vtx: " << dcyVtx);
228 
229  int i = 0;
231  ATH_MSG_VERBOSE("Processing with filter[" << i << "]...");
232  if ( !(*filter)->isAccepted( dcyVtx ) ) continue;
233  m_counter[i] += 1;
234  ATH_MSG_VERBOSE("Filter[" << i << "] accepted this vtx : " << dcyVtx);
235  bcToFullVtx.insert(vtxBC);
236  addVertex( dcyVtx, evt, VtxType::IsRootVertex );
237  break;
238  }//> end loop over filters
239  }//> loop over particles
240 
241  if ( m_doSignalProcessVtx ) {
249  auto sigProcVtx = HepMC::signal_process_vertex(evtSrc);
250  if ( sigProcVtx ) {
251  if ( bcToFullVtx.count(HepMC::barcode_or_id(sigProcVtx)) == 0) {
252  addVertex( sigProcVtx, evt,VtxType::IsNotRootVertex, true );
253  }//> signal process vertex has to be added
254  } else {
255  //> Original GenEvent has a NO signal process vertex set-up
256  ATH_MSG_DEBUG("You asked to record signal_process_vertex but :" << endmsg << " there is NO signal_process_vertex in this event !!");
257  }
258 
259  } //> end do SignalProcessVtx
260 
262 
263  filterColl->push_back(evt);
264 }

◆ initialize()

StatusCode McVtxFilterTool::initialize ( )
virtual

Athena Algorithm's Hooks.

Implements IMcVtxFilterTool.

Definition at line 111 of file McVtxFilterTool.cxx.

112 {
113  ATH_MSG_DEBUG("Initializing " << name() << "...");
114 
115  if ( msgLvl(MSG::DEBUG) ) {
116  displayOptions();
117  }
118 
119  // configure the filters with the provided DecayPatterns (from
120  // jobO or via the property interface
122 
123  return StatusCode::SUCCESS;
124 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ interfaceID()

const InterfaceID & IMcVtxFilterTool::interfaceID ( )
inlinestaticinherited

I/O operators.

Inline methods:

Definition at line 82 of file IMcVtxFilterTool.h.

83 {
84  return IID_IMcVtxFilterTool;
85 }

◆ isAccepted()

bool McVtxFilterTool::isAccepted ( const HepMC::ConstGenVertexPtr vtx) const
virtual

Return true if one of the McVtxFilters accept this GenVertex.

Implements IMcVtxFilterTool.

Definition at line 189 of file McVtxFilterTool.cxx.

190 {
191  for(const auto *filter : m_filters) {
192  if ( filter->isAccepted( vtx ) ) {
193  return true;
194  }
195  }//> end loop over McVtxFilters
196 
197  return false;
198 }

◆ keepParticle()

bool McVtxFilterTool::keepParticle ( const VtxType::Flag  vtxType,
const HepMC::ConstGenParticlePtr p 
) const
protected

Helper function: return true if we are at a root vertex (i.e., a vertex that satisfies one of the chosen decay modes) and if the PDG of the particle is in the m_particles list (or the m_particle list is empty).

Definition at line 415 of file McVtxFilterTool.cxx.

417 {
418  // no particle, so no particle to keep. Simple, isn't ?
419  if ( nullptr == part ) {
420  return false;
421  }
422 
423  // By default, we keep all particles
424  if ( m_particles.value().empty() ) {
425  return true;
426  }
427 
428  // only filter decay particles of the root vertex
429  // ie: the vertex which matches a decay pattern setup by the
430  // "DecayPatterns" property.
431  if ( vtxType == VtxType::IsNotRootVertex ) {
432  return true;
433 
434  } else if ( vtxType == VtxType::IsRootVertex ) {
435  // we are at a Root vertex.
436  // And we only keep the outgoing particles which are in our list
437  const int pdgId = part->pdg_id();
438  return std::find( m_particles.value().begin(),
439  m_particles.value().end(),
440  pdgId ) != m_particles.value().end();
441  } else {
442 
443  // Humm.. we don't know anything about this VtxType...
444  // by default we keep all particles
445  // But we tell user that something is wrong !
446  msg(MSG::WARNING)
447  << "In keepParticle: Don't know anything about this VtxType ["
448  << vtxType << "] !!"
449  << endmsg
450  << "We'll keep this particle [ " << part
451  << "] but : Check your jobOption !!"
452  << endmsg;
453  return true;
454  }
455 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::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< AlgTool > >::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.

◆ 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< AlgTool > >::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< AlgTool > >::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  }

◆ setupFilters()

void McVtxFilterTool::setupFilters ( Gaudi::Details::PropertyBase &  decayPatterns)
protected

Callback method to ensure consistency of filters.

Method to ensure the synchronisation between the filters and the decay patterns they are supposed to match. This is to cope with the case where this tool is called by some parent AlgTool/Algorithm which wants to override the DecayPatterns property given by the JobOptionSvc. We ensure the consistency between those 2 entities by defining a callback function (@setupFilters) to perform the job.

Definition at line 461 of file McVtxFilterTool.cxx.

462 {
463  m_filters.clear();
464  m_counter.clear();
465 
466  const std::vector<std::string>& decayPatterns = m_decayPatterns.value();
467  std::vector<bool> matchSigns = m_matchSigns.value();
468  std::vector<bool> matchBranches = m_matchBranches.value();
469 
470  // Normally, using the Configurables, the lengths of properties should
471  // be the same... but who knows. Better test it.
472  // On the other hand, for compatibility reasons, we allow the situation
473  // where *both* matchSigns and matchBranches are empty.
474  // Only after having removed the "old-style" case we can raise an exception.
475  const bool oldCfg = ( m_matchSigns.value().empty() &&
476  m_matchBranches.value().empty() );
477  if ( !oldCfg &&
478  ( decayPatterns.size() != matchSigns.size() ||
479  decayPatterns.size() != matchBranches.size() ||
480  matchSigns.size() != matchBranches.size() ) ) {
481  std::string error;
482  error = "Lengths of ArrayProperty configuring McVtxFilters ";
483  error += "are DIFFERING !!";
484  msg(MSG::WARNING)
485  << "In setupFilter: " << error
486  << endmsg
487  << "\t# decayPatterns: " << decayPatterns.size() << endmsg
488  << "\t# matchSigns: " << matchSigns.size() << endmsg
489  << "\t# matchBranches: " << matchBranches.size() << endmsg
490  << "Reference size is 'decayPatterns':" << endmsg
491  << "\t==> Will fill holes with default values !" << endmsg
492  << "\t==> Will drop extra values !"
493  << endmsg;
494  //throw std::runtime_error(error);
495  }
496 
497  const unsigned int nDecayPatterns = decayPatterns.size();
498  m_filters.resize( nDecayPatterns );
499  m_counter.resize( nDecayPatterns, 0 );
500 
501  if ( nDecayPatterns > matchSigns.size() ) {
502  // fill it with default values
503  const unsigned int nCount = nDecayPatterns - matchSigns.size();
504  std::fill_n( std::back_inserter(matchSigns),
505  nCount, // number of times we fill it
506  false );// default value
507  }
508 
509  if ( nDecayPatterns > matchBranches.size() ) {
510  // fill it with default values
511  const unsigned int nCount = nDecayPatterns - matchBranches.size();
512  std::fill_n( std::back_inserter(matchBranches),
513  nCount, // number of times we fill it
514  false );// default value
515  }
516 
517  for ( unsigned int i = 0; i != nDecayPatterns; ++i ) {
518  m_filters[i] = new McVtxFilter( decayPatterns[i],
519  bool(matchSigns[i]),
520  bool(matchBranches[i]) );
521  }
522 
523  }

◆ stats()

void McVtxFilterTool::stats ( ) const
virtual

Display the statistics for each McVtxFilter this Tool is embedding.

Implements IMcVtxFilterTool.

Definition at line 179 of file McVtxFilterTool.cxx.

180 {
181  msg(MSG::INFO) << "Statistics for each filter : " << endmsg;
182  for( unsigned int i = 0; i < m_counter.size(); ++i ) {
183  msg(MSG::INFO)
184  << "\t==> [" << m_decayPatterns.value()[i] << "] accepted "
185  << m_counter[i] << " vertices" << endmsg;
186  }
187  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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  }

Member Data Documentation

◆ m_counter

std::vector<double> McVtxFilterTool::m_counter
protected

Stores the total number of filtered vertices for each McVtxFilter.

Definition at line 201 of file McVtxFilterTool.h.

◆ m_decayPatterns

StringArrayProperty McVtxFilterTool::m_decayPatterns
protected

Patterns of the decays to look for (ex: "23 -> -5 + 5" )

Definition at line 185 of file McVtxFilterTool.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doSignalProcessVtx

BooleanProperty McVtxFilterTool::m_doSignalProcessVtx
protected

Switch to include or not the signal_process_vertex into the McEventCollection (default = true)

Definition at line 206 of file McVtxFilterTool.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fillTree

BooleanProperty McVtxFilterTool::m_fillTree
protected

Switch to fill the entire tree from a decay vertex.

Definition at line 210 of file McVtxFilterTool.h.

◆ m_filters

DataVector<McVtxFilter> McVtxFilterTool::m_filters
protected

Filters.

Definition at line 197 of file McVtxFilterTool.h.

◆ m_matchBranches

BooleanArrayProperty McVtxFilterTool::m_matchBranches
protected

Booleans to setup each of the McVtxFilter::matchBranch.

Definition at line 193 of file McVtxFilterTool.h.

◆ m_matchSigns

BooleanArrayProperty McVtxFilterTool::m_matchSigns
protected

Booleans to setup each of the McVtxFilter::matchSign.

Definition at line 189 of file McVtxFilterTool.h.

◆ m_mcEventsName

StringProperty McVtxFilterTool::m_mcEventsName
protected

Location of the McEventCollection to be filtered.

Definition at line 177 of file McVtxFilterTool.h.

◆ m_mcEventsOutputName

StringProperty McVtxFilterTool::m_mcEventsOutputName
protected

Output McEventCollection location (filtered from the McEventCollection)

Definition at line 181 of file McVtxFilterTool.h.

◆ m_particles

LongArrayProperty McVtxFilterTool::m_particles
protected

List of outgoing particles from the decay vertex to include.

Definition at line 214 of file McVtxFilterTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
McVtxFilterTool::m_doSignalProcessVtx
BooleanProperty m_doSignalProcessVtx
Switch to include or not the signal_process_vertex into the McEventCollection (default = true)
Definition: McVtxFilterTool.h:206
HepMC::suggest_barcode
bool suggest_barcode(T &p, int i)
Definition: GenEvent.h:670
McVtxFilterTool::m_mcEventsOutputName
StringProperty m_mcEventsOutputName
Output McEventCollection location (filtered from the McEventCollection)
Definition: McVtxFilterTool.h:181
McVtxFilterTool::addVertex
void addVertex(const HepMC::ConstGenVertexPtr &vtx, HepMC::GenEvent *evt, const VtxType::Flag vtxType=VtxType::IsNotRootVertex, bool isSignal=false) const
Add the vertex to the event : nothing very special, just to factorize code Input GenVertex is const b...
Definition: McVtxFilterTool.cxx:271
HepMC::polarization
Polarization polarization(const T &a)
Definition: Polarization.h:47
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
McVtxFilterTool::m_mcEventsName
StringProperty m_mcEventsName
Location of the McEventCollection to be filtered.
Definition: McVtxFilterTool.h:177
True
#define True
Definition: ALFA_SvdCalc.h:37
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LB_AnalMapSplitter.of
of
Definition: LB_AnalMapSplitter.py:48
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
McEventCollection
McEventCollection
Definition: GeneratorObjectsTPCnv.cxx:60
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
McVtxFilterTool::m_counter
std::vector< double > m_counter
Stores the total number of filtered vertices for each McVtxFilter.
Definition: McVtxFilterTool.h:201
McVtxFilterTool::m_filters
DataVector< McVtxFilter > m_filters
Filters.
Definition: McVtxFilterTool.h:197
McVtxFilterTool::VtxType::IsNotRootVertex
@ IsNotRootVertex
Definition: McVtxFilterTool.h:83
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
McVtxFilterTool::m_matchSigns
BooleanArrayProperty m_matchSigns
Booleans to setup each of the McVtxFilter::matchSign.
Definition: McVtxFilterTool.h:189
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SUSY_SimplifiedModel_PostInclude.process
string process
Definition: SUSY_SimplifiedModel_PostInclude.py:42
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TruthHelper::copyBeamParticles
void copyBeamParticles(const HepMC::GenEvent &inEvt[[maybe_unused]], HepMC::GenEvent &outEvt[[maybe_unused]])
Definition: copyBeamParticles.cxx:21
covarianceTool.filter
filter
Definition: covarianceTool.py:514
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
McVtxFilter
McVtxFilter allows to select HepMC::GenParticle based on the decay pattern.
Definition: McVtxFilter.h:45
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
HepMC::set_signal_process_vertex
void set_signal_process_vertex(GenEvent *e, T v)
Definition: GenEvent.h:650
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
McVtxFilterTool::m_fillTree
BooleanProperty m_fillTree
Switch to fill the entire tree from a decay vertex.
Definition: McVtxFilterTool.h:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
McVtxFilterTool::filterMcEventCollection
virtual void filterMcEventCollection(const McEventCollection *mcCollection, McEventCollection *filterColl)
Filter the McEventCollection according to the list of McVtxFilter embedded in this AlgTool,...
Definition: McVtxFilterTool.cxx:205
HepMC::flow
int flow(const T &a, int i)
Definition: Flow.h:51
HepMC::newGenVertexPtr
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
Definition: GenVertex.h:64
lumiFormat.i
int i
Definition: lumiFormat.py:85
ReadCalibFromCool.keep
keep
Definition: ReadCalibFromCool.py:85
HepMC::barcode_or_id
int barcode_or_id(const ConstGenParticlePtr &p)
Definition: GenParticle.h:42
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HepMC::set_polarization
void set_polarization(T &a, Polarization b)
Definition: Polarization.h:44
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
McVtxFilterTool::m_matchBranches
BooleanArrayProperty m_matchBranches
Booleans to setup each of the McVtxFilter::matchBranch.
Definition: McVtxFilterTool.h:193
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
McVtxFilterTool::m_decayPatterns
StringArrayProperty m_decayPatterns
Patterns of the decays to look for (ex: "23 -> -5 + 5" )
Definition: McVtxFilterTool.h:185
DataVector::clear
void clear()
Erase all the elements in the collection.
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
python.CaloBCIDAvgAlgConfig.only
list only
Definition: CaloBCIDAvgAlgConfig.py:32
DataVector::resize
void resize(size_type sz)
Resizes the collection to the specified number of elements.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
McVtxFilterTool::m_particles
LongArrayProperty m_particles
List of outgoing particles from the decay vertex to include.
Definition: McVtxFilterTool.h:214
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
McVtxFilterTool::keepParticle
bool keepParticle(const VtxType::Flag vtxType, const HepMC::ConstGenParticlePtr &p) const
Helper function: return true if we are at a root vertex (i.e., a vertex that satisfies one of the cho...
Definition: McVtxFilterTool.cxx:415
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
HepMC::newGenParticlePtr
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Definition: GenParticle.h:39
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
HepMC::copyemptyGenEvent
GenEvent * copyemptyGenEvent(const GenEvent *inEvt)
Definition: GenEvent.h:653
get_generator_info.error
error
Definition: get_generator_info.py:40
McVtxFilterTool::displayOptions
void displayOptions() const
Display the decay pattern of each McVtxFilter this Tool is embedding.
Definition: McVtxFilterTool.cxx:162
DerivationFramework::ClustersInCone::select
void select(const xAOD::IParticle *particle, const float coneSize, const xAOD::CaloClusterContainer *clusters, std::vector< bool > &mask)
Definition: ClustersInCone.cxx:14
error
Definition: IImpactPoint3dEstimator.h:70
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
McVtxFilterTool::VtxType::IsRootVertex
@ IsRootVertex
Definition: McVtxFilterTool.h:82
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
McVtxFilterTool::setupFilters
void setupFilters(Gaudi::Details::PropertyBase &decayPatterns)
Callback method to ensure consistency of filters.
Definition: McVtxFilterTool.cxx:461
GenParticle
@ GenParticle
Definition: TruthClasses.h:30
HepMC::signal_process_vertex
GenVertex * signal_process_vertex(const GenEvent *e)
Definition: GenEvent.h:625