ATLAS Offline Software
SiHitCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "InDetSimEvent/SiHit.h"
6 #include "Identifier/Identifier.h"
8 
11 
12 
13 void
14 SiHitCnv_p1::persToTrans(const SiHit_p1* persObj, SiHit* transObj,
15 MsgStream &log)
16 {
17  HepMcParticleLinkCnv_p1 HepMcPLCnv;
18  HepMcParticleLink link;
19  HepMcPLCnv.persToTrans(&(persObj->m_partLink),&link, log);
20 
21  *transObj = SiHit (HepGeom::Point3D<double> (persObj->m_stX,
22  persObj->m_stY,
23  persObj->m_stZ),
24  HepGeom::Point3D<double> (persObj->m_enX,
25  persObj->m_enY,
26  persObj->m_enZ),
27  persObj->m_energyLoss,
28  persObj->m_meanTime,
29  link,
30  persObj->m_ID
31  );
32 }
33 
34 
35 void
36 SiHitCnv_p1::transToPers(const SiHit* transObj, SiHit_p1* persObj,
37 MsgStream &log)
38 {
39 // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "SiHitCnv_p1::transToPers called " << endmsg;
40  HepMcParticleLinkCnv_p1 HepMcPLCnv;
41 
42  HepGeom::Point3D<double> st = transObj->localStartPosition();
43  persObj->m_stX = st.x();
44  persObj->m_stY = st.y();
45  persObj->m_stZ = st.z();
46 
47  HepGeom::Point3D<double> en = transObj->localEndPosition();
48  persObj->m_enX = en.x();
49  persObj->m_enY = en.y();
50  persObj->m_enZ = en.z();
51 
52  persObj->m_energyLoss = transObj->energyLoss();
53  persObj->m_meanTime = transObj->meanTime();
54  persObj->m_ID = transObj->identify();
55  HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log);
56 }
SiHit::localEndPosition
HepGeom::Point3D< double > localEndPosition() const
Definition: SiHit.cxx:153
SiHit.h
SiHit_p1::m_enX
float m_enX
Definition: SiHit_p1.h:13
SiHit_p1::m_enZ
float m_enZ
Definition: SiHit_p1.h:13
SiHit_p1
Definition: SiHit_p1.h:10
SiHit
Definition: SiHit.h:19
SiHit_p1.h
SiHit::meanTime
double meanTime() const
Definition: SiHit.h:180
SiHitCnv_p1::persToTrans
virtual void persToTrans(const SiHit_p1 *persObj, SiHit *transObj, MsgStream &log)
Definition: SiHitCnv_p1.cxx:14
SiHit_p1::m_meanTime
float m_meanTime
Definition: SiHit_p1.h:15
SiHit_p1::m_stX
float m_stX
Definition: SiHit_p1.h:12
SiHit::particleLink
const HepMcParticleLink & particleLink() const
Definition: SiHit.h:190
SiHit::energyLoss
double energyLoss() const
Definition: SiHit.h:175
HepMcParticleLinkCnv_p1.h
PlotCalibFromCool.en
en
Definition: PlotCalibFromCool.py:399
HepMcParticleLinkCnv_p1::transToPers
virtual void transToPers(const HepMcParticleLink *transObj, HepMcParticleLink_p1 *persObj, MsgStream &msg) const override
Method creating the persistent representation HepMcParticleLink_p1 from its transient representation ...
Definition: HepMcParticleLinkCnv_p1.cxx:51
SiHit_p1::m_partLink
HepMcParticleLink_p1 m_partLink
Definition: SiHit_p1.h:16
SiHit::identify
unsigned int identify() const
Definition: SiHit.h:170
HepMcParticleLinkCnv_p1
Definition: HepMcParticleLinkCnv_p1.h:33
SiHit_p1::m_enY
float m_enY
Definition: SiHit_p1.h:13
SiHitCnv_p1.h
HepMcParticleLinkCnv_p1::persToTrans
virtual void persToTrans(const HepMcParticleLink_p1 *persObj, HepMcParticleLink *transObj, MsgStream &msg) const override
Method creating the transient representation of HepMcParticleLink from its persistent representation ...
Definition: HepMcParticleLinkCnv_p1.cxx:31
SiHit_p1::m_ID
unsigned int m_ID
Definition: SiHit_p1.h:17
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SiHit_p1::m_energyLoss
float m_energyLoss
Definition: SiHit_p1.h:14
SiHit_p1::m_stZ
float m_stZ
Definition: SiHit_p1.h:12
SiHitCnv_p1::transToPers
virtual void transToPers(const SiHit *transObj, SiHit_p1 *persObj, MsgStream &log)
Definition: SiHitCnv_p1.cxx:36
SiHit::localStartPosition
HepGeom::Point3D< double > localStartPosition() const
Definition: SiHit.cxx:146
SiHit_p1::m_stY
float m_stY
Definition: SiHit_p1.h:12