5#ifndef EGAMMAALGS_EGAMMATRUTHASSOCIATIONALG_H
6#define EGAMMAALGS_EGAMMATRUTHASSOCIATIONALG_H
9#include "GaudiKernel/EventContext.h"
10#include "GaudiKernel/ToolHandle.h"
52 virtual StatusCode
initialize() override final;
54 virtual StatusCode
finalize() override final;
71 const std::string& name);
78 const EventContext& ctx);
91 template<
class T,
class L>
92 StatusCode
match(
const EventContext& ctx,
108 const EventContext& ctx,
121 "CreateEgammaTruthContainer",
123 "Create egammaTruthContainer?"
130 "Match (central) electrons?" };
140 "MatchForwardElectrons",
142 "Match forward electrons?" };
153 "DoNotSet_ClusterContainerName",
155 "Do not set; configuration via the string property"
162 "ClusterContainerName",
164 "Name of the egamma cluster container"
170 "DoNotSet_ElectronContainerName",
172 "Do not set; configuration via the string property"
179 "ElectronContainerName",
181 "Name of the input electron container"
187 "DoNotSet_FwdElectronContainerName",
189 "Do not set; configuration via the string property"
196 "FwdElectronContainerName",
198 "Name of the input fwd electron container"
204 "DoNotSet_PhotonContainerName",
206 "Do not set; configuration via the string property"
213 "PhotonContainerName",
215 "Name of the input photon container"
221 "TruthEventContainerName",
223 "Name of the truth event container"
229 "TruthParticleContainerName",
231 "Name of the truth particle container"
238 "EgammaTruthContainerName",
240 "Name of the output egamma truth particle container"
248 "Minimum Pt to enter egamma truth particle container"
254 "MinPtEgammaTruthFSR",
256 "Minimum Pt for FSR to enter egamma truth particle container"
264 "Allow electron from photon in egamma truth particle container"
272 "EMMCTruthClassifier",
273 "Handle of MCTruthClassifier"
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
SG::Accessor< T, ALLOC > Accessor
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for adding a decoration to an object.
Property holding a SG store/key/clid from which a WriteHandle is made.
Gaudi::Property< bool > m_doEgammaTruthContainer
Create egamma truth container?
virtual ~egammaTruthAssociationAlg()=default
destructor
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
Name of the truth particle container.
Gaudi::Property< std::string > m_electronDecName
The electron container name property used to initialize the WriteDecorHandleKeyArray.
Gaudi::Property< bool > m_matchElectrons
Match electrons?
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_fwdElectronDecKeys
The fwd electron container decor handle key array.
SG::WriteDecorHandleKeyArray< xAOD::PhotonContainer > m_photonDecKeys
The photon container decor handle key array.
StatusCode initializeDecorKeys(SG::WriteDecorHandleKeyArray< T > &keys, const std::string &name)
A function that initializes the decor handles, but also checks the naming convention.
Gaudi::Property< bool > m_matchClusters
Match clusters?
StatusCode match(const EventContext &ctx, const xAOD::TruthParticleContainer &truthParticles, const SG::WriteDecorHandleKeyArray< T > &hkeys, const SG::AuxElement::Accessor< L > &linkAccess, xAOD::TruthParticleContainer *egammaTruthContainer) const
Loop over elements in the reco container, decorate them with truth info and decorate the truth partic...
Gaudi::Property< bool > m_matchPhotons
Match photons?
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_egammaTruthParticleContainerKey
Name of the output egamma truth container.
virtual StatusCode execute(const EventContext &ctx) const override final
execute on container
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_electronDecKeys
The electron container decor handle key array.
Gaudi::Property< std::string > m_photonDecName
The photon container name property used to initialize the WriteDecorHandleKeyArray.
void getNewTruthParticle(const EventContext &ctx, xAOD::TruthParticleContainer &egammaTruthContainer, const xAOD::TruthParticle *truth, const xAOD::TruthParticleContainer *oldContainer) const
Create a copy a truth particle, add it to the new getNewTruthParticle container and decorate it with ...
Gaudi::Property< float > m_minPt
Minimum Pt to enter egamma truth particle container.
Gaudi::Property< std::string > m_fwdElectronDecName
The fwd electron name property used to initialize the WriteDecorHandleKeyArray.
bool isPromptEgammaParticle(const EventContext &ctx, const xAOD::TruthParticle *truth) const
Return true if the truth particle is a prompt electron or photon.
Gaudi::Property< bool > m_matchForwardElectrons
Match fwd electrons?
Gaudi::Property< float > m_minPtFSR
Minimum Pt for FSR to enter egamma truth particle container.
Gaudi::Property< std::string > m_clusterDecName
The egamma cluster name property used to initialize the WriteDecorHandleKeyArray.
MCTruthInfo_t particleTruthClassifier(const EventContext &ctx, const T *) const
return the result of MCTruthClassifier::particleTruthClassifier or do a second pass for electrons bas...
SG::WriteDecorHandleKeyArray< xAOD::CaloClusterContainer > m_clusterDecKeys
The egamma cluster decor handle key array.
egammaTruthAssociationAlg(const std::string &name, ISvcLocator *pSvcLocator)
constructor
Gaudi::Property< bool > m_UPCmode
Allow electron from photon in egamma truth particle container.
ToolHandle< IMCTruthClassifier > m_mcTruthClassifier
MCTruthClassifier.
virtual StatusCode finalize() override final
finalize method
virtual StatusCode initialize() override final
initialize method
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventContainerKey
Name of the truth event container.
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
MCTruthPartClassifier::ParticleType first
const xAOD::TruthParticle * genPart
MCTruthPartClassifier::ParticleOrigin second
writeDecorHandles(const SG::WriteDecorHandleKeyArray< T > &keys, const EventContext &ctx)
SG::ReadHandle< T > & readHandle()
SG::WriteDecorHandle< T, int > type
SG::WriteDecorHandle< T, int > origin
SG::WriteDecorHandle< T, ElementLink< xAOD::TruthParticleContainer > > el