ATLAS Offline Software
CopyTruthJetParticles.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 COPYTRUTHJETPARTICLES_H
6 #define COPYTRUTHJETPARTICLES_H
7 
8 #include "AsgTools/AsgTool.h"
15 #include "AsgTools/ToolHandle.h"
19 #include <vector>
20 #include <map>
21 
25  public:
26 
28  CopyTruthJetParticles(const std::string& name);
29 
31  virtual StatusCode initialize() override final;
32 
34  virtual int execute() const override final;
35 
36 private:
39  std::vector<const xAOD::TruthParticle*>& promptLeptons,
40  std::map<const xAOD::TruthParticle*,unsigned int>& tc_results) const;
41 
42  unsigned int getTCresult(const xAOD::TruthParticle* tp,
43  std::map<const xAOD::TruthParticle*,unsigned int>& tc_results) const;
44 
45  bool comesFrom( const xAOD::TruthParticle* tp, const int pdgID, std::vector<int>& used_vertices ) const;
46 
48  ToolHandle<IMCTruthClassifier> m_classif{this, "MCTruthClassifier", ""};
49 
51  SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthParticleKey{this, "TruthParticleKey", "TruthParticles", "SG Key for input truth particle container"};
52 
54  SG::ReadDecorHandleKeyArray<xAOD::TruthParticleContainer> m_dressingNames{this, "DressingDecorationNames", {}, "Name of the dressed photon decoration (if one should be used)"};
55 
57  SG::WriteHandleKey<ConstDataVector<xAOD::TruthParticleContainer> > m_outTruthPartKey{this, "OutputName", "TagInputs", "Name of the resulting TruthParticle collection"};
58 
60  Gaudi::Property<float> m_ptmin{this, "PtMin", 0. , "Minimum pT of particles to be accepted for tagging (in MeV)"};
61 
63  Gaudi::Property<float> m_maxAbsEta{this, "MaxAbsEta" , 5.};
64 
65  Gaudi::Property<std::vector<int>> m_vetoPDG_IDs{this, "VetoPDG_IDs", {},
66  "List of PDG IDs (python list) to veto. Will ignore these and all children of these."};
67 
68  // Options for storate
69  Gaudi::Property<bool> m_includeBSMNonInt{this, "IncludeBSMNonInteracting", false,
70  "Include noninteracting BSM particles (excluding neutrinos) in the output collection"};
71  Gaudi::Property<bool> m_includeNu{this,"IncludeNeutrinos", false,
72  "Include neutrinos in the output collection"};
73  Gaudi::Property<bool> m_includeMu{this, "IncludeMuons", false,
74  "Include muons in the output collection"};
75  Gaudi::Property<bool> m_includePromptLeptons{this, "IncludePromptLeptons", true,
76  "Include leptons from prompt decays (i.e. not from hadron decays) in the output collection"};
77  Gaudi::Property<bool> m_includePromptPhotons{this, "IncludePromptPhotons", true,
78  "Include photons from Higgs and other decays that produce isolated photons"};
79  Gaudi::Property<bool> m_chargedOnly{this, "ChargedParticlesOnly", false,
80  "Include only charged particles in the output collection" };
81  // -- added for dark jet clustering -- //
82  Gaudi::Property<bool> m_includeSM{this, "IncludeSMParts", true,
83  "Include SM particles in the output collection"};
84  Gaudi::Property<bool> m_includeDark{this, "IncludeDarkHads", false,
85  "Include dark hadrons in the output collection"};
86 
87  // ATLASRECTS-8290: this is for backward compatability, remove eventually
88  Gaudi::Property<bool> m_use_barcode {
89  this, "useBarcode", false, "use barcode rather than UID"
90  };
92 
93 };
94 
95 
96 #endif
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
CopyTruthJetParticles::m_chargedOnly
Gaudi::Property< bool > m_chargedOnly
Definition: CopyTruthJetParticles.h:79
CopyTruthJetParticles::m_includeSM
Gaudi::Property< bool > m_includeSM
Definition: CopyTruthJetParticles.h:82
CopyTruthJetParticles::comesFrom
bool comesFrom(const xAOD::TruthParticle *tp, const int pdgID, std::vector< int > &used_vertices) const
Definition: CopyTruthJetParticles.cxx:227
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
TruthParticleContainer.h
ParticleTest.tp
tp
Definition: ParticleTest.py:25
IJetExecuteTool
IJetExecuteTool is a dual-use tool interface for generic tools, i.e. those that behave like algorithm...
Definition: IJetExecuteTool.h:19
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:45
CopyTruthJetParticles::m_maxAbsEta
Gaudi::Property< float > m_maxAbsEta
Maximum allowed eta for particles in jets.
Definition: CopyTruthJetParticles.h:63
CopyTruthJetParticles::m_truthParticleKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleKey
Key for input truth event.
Definition: CopyTruthJetParticles.h:51
SG::ConstAccessor< int >
CopyTruthJetParticles::m_includeDark
Gaudi::Property< bool > m_includeDark
Definition: CopyTruthJetParticles.h:84
SG::ReadHandleKey< xAOD::TruthParticleContainer >
CopyTruthJetParticles::m_includeMu
Gaudi::Property< bool > m_includeMu
Definition: CopyTruthJetParticles.h:73
ReadDecorHandleKeyArray.h
CopyTruthJetParticles::m_use_barcode
Gaudi::Property< bool > m_use_barcode
Definition: CopyTruthJetParticles.h:88
IMCTruthClassifier.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
IJetExecuteTool.h
CopyTruthJetParticles::m_uid
SG::ConstAccessor< int > m_uid
Definition: CopyTruthJetParticles.h:91
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition: AsgToolMacros.h:40
CopyTruthJetParticles::m_includePromptLeptons
Gaudi::Property< bool > m_includePromptLeptons
Definition: CopyTruthJetParticles.h:75
CopyTruthJetParticles::m_includePromptPhotons
Gaudi::Property< bool > m_includePromptPhotons
Definition: CopyTruthJetParticles.h:77
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
CopyTruthJetParticles::execute
virtual int execute() const override final
redefine execute so we can call our own classify()
Definition: CopyTruthJetParticles.cxx:151
CopyTruthJetParticles::m_includeBSMNonInt
Gaudi::Property< bool > m_includeBSMNonInt
Definition: CopyTruthJetParticles.h:69
CopyTruthJetParticles::m_ptmin
Gaudi::Property< float > m_ptmin
Minimum pT for particle selection (in MeV)
Definition: CopyTruthJetParticles.h:60
CopyTruthJetParticles::m_classif
ToolHandle< IMCTruthClassifier > m_classif
Handle on MCTruthClassifier for finding prompt leptons.
Definition: CopyTruthJetParticles.h:48
CopyTruthJetParticles::classifyJetInput
bool classifyJetInput(const xAOD::TruthParticle *tp, std::vector< const xAOD::TruthParticle * > &promptLeptons, std::map< const xAOD::TruthParticle *, unsigned int > &tc_results) const
Redefine our own Classifier function(s)
Definition: CopyTruthJetParticles.cxx:50
CopyTruthJetParticles::initialize
virtual StatusCode initialize() override final
Function initialising the tool.
Definition: CopyTruthJetParticles.cxx:36
CopyTruthJetParticles::m_dressingNames
SG::ReadDecorHandleKeyArray< xAOD::TruthParticleContainer > m_dressingNames
Name of the decoration to be used for identifying FSR (dressing) photons.
Definition: CopyTruthJetParticles.h:54
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
CopyTruthJetParticles::m_vetoPDG_IDs
Gaudi::Property< std::vector< int > > m_vetoPDG_IDs
Definition: CopyTruthJetParticles.h:65
CopyTruthJetParticles::getTCresult
unsigned int getTCresult(const xAOD::TruthParticle *tp, std::map< const xAOD::TruthParticle *, unsigned int > &tc_results) const
Definition: CopyTruthJetParticles.cxx:141
CopyTruthJetParticles
Definition: CopyTruthJetParticles.h:22
ToolHandle.h
CopyTruthJetParticles::m_includeNu
Gaudi::Property< bool > m_includeNu
Definition: CopyTruthJetParticles.h:71
AsgTool.h
TruthParticle.h
CopyTruthJetParticles::m_outTruthPartKey
SG::WriteHandleKey< ConstDataVector< xAOD::TruthParticleContainer > > m_outTruthPartKey
Key for output truth particles.
Definition: CopyTruthJetParticles.h:57
CopyTruthJetParticles::CopyTruthJetParticles
CopyTruthJetParticles(const std::string &name)
Constructor.
Definition: CopyTruthJetParticles.cxx:33