ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::TruthCollectionMaker Class Reference

#include <TruthCollectionMaker.h>

Inheritance diagram for DerivationFramework::TruthCollectionMaker:
Collaboration diagram for DerivationFramework::TruthCollectionMaker:

Public Member Functions

 TruthCollectionMaker (const std::string &t, const std::string &n, const IInterface *p)
 
 ~TruthCollectionMaker ()
 
StatusCode initialize ()
 
StatusCode finalize ()
 
virtual StatusCode addBranches (const EventContext &ctx) const
 

Private Attributes

std::atomic< unsigned int > m_ntotpart
 
std::atomic< unsigned int > m_npasspart
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"}
 
SG::WriteHandleKey< xAOD::TruthParticleContainerm_outputParticlesKey {this, "OutputCollectionName", "", "WriteHandleKey for new TruthParticleContainer"}
 
Gaudi::Property< std::string > m_partString {this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"}
 
Gaudi::Property< bool > m_do_compress {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"}
 
Gaudi::Property< bool > m_do_sherpa {this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"}
 
Gaudi::Property< bool > m_keep_navigation_info {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_linkDecoratorKey {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_hadronOriginDecoratorKey {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_originReadDecorKey {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_typeReadDecorKey {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_outcomeReadDecorKey {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_classificationReadDecorKey {this, "inputClassification", m_particlesKey, "Classification", "Classification code"}
 
ServiceHandle< StoreGateSvcm_metaStore
 Handle on the metadata store for init. More...
 

Detailed Description

Definition at line 29 of file TruthCollectionMaker.h.

Constructor & Destructor Documentation

◆ TruthCollectionMaker()

DerivationFramework::TruthCollectionMaker::TruthCollectionMaker ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 29 of file TruthCollectionMaker.cxx.

32  : base_class(t,n,p)
33  , m_ntotpart(0)
34  , m_npasspart(0)
35  , m_metaStore( "MetaDataStore", n )
36 {
37  declareProperty("MetaDataStore", m_metaStore );
38 }

◆ ~TruthCollectionMaker()

DerivationFramework::TruthCollectionMaker::~TruthCollectionMaker ( )

Definition at line 41 of file TruthCollectionMaker.cxx.

41  {
42 }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::TruthCollectionMaker::addBranches ( const EventContext &  ctx) const
virtual

Definition at line 95 of file TruthCollectionMaker.cxx.

96 {
97  // Event context for AthenaMT
98 
99  // Set up for some metadata handling
100  // TODO: this isn't MT compliant. This information should go into the config level and avoid meta store
101  static const bool is_sherpa = [this]() {
102  bool is_sherpa = false;
103  if (m_metaStore->contains<xAOD::TruthMetaDataContainer>("TruthMetaData")){
104  // Note that I'd like to get this out of metadata in general, but it seems that the
105  // metadata isn't fully available in initialize, and since this is a const function
106  // I can only do the retrieve every event, rather than lazy-initializing, since this
107  // metadata ought not change during a run
108  const xAOD::TruthMetaDataContainer* truthMetaData(nullptr);
109  // Shamelessly stolen from the file meta data tool
110  if (m_metaStore->retrieve(truthMetaData).isSuccess() && !truthMetaData->empty()){
111  // Let's just be super sure...
112  const std::string gens = truthMetaData->at(0)->generators();
113  is_sherpa = (gens.find("sherpa")==std::string::npos &&
114  gens.find("Sherpa")==std::string::npos &&
115  gens.find("SHERPA")==std::string::npos) ? false : true;
116  } // Seems to be the only sure way...
117  else {
118  ATH_MSG_WARNING("Found xAODTruthMetaDataContainer empty! Configuring to be NOT Sherpa.");
119  }
120  ATH_MSG_INFO("From metadata configured: Sherpa? " << is_sherpa);
121  } else {
122  ATH_MSG_WARNING("Could not find metadata container in storegate; assuming NOT Sherpa");
123  }
124  return is_sherpa;
125  }();
126 
127  // Retrieve truth collections
129  if (!truthParticles.isValid()) {
130  ATH_MSG_ERROR("Couldn't retrieve TruthParticle collection with name " << m_particlesKey);
131  return StatusCode::FAILURE;
132  }
133 
134  // Create the new particle containers and WriteHandles
136  ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
137  std::make_unique<xAOD::TruthParticleAuxContainer>()));
138  ATH_MSG_DEBUG( "Recorded new TruthParticleContainer with key: " << (m_outputParticlesKey.key()));
139 
140  // Set up a mask with the same entries as the full collections
141  unsigned int nParticles = truthParticles->size();
142  m_ntotpart += nParticles;
143 
144  // Set up decor readers
149 
150  // Set up decorators
159 
160  // Execute the text parsers and update the mask
161  if (!m_partString.empty()) {
162  std::vector<int> entries = m_parser->evaluateAsVector();
163  unsigned int nEntries = entries.size();
164  // check the sizes are compatible
165  if (nParticles != nEntries ) {
166  ATH_MSG_ERROR("Sizes incompatible! Are you sure your selection string used TruthParticles?");
167  return StatusCode::FAILURE;
168  } else {
169  // add relevant particles to new collection
170 
171  //---------------
172  //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.
173  //---------------
174 
175  //Let's check if we want to build W/Z bosons
176  bool SherpaW = false;
177  bool SherpaZ = false;
178  if (m_partString.value().find("24") != std::string::npos && m_do_sherpa && is_sherpa) {
179  SherpaW = true;
180  }
181  if (m_partString.value().find("23") != std::string::npos && m_do_sherpa && is_sherpa) {
182  SherpaZ = true;
183  }
184  if ((SherpaW or SherpaZ) && is_sherpa){
185  if (std::accumulate(entries.begin(),entries.end(),0) > 0){ //We actually have some W and Z bosons in there.
186  SherpaW = false;
187  SherpaZ = false;
188  }
189  }
190 
191  if ((SherpaW || SherpaZ) && is_sherpa){
192  // Currently only handles un-ambiguous cases
193  std::vector<const xAOD::TruthParticle*> status_nonPhysical;
194  for (unsigned int i=0; i<nParticles; ++i) {
195  // Nullptr check
196  if (!truthParticles->at(i)) continue;
197  // Only collect leptons
198  if (!MC::isSMLepton(truthParticles->at(i))) continue;
199  // Gather by status
200  if (!MC::isPhysical(truthParticles->at(i))) status_nonPhysical.push_back( truthParticles->at(i) );
201  } // Done with loop over truth particles
202  // Boson cases that we can actually deal with -- generically up to VVV
203  if ((status_nonPhysical.size()==2 || status_nonPhysical.size()==4 || status_nonPhysical.size()==6) && (SherpaZ || SherpaW)){
204  // Basic boson pairing...
205  int gens[3] = {0,0,0};
206  for (size_t i=0;i<status_nonPhysical.size();++i){
207  if (status_nonPhysical[i]->absPdgId()<13) gens[0]++;
208  else if (status_nonPhysical[i]->absPdgId()<15) gens[1]++;
209  else gens[2]++;
210  } // Loop over status_nonPhysical particles
211  // Should only have even numbers per generation. Any number greater than 2 or ==1 and we're dead
212  if (gens[0]>2 || gens[0]==1 || gens[1]>2 || gens[1]==1 || gens[2]>2 || gens[2]==1){
213  // In agreeing with Sherpa authors, these are Q-M ambiguous states. Do not let users be evil.
214  ATH_MSG_VERBOSE("Too many leptons of one generation. Cannot make bosons. Give up");
215  return StatusCode::SUCCESS;
216  }
217  std::vector<const xAOD::TruthParticle*> boson;
218  for (size_t i=0;i<status_nonPhysical.size();++i){
219  if (status_nonPhysical[i]->absPdgId()<13) boson.push_back(status_nonPhysical[i]);
220  else if (gens[0]==0 && status_nonPhysical[i]->absPdgId()<15) boson.push_back(status_nonPhysical[i]);
221  else if (gens[0]==0 && gens[1]==0) boson.push_back(status_nonPhysical[i]);
222  if (boson.size()==2){
223  // Make a boson! Just have to figure out _which_ boson!
224  int pdg_id=0;
225  // Easy case: Z boson
226  if (boson[0]->pdgId()==-boson[1]->pdgId()) pdg_id=23;
227  else if (std::abs(boson[0]->pdgId()+boson[1]->pdgId())!=1){
228  // No idea what you were
229  ATH_MSG_WARNING("Do not know how to interpret as a boson: " << boson[0]->pdgId() << " " << boson[1]->pdgId());
230  } else {
231  // W boson
232  pdg_id=24*(boson[0]->pdgId()+boson[1]->pdgId());
233  }
234  if ( (SherpaW && MC::isW(pdg_id)) ||
235  (SherpaZ && MC::isZ(pdg_id)) ){
236  // Make a Z or a W
237  xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
238  newParticlesWriteHandle->push_back( xTruthParticle );
240  if (boson[0]->hasProdVtx()) {
241  if ((boson[0]->prodVtx()->nIncomingParticles() > 0) && (boson[0]->prodVtx()->incomingParticle(0)!=nullptr)) {
242  motherIDDecorator(*xTruthParticle) = boson[0]->prodVtx()->incomingParticle(0)->pdgId();
243  } else {motherIDDecorator(*xTruthParticle) = 0;}
244  } else {motherIDDecorator(*xTruthParticle) = 0;}
245  if (boson[0]->hasDecayVtx()) {
246  if ((boson[0]->decayVtx()->nOutgoingParticles() > 0) && (boson[0]->decayVtx()->outgoingParticle(0)!=nullptr)) {
247  daughterIDDecorator(*xTruthParticle) = boson[0]->decayVtx()->outgoingParticle(0)->pdgId();
248  } else {daughterIDDecorator(*xTruthParticle) = 0;}
249  } else {daughterIDDecorator(*xTruthParticle) = 0;}
250  }
251  // Set with what makes sense here
252  xTruthParticle->setPdgId(pdg_id);
253  // Set dummy values
254  xTruthParticle->setUid(HepMC::INVALID_PARTICLE_ID);
255  xTruthParticle->setStatus(3);
256  // Use the sum of the momenta
257  xAOD::IParticle::FourMom_t new_mom = boson[0]->p4()+boson[1]->p4();
258  xTruthParticle->setM(new_mom.M());
259  xTruthParticle->setPx(new_mom.Px());
260  xTruthParticle->setPy(new_mom.Py());
261  xTruthParticle->setPz(new_mom.Pz());
262  xTruthParticle->setE(new_mom.E());
263  }
264  // Now clear the vectors
265  boson.clear();
266  // And move to the next generation
267  if (gens[0]==0 && gens[1]==0) gens[2]=0;
268  else if (gens[0]==0) gens[1]=0;
269  else gens[0]=0;
270  } // Done making a boson
271  } // Done looping over particles
272  }
273  if (status_nonPhysical.size()==1 || status_nonPhysical.size()==3 || status_nonPhysical.size()==5 || status_nonPhysical.size()>6){
274  ATH_MSG_WARNING(status_nonPhysical.size() << " leptons found in the Sherpa event record. Not sure how to deal with this.");
275  }
276  return StatusCode::SUCCESS;
277  }
278  for (unsigned int i=0; i<nParticles; ++i) {
279  ElementLink<xAOD::TruthParticleContainer> eltp(*truthParticles,i);
280  if (entries[i]==1) {
281  //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.
282 
283  const xAOD::TruthParticle* theParticle = (*truthParticles)[i];
284  if (m_do_compress){
285  bool same_as_mother = false;
286  bool same_as_daughter = false;
287  if (theParticle->hasProdVtx()){
288  if ((theParticle->prodVtx()->nIncomingParticles() > 0) && (theParticle->prodVtx()->incomingParticle(0)!=nullptr)) {
289  if (theParticle->prodVtx()->incomingParticle(0)->pdgId() == theParticle->pdgId()){
290  same_as_mother = true;
291  }
292  }
293  }
294  if (theParticle->hasDecayVtx()){
295  if ((theParticle->decayVtx()->nOutgoingParticles() > 0) && (theParticle->decayVtx()->outgoingParticle(0)!=nullptr)) {
296  if (theParticle->decayVtx()->outgoingParticle(0)->pdgId() == theParticle->pdgId()){
297  same_as_daughter = true;
298  }
299  }
300  }
301  if (same_as_mother && same_as_daughter){
302  entries[i]=0;
303  continue;
304  }
305  }
306  xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
307  newParticlesWriteHandle->push_back( xTruthParticle );
309  if (theParticle->hasProdVtx()) {
310  if ((theParticle->prodVtx()->nIncomingParticles() > 0) && (theParticle->prodVtx()->incomingParticle(0)!=nullptr)) {
311  motherIDDecorator(*xTruthParticle) = theParticle->prodVtx()->incomingParticle(0)->pdgId();
312  } else {motherIDDecorator(*xTruthParticle) = 0;}
313  } else {motherIDDecorator(*xTruthParticle) = 0;}
314  if (theParticle->hasDecayVtx()) {
315  if ((theParticle->decayVtx()->nOutgoingParticles() > 0) && (theParticle->decayVtx()->outgoingParticle(0)!=nullptr)) {
316  daughterIDDecorator(*xTruthParticle) = theParticle->decayVtx()->outgoingParticle(0)->pdgId();
317  } else {daughterIDDecorator(*xTruthParticle) = 0;}
318  } else {daughterIDDecorator(*xTruthParticle) = 0;}
319  }
320  // Fill with numerical content
321  *xTruthParticle=*theParticle;
322  // Copy over the decorations if they are available
323  typeDecorator(*xTruthParticle) =
324  typeReadDecor(*theParticle);
325 
326  originDecorator(*xTruthParticle) =
327  originReadDecor(*theParticle);
328 
329  outcomeDecorator(*xTruthParticle) =
330  outcomeReadDecor(*theParticle);
331 
332  classificationDecorator(*xTruthParticle) =
333  classificationReadDecor(*theParticle);
334 
335  if (m_outputParticlesKey.key()=="TruthHFHadrons"){ // FIXME Cannot find any other reference to this container name in Athena...
336  static const SG::ConstAccessor<int> TopHadronOriginFlagAcc("TopHadronOriginFlag"); // FIXME This should be a ReadDecorHandle
337  hadronOriginDecorator(*xTruthParticle) =
338  TopHadronOriginFlagAcc.withDefault (*theParticle, 0); // FIXME avoid using withDefault as it masks configuration/scheduling issues?
339  }
340 
341  if(m_keep_navigation_info) linkDecorator(*xTruthParticle) = eltp;
342  }
343  }
344  }
345  // Count the mask
346  for (unsigned int i=0; i<nParticles; ++i) if (entries[i]) ++m_npasspart;
347  }
348 
349  return StatusCode::SUCCESS;
350 }

◆ finalize()

StatusCode DerivationFramework::TruthCollectionMaker::finalize ( )

Definition at line 85 of file TruthCollectionMaker.cxx.

86 {
87  ATH_MSG_VERBOSE("finalize() ...");
88  //ATH_MSG_INFO("Processed "<< m_ntotvtx <<" truth vertices, "<< m_npassvtx << " were retained ");
89  ATH_MSG_INFO("Processed "<< m_ntotpart <<" truth particles, "<< m_npasspart << " were retained ");
90  ATH_CHECK( finalizeParser() );
91  return StatusCode::SUCCESS;
92 }

◆ initialize()

StatusCode DerivationFramework::TruthCollectionMaker::initialize ( )

Definition at line 45 of file TruthCollectionMaker.cxx.

46 {
47  ATH_MSG_VERBOSE("initialize() ...");
48  // Input truth particles
50  ATH_MSG_INFO("Using " << m_particlesKey.key() << " as the input truth container key");
51 
52  // Output (new) truth particles
54  ATH_MSG_INFO("New truth particles container key: " << m_outputParticlesKey.key() );
55 
56  if (m_partString.empty()) {
57  ATH_MSG_FATAL("No selection string provided");
58  return StatusCode::FAILURE;
59  } else {ATH_MSG_INFO("Truth particle selection string: " << m_partString );}
60 
61  // Set up the text-parsing machinery for thinning the truth directly according to user cuts
62  if (!m_partString.empty()) {
63  ATH_CHECK( initializeParser(m_partString) );
64  }
65 
66  // Initialise read handle keys
71 
72  // Initialise decorator handle keys
81 
82  return StatusCode::SUCCESS;
83 }

Member Data Documentation

◆ m_classificationDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"}
private

Definition at line 62 of file TruthCollectionMaker.h.

◆ m_classificationReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_classificationReadDecorKey {this, "inputClassification", m_particlesKey, "Classification", "Classification code"}
private

Definition at line 79 of file TruthCollectionMaker.h.

◆ m_daughterIDDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"}
private

Definition at line 66 of file TruthCollectionMaker.h.

◆ m_do_compress

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_do_compress {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"}
private

Definition at line 47 of file TruthCollectionMaker.h.

◆ m_do_sherpa

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_do_sherpa {this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"}
private

Definition at line 49 of file TruthCollectionMaker.h.

◆ m_hadronOriginDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_hadronOriginDecoratorKey {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"}
private

Definition at line 68 of file TruthCollectionMaker.h.

◆ m_keep_navigation_info

Gaudi::Property<bool> DerivationFramework::TruthCollectionMaker::m_keep_navigation_info {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"}
private

Definition at line 51 of file TruthCollectionMaker.h.

◆ m_linkDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_linkDecoratorKey {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"}
private

Definition at line 54 of file TruthCollectionMaker.h.

◆ m_metaStore

ServiceHandle<StoreGateSvc> DerivationFramework::TruthCollectionMaker::m_metaStore
private

Handle on the metadata store for init.

Definition at line 82 of file TruthCollectionMaker.h.

◆ m_motherIDDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"}
private

Definition at line 64 of file TruthCollectionMaker.h.

◆ m_npasspart

std::atomic<unsigned int> DerivationFramework::TruthCollectionMaker::m_npasspart
private

Definition at line 38 of file TruthCollectionMaker.h.

◆ m_ntotpart

std::atomic<unsigned int> DerivationFramework::TruthCollectionMaker::m_ntotpart
mutableprivate

Definition at line 38 of file TruthCollectionMaker.h.

◆ m_originDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
private

Definition at line 56 of file TruthCollectionMaker.h.

◆ m_originReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_originReadDecorKey {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"}
private

Definition at line 73 of file TruthCollectionMaker.h.

◆ m_outcomeDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
private

Definition at line 60 of file TruthCollectionMaker.h.

◆ m_outcomeReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outcomeReadDecorKey {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"}
private

Definition at line 77 of file TruthCollectionMaker.h.

◆ m_outputParticlesKey

SG::WriteHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_outputParticlesKey {this, "OutputCollectionName", "", "WriteHandleKey for new TruthParticleContainer"}
private

Definition at line 42 of file TruthCollectionMaker.h.

◆ m_particlesKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"}
private

Definition at line 40 of file TruthCollectionMaker.h.

◆ m_partString

Gaudi::Property<std::string> DerivationFramework::TruthCollectionMaker::m_partString {this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"}
private

Definition at line 45 of file TruthCollectionMaker.h.

◆ m_typeDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
private

Definition at line 58 of file TruthCollectionMaker.h.

◆ m_typeReadDecorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthCollectionMaker::m_typeReadDecorKey {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"}
private

Definition at line 75 of file TruthCollectionMaker.h.


The documentation for this class was generated from the following files:
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
DerivationFramework::TruthCollectionMaker::m_daughterIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
Definition: TruthCollectionMaker.h:67
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle< xAOD::TruthParticleContainer >
xAOD::TruthParticle_v1::setE
void setE(float value)
Set the energy of the particle.
Definition: TruthParticle_v1.cxx:230
runITkAlign.accumulate
accumulate
Update flags based on parser line args.
Definition: runITkAlign.py:62
DerivationFramework::TruthCollectionMaker::m_do_sherpa
Gaudi::Property< bool > m_do_sherpa
Definition: TruthCollectionMaker.h:50
DerivationFramework::TruthCollectionMaker::m_outcomeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
Definition: TruthCollectionMaker.h:61
DerivationFramework::TruthCollectionMaker::m_do_compress
Gaudi::Property< bool > m_do_compress
Definition: TruthCollectionMaker.h:48
HepMC::INVALID_PARTICLE_ID
constexpr int INVALID_PARTICLE_ID
Definition: MagicNumbers.h:57
DerivationFramework::TruthCollectionMaker::m_typeReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeReadDecorKey
Definition: TruthCollectionMaker.h:76
DerivationFramework::TruthCollectionMaker::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition: TruthCollectionMaker.h:41
xAOD::TruthParticle_v1::setPx
void setPx(float value)
Set the x component of the particle's momentum.
SG::ConstAccessor< int >
DerivationFramework::TruthCollectionMaker::m_hadronOriginDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_hadronOriginDecoratorKey
Definition: TruthCollectionMaker.h:69
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
DerivationFramework::TruthCollectionMaker::m_npasspart
std::atomic< unsigned int > m_npasspart
Definition: TruthCollectionMaker.h:38
isSMLepton
bool isSMLepton(const T &p)
APID: the fourth generation leptons are not standard model leptons.
Definition: AtlasPID.h:194
xAOD::IParticle::FourMom_t
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:69
MC::isPhysical
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
Definition: HepMCHelpers.h:51
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
xAOD::TruthParticle_v1::setM
void setM(float value)
Also store the mass.
Definition: TruthParticle_v1.cxx:236
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:85
SG::ReadDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
beamspotman.n
n
Definition: beamspotman.py:727
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
isZ
bool isZ(const T &p)
Definition: AtlasPID.h:379
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
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:69
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
DerivationFramework::TruthCollectionMaker::m_classificationDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
Definition: TruthCollectionMaker.h:63
xAOD::TruthVertex_v1::incomingParticle
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
Definition: TruthVertex_v1.cxx:70
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DerivationFramework::TruthCollectionMaker::m_typeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
Definition: TruthCollectionMaker.h:59
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
DerivationFramework::TruthCollectionMaker::m_originReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originReadDecorKey
Definition: TruthCollectionMaker.h:74
DerivationFramework::TruthCollectionMaker::m_ntotpart
std::atomic< unsigned int > m_ntotpart
Definition: TruthCollectionMaker.h:38
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:75
DerivationFramework::TruthCollectionMaker::m_linkDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_linkDecoratorKey
Definition: TruthCollectionMaker.h:55
xAOD::TruthParticle_v1::setPdgId
void setPdgId(int pid)
Set PDG ID code.
xAOD::TruthParticle_v1::setUid
void setUid(int value)
Set unique ID.
runIDPVM.pdgId
pdgId
Definition: runIDPVM.py:91
DerivationFramework::TruthCollectionMaker::m_keep_navigation_info
Gaudi::Property< bool > m_keep_navigation_info
Definition: TruthCollectionMaker.h:52
DerivationFramework::TruthCollectionMaker::m_outputParticlesKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
Definition: TruthCollectionMaker.h:43
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
isW
bool isW(const T &p)
Definition: AtlasPID.h:382
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
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.
xAOD::TruthParticle_v1::setPz
void setPz(float value)
Set the z component of the particle's momentum.
DerivationFramework::TruthCollectionMaker::m_outcomeReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeReadDecorKey
Definition: TruthCollectionMaker.h:78
DerivationFramework::TruthCollectionMaker::m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
Definition: TruthCollectionMaker.h:57
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
DerivationFramework::TruthCollectionMaker::m_motherIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
Definition: TruthCollectionMaker.h:65
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
dqBeamSpot.nEntries
int nEntries
Definition: dqBeamSpot.py:72
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:120
DerivationFramework::TruthCollectionMaker::m_classificationReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationReadDecorKey
Definition: TruthCollectionMaker.h:80
DerivationFramework::TruthCollectionMaker::m_partString
Gaudi::Property< std::string > m_partString
Definition: TruthCollectionMaker.h:46