ATLAS Offline Software
McEventCollectionCnv_p5.h
Go to the documentation of this file.
1 
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
24 #include "AtlasHepMC/GenVertex.h"
25 #include "AtlasHepMC/GenParticle.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 
41 class IHepMCWeightSvc;
42 
43 // Forward declaration
44 class MsgStream;
45 namespace 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
137 
142 #ifdef HEPMC3
143  static int writeGenParticle( const HepMC::ConstGenParticlePtr& p,
144  McEventCollection_p5& persEvt ) ;
145 #else
147  McEventCollection_p5& persEvt ) const;
148 #endif
149 
151  // Protected data:
153  protected:
154 
157 };
158 #endif //> GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_P5_H
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
IHepMCWeightSvc
IService to read/write HepMC's WeightContainer key names from/to IOVMetaDataContainers author: will b...
Definition: IHepMCWeightSvc.h:18
GenEvent.h
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
McEventCollectionCnv_p5::transToPers
virtual void transToPers(const McEventCollection *transObj, McEventCollection_p5 *persObj, MsgStream &log)
Method creating the persistent representation McEventCollection_p5 from its transient representation ...
Definition: McEventCollectionCnv_p5.cxx:333
McEventCollectionCnv_p5::~McEventCollectionCnv_p5
virtual ~McEventCollectionCnv_p5()
Destructor.
McEventCollectionCnv_p5::createGenVertex
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.
Definition: McEventCollectionCnv_p5.cxx:558
HepMC::DataPool
Definition: HepMcDataPool.h:81
McEventCollectionCnv_p5::writeGenVertex
void writeGenVertex(const HepMC::GenVertex &vtx, McEventCollection_p5 &persEvt) const
Method to write a persistent GenVertex object.
Definition: McEventCollectionCnv_p5.cxx:792
GenVertex.h
McEventCollectionCnv_p5::m_isPileup
bool m_isPileup
Definition: McEventCollectionCnv_p5.h:155
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
McEventCollectionCnv_p5::persToTrans
virtual void persToTrans(const McEventCollection_p5 *persObj, McEventCollection *transObj, MsgStream &log)
Method creating the transient representation of McEventCollection from its persistent representation ...
Definition: McEventCollectionCnv_p5.cxx:58
McEventCollectionCnv_p5::McEventCollectionCnv_p5
McEventCollectionCnv_p5()
Default constructor:
Definition: McEventCollectionCnv_p5.cxx:30
McEventCollection
McEventCollection
Definition: GeneratorObjectsTPCnv.cxx:60
TPConverterBase
Definition: TPConverter.h:738
McEventCollection_p5
Definition: McEventCollection_p5.h:27
GenParticle.h
McEventCollectionCnv_p5::operator=
McEventCollectionCnv_p5 & operator=(const McEventCollectionCnv_p5 &rhs)
Assignement operator.
Definition: McEventCollectionCnv_p5.cxx:41
McEventCollectionCnv_p5::setPileup
void setPileup()
Definition: McEventCollectionCnv_p5.cxx:920
GenParticle_p5
Definition: GenParticle_p5.h:22
McEventCollectionCnv_p5
Definition: McEventCollectionCnv_p5.h:51
McEventCollection.h
McEventCollectionCnv_p5::m_hepMCWeightSvc
ServiceHandle< IHepMCWeightSvc > m_hepMCWeightSvc
Definition: McEventCollectionCnv_p5.h:156
McEventCollection_p5.h
T_AthenaPoolTPConverter.h
McEventCollectionCnv_p5::writeGenParticle
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...
Definition: McEventCollectionCnv_p5.cxx:873
test_pyathena.parent
parent
Definition: test_pyathena.py:15
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
McEventCollectionCnv_p5::ParticlesMap_t
std::unordered_map< HepMC::GenParticlePtr, int > ParticlesMap_t
Definition: McEventCollectionCnv_p5.h:98
McEventCollectionCnv_p5::createGenParticle
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.
Definition: McEventCollectionCnv_p5.cxx:649
HepMC
Definition: Barcode.h:14
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
GenVertex_p5
Definition: GenVertex_p5.h:24
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:47
McEventCollectionCnv_p5::Base_t
T_AthenaPoolTPCnvBase< McEventCollection, McEventCollection_p5 > Base_t
Definition: McEventCollectionCnv_p5.h:54
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
GenParticle
@ GenParticle
Definition: TruthClasses.h:30
ServiceHandle< IHepMCWeightSvc >