ATLAS Offline Software
Loading...
Searching...
No Matches
McEventCollectionCnv_p4.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_p4.h
8// Header file for class McEventCollectionCnv_p4
9// Author: S.Binet<binet@cern.ch>
11#ifndef GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_P4_H
12#define GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_P4_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
53// Forward declaration
54class IHepMCWeightSvc;
55class MsgStream;
56namespace HepMC { struct DataPool; }
57
59 McEventCollection,
60 McEventCollection_p4
61 >
62{
63
66
68 // Public methods:
70 public:
71
75
79
83
87
88 void setPileup();
89
93 virtual void persToTrans( const McEventCollection_p4* persObj,
94 McEventCollection* transObj,
95 MsgStream &log ) ;
96
100 virtual void transToPers( const McEventCollection* transObj,
101 McEventCollection_p4* persObj,
102 MsgStream &log ) ;
103
105 // Protected method:
107 protected:
108
109 typedef std::unordered_map<HepMC::GenParticlePtr,int> ParticlesMap_t;
110
121 createGenVertex( const McEventCollection_p4& persEvts,
122 const GenVertex_p4& vtx,
123 ParticlesMap_t& bcToPart,
124 HepMC::DataPool& datapools,HepMC::GenEvent* parent=nullptr ) const;
125
133 ParticlesMap_t& partToEndVtx,
134 HepMC::DataPool& datapools,const HepMC::GenVertexPtr& parent=nullptr , bool add_to_output = true ) const;
135
140#ifdef HEPMC3
141 static void writeGenVertex( const HepMC::ConstGenVertexPtr& vtx,
142 McEventCollection_p4& persEvt ) ;
143#else
144 void writeGenVertex( const HepMC::GenVertex& vtx,
145 McEventCollection_p4& persEvt ) const;
146#endif
147
153#ifdef HEPMC3
154 static int writeGenParticle( const HepMC::ConstGenParticlePtr& p,
155 McEventCollection_p4& persEvt ) ;
156#else
157 int writeGenParticle( const HepMC::GenParticle& p,
158 McEventCollection_p4& persEvt ) const;
159
160#endif
162 // Protected data:
164 protected:
165
168};
169#endif //> GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_P4_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...
void writeGenVertex(const HepMC::GenVertex &vtx, McEventCollection_p4 &persEvt) const
Method to write a persistent GenVertex object.
virtual void persToTrans(const McEventCollection_p4 *persObj, McEventCollection *transObj, MsgStream &log)
Method creating the transient representation of McEventCollection from its persistent representation ...
HepMC::GenParticlePtr createGenParticle(const GenParticle_p4 &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.
McEventCollectionCnv_p4 & operator=(const McEventCollectionCnv_p4 &rhs)
Assignement operator.
virtual ~McEventCollectionCnv_p4()
Destructor.
McEventCollectionCnv_p4()
Default constructor:
int writeGenParticle(const HepMC::GenParticle &p, McEventCollection_p4 &persEvt) const
Method to write a persistent GenParticle object It returns the index of the persistent GenParticle in...
virtual void transToPers(const McEventCollection *transObj, McEventCollection_p4 *persObj, MsgStream &log)
Method creating the persistent representation McEventCollection_p4 from its transient representation ...
T_AthenaPoolTPCnvBase< McEventCollection, McEventCollection_p4 > Base_t
std::unordered_map< HepMC::GenParticlePtr, int > ParticlesMap_t
HepMC::GenVertexPtr createGenVertex(const McEventCollection_p4 &persEvts, const GenVertex_p4 &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.
ServiceHandle< IHepMCWeightSvc > m_hepMCWeightSvc
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