ATLAS Offline Software
TruthCollectionMaker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TruthCollectionMaker.cxx
7 // Author: James Catmore (James.Catmore@cern.ch)
8 // Removes all truth particles/vertices which do not pass a user-defined cut
9 
10 // Base class
12 // EDM includes
15 // Handles
17 // To look up which generator is being used
18 #include "StoreGate/StoreGateSvc.h"
22 // STL Includes
23 #include <vector>
24 #include <string>
25 #include <numeric>
26 
27 // Constructor
29  const std::string& n,
30  const IInterface* p)
32  , m_ntotpart(0)
33  , m_npasspart(0)
34  , m_metaStore( "MetaDataStore", n )
35 {
36  declareInterface<DerivationFramework::IAugmentationTool>(this);
37  declareProperty("MetaDataStore", m_metaStore );
38 }
39 
40 // Destructor
42 }
43 
44 // Athena initialize and finalize
46 {
47  ATH_MSG_VERBOSE("initialize() ...");
48 
49  // Input truth particles
50  ATH_CHECK( m_particlesKey.initialize() );
51  ATH_MSG_INFO("Using " << m_particlesKey.key() << " as the input truth container key");
52 
53  // Output (new) truth particles
54  ATH_CHECK(m_outputParticlesKey.initialize());
55  ATH_MSG_INFO("New truth particles container key: " << m_outputParticlesKey.key() );
56 
57  if (m_partString.empty()) {
58  ATH_MSG_FATAL("No selection string provided");
59  return StatusCode::FAILURE;
60  } else {ATH_MSG_INFO("Truth particle selection string: " << m_partString );}
61 
62  // Set up the text-parsing machinery for thinning the truth directly according to user cuts
63  if (!m_partString.empty()) {
64  ATH_CHECK( initializeParser(m_partString) );
65  }
66 
67  // Initialise read handle keys
68  ATH_CHECK(m_originReadDecorKey.initialize());
69  ATH_CHECK(m_typeReadDecorKey.initialize());
70  ATH_CHECK(m_outcomeReadDecorKey.initialize());
71  ATH_CHECK(m_classificationReadDecorKey.initialize());
72 
73  // Initialise decorator handle keys
74  ATH_CHECK(m_linkDecoratorKey.initialize());
75  ATH_CHECK(m_originDecoratorKey.initialize());
76  ATH_CHECK(m_typeDecoratorKey.initialize());
77  ATH_CHECK(m_outcomeDecoratorKey.initialize());
78  ATH_CHECK(m_classificationDecoratorKey.initialize());
79  ATH_CHECK(m_motherIDDecoratorKey.initialize());
80  ATH_CHECK(m_daughterIDDecoratorKey.initialize());
81  ATH_CHECK(m_hadronOriginDecoratorKey.initialize());
82 
83  return StatusCode::SUCCESS;
84 }
85 
87 {
88  ATH_MSG_VERBOSE("finalize() ...");
89  //ATH_MSG_INFO("Processed "<< m_ntotvtx <<" truth vertices, "<< m_npassvtx << " were retained ");
90  ATH_MSG_INFO("Processed "<< m_ntotpart <<" truth particles, "<< m_npasspart << " were retained ");
91  ATH_CHECK( finalizeParser() );
92  return StatusCode::SUCCESS;
93 }
94 
95 // Selection and collection creation
97 {
98  // Event context for AthenaMT
99  const EventContext& ctx = Gaudi::Hive::currentContext();
100 
101  // Set up for some metadata handling
102  // TODO: this isn't MT compliant. This information should go into the config level and avoid meta store
103  static const bool is_sherpa = [this]() {
104  bool is_sherpa = false;
105  if (m_metaStore->contains<xAOD::TruthMetaDataContainer>("TruthMetaData")){
106  // Note that I'd like to get this out of metadata in general, but it seems that the
107  // metadata isn't fully available in initialize, and since this is a const function
108  // I can only do the retrieve every event, rather than lazy-initializing, since this
109  // metadata ought not change during a run
110  const xAOD::TruthMetaDataContainer* truthMetaData(nullptr);
111  // Shamelessly stolen from the file meta data tool
112  if (m_metaStore->retrieve(truthMetaData).isSuccess() && !truthMetaData->empty()){
113  // Let's just be super sure...
114  const std::string gens = truthMetaData->at(0)->generators();
115  is_sherpa = (gens.find("sherpa")==std::string::npos &&
116  gens.find("Sherpa")==std::string::npos &&
117  gens.find("SHERPA")==std::string::npos) ? false : true;
118  } // Seems to be the only sure way...
119  else {
120  ATH_MSG_WARNING("Found xAODTruthMetaDataContainer empty! Configuring to be NOT Sherpa.");
121  }
122  ATH_MSG_INFO("From metadata configured: Sherpa? " << is_sherpa);
123  } else {
124  ATH_MSG_WARNING("Could not find metadata container in storegate; assuming NOT Sherpa");
125  }
126  return is_sherpa;
127  }();
128 
129  // Retrieve truth collections
130  SG::ReadHandle<xAOD::TruthParticleContainer> truthParticles(m_particlesKey,ctx);
131  if (!truthParticles.isValid()) {
132  ATH_MSG_ERROR("Couldn't retrieve TruthParticle collection with name " << m_particlesKey);
133  return StatusCode::FAILURE;
134  }
135 
136  // Create the new particle containers and WriteHandles
137  SG::WriteHandle<xAOD::TruthParticleContainer> newParticlesWriteHandle(m_outputParticlesKey, ctx);
138  ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
139  std::make_unique<xAOD::TruthParticleAuxContainer>()));
140  ATH_MSG_DEBUG( "Recorded new TruthParticleContainer with key: " << (m_outputParticlesKey.key()));
141 
142  // Set up a mask with the same entries as the full collections
143  unsigned int nParticles = truthParticles->size();
144  m_ntotpart += nParticles;
145 
146  // Set up decor readers
147  SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > originReadDecor(m_originReadDecorKey, ctx);
148  SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > typeReadDecor(m_typeReadDecorKey, ctx);
149  SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > outcomeReadDecor(m_outcomeReadDecorKey, ctx);
150  SG::ReadDecorHandle<xAOD::TruthParticleContainer, unsigned int > classificationReadDecor(m_classificationReadDecorKey, ctx);
151 
152  // Set up decorators
154  SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > originDecorator(m_originDecoratorKey, ctx);
155  SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > typeDecorator(m_typeDecoratorKey, ctx);
156  SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > outcomeDecorator(m_outcomeDecoratorKey, ctx);
157  SG::WriteDecorHandle<xAOD::TruthParticleContainer, unsigned int > classificationDecorator(m_classificationDecoratorKey, ctx);
158  SG::WriteDecorHandle< xAOD::TruthParticleContainer, int > motherIDDecorator(m_motherIDDecoratorKey, ctx);
159  SG::WriteDecorHandle< xAOD::TruthParticleContainer, int > daughterIDDecorator(m_daughterIDDecoratorKey, ctx);
160  SG::WriteDecorHandle< xAOD::TruthParticleContainer, int > hadronOriginDecorator(m_hadronOriginDecoratorKey, ctx);
161 
162  // Execute the text parsers and update the mask
163  if (!m_partString.empty()) {
164  std::vector<int> entries = m_parser->evaluateAsVector();
165  unsigned int nEntries = entries.size();
166  // check the sizes are compatible
167  if (nParticles != nEntries ) {
168  ATH_MSG_ERROR("Sizes incompatible! Are you sure your selection string used TruthParticles?");
169  return StatusCode::FAILURE;
170  } else {
171  // add relevant particles to new collection
172 
173  //---------------
174  //This is some code to *add* new particles. Probably a good idea to break this off as a sub-function, but I'll let James C decide where that should go.
175  //---------------
176 
177  //Let's check if we want to build W/Z bosons
178  bool SherpaW = false;
179  bool SherpaZ = false;
180  if (m_partString.value().find("24") != std::string::npos && m_do_sherpa && is_sherpa) {
181  SherpaW = true;
182  }
183  if (m_partString.value().find("23") != std::string::npos && m_do_sherpa && is_sherpa) {
184  SherpaZ = true;
185  }
186  if ((SherpaW or SherpaZ) && is_sherpa){
187  if (std::accumulate(entries.begin(),entries.end(),0) > 0){ //We actually have some W and Z bosons in there.
188  SherpaW = false;
189  SherpaZ = false;
190  }
191  }
192 
193  if ((SherpaW || SherpaZ) && is_sherpa){
194  // Currently only handles un-ambiguous cases
195  std::vector<const xAOD::TruthParticle*> status20, status3;
196  for (unsigned int i=0; i<nParticles; ++i) {
197  // Nullptr check
198  if (!truthParticles->at(i)) continue;
199  // Only collect leptons
200  if (!MC::isSMLepton(truthParticles->at(i))) continue;
201  // Gather by status
202  if (truthParticles->at(i)->status()==20) status20.push_back( truthParticles->at(i) );
203  if (truthParticles->at(i)->status()== 3) status3.push_back( truthParticles->at(i) );
204  } // Done with loop over truth particles
205  // Make it so that we can exclusively use one vector
206  // Status 20 should have the priority -- it is the future
207  if (!status20.empty()){
208  status3.swap(status20);
209  }
210  // Boson cases that we can actually deal with -- generically up to VVV
211  if ((status3.size()==2 || status3.size()==4 || status3.size()==6) && (SherpaZ || SherpaW)){
212  // Basic boson pairing...
213  int gens[3] = {0,0,0};
214  for (size_t i=0;i<status3.size();++i){
215  if (status3[i]->absPdgId()<13) gens[0]++;
216  else if (status3[i]->absPdgId()<15) gens[1]++;
217  else gens[2]++;
218  } // Loop over status3 particles
219  // Should only have even numbers per generation. Any number greater than 2 or ==1 and we're dead
220  if (gens[0]>2 || gens[0]==1 || gens[1]>2 || gens[1]==1 || gens[2]>2 || gens[2]==1){
221  // In agreeing with Sherpa authors, these are Q-M ambiguous states. Do not let users be evil.
222  ATH_MSG_VERBOSE("Too many leptons of one generation. Cannot make bosons. Give up");
223  return StatusCode::SUCCESS;
224  }
225  std::vector<const xAOD::TruthParticle*> boson;
226  for (size_t i=0;i<status3.size();++i){
227  if (status3[i]->absPdgId()<13) boson.push_back(status3[i]);
228  else if (gens[0]==0 && status3[i]->absPdgId()<15) boson.push_back(status3[i]);
229  else if (gens[0]==0 && gens[1]==0) boson.push_back(status3[i]);
230  if (boson.size()==2){
231  // Make a boson! Just have to figure out _which_ boson!
232  int pdg_id=0;
233  // Easy case: Z boson
234  if (boson[0]->pdgId()==-boson[1]->pdgId()) pdg_id=23;
235  else if (std::abs(boson[0]->pdgId()+boson[1]->pdgId())!=1){
236  // No idea what you were
237  ATH_MSG_WARNING("Do not know how to interpret as a boson: " << boson[0]->pdgId() << " " << boson[1]->pdgId());
238  } else {
239  // W boson
240  pdg_id=24*(boson[0]->pdgId()+boson[1]->pdgId());
241  }
242  if ( (SherpaW && std::abs(pdg_id)==24) ||
243  (SherpaZ && pdg_id==23) ){
244  // Make a Z or a W
245  xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
246  newParticlesWriteHandle->push_back( xTruthParticle );
247  if (m_keep_navigation_info){
248  if (boson[0]->hasProdVtx()) {
249  if ((boson[0]->prodVtx()->nIncomingParticles() > 0) && (boson[0]->prodVtx()->incomingParticle(0)!=nullptr)) {
250  motherIDDecorator(*xTruthParticle) = boson[0]->prodVtx()->incomingParticle(0)->pdgId();
251  } else {motherIDDecorator(*xTruthParticle) = 0;}
252  } else {motherIDDecorator(*xTruthParticle) = 0;}
253  if (boson[0]->hasDecayVtx()) {
254  if ((boson[0]->decayVtx()->nOutgoingParticles() > 0) && (boson[0]->decayVtx()->outgoingParticle(0)!=nullptr)) {
255  daughterIDDecorator(*xTruthParticle) = boson[0]->decayVtx()->outgoingParticle(0)->pdgId();
256  } else {daughterIDDecorator(*xTruthParticle) = 0;}
257  } else {daughterIDDecorator(*xTruthParticle) = 0;}
258  }
259  // Set with what makes sense here
260  xTruthParticle->setPdgId(pdg_id);
261  // Set dummy values
262  xTruthParticle->setBarcode(-1);
263  xTruthParticle->setStatus(3);
264  // Use the sum of the momenta
265  xAOD::IParticle::FourMom_t new_mom = boson[0]->p4()+boson[1]->p4();
266  xTruthParticle->setM(new_mom.M());
267  xTruthParticle->setPx(new_mom.Px());
268  xTruthParticle->setPy(new_mom.Py());
269  xTruthParticle->setPz(new_mom.Pz());
270  xTruthParticle->setE(new_mom.E());
271  }
272  // Now clear the vectors
273  boson.clear();
274  // And move to the next generation
275  if (gens[0]==0 && gens[1]==0) gens[2]=0;
276  else if (gens[0]==0) gens[1]=0;
277  else gens[0]=0;
278  } // Done making a boson
279  } // Done looping over particles
280  }
281  if (status3.size()==1 || status3.size()==3 || status3.size()==5 || status3.size()>6){
282  ATH_MSG_WARNING(status3.size() << " leptons found in the Sherpa event record. Not sure how to deal with this.");
283  }
284  return StatusCode::SUCCESS;
285  }
286  for (unsigned int i=0; i<nParticles; ++i) {
287  ElementLink<xAOD::TruthParticleContainer> eltp(*truthParticles,i);
288  if (entries[i]==1) {
289  //In TRUTH3, we want to remove all particles but the first and last in a decay chain. This is off in TRUTH1. The first and last particles in the decay chain are decorated as such.
290 
291  const xAOD::TruthParticle* theParticle = (*truthParticles)[i];
292  if (m_do_compress){
293  bool same_as_mother = false;
294  bool same_as_daughter = false;
295  if (theParticle->hasProdVtx()){
296  if ((theParticle->prodVtx()->nIncomingParticles() > 0) && (theParticle->prodVtx()->incomingParticle(0)!=nullptr)) {
297  if (theParticle->prodVtx()->incomingParticle(0)->pdgId() == theParticle->pdgId()){
298  same_as_mother = true;
299  }
300  }
301  }
302  if (theParticle->hasDecayVtx()){
303  if ((theParticle->decayVtx()->nOutgoingParticles() > 0) && (theParticle->decayVtx()->outgoingParticle(0)!=nullptr)) {
304  if (theParticle->decayVtx()->outgoingParticle(0)->pdgId() == theParticle->pdgId()){
305  same_as_daughter = true;
306  }
307  }
308  }
309  if (same_as_mother && same_as_daughter){
310  entries[i]=0;
311  continue;
312  }
313  }
314  xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
315  newParticlesWriteHandle->push_back( xTruthParticle );
316  if (m_keep_navigation_info){
317  if (theParticle->hasProdVtx()) {
318  if ((theParticle->prodVtx()->nIncomingParticles() > 0) && (theParticle->prodVtx()->incomingParticle(0)!=nullptr)) {
319  motherIDDecorator(*xTruthParticle) = theParticle->prodVtx()->incomingParticle(0)->pdgId();
320  } else {motherIDDecorator(*xTruthParticle) = 0;}
321  } else {motherIDDecorator(*xTruthParticle) = 0;}
322  if (theParticle->hasDecayVtx()) {
323  if ((theParticle->decayVtx()->nOutgoingParticles() > 0) && (theParticle->decayVtx()->outgoingParticle(0)!=nullptr)) {
324  daughterIDDecorator(*xTruthParticle) = theParticle->decayVtx()->outgoingParticle(0)->pdgId();
325  } else {daughterIDDecorator(*xTruthParticle) = 0;}
326  } else {daughterIDDecorator(*xTruthParticle) = 0;}
327  }
328  // Fill with numerical content
329  *xTruthParticle=*theParticle;
330  // Copy over the decorations if they are available
331  typeDecorator(*xTruthParticle) =
332  typeReadDecor.withDefault(*theParticle, 0);
333 
334  originDecorator(*xTruthParticle) =
335  originReadDecor.withDefault(*theParticle, 0);
336 
337  outcomeDecorator(*xTruthParticle) =
338  outcomeReadDecor.withDefault(*theParticle, 0);
339 
340  classificationDecorator(*xTruthParticle) =
341  classificationReadDecor.withDefault(*theParticle, 0);
342 
343  if (m_outputParticlesKey.key()=="TruthHFHadrons"){
344  static const SG::ConstAccessor<int> TopHadronOriginFlagAcc("TopHadronOriginFlag");
345  hadronOriginDecorator(*xTruthParticle) =
346  TopHadronOriginFlagAcc.withDefault (*theParticle, 0);
347  }
348 
349  if(m_keep_navigation_info) linkDecorator(*xTruthParticle) = eltp;
350  }
351  }
352  }
353  // Count the mask
354  for (unsigned int i=0; i<nParticles; ++i) if (entries[i]) ++m_npasspart;
355  }
356 
357  return StatusCode::SUCCESS;
358 }
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
xAOD::TruthParticle_v1::setStatus
void setStatus(int value)
Set status code.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SG::ReadDecorHandle::withDefault
const_reference_type withDefault(size_t index, const D &deflt)
Fetch the variable for one element, as a const reference.
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::TruthParticle_v1::setE
void setE(float value)
Set the energy of the particle.
Definition: TruthParticle_v1.cxx:235
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::TruthParticle_v1::setBarcode
void setBarcode(int value)
Set barcode.
TruthParticleContainer.h
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
DerivationFramework::TruthCollectionMaker::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: TruthCollectionMaker.cxx:96
xAOD::TruthParticle_v1::setPx
void setPx(float value)
Set the x component of the particle's momentum.
SG::ConstAccessor< int >
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PowhegPy8EG_H2a.pdgId
dictionary pdgId
Definition: PowhegPy8EG_H2a.py:128
isSMLepton
bool isSMLepton(const T &p)
Definition: AtlasPID.h:134
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:68
TruthParticleAuxContainer.h
DerivationFramework::TruthCollectionMaker::TruthCollectionMaker
TruthCollectionMaker(const std::string &t, const std::string &n, const IInterface *p)
Definition: TruthCollectionMaker.cxx:28
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
xAOD::TruthParticle_v1::setM
void setM(float value)
Also store the mass.
Definition: TruthParticle_v1.cxx:241
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
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
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
WriteDecorHandle.h
Handle class for adding a decoration to an object.
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
xAOD::TruthParticle_v1::setPy
void setPy(float value)
Set the y component of the particle's momentum.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::TruthVertex_v1::incomingParticle
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
Definition: TruthVertex_v1.cxx:71
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
DerivationFramework::TruthCollectionMaker::finalize
StatusCode finalize()
Definition: TruthCollectionMaker.cxx:86
ExpressionParserUser
Definition: ExpressionParserUser.h:107
xAOD::TruthParticle_v1::setPdgId
void setPdgId(int pid)
Set PDG ID code.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::TruthVertex_v1::nIncomingParticles
size_t nIncomingParticles() const
Get the number of incoming particles.
Definition: TruthVertex_v1.cxx:49
xAOD::TruthParticle_v1::setPz
void setPz(float value)
Set the z component of the particle's momentum.
entries
double entries
Definition: listroot.cxx:49
DerivationFramework::TruthCollectionMaker::m_metaStore
ServiceHandle< StoreGateSvc > m_metaStore
Handle on the metadata store for init.
Definition: TruthCollectionMaker.h:82
TruthCollectionMaker.h
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
dqBeamSpot.nEntries
int nEntries
Definition: dqBeamSpot.py:73
TruthMetaDataContainer.h
StoreGateSvc.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DerivationFramework::TruthCollectionMaker::~TruthCollectionMaker
~TruthCollectionMaker()
Definition: TruthCollectionMaker.cxx:41
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:121
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
DerivationFramework::TruthCollectionMaker::initialize
StatusCode initialize()
Definition: TruthCollectionMaker.cxx:45
HepMCHelpers.h
SG::ConstAccessor::withDefault
const_reference_type withDefault(const ELT &e, const T &deflt) const
Fetch the variable for one element, as a const reference, with a default.