5#ifndef XAODCREATORALGS_XAODTRUTHCNVALG_H
6#define XAODCREATORALGS_XAODTRUTHCNVALG_H
17#pragma clang diagnostic push
18#pragma clang diagnostic ignored "-Wkeyword-macro"
24#pragma clang diagnostic pop
42#include "GaudiKernel/IIncidentListener.h"
44#include <unordered_set>
66 ,
virtual public IIncidentListener
76 virtual StatusCode
execute (
const EventContext& ctx)
const override;
79 virtual void handle(
const Incident& incident)
override;
98 const std::string& metaName);
99 StatusCode
maybeWrite (uint32_t mcChannelNumber,
100 const HepMC::GenEvent& genEvt,
106 typedef std::lock_guard<std::mutex>
lock_t;
118 std::vector<ElementLink<xAOD::TruthParticleContainer> >
incomingEL;
120 std::vector<ElementLink<xAOD::TruthParticleContainer> >
outgoingEL;
123 typedef std::map<HepMC::ConstGenVertexPtr, VertexParticles>
VertexMap;
131 this,
"AODContainerName",
"GEN_AOD",
"The input McEvenCollection"};
135 this,
"xAODTruthEventContainerName",
"TruthEvents",
"Output TruthEvents container"};
137 this,
"xAODTruthPileupEventContainerName",
"TruthPileupEvents",
"Output TruthPileupEvents container"};
139 this,
"xAODTruthParticleContainerName",
"TruthParticles",
"Output TruthParticles container"};
141 this,
"xAODTruthVertexContainerName",
"TruthVertices",
"Output TruthVertices container"};
143 this,
"TruthLinks",
"xAODTruthLinks",
"Output xAODTruthLinks container"};
145 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.
const GenParticle * ConstGenParticlePtr
const HepMC::GenVertex * ConstGenVertexPtr
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