5#ifndef XAODCREATORALGS_XAODTRUTHCNVALG_H
6#define XAODCREATORALGS_XAODTRUTHCNVALG_H
24#include "GaudiKernel/IIncidentListener.h"
26#include <unordered_set>
47 ,
virtual public IIncidentListener
57 virtual StatusCode
execute (
const EventContext& ctx)
const override;
60 virtual void handle(
const Incident& incident)
override;
79 const std::string& metaName);
80 StatusCode
maybeWrite (uint32_t mcChannelNumber,
87 typedef std::lock_guard<std::mutex>
lock_t;
99 std::vector<ElementLink<xAOD::TruthParticleContainer> >
incomingEL;
101 std::vector<ElementLink<xAOD::TruthParticleContainer> >
outgoingEL;
104 typedef std::map<HepMC::ConstGenVertexPtr, VertexParticles>
VertexMap;
112 this,
"AODContainerName",
"GEN_AOD",
"The input McEvenCollection"};
116 this,
"xAODTruthEventContainerName",
"TruthEvents",
"Output TruthEvents container"};
118 this,
"xAODTruthPileupEventContainerName",
"TruthPileupEvents",
"Output TruthPileupEvents container"};
120 this,
"xAODTruthParticleContainerName",
"TruthParticles",
"Output TruthParticles container"};
122 this,
"xAODTruthVertexContainerName",
"TruthVertices",
"Output TruthVertices container"};
124 this,
"TruthLinks",
"xAODTruthLinks",
"Output xAODTruthLinks container"};
126 this,
"xAODTruthLHEParticleContainerName",
"",
"Output TruthLHEParticles container"};
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.
Define macros for attributes used to control the static checker.
An algorithm that can be simultaneously executed in multiple threads.
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.
SG::WriteHandleKey< xAOD::TruthVertexContainer > m_xaodTruthVertexContainerKey
MetadataFields m_metaFields
Gaudi::Property< bool > m_doAllPileUp
Pile-up options.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_lheTruthParticleContainerKey
MetaDataWriter m_meta ATLAS_THREAD_SAFE
Helper for writing to the meta data store.
SG::WriteHandleKey< xAODTruthParticleLinkVector > m_truthLinkContainerKey
SG::ReadHandleKey< McEventCollection > m_aodContainerKey
The key of the input AOD truth container.
static void fillVertex(xAOD::TruthVertex *tv, const HepMC::ConstGenVertexPtr &gv)
These functions do not set up ELs, just the other variables.
xAODTruthCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_xaodTruthParticleContainerKey
Gaudi::Property< bool > m_writeMetaData
option to disable writing of metadata (e.g. if running a filter on xAOD in generators)
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
std::map< HepMC::ConstGenVertexPtr, VertexParticles > VertexMap
Convenience handle for a map of vtx ptrs -> connected particles.
ServiceHandle< StoreGateSvc > m_metaStore
Connection to the metadata store.
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfo
Event Info.
Gaudi::Property< bool > m_doInTimePileUp
virtual void handle(const Incident &incident) override
Incident handler.
static void fillParticle(xAOD::TruthParticle *tp, const HepMC::ConstGenParticlePtr &gp)
bool m_firstBeginRun
Tag Info.
std::string m_metaName
SG key and name for meta data.
SG::WriteHandleKey< xAOD::TruthEventContainer > m_xaodTruthEventContainerKey
The key for the output xAOD truth containers.
SG::WriteHandleKey< xAOD::TruthPileupEventContainer > m_xaodTruthPUEventContainerKey
virtual StatusCode initialize() override
Function initialising the algorithm.
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
HepMC3::ConstGenVertexPtr ConstGenVertexPtr
HepMC3::GenEvent GenEvent
TruthMetaDataContainer_v1 TruthMetaDataContainer
Declare the latest version of the truth vertex container.
TruthVertex_v1 TruthVertex
Typedef to implementation.
TruthParticle_v1 TruthParticle
Typedef to implementation.
Type for tracking particles connected to a single vertex.
std::vector< xAOD::TruthParticle * > outgoing
std::vector< ElementLink< xAOD::TruthParticleContainer > > incomingEL
std::vector< xAOD::TruthParticle * > incoming
std::vector< ElementLink< xAOD::TruthParticleContainer > > outgoingEL