ATLAS Offline Software
TruthDecayCollectionMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DERIVATIONFRAMEWORK_TRUTHDECAYCOLLECTIONMAKER_H
6 #define DERIVATIONFRAMEWORK_TRUTHDECAYCOLLECTIONMAKER_H
7 
8 // Base classes
11 // EDM -- typedefs so these are includes
14 // Handles and keys
18 #include "StoreGate/WriteHandle.h"
19 // Standard library includes
20 #include <vector>
21 #include <string>
22 
23 namespace DerivationFramework {
24 
25 
27  public:
28  TruthDecayCollectionMaker(const std::string& t, const std::string& n, const IInterface* p);
31  virtual StatusCode addBranches() const;
32 
33  private:
34  Gaudi::Property<std::vector<int> > m_pdgIdsToKeep
35  {this, "PDGIDsToKeep", {}, "PDG IDs of particles to build the collection from"};
36  Gaudi::Property<bool> m_keepBHadrons
37  {this, "KeepBHadrons", false, "Keep b-hadrons (easier than by PDG ID)"};
38  Gaudi::Property<bool> m_keepCHadrons
39  {this, "KeepCHadrons", false, "Keep c-hadrons (easier than by PDG ID)"};
40  Gaudi::Property<bool> m_keepBSM
41  {this, "KeepBSM", false, "Keep BSM particles (easier than by PDG ID)"};
42  Gaudi::Property<bool> m_rejectHadronChildren
43  {this, "RejectHadronChildren", false, "Drop hadron descendants"};
45  {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"};
47  {this, "NewParticleKey", "", "WriteHandleKey for new TruthParticleContainer"};
49  {this, "NewVertexKey", "", "WriteHandleKey for new TruthVertexContainer"};
51  {this, "classifierParticleOrigin", "TruthParticles.classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"};
53  {this, "classifierParticleType", "TruthParticles.classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"};
55  {this, "classifierParticleOutCome", "TruthParticles.classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
57  {this, "Classification", "TruthParticles.Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
59  {this, "motherID", "TruthParticles.motherID","Name of the decoration which records the ID of the particle's mother"};
61  {this, "daughterID", "TruthParticles.daughterID","Name of the decoration which records the ID of the particle's daughter"};
62 
63  Gaudi::Property<std::string> m_collectionName
64  {this, "NewCollectionName", "", "New collection name stem"};
65  Gaudi::Property<int> m_generations
66  {this, "Generations", -1, "Number of generations after the particle in question to keep (-1 for all)"};
67 
68  // Helper functions for building up the decay product collections
69  int addTruthParticle( const EventContext& ctx,
70  const xAOD::TruthParticle& old_part, xAOD::TruthParticleContainer* part_cont,
71  xAOD::TruthVertexContainer* vert_cont, std::vector<int>& seen_particles,
72  const int generations=-1) const;
73  int addTruthVertex( const EventContext&,
74  const xAOD::TruthVertex& old_vert, xAOD::TruthParticleContainer* part_cont,
75  xAOD::TruthVertexContainer* vert_cont, std::vector<int>& seen_particles,
76  const int generations=-1) const;
77  bool id_ok( const xAOD::TruthParticle& part ) const;
78  };
79 }
80 
81 #endif // DERIVATIONFRAMEWORK_TRUTHDECAYCOLLECTIONMAKER_H
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
DerivationFramework::TruthDecayCollectionMaker::m_rejectHadronChildren
Gaudi::Property< bool > m_rejectHadronChildren
< Option to reject hadron descendants
Definition: TruthDecayCollectionMaker.h:43
IAugmentationTool.h
DerivationFramework::TruthDecayCollectionMaker::m_outputParticlesKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
Definition: TruthDecayCollectionMaker.h:47
TruthVertexContainer.h
TruthParticleContainer.h
DerivationFramework::TruthDecayCollectionMaker::TruthDecayCollectionMaker
TruthDecayCollectionMaker(const std::string &t, const std::string &n, const IInterface *p)
Definition: TruthDecayCollectionMaker.cxx:29
DerivationFramework::TruthDecayCollectionMaker::m_keepBSM
Gaudi::Property< bool > m_keepBSM
< Option to keep all BSM particles (better than giving PDG IDs)
Definition: TruthDecayCollectionMaker.h:41
DerivationFramework::TruthDecayCollectionMaker::initialize
StatusCode initialize()
Definition: TruthDecayCollectionMaker.cxx:42
DerivationFramework::TruthDecayCollectionMaker::m_keepBHadrons
Gaudi::Property< bool > m_keepBHadrons
< Option to keep all b-hadrons (better than giving PDG IDs)
Definition: TruthDecayCollectionMaker.h:37
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::ReadHandleKey< xAOD::TruthParticleContainer >
DerivationFramework::IAugmentationTool
Definition: IAugmentationTool.h:24
HepMC::BarcodeBased::generations
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (only to be used in...
Definition: MagicNumbers.h:204
WriteHandle.h
Handle class for recording to StoreGate.
DerivationFramework::TruthDecayCollectionMaker::m_keepCHadrons
Gaudi::Property< bool > m_keepCHadrons
< Option to keep all c-hadrons (better than giving PDG IDs)
Definition: TruthDecayCollectionMaker.h:39
DerivationFramework::TruthDecayCollectionMaker::addTruthVertex
int addTruthVertex(const EventContext &, const xAOD::TruthVertex &old_vert, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
Definition: TruthDecayCollectionMaker.cxx:188
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
DerivationFramework::TruthDecayCollectionMaker::addTruthParticle
int addTruthParticle(const EventContext &ctx, const xAOD::TruthParticle &old_part, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
Definition: TruthDecayCollectionMaker.cxx:123
DerivationFramework::TruthDecayCollectionMaker::m_collectionName
Gaudi::Property< std::string > m_collectionName
< Output collection name stem
Definition: TruthDecayCollectionMaker.h:64
beamspotman.n
n
Definition: beamspotman.py:731
DerivationFramework::TruthDecayCollectionMaker::m_typeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
Definition: TruthDecayCollectionMaker.h:53
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::TruthDecayCollectionMaker::m_motherIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
Definition: TruthDecayCollectionMaker.h:59
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
AthAlgTool.h
DerivationFramework::TruthDecayCollectionMaker::m_outputVerticesKey
SG::WriteHandleKey< xAOD::TruthVertexContainer > m_outputVerticesKey
Definition: TruthDecayCollectionMaker.h:49
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
DerivationFramework::TruthDecayCollectionMaker::m_classificationDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
Definition: TruthDecayCollectionMaker.h:57
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
DerivationFramework::TruthDecayCollectionMaker::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition: TruthDecayCollectionMaker.h:45
DerivationFramework::TruthDecayCollectionMaker::id_ok
bool id_ok(const xAOD::TruthParticle &part) const
Definition: TruthDecayCollectionMaker.cxx:226
DerivationFramework::TruthDecayCollectionMaker::m_generations
Gaudi::Property< int > m_generations
< Number of generations after the particle in question to keep
Definition: TruthDecayCollectionMaker.h:66
DerivationFramework::TruthDecayCollectionMaker::m_outcomeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
Definition: TruthDecayCollectionMaker.h:55
DerivationFramework::TruthDecayCollectionMaker::~TruthDecayCollectionMaker
~TruthDecayCollectionMaker()
Definition: TruthDecayCollectionMaker.cxx:38
DerivationFramework::TruthDecayCollectionMaker::m_pdgIdsToKeep
Gaudi::Property< std::vector< int > > m_pdgIdsToKeep
< List of PDG IDs to build this collection from
Definition: TruthDecayCollectionMaker.h:35
AthAlgTool
Definition: AthAlgTool.h:26
DerivationFramework::TruthDecayCollectionMaker::m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
Definition: TruthDecayCollectionMaker.h:51
DerivationFramework::TruthDecayCollectionMaker::m_daughterIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
Definition: TruthDecayCollectionMaker.h:61
DerivationFramework::TruthDecayCollectionMaker
Definition: TruthDecayCollectionMaker.h:26
DerivationFramework::TruthDecayCollectionMaker::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: TruthDecayCollectionMaker.cxx:86