ATLAS Offline Software
Loading...
Searching...
No Matches
McEventCollectionCnv_p5.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2022 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
17#ifdef __clang__
18#pragma clang diagnostic push
19#pragma clang diagnostic ignored "-Wkeyword-macro"
20#endif
21#define private public
22#define protected public
23#include "AtlasHepMC/GenEvent.h"
26#undef private
27#undef protected
28#ifdef __clang__
29#pragma clang diagnostic pop
30#endif
32
33// AthenaPoolCnvSvc includes
35
36// GeneratorObjectsTPCnv includes
38
39#include "GaudiKernel/ServiceHandle.h"
40
41class IHepMCWeightSvc;
42
43// Forward declaration
44class MsgStream;
45namespace HepMC { struct DataPool; }
46
48 McEventCollection,
49 McEventCollection_p5
50 >
51{
52
55
57 // Public methods:
59 public:
60
64
68
72
76
77 void setPileup();
78
82 virtual void persToTrans( const McEventCollection_p5* persObj,
83 McEventCollection* transObj,
84 MsgStream &log ) ;
85
89 virtual void transToPers( const McEventCollection* transObj,
90 McEventCollection_p5* persObj,
91 MsgStream &log ) ;
92
94 // Protected method:
96 protected:
97
98 typedef std::unordered_map<HepMC::GenParticlePtr,int> ParticlesMap_t;
99
110 createGenVertex( const McEventCollection_p5& persEvts,
111 const GenVertex_p5& vtx,
112 ParticlesMap_t& bcToPart,
113 HepMC::DataPool& datapools, HepMC::GenEvent* parent=nullptr ) const;
114
122 ParticlesMap_t& partToEndVtx,
123 HepMC::DataPool& datapools, const HepMC::GenVertexPtr& parent=nullptr, bool add_to_output = true ) const;
124
129#ifdef HEPMC3
130 static void writeGenVertex( const HepMC::ConstGenVertexPtr& vtx,
131 McEventCollection_p5& persEvt ) ;
132#else
133 void writeGenVertex( const HepMC::GenVertex& vtx,
134 McEventCollection_p5& persEvt ) const;
135
136#endif
142#ifdef HEPMC3
143 static int writeGenParticle( const HepMC::ConstGenParticlePtr& p,
144 McEventCollection_p5& persEvt ) ;
145#else
146 int writeGenParticle( const HepMC::GenParticle& p,
147 McEventCollection_p5& persEvt ) const;
148#endif
149
151 // Protected data:
153 protected:
154
157};
158#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