ATLAS Offline Software
SiHitCnv_p2.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_p2::persToTrans(const SiHit_p2* persObj, SiHit* transObj, MsgStream &log)
15 {
16  HepMcParticleLinkCnv_p2 HepMcPLCnv;
17  HepMcParticleLink link;
18  HepMcPLCnv.persToTrans(&(persObj->m_partLink),&link, log);
19 
20  *transObj = SiHit (HepGeom::Point3D<double> (persObj->m_stX,
21  persObj->m_stY,
22  persObj->m_stZ),
23  HepGeom::Point3D<double> (persObj->m_enX,
24  persObj->m_enY,
25  persObj->m_enZ),
26  persObj->m_energyLoss,
27  persObj->m_meanTime,
28  link,
29  persObj->m_ID
30  );
31 }
32 
33 
34 void
35 SiHitCnv_p2::transToPers(const SiHit* transObj, SiHit_p2* persObj, MsgStream &log)
36 {
37 // if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "SiHitCnv_p2::transToPers called " << endmsg;
38  HepMcParticleLinkCnv_p2 HepMcPLCnv;
39 
40  HepGeom::Point3D<double> st = transObj->localStartPosition();
41  persObj->m_stX = st.x();
42  persObj->m_stY = st.y();
43  persObj->m_stZ = st.z();
44 
45  HepGeom::Point3D<double> en = transObj->localEndPosition();
46  persObj->m_enX = en.x();
47  persObj->m_enY = en.y();
48  persObj->m_enZ = en.z();
49 
50  persObj->m_energyLoss = transObj->energyLoss();
51  persObj->m_meanTime = transObj->meanTime();
52  persObj->m_ID = transObj->identify();
53  HepMcPLCnv.transToPers(&(transObj->particleLink()),&(persObj->m_partLink), log);
54 }
HepMcParticleLinkCnv_p2::persToTrans
virtual void persToTrans(const HepMcParticleLink_p2 *persObj, HepMcParticleLink *transObj, MsgStream &msg) const override
Method creating the transient representation of HepMcParticleLink from its persistent representation ...
Definition: HepMcParticleLinkCnv_p2.cxx:16
HepMcParticleLinkCnv_p2::transToPers
virtual void transToPers(const HepMcParticleLink *transObj, HepMcParticleLink_p2 *persObj, MsgStream &msg) const override
Method creating the persistent representation HepMcParticleLink_p2 from its transient representation ...
Definition: HepMcParticleLinkCnv_p2.cxx:36
SiHit::localEndPosition
HepGeom::Point3D< double > localEndPosition() const
Definition: SiHit.cxx:153
SiHit_p2::m_stY
float m_stY
Definition: SiHit_p2.h:12
SiHit.h
SiHit_p2::m_energyLoss
float m_energyLoss
Definition: SiHit_p2.h:14
SiHit_p2::m_stX
float m_stX
Definition: SiHit_p2.h:12
SiHitCnv_p2::persToTrans
virtual void persToTrans(const SiHit_p2 *persObj, SiHit *transObj, MsgStream &log)
Definition: SiHitCnv_p2.cxx:14
SiHit_p2::m_meanTime
float m_meanTime
Definition: SiHit_p2.h:15
SiHit
Definition: SiHit.h:19
SiHit_p2::m_partLink
HepMcParticleLink_p2 m_partLink
Definition: SiHit_p2.h:16
SiHit::meanTime
double meanTime() const
Definition: SiHit.h:180
SiHit_p2::m_enZ
float m_enZ
Definition: SiHit_p2.h:13
SiHit_p2.h
SiHitCnv_p2.h
SiHit_p2::m_enY
float m_enY
Definition: SiHit_p2.h:13
SiHit::particleLink
const HepMcParticleLink & particleLink() const
Definition: SiHit.h:190
SiHit_p2
Definition: SiHit_p2.h:10
SiHit::energyLoss
double energyLoss() const
Definition: SiHit.h:175
PlotCalibFromCool.en
en
Definition: PlotCalibFromCool.py:399
SiHit::identify
unsigned int identify() const
Definition: SiHit.h:170
HepMcParticleLinkCnv_p2.h
SiHitCnv_p2::transToPers
virtual void transToPers(const SiHit *transObj, SiHit_p2 *persObj, MsgStream &log)
Definition: SiHitCnv_p2.cxx:35
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SiHit_p2::m_ID
unsigned int m_ID
Definition: SiHit_p2.h:17
SiHit_p2::m_stZ
float m_stZ
Definition: SiHit_p2.h:12
HepMcParticleLinkCnv_p2
Definition: HepMcParticleLinkCnv_p2.h:29
SiHit_p2::m_enX
float m_enX
Definition: SiHit_p2.h:13
SiHit::localStartPosition
HepGeom::Point3D< double > localStartPosition() const
Definition: SiHit.cxx:146