ATLAS Offline Software
Loading...
Searching...
No Matches
TruthDecayCollectionMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
19// Standard library includes
20#include <vector>
21#include <string>
22
23namespace DerivationFramework {
24
25
26 class TruthDecayCollectionMaker : public extends<AthAlgTool, IAugmentationTool> {
27 public:
28
29 using base_class::base_class;
30
31 virtual StatusCode initialize() override final;
32 virtual StatusCode addBranches(const EventContext& ctx) const override final;
33
34 private:
35 Gaudi::Property<std::vector<int> > m_pdgIdsToKeep
36 {this, "PDGIDsToKeep", {}, "PDG IDs of particles to build the collection from"};
37 Gaudi::Property<bool> m_keepBHadrons
38 {this, "KeepBHadrons", false, "Keep b-hadrons (easier than by PDG ID)"};
39 Gaudi::Property<bool> m_keepCHadrons
40 {this, "KeepCHadrons", false, "Keep c-hadrons (easier than by PDG ID)"};
41 Gaudi::Property<bool> m_keepBSM
42 {this, "KeepBSM", false, "Keep BSM particles (easier than by PDG ID)"};
43 Gaudi::Property<bool> m_rejectHadronChildren
44 {this, "RejectHadronChildren", false, "Drop hadron descendants"};
45
46 // Read(Decor)HandleKeys
48 {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"};
50 {this, "Input_classifierParticleOrigin", m_particlesKey, "classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"};
52 {this, "Input_classifierParticleType", m_particlesKey, "classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"};
54 {this, "Input_classifierParticleOutCome", m_particlesKey, "classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
56 {this, "Input_Classification", m_particlesKey, "Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
57
58 // Write(Decor)HandleKeys
60 {this, "NewVertexKey", "", "WriteHandleKey for new TruthVertexContainer"};
62 {this, "NewParticleKey", "", "WriteHandleKey for new TruthParticleContainer"};
63
65 {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"};
67 {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"};
69 {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
71 {this, "Classification", m_outputParticlesKey, "Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
73 {this, "motherID", m_outputParticlesKey, "motherID","Name of the decoration which records the ID of the particle's mother"};
75 {this, "daughterID", m_outputParticlesKey, "daughterID","Name of the decoration which records the ID of the particle's daughter"};
76
77
78 Gaudi::Property<int> m_generations
79 {this, "Generations", -1, "Number of generations after the particle in question to keep (-1 for all)"};
80
81 // Helper functions for building up the decay product collections
82 int addTruthParticle( const EventContext& ctx,
83 const xAOD::TruthParticle& old_part, xAOD::TruthParticleContainer* part_cont,
84 xAOD::TruthVertexContainer* vert_cont, std::vector<int>& seen_particles,
85 const int generations=-1) const;
86 int addTruthVertex( const EventContext&,
87 const xAOD::TruthVertex& old_vert, xAOD::TruthParticleContainer* part_cont,
88 xAOD::TruthVertexContainer* vert_cont, std::vector<int>& seen_particles,
89 const int generations=-1) const;
90 bool id_ok( const xAOD::TruthParticle& part ) const;
91 };
92}
93
94#endif // DERIVATIONFRAMEWORK_TRUTHDECAYCOLLECTIONMAKER_H
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
SG::WriteHandleKey< xAOD::TruthVertexContainer > m_outputVerticesKey
virtual StatusCode addBranches(const EventContext &ctx) const override final
Gaudi::Property< bool > m_keepCHadrons
< Option to keep all c-hadrons (better than giving PDG IDs)
Gaudi::Property< std::vector< int > > m_pdgIdsToKeep
< List of PDG IDs to build this collection from
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
Gaudi::Property< bool > m_rejectHadronChildren
< Option to reject hadron descendants
Gaudi::Property< int > m_generations
^^^^ These should be replaced by SG::Accessor.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
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
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeAccessorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationAccessorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originAccessorKey
Gaudi::Property< bool > m_keepBHadrons
< Option to keep all b-hadrons (better than giving PDG IDs)
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeAccessorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
FIXME Using WriteDecorHandles for decorations on a Container created in the current algorithm is unne...
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
bool id_ok(const xAOD::TruthParticle &part) const
Gaudi::Property< bool > m_keepBSM
< Option to keep all BSM particles (better than giving PDG IDs)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
THE reconstruction tool.
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15
TruthVertexContainer_v1 TruthVertexContainer
Declare the latest version of the truth vertex container.
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.