ATLAS Offline Software
Loading...
Searching...
No Matches
McEventCollectionCnv_p5.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7// McEventCollectionCnv_p5.h
8// Header file for class McEventCollectionCnv_p5
9// Author: S.Binet<binet@cern.ch>
11#ifndef GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_P5_H
12#define GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_P5_H
13
14// STL includes
15#include <unordered_map>
16#include <sstream>
17
18#ifndef HEPMC3
19# ifdef __clang__
20# pragma clang diagnostic push
21# pragma clang diagnostic ignored "-Wkeyword-macro"
22# endif
23# if __GNUC__ >= 16
24# pragma GCC diagnostic push
25# pragma GCC diagnostic ignored "-Wkeyword-macro"
26# endif
27# define private public
28# define protected public
29#endif
30#include "AtlasHepMC/GenEvent.h"
33#ifndef HEPMC3
34# undef private
35# undef protected
36# ifdef __clang__
37# pragma clang diagnostic pop
38# endif
39# if __GNUC__ >= 16
40# pragma GCC diagnostic pop
41# endif
42#endif
44
45// AthenaPoolCnvSvc includes
47
48// GeneratorObjectsTPCnv includes
50
51#include "GaudiKernel/ServiceHandle.h"
52
53class IHepMCWeightSvc;
54
55// Forward declaration
56class MsgStream;
57namespace HepMC { struct DataPool; }
58
60 McEventCollection,
61 McEventCollection_p5
62 >
63{
64
67
69 // Public methods:
71 public:
72
76
80
84
88
89 void setPileup();
90
94 virtual void persToTrans( const McEventCollection_p5* persObj,
95 McEventCollection* transObj,
96 MsgStream &log ) ;
97
101 virtual void transToPers( const McEventCollection* transObj,
102 McEventCollection_p5* persObj,
103 MsgStream &log ) ;
104
106 // Protected method:
108 protected:
109
110 typedef std::unordered_map<HepMC::GenParticlePtr,int> ParticlesMap_t;
111
122 createGenVertex( const McEventCollection_p5& persEvts,
123 const GenVertex_p5& vtx,
124 ParticlesMap_t& bcToPart,
125 HepMC::DataPool& datapools, HepMC::GenEvent* parent=nullptr ) const;
126
134 ParticlesMap_t& partToEndVtx,
135 HepMC::DataPool& datapools, const HepMC::GenVertexPtr& parent=nullptr, bool add_to_output = true ) const;
136
141#ifdef HEPMC3
142 static void writeGenVertex( const HepMC::ConstGenVertexPtr& vtx,
143 McEventCollection_p5& persEvt ) ;
144#else
145 void writeGenVertex( const HepMC::GenVertex& vtx,
146 McEventCollection_p5& persEvt ) const;
147
148#endif
154#ifdef HEPMC3
155 static int writeGenParticle( const HepMC::ConstGenParticlePtr& p,
156 McEventCollection_p5& persEvt ) ;
157#else
158 int writeGenParticle( const HepMC::GenParticle& p,
159 McEventCollection_p5& persEvt ) const;
160#endif
161
163 // Protected data:
165 protected:
166
169};
170#endif //> GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_P5_H
TPConverterBase< TRANS, PERS > T_AthenaPoolTPCnvBase
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
IService to read/write HepMC's WeightContainer key names from/to IOVMetaDataContainers author: will b...
McEventCollectionCnv_p5 & operator=(const McEventCollectionCnv_p5 &rhs)
Assignement operator.
virtual void transToPers(const McEventCollection *transObj, McEventCollection_p5 *persObj, MsgStream &log)
Method creating the persistent representation McEventCollection_p5 from its transient representation ...
T_AthenaPoolTPCnvBase< McEventCollection, McEventCollection_p5 > Base_t
void writeGenVertex(const HepMC::GenVertex &vtx, McEventCollection_p5 &persEvt) const
Method to write a persistent GenVertex object.
virtual ~McEventCollectionCnv_p5()
Destructor.
McEventCollectionCnv_p5()
Default constructor:
HepMC::GenParticlePtr createGenParticle(const GenParticle_p5 &p, ParticlesMap_t &partToEndVtx, HepMC::DataPool &datapools, const HepMC::GenVertexPtr &parent=nullptr, bool add_to_output=true) const
Create a transient GenParticle from a persistent one (vers.1) It returns the new GenParticle.
std::unordered_map< HepMC::GenParticlePtr, int > ParticlesMap_t
virtual void persToTrans(const McEventCollection_p5 *persObj, McEventCollection *transObj, MsgStream &log)
Method creating the transient representation of McEventCollection from its persistent representation ...
int writeGenParticle(const HepMC::GenParticle &p, McEventCollection_p5 &persEvt) const
Method to write a persistent GenParticle object It returns the index of the persistent GenParticle in...
ServiceHandle< IHepMCWeightSvc > m_hepMCWeightSvc
HepMC::GenVertexPtr createGenVertex(const McEventCollection_p5 &persEvts, const GenVertex_p5 &vtx, ParticlesMap_t &bcToPart, HepMC::DataPool &datapools, HepMC::GenEvent *parent=nullptr) const
Create a transient GenVertex from a persistent one (version 1) It returns the new GenVertex.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
HepMC::GenVertex * GenVertexPtr
Definition GenVertex.h:59
GenParticle * GenParticlePtr
Definition GenParticle.h:37
const GenParticle * ConstGenParticlePtr
Definition GenParticle.h:38
const HepMC::GenVertex * ConstGenVertexPtr
Definition GenVertex.h:60