ATLAS Offline Software
TrackRecordCnv_p2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 void
10 TrackRecordCnv_p2::persToTrans(const TrackRecord_p2* persObj, TrackRecord* transObj, MsgStream &log) const
11 {
12  log << MSG::DEBUG << "TrackRecordCnv_p2::persToTrans called " << endmsg;
13 
14  transObj->SetPDGCode (persObj->PDG_code());
15  transObj->SetStatus (persObj->status());
16  transObj->SetEnergy ((double) persObj->energy());
17  transObj->SetMomentum (CLHEP::Hep3Vector( persObj->momentumX(), persObj->momentumY(), persObj->momentumZ() ));
18  transObj->SetPosition (CLHEP::Hep3Vector( persObj->positionX(), persObj->positionY(), persObj->positionZ() ));
19  transObj->SetTime ((double) persObj->time());
20  transObj->SetID (persObj->uniqueID());
21  transObj->SetVolName (persObj->volName());
22 }
23 
24 
25 void
26 TrackRecordCnv_p2::transToPers(const TrackRecord* transObj, TrackRecord_p2* persObj, MsgStream &log) const
27 {
28  log << MSG::DEBUG << "TrackRecordCnv_p2::transToPers called " << endmsg;
29  persObj->m_PDG_code = transObj->GetPDGCode();
30  persObj->m_status = transObj->status();
31  persObj->m_energy = (float) transObj->GetEnergy();
32  CLHEP::Hep3Vector mom = transObj->GetMomentum();
33  persObj->m_momentumX = (float) mom.x();
34  persObj->m_momentumY = (float) mom.y();
35  persObj->m_momentumZ = (float) mom.z();
36  CLHEP::Hep3Vector pos = transObj->GetPosition();
37  persObj->m_positionX = (float) pos.x();
38  persObj->m_positionY = (float) pos.y();
39  persObj->m_positionZ = (float) pos.z();
40  persObj->m_time = (float) transObj->GetTime();
41  persObj->m_uniqueID = transObj->id();
42  persObj->m_volName = transObj->GetVolName();
43 }
TrackRecord_p2::time
float time() const
Definition: TrackRecord_p2.h:21
TrackRecord::SetID
void SetID(int uniqueID)
Set uniqueID.
Definition: TrackRecord.h:127
TrackRecord_p2
Definition: TrackRecord_p2.h:9
TrackRecordCnv_p2::persToTrans
virtual void persToTrans(const TrackRecord_p2 *persObj, TrackRecord *transObj, MsgStream &log) const override
Definition: TrackRecordCnv_p2.cxx:10
TrackRecord_p2::positionX
float positionX() const
Definition: TrackRecord_p2.h:18
TrackRecord::id
int id() const
unique ID - fall back to HepMcParticeLink if m_id has not been set directly
Definition: TrackRecord.h:124
TrackRecord_p2::PDG_code
int PDG_code() const
Definition: TrackRecord_p2.h:12
TrackRecord::status
int status() const
status.
Definition: TrackRecord.h:118
TrackRecordCnv_p2::transToPers
virtual void transToPers(const TrackRecord *transObj, TrackRecord_p2 *persObj, MsgStream &log) const override
Definition: TrackRecordCnv_p2.cxx:26
TrackRecord_p2::m_momentumY
float m_momentumY
Definition: TrackRecord_p2.h:30
TrackRecord::SetPDGCode
void SetPDGCode(int pcode)
Set PDG code.
Definition: TrackRecord.h:103
TrackRecord::SetVolName
void SetVolName(const std::string &theName)
Set Volume name.
Definition: TrackRecord.h:115
TrackRecord_p2::positionZ
float positionZ() const
Definition: TrackRecord_p2.h:20
TrackRecord_p2::momentumX
float momentumX() const
Definition: TrackRecord_p2.h:15
TrackRecord_p2::m_PDG_code
int m_PDG_code
Definition: TrackRecord_p2.h:27
TrackRecord_p2::m_positionZ
float m_positionZ
Definition: TrackRecord_p2.h:31
TrackRecord::GetTime
double GetTime() const
Time.
Definition: TrackRecord.h:106
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
TrackRecord_p2::m_uniqueID
int m_uniqueID
Definition: TrackRecord_p2.h:33
TrackRecord_p2::m_energy
float m_energy
Definition: TrackRecord_p2.h:29
TrackRecord_p2::m_momentumZ
float m_momentumZ
Definition: TrackRecord_p2.h:30
TrackRecord::GetPosition
CLHEP::Hep3Vector GetPosition() const
Position.
Definition: TrackRecord.h:88
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrackRecord_p2::m_positionY
float m_positionY
Definition: TrackRecord_p2.h:31
TrackRecord::SetTime
void SetTime(double time)
Set time.
Definition: TrackRecord.h:109
TrackRecord::SetPosition
void SetPosition(CLHEP::Hep3Vector p)
Set position.
Definition: TrackRecord.h:91
TrackRecord.h
TrackRecord_p2::volName
const std::string & volName() const
Definition: TrackRecord_p2.h:23
TrackRecord::SetMomentum
void SetMomentum(CLHEP::Hep3Vector e)
Set momentum.
Definition: TrackRecord.h:97
TrackRecord::GetEnergy
double GetEnergy() const
Energy.
Definition: TrackRecord.h:82
TrackRecord_p2::positionY
float positionY() const
Definition: TrackRecord_p2.h:19
TrackRecord_p2::uniqueID
int uniqueID() const
Definition: TrackRecord_p2.h:22
TrackRecord::GetMomentum
CLHEP::Hep3Vector GetMomentum() const
Momentum.
Definition: TrackRecord.h:94
TrackRecord_p2::status
int status() const
Definition: TrackRecord_p2.h:13
TrackRecord
Definition: TrackRecord.h:12
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TrackRecord::SetStatus
void SetStatus(int status)
Set status.
Definition: TrackRecord.h:121
TrackRecord::GetVolName
const std::string & GetVolName() const
Volume name.
Definition: TrackRecord.h:112
TrackRecord_p2::m_status
int m_status
Definition: TrackRecord_p2.h:28
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrackRecord_p2::energy
float energy() const
Definition: TrackRecord_p2.h:14
TrackRecordCnv_p2.h
TrackRecord_p2::m_momentumX
float m_momentumX
Definition: TrackRecord_p2.h:30
TrackRecord_p2::m_volName
std::string m_volName
Definition: TrackRecord_p2.h:34
TrackRecord_p2.h
TrackRecord::SetEnergy
void SetEnergy(double e)
Set energy.
Definition: TrackRecord.h:85
TrackRecord_p2::m_time
float m_time
Definition: TrackRecord_p2.h:32
TrackRecord::GetPDGCode
int GetPDGCode() const
PDG Code.
Definition: TrackRecord.h:100
readCCLHist.float
float
Definition: readCCLHist.py:83
TrackRecord_p2::momentumY
float momentumY() const
Definition: TrackRecord_p2.h:16
TrackRecord_p2::m_positionX
float m_positionX
Definition: TrackRecord_p2.h:31
TrackRecord_p2::momentumZ
float momentumZ() const
Definition: TrackRecord_p2.h:17