ATLAS Offline Software
McVtxFilterTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // McVtxFilterTool.cxx
7 // Implementation file for class McVtxFilterTool
8 // Author: S.Binet<binet@cern.ch>
10 
11 
12 // STL includes
13 #include <algorithm>
14 
15 // FrameWork includes
16 #include "Gaudi/Property.h"
17 
18 // HepMC includes
19 #include "AtlasHepMC/GenEvent.h"
20 #include "AtlasHepMC/GenVertex.h"
21 #include "AtlasHepMC/GenParticle.h"
23 
24 // McParticleTools includes
25 #include "McVtxFilterTool.h"
26 #include "copyBeamParticles.h"
27 
31 
35  const std::string& name,
36  const IInterface* parent ) :
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 }
101 
105 {
106  ATH_MSG_DEBUG("Calling destructor");
107 }
108 
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 }
125 
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 }
157 
161 
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 }
178 
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  }
188 
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 }
199 
203 
204 void
206  McEventCollection* filterColl )
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 }
265 
266 
270 
272  HepMC::GenEvent * evt,
273  const VtxType::Flag vtxType, bool isSignal ) const
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  }
414 
416  const HepMC::ConstGenParticlePtr& part ) const
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 }
456 
458 // Non-const methods:
460 
461 void McVtxFilterTool::setupFilters( Gaudi::Details::PropertyBase& /*decayPatterns*/ )
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  }
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:548
McVtxFilterTool::m_mcEventsOutputName
StringProperty m_mcEventsOutputName
Output McEventCollection location (filtered from the McEventCollection)
Definition: McVtxFilterTool.h:181
McVtxFilterTool::stats
void stats() const
Display the statistics for each McVtxFilter this Tool is embedding.
Definition: McVtxFilterTool.cxx:179
GenEvent.h
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
McVtxFilterTool::isAccepted
virtual bool isAccepted(const HepMC::ConstGenVertexPtr &vtx) const
Return true if one of the McVtxFilters accept this GenVertex.
Definition: McVtxFilterTool.cxx:189
McVtxFilterTool::execute
virtual StatusCode execute()
Definition: McVtxFilterTool.cxx:126
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
McVtxFilterTool::initialize
virtual StatusCode initialize()
Athena Algorithm's Hooks.
Definition: McVtxFilterTool.cxx:111
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
GenVertex.h
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
McEventCollection
McEventCollection
Definition: GeneratorObjectsTPCnv.cxx:60
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
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
GenParticle.h
PowhegPy8EG_H2a.pdgId
dictionary pdgId
Definition: PowhegPy8EG_H2a.py:128
McVtxFilterTool::McVtxFilterTool
McVtxFilterTool()
Default constructor:
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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
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:528
McVtxFilterTool::m_fillTree
BooleanProperty m_fillTree
Switch to fill the entire tree from a decay vertex.
Definition: McVtxFilterTool.h:210
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
McEventCollection.h
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:92
McVtxFilterTool::VtxType::Flag
Flag
Definition: McVtxFilterTool.h:80
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
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.
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
DataVector::resize
void resize(size_type sz)
Resizes the collection to the specified number of elements.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
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::~McVtxFilterTool
virtual ~McVtxFilterTool()
Destructor:
Definition: McVtxFilterTool.cxx:104
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.
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
McVtxFilterTool.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
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
AthAlgTool
Definition: AthAlgTool.h:26
HepMC::copyemptyGenEvent
GenEvent * copyemptyGenEvent(const GenEvent *inEvt)
Definition: GenEvent.h:531
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
error
Definition: IImpactPoint3dEstimator.h:70
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.
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
copyBeamParticles.h
Helper to copy beam particle information.
HepMC::signal_process_vertex
GenVertex * signal_process_vertex(const GenEvent *e)
Definition: GenEvent.h:503