ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleShallowCloneCnv_p1.cxx
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// ParticleShallowCloneCnv_p1.cxx
8// Implementation file for class ParticleShallowCloneCnv_p1
9// Author: Karsten Koeneke - February 2013
11
12
13// STL includes
14
15// ParticleEvent includes
17
18// DataModelAthenaPool includes
20
21// EventCommonTPCnv includes
23
24// ParticleEventTPCnv includes
26
27
30
31
32// pre-allocate converters
36
37
40 MsgStream& msg ) const
41{
42// msg << MSG::DEBUG << "Loading ParticleShallowClone from persistent state..."
43// << endmsg;
44
45 // convert the 4Momentum part
46 s_momCnv.persToTrans( &pers->m_momentum,
47 trans,
48 msg );
49
50 // Convert the ElementLink to the master particle
51 s_masterLinkCnv.persToTrans( &pers->m_masterLink,
52 &trans->m_masterLink,
53 msg );
54
55 // Convert the ElementLink to the vertex
56 s_originLinkCnv.persToTrans( &pers->m_originLink,
57 &trans->m_originLink,
58 msg );
59
60 // Convert the other attributes
61 trans->m_hasCharge = pers->m_hasCharge;
62 trans->m_charge = static_cast<ChargeType>(pers->m_charge);
63
64// msg << MSG::DEBUG << "Loaded ParticleShallowClone from persistent state [OK]"
65// << endmsg;
66 return;
67}
68
71 MsgStream& msg ) const
72{
73// msg << MSG::DEBUG << "Creating persistent state of ParticleShallowClone..."
74// << endmsg;
75
76 // convert the 4Momentum part
77 s_momCnv.transToPers( &trans->momentumBase(),
78 &pers->m_momentum,
79 msg );
80
81 // Convert the ElementLink to the master particle
82 s_masterLinkCnv.transToPers( &trans->m_masterLink,
83 &pers->m_masterLink,
84 msg );
85
86 // Convert the ElementLink to the vertex
87 s_originLinkCnv.transToPers( &trans->m_originLink,
88 &pers->m_originLink,
89 msg );
90
91 // Convert the other attributes
92 pers->m_hasCharge = trans->m_hasCharge;
93 pers->m_charge = static_cast<float>(trans->m_charge);
94
95// msg << MSG::DEBUG << "Created persistent state of ParticleShallowClone [OK]"
96// << endmsg;
97 return;
98}
static const P4ImplPxPyPzECnv_p1 s_momCnv
This file contains the class definition for the ElementLinkCnv_p3 class.
double ChargeType
typedef ChargeType used to anticipate changes here
static const OriginLinkCnv_t s_originLinkCnv
ElementLinkCnv_p3< MasterLink_t > MasterLinkCnv_t
ElementLinkCnv_p3< ElementLink< VxContainer > > OriginLinkCnv_t
static const MasterLinkCnv_t s_masterLinkCnv
ElementLink< VxContainer > m_originLink
Persistent pointer (ElementLink) to the origin of this particle.
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
ChargeType m_charge
Value of the charge of the particle (this has real meaning, only if hasCharge() returns true)
bool m_hasCharge
Switch to tell if this particle has a charge.
MasterLink_t m_masterLink
The persistent pointer (ElementLink) to the original "master" particle.
virtual void transToPers(const Analysis::ParticleShallowClone *transObj, ParticleShallowClone_p1 *persObj, MsgStream &msg) const override
Method creating the persistent representation ParticleShallowClone_p1 from its transient representati...
virtual void persToTrans(const ParticleShallowClone_p1 *persObj, Analysis::ParticleShallowClone *transObj, MsgStream &msg) const override
Method creating the transient representation of ParticleShallowClone from its persistent representati...
ElementLinkInt_p3 m_masterLink
The persistent pointer (ElementLink) to the original "master" particle.
P4PxPyPzE_p1 m_momentum
the 4-mom part
float m_charge
Value of the charge of the particle (this has real meaning, only if hasCharge() returns true)
bool m_hasCharge
Switch to tell if this particle has a charge.
ElementLinkInt_p3 m_originLink
Persistent pointer (ElementLink) to the origin of this particle.
MsgStream & msg
Definition testRead.cxx:32