ATLAS Offline Software
Loading...
Searching...
No Matches
TruthParticleCnvTool.h
Go to the documentation of this file.
1
2
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
33
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
56class TruthParticle;
58
59class 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,
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
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
165
166inline void TruthParticleCnvTool::setVxCandidateName( const std::string& name )
167{
168 m_vxCandidatesName = name;
169}
170
171#endif // MCPARTICLETOOLS_TRUTHPARTICLECNVTOOL_H
interface for AlgTools which want to compute and/or retrieve isolation energies for/from HepMC::GenEv...
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
PileuType_t
define some Pile-up classification Important : this classification is copied in McParticleAlgs/python...
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
int m_selectSignalTypeProp
Type of truth particle we want to create (property to be set by jobO)
virtual ~TruthParticleCnvTool()
Destructor:
TruthParticleCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
SG::WriteHandleKey< TruthParticleContainer > m_mcPartsOutputWriteHandleKey
Output TruthParticle WriteHandleKey (built from the McEventCollection)
ToolHandle< ITruthIsolationTool > IsolTool_t
virtual StatusCode execute() const override
ParticleDataType::DataType m_dataType
Type of data we are dealing with (Full/Fast/Truth/...)
IsolTool_t m_isolationTool
Pointer to the ITruthIsolationTool to be able to retrieve the previously computed transverse energy i...
void setDataType(const int type)
Inline methods:
virtual StatusCode initialize() override
Athena Algorithm's Hooks.
void setVxCandidateName(const std::string &name)
const HepPDT::ParticleDataTable * m_pdt
Particle Property service.
PileUpClassification::PileuType_t m_selectSignalType
Type of truth particle we want to create.
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...
BooleanProperty m_doEtIsolation
Switch to compute or not the Et-isolations for TruthParticle (and their underlying HepMC::GenParticle...
SG::ReadHandleKey< McEventCollection > m_mcEventsReadHandleKey
ReadHandleKey for the McEventCollection the TruthParticles will be made from.