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
35// Framework includes
36#include "GaudiKernel/ToolHandle.h"
37#include "GaudiKernel/ServiceHandle.h"
39
40#include "EventKernel/IParticle.h" //> for ParticleDataType
41
42// CLHEP/HepMC includes
44
45// McParticleKernel includes
47
49
50// McParticleEvent includes
52
53// Forward declarations
55class TruthParticle;
57
58class TruthParticleCnvTool : public extends<AthAlgTool, ITruthParticleCnvTool>
59{
61 // Public methods:
63 public:
64
66 TruthParticleCnvTool( const std::string& type,
67 const std::string& name,
68 const IInterface* parent );
69
71 virtual ~TruthParticleCnvTool ();
72
73 // Athena's Hooks
74 virtual StatusCode initialize() override;
75 virtual StatusCode execute() const override;
76 virtual StatusCode execute (const EventContext& ctx) const override;
77
79 // Const methods:
81
90 StatusCode convert( const McEventCollection* mcEvts,
91 const unsigned int genEvtIndex,
93 const ITruthParticleVisitor* visitor ) const override;
94
96 // Non-const methods:
98
99 void setDataType( const int type );
100 void setVxCandidateName( const std::string& name );
101
103 // Private data:
105 private:
106
111
113
116 SG::ReadHandleKey<McEventCollection> m_mcEventsReadHandleKey{this,"McEvents","GEN_AOD","ReadHandleKey for the input McEventCollection, from which the TruthParticles will be made from"};
117
120 SG::WriteHandleKey<TruthParticleContainer> m_mcPartsOutputWriteHandleKey{this,"TruthParticlesOutput","SpclMC","WriteHandleKey for the output truth particles (built from the McEventCollection)"};
121
125
129
130
131
133 // Protected data:
135 protected:
136
142 BooleanProperty m_doEtIsolation;
143
144 typedef ToolHandle<ITruthIsolationTool> IsolTool_t;
145
150
151};
152
160
161inline void TruthParticleCnvTool::setVxCandidateName( const std::string& name )
162{
163 m_vxCandidatesName = name;
164}
165
166#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)
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.