ATLAS Offline Software
Loading...
Searching...
No Matches
McEventCollectionCnv_p6.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_p6.h
8// Header file for class McEventCollectionCnv_p6
9// Author: J.Chapman
11#ifndef GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_p6_H
12#define GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_p6_H
13
14// STL includes
15#include <unordered_map>
16
17#ifdef HEPMC3
18#include "AtlasHepMC/GenEvent.h"
21#include "HepMC3/Data/GenRunInfoData.h"
22#else
23#ifdef __clang__
24#pragma clang diagnostic push
25#pragma clang diagnostic ignored "-Wkeyword-macro"
26#endif
27#define private public
28#define protected public
29#include "AtlasHepMC/GenEvent.h"
32#undef private
33#undef protected
34#ifdef __clang__
35#pragma clang diagnostic pop
36#endif
37#endif
39
40// AthenaPoolCnvSvc includes
42
43// GeneratorObjectsTPCnv includes
45
46#include "GaudiKernel/ServiceHandle.h"
47
48class IHepMCWeightSvc;
49
50// Forward declaration
51class MsgStream;
52namespace HepMC { struct DataPool; }
53
55 McEventCollection,
56 McEventCollection_p6
57 >
58{
59
62
64 // Public methods:
66 public:
67
71
75
79
83
84 void setPileup();
85
89 virtual void persToTrans( const McEventCollection_p6* persObj,
90 McEventCollection* transObj,
91 MsgStream &log ) ;
92
96 virtual void transToPers( const McEventCollection* transObj,
97 McEventCollection_p6* persObj,
98 MsgStream &log ) ;
99
100 protected:
101
102 typedef std::unordered_map<HepMC::GenParticlePtr,int> ParticlesMap_t;
103
114 createGenVertex( const McEventCollection_p6& persEvts,
115 const GenVertex_p6& vtx,
116 ParticlesMap_t& bcToPart,
117 HepMC::DataPool& datapools, HepMC::GenEvent* parent=nullptr ) const;
118
126 ParticlesMap_t& partToEndVtx,
127 HepMC::DataPool& datapools, const HepMC::GenVertexPtr& parent=nullptr, bool add_to_output = true ) const;
128
133#ifdef HEPMC3
134 static void writeGenVertex( const HepMC::ConstGenVertexPtr& vtx, McEventCollection_p6& persEvt );
135#else
136 void writeGenVertex( const HepMC::GenVertex& vtx, McEventCollection_p6& persEvt ) const;
137
138#endif
144#ifdef HEPMC3
146#else
147 int writeGenParticle( const HepMC::GenParticle& p, McEventCollection_p6& persEvt ) const;
148#endif
149
152};
153#endif //> GENERATOROBJECTSTPCNV_MCEVENTCOLLECTIONCNV_p6_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_p6()
Default constructor:
HepMC::GenParticlePtr createGenParticle(const GenParticle_p6 &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.
virtual void persToTrans(const McEventCollection_p6 *persObj, McEventCollection *transObj, MsgStream &log)
Method creating the transient representation of McEventCollection from its persistent representation ...
virtual ~McEventCollectionCnv_p6()
Destructor.
ServiceHandle< IHepMCWeightSvc > m_hepMCWeightSvc
HepMC::GenVertexPtr createGenVertex(const McEventCollection_p6 &persEvts, const GenVertex_p6 &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.
McEventCollectionCnv_p6 & operator=(const McEventCollectionCnv_p6 &rhs)
Assignement operator.
void writeGenVertex(const HepMC::GenVertex &vtx, McEventCollection_p6 &persEvt) const
Method to write a persistent GenVertex object.
std::unordered_map< HepMC::GenParticlePtr, int > ParticlesMap_t
T_AthenaPoolTPCnvBase< McEventCollection, McEventCollection_p6 > Base_t
int writeGenParticle(const HepMC::GenParticle &p, McEventCollection_p6 &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_p6 *persObj, MsgStream &log)
Method creating the persistent representation McEventCollection_p6 from its transient representation ...
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