ATLAS Offline Software
Loading...
Searching...
No Matches
McEventCollectionCnv_p4.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_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
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
41// Forward declaration
42class IHepMCWeightSvc;
43class MsgStream;
44namespace HepMC { struct DataPool; }
45
47 McEventCollection,
48 McEventCollection_p4
49 >
50{
51
54
56 // Public methods:
58 public:
59
63
67
71
75
76 void setPileup();
77
81 virtual void persToTrans( const McEventCollection_p4* persObj,
82 McEventCollection* transObj,
83 MsgStream &log ) ;
84
88 virtual void transToPers( const McEventCollection* transObj,
89 McEventCollection_p4* persObj,
90 MsgStream &log ) ;
91
93 // Protected method:
95 protected:
96
97 typedef std::unordered_map<HepMC::GenParticlePtr,int> ParticlesMap_t;
98
109 createGenVertex( const McEventCollection_p4& persEvts,
110 const GenVertex_p4& vtx,
111 ParticlesMap_t& bcToPart,
112 HepMC::DataPool& datapools,HepMC::GenEvent* parent=nullptr ) const;
113
121 ParticlesMap_t& partToEndVtx,
122 HepMC::DataPool& datapools,const HepMC::GenVertexPtr& parent=nullptr , bool add_to_output = true ) const;
123
128#ifdef HEPMC3
129 static void writeGenVertex( const HepMC::ConstGenVertexPtr& vtx,
130 McEventCollection_p4& persEvt ) ;
131#else
132 void writeGenVertex( const HepMC::GenVertex& vtx,
133 McEventCollection_p4& persEvt ) const;
134#endif
135
141#ifdef HEPMC3
142 static int writeGenParticle( const HepMC::ConstGenParticlePtr& p,
143 McEventCollection_p4& persEvt ) ;
144#else
145 int writeGenParticle( const HepMC::GenParticle& p,
146 McEventCollection_p4& persEvt ) const;
147
148#endif
150 // Protected data:
152 protected:
153
156};
157#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