ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ParticleEventTPCnv
src
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
16
#include "
ParticleEvent/ParticleShallowClone.h
"
17
18
// DataModelAthenaPool includes
19
#include "
DataModelAthenaPool/ElementLinkCnv_p3.h
"
20
21
// EventCommonTPCnv includes
22
#include "
EventCommonTPCnv/P4PxPyPzECnv_p1.h
"
23
24
// ParticleEventTPCnv includes
25
#include "
ParticleEventTPCnv/ParticleShallowCloneCnv_p1.h
"
26
27
28
typedef
ElementLinkCnv_p3<MasterLink_t>
MasterLinkCnv_t
;
29
typedef
ElementLinkCnv_p3< ElementLink< VxContainer >
>
OriginLinkCnv_t
;
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
38
void
ParticleShallowCloneCnv_p1::persToTrans
(
const
ParticleShallowClone_p1
* pers,
39
Analysis::ParticleShallowClone
* trans,
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
69
void
ParticleShallowCloneCnv_p1::transToPers
(
const
Analysis::ParticleShallowClone
* trans,
70
ParticleShallowClone_p1
* pers,
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
}
s_momCnv
static const P4ImplPxPyPzECnv_p1 s_momCnv
Definition
CompositeParticleCnv_p1.cxx:33
ElementLinkCnv_p3.h
This file contains the class definition for the ElementLinkCnv_p3 class.
ChargeType
double ChargeType
typedef ChargeType used to anticipate changes here
Definition
Event/EventKernel/EventKernel/IParticle.h:40
P4PxPyPzECnv_p1.h
s_originLinkCnv
static const OriginLinkCnv_t s_originLinkCnv
Definition
ParticleShallowCloneCnv_p1.cxx:35
MasterLinkCnv_t
ElementLinkCnv_p3< MasterLink_t > MasterLinkCnv_t
Definition
ParticleShallowCloneCnv_p1.cxx:28
OriginLinkCnv_t
ElementLinkCnv_p3< ElementLink< VxContainer > > OriginLinkCnv_t
Definition
ParticleShallowCloneCnv_p1.cxx:29
s_masterLinkCnv
static const MasterLinkCnv_t s_masterLinkCnv
Definition
ParticleShallowCloneCnv_p1.cxx:34
ParticleShallowCloneCnv_p1.h
ParticleShallowClone.h
Analysis::ParticleShallowClone
Definition
ParticleShallowClone.h:51
Analysis::ParticleShallowClone::m_originLink
ElementLink< VxContainer > m_originLink
Persistent pointer (ElementLink) to the origin of this particle.
Definition
ParticleShallowClone.h:266
Analysis::ParticleShallowClone::momentumBase
const momentum_type & momentumBase() const
access to underlying base type (I4Momentum-like)
Definition
ParticleShallowClone.h:419
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
Analysis::ParticleShallowClone::m_hasCharge
bool m_hasCharge
Switch to tell if this particle has a charge.
Definition
ParticleShallowClone.h:269
Analysis::ParticleShallowClone::m_masterLink
MasterLink_t m_masterLink
The persistent pointer (ElementLink) to the original "master" particle.
Definition
ParticleShallowClone.h:263
ElementLinkCnv_p3
Definition
ElementLinkCnv_p3.h:27
P4PxPyPzECnv_p1
Definition
P4PxPyPzECnv_p1.h:35
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
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
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
ParticleShallowClone_p1::m_momentum
P4PxPyPzE_p1 m_momentum
the 4-mom part
Definition
ParticleShallowClone_p1.h:55
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
ParticleShallowClone_p1::m_hasCharge
bool m_hasCharge
Switch to tell if this particle has a charge.
Definition
ParticleShallowClone_p1.h:64
ParticleShallowClone_p1::m_originLink
ElementLinkInt_p3 m_originLink
Persistent pointer (ElementLink) to the origin of this particle.
Definition
ParticleShallowClone_p1.h:61
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0