ATLAS Offline Software
TruthParticleCnvTool.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // TruthParticleCnvTool.h
8 // Header file for class TruthParticleCnvTool
9 // Author: S.Binet<binet@cern.ch>
10 // Purpose: Create a TruthParticleContainer from a HepMC::GenEvent
12 #ifndef MCPARTICLETOOLS_TRUTHPARTICLECNVTOOL_H
13 #define MCPARTICLETOOLS_TRUTHPARTICLECNVTOOL_H
14 
34 #include "HepPDT/ParticleDataTable.hh"
35 
36 // Framework includes
37 #include "GaudiKernel/ToolHandle.h"
38 #include "GaudiKernel/ServiceHandle.h"
40 
41 #include "EventKernel/IParticle.h" //> for ParticleDataType
42 
43 // CLHEP/HepMC includes
45 
46 // McParticleKernel includes
48 
50 
51 // McParticleEvent includes
53 
54 // Forward declarations
55 class McEventCollection;
56 class TruthParticle;
58 
59 class TruthParticleCnvTool : public extends<AthAlgTool, ITruthParticleCnvTool>
60 {
62  // Public methods:
64  public:
65 
67  TruthParticleCnvTool( const std::string& type,
68  const std::string& name,
69  const IInterface* parent );
70 
72  virtual ~TruthParticleCnvTool ();
73 
74  // Athena's Hooks
75  virtual StatusCode initialize() override;
76  virtual StatusCode execute() const override;
77  virtual StatusCode execute (const EventContext& ctx) const override;
78 
80  // Const methods:
82 
91  StatusCode convert( const McEventCollection* mcEvts,
92  const unsigned int genEvtIndex,
93  TruthParticleContainer* mcParts,
94  const ITruthParticleVisitor* visitor ) const override;
95 
97  // Non-const methods:
99 
100  void setDataType( const int type );
101  void setVxCandidateName( const std::string& name );
102 
104  // Private data:
106  private:
107 
112 
113  std::string m_vxCandidatesName;
114 
117  SG::ReadHandleKey<McEventCollection> m_mcEventsReadHandleKey{this,"McEvents","GEN_AOD","ReadHandleKey for the input McEventCollection, from which the TruthParticles will be made from"};
118 
121  SG::WriteHandleKey<TruthParticleContainer> m_mcPartsOutputWriteHandleKey{this,"TruthParticlesOutput","SpclMC","WriteHandleKey for the output truth particles (built from the McEventCollection)"};
122 
125  const HepPDT::ParticleDataTable * m_pdt;
126 
130 
134 
135 
136 
138  // Protected data:
140  protected:
141 
147  BooleanProperty m_doEtIsolation;
148 
149  typedef ToolHandle<ITruthIsolationTool> IsolTool_t;
150 
155 
156 };
157 
161 inline void TruthParticleCnvTool::setDataType( const int type )
162 {
164 }
165 
166 inline void TruthParticleCnvTool::setVxCandidateName( const std::string& name )
167 {
169 }
170 
171 #endif // MCPARTICLETOOLS_TRUTHPARTICLECNVTOOL_H
TruthParticleCnvTool::m_mcEventsReadHandleKey
SG::ReadHandleKey< McEventCollection > m_mcEventsReadHandleKey
ReadHandleKey for the McEventCollection the TruthParticles will be made from.
Definition: TruthParticleCnvTool.h:117
ITruthParticleCnvTool.h
TruthParticleCnvTool::setVxCandidateName
void setVxCandidateName(const std::string &name)
Definition: TruthParticleCnvTool.h:166
TruthParticleCnvTool::m_pdt
const HepPDT::ParticleDataTable * m_pdt
Particle Property service.
Definition: TruthParticleCnvTool.h:125
TruthParticleContainer.h
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
TruthParticleCnvTool::IsolTool_t
ToolHandle< ITruthIsolationTool > IsolTool_t
Definition: TruthParticleCnvTool.h:149
PileUpClassification::PileuType_t
PileuType_t
define some Pile-up classification Important : this classification is copied in McParticleAlgs/python...
Definition: PileUpClassification.h:29
TruthParticleCnvTool::m_dataType
ParticleDataType::DataType m_dataType
Type of data we are dealing with (Full/Fast/Truth/...)
Definition: TruthParticleCnvTool.h:110
TruthParticleCnvTool::m_vxCandidatesName
std::string m_vxCandidatesName
Definition: TruthParticleCnvTool.h:113
IParticle.h
TruthParticleCnvTool::m_isolationTool
IsolTool_t m_isolationTool
Pointer to the ITruthIsolationTool to be able to retrieve the previously computed transverse energy i...
Definition: TruthParticleCnvTool.h:154
SG::ReadHandleKey< McEventCollection >
TruthParticleContainer
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticleContainer.h:42
ParticleDataType::DataType
DataType
Definition: Event/EventKernel/EventKernel/IParticle.h:36
TruthParticleCnvTool::TruthParticleCnvTool
TruthParticleCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition: TruthParticleCnvTool.cxx:48
TruthParticleCnvTool::m_doEtIsolation
BooleanProperty m_doEtIsolation
Switch to compute or not the Et-isolations for TruthParticle (and their underlying HepMC::GenParticle...
Definition: TruthParticleCnvTool.h:147
ITruthIsolationTool
Definition: ITruthIsolationTool.h:33
SG::WriteHandleKey< TruthParticleContainer >
McEventCollection.h
ITruthParticleVisitor
Definition: ITruthParticleVisitor.h:30
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
TruthParticleCnvTool::execute
virtual StatusCode execute() const override
Definition: TruthParticleCnvTool.cxx:146
TruthParticleCnvTool::m_selectSignalType
PileUpClassification::PileuType_t m_selectSignalType
Type of truth particle we want to create.
Definition: TruthParticleCnvTool.h:129
test_pyathena.parent
parent
Definition: test_pyathena.py:15
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TruthParticleCnvTool::initialize
virtual StatusCode initialize() override
Athena Algorithm's Hooks.
Definition: TruthParticleCnvTool.cxx:100
TruthParticleCnvTool::~TruthParticleCnvTool
virtual ~TruthParticleCnvTool()
Destructor:
Definition: TruthParticleCnvTool.cxx:93
TruthParticleCnvTool::m_selectSignalTypeProp
int m_selectSignalTypeProp
Type of truth particle we want to create (property to be set by jobO)
Definition: TruthParticleCnvTool.h:133
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TruthParticleCnvTool
Definition: TruthParticleCnvTool.h:60
TruthParticleCnvTool::m_mcPartsOutputWriteHandleKey
SG::WriteHandleKey< TruthParticleContainer > m_mcPartsOutputWriteHandleKey
Output TruthParticle WriteHandleKey (built from the McEventCollection)
Definition: TruthParticleCnvTool.h:121
TruthParticleCnvTool::setDataType
void setDataType(const int type)
Inline methods:
Definition: TruthParticleCnvTool.h:161
PileUpClassification.h
TruthParticleCnvTool::convert
StatusCode convert(const McEventCollection *mcEvts, const unsigned int genEvtIndex, TruthParticleContainer *mcParts, const ITruthParticleVisitor *visitor) const override
Converts a McEventCollection into an TruthParticleContainer (ie: converts it into an AOD compliant co...
Definition: TruthParticleCnvTool.cxx:224
TruthParticleCnvTool::m_dataType_int
int m_dataType_int
Definition: TruthParticleCnvTool.h:111