ATLAS Offline Software
ParticleShallowCloneCnv_p1.cxx
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 // 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
33 static const P4PxPyPzECnv_p1 s_momCnv;
34 static const MasterLinkCnv_t s_masterLinkCnv;
35 static const OriginLinkCnv_t s_originLinkCnv;
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 }
P4PxPyPzECnv_p1::persToTrans
virtual void persToTrans(const P4PxPyPzE_p1 *persObj, P4PxPyPzE *transObj, MsgStream &log) const override
Method creating the transient representation of P4PxPyPzE from its persistent representation P4PxPyPz...
Definition: P4PxPyPzECnv_p1.cxx:26
ElementLinkCnv_p3
Definition: ElementLinkCnv_p3.h:27
ParticleShallowClone_p1::m_hasCharge
bool m_hasCharge
Switch to tell if this particle has a charge.
Definition: ParticleShallowClone_p1.h:64
ElementLinkCnv_p3.h
This file contains the class definition for the ElementLinkCnv_p3 class.
ElementLinkCnv_p3::persToTrans
void persToTrans(const PersLink_t &pers, Link_t &trans, MsgStream &log) const
P4PxPyPzECnv_p1.h
P4PxPyPzECnv_p1
Definition: P4PxPyPzECnv_p1.h:35
Analysis::ParticleShallowClone::m_hasCharge
bool m_hasCharge
Switch to tell if this particle has a charge.
Definition: ParticleShallowClone.h:269
ParticleShallowCloneCnv_p1::persToTrans
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...
Definition: ParticleShallowCloneCnv_p1.cxx:38
ParticleShallowClone_p1::m_charge
float m_charge
Value of the charge of the particle (this has real meaning, only if hasCharge() returns true)
Definition: ParticleShallowClone_p1.h:69
Analysis::ParticleShallowClone::m_charge
ChargeType m_charge
Value of the charge of the particle (this has real meaning, only if hasCharge() returns true)
Definition: ParticleShallowClone.h:274
ParticleShallowCloneCnv_p1::transToPers
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...
Definition: ParticleShallowCloneCnv_p1.cxx:69
ParticleShallowClone_p1
Definition: ParticleShallowClone_p1.h:28
ParticleShallowClone_p1::m_masterLink
ElementLinkInt_p3 m_masterLink
The persistent pointer (ElementLink) to the original "master" particle.
Definition: ParticleShallowClone_p1.h:58
MasterLinkCnv_t
ElementLinkCnv_p3< MasterLink_t > MasterLinkCnv_t
Definition: ParticleShallowCloneCnv_p1.cxx:28
Analysis::ParticleShallowClone::m_originLink
ElementLink< VxContainer > m_originLink
Persistent pointer (ElementLink) to the origin of this particle.
Definition: ParticleShallowClone.h:266
ParticleShallowClone_p1::m_originLink
ElementLinkInt_p3 m_originLink
Persistent pointer (ElementLink) to the origin of this particle.
Definition: ParticleShallowClone_p1.h:61
ElementLinkCnv_p3::transToPers
void transToPers(const Link_t &trans, PersLink_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
OriginLinkCnv_t
ElementLinkCnv_p3< ElementLink< VxContainer > > OriginLinkCnv_t
Definition: ParticleShallowCloneCnv_p1.cxx:29
ParticleShallowCloneCnv_p1.h
Analysis::ParticleShallowClone::momentumBase
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
Definition: ParticleShallowClone.h:419
Analysis::ParticleShallowClone
Definition: ParticleShallowClone.h:51
P4PxPyPzECnv_p1::transToPers
virtual void transToPers(const P4PxPyPzE *transObj, P4PxPyPzE_p1 *persObj, MsgStream &log) const override
Method creating the persistent representation P4PxPyPzE_p1 from its transient representation P4PxPyPz...
Definition: P4PxPyPzECnv_p1.cxx:38
ChargeType
double ChargeType
typedef ChargeType used to anticipate changes here
Definition: Event/EventKernel/EventKernel/IParticle.h:40
ParticleShallowClone_p1::m_momentum
P4PxPyPzE_p1 m_momentum
the 4-mom part
Definition: ParticleShallowClone_p1.h:55
Analysis::ParticleShallowClone::m_masterLink
MasterLink_t m_masterLink
The persistent pointer (ElementLink) to the original "master" particle.
Definition: ParticleShallowClone.h:263
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
ParticleShallowClone.h