ATLAS Offline Software
MuonSimDataCnv_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 
7 
8 void MuonSimDataCnv_p2::persToTrans(const Muon::MuonSimData_p2 * persObj, MuonSimData * transObj, MsgStream & log){
9  log << MSG::DEBUG << "MuonSimDataCnv_p2::persToTrans" << endmsg;
10  //log << MSG::VERBOSE << "\tconverting m_word:\t" << persObj->m_word << "\tto\t" << transObj->m_word << endmsg;
11  //log << MSG::VERBOSE << "\tconverting x:\t" << persObj->x << "\tto\t" << transObj->x << endmsg;
12  //log << MSG::VERBOSE << "\tconverting y:\t" << persObj->y << "\tto\t" << transObj->y << endmsg;
13  //log << MSG::VERBOSE << "\tconverting z:\t" << persObj->z << "\tto\t" << transObj->z << endmsg;
14 
15  std::vector<MuonSimData::Deposit> deposits;
16  deposits.reserve(persObj->m_deposits.size());
17  HepMcParticleLink transMcPartLink;
18  for (const std::pair<HepMcParticleLink_p2, Muon::MuonMCData_p1>& p :
19  persObj->m_deposits)
20  {
21  m_mcpartlinkCnv.persToTrans(&p.first, &transMcPartLink, log);
22  MuonMCData transMcData;
23  m_mcdataCnv.persToTrans(&p.second, &transMcData, log);
24  deposits.emplace_back(transMcPartLink, transMcData);
25  }
26 
27  *transObj = MuonSimData (std::move(deposits),
28  persObj->m_word);
29 
30  Amg::Vector3D pos (persObj->x, persObj->y, persObj->z);
31  transObj->setPosition (pos);
32  transObj->setTime(persObj->t);
33 }
34 
35 void MuonSimDataCnv_p2::transToPers( const MuonSimData * transObj, Muon::MuonSimData_p2 * persObj, MsgStream & log){
36  log << MSG::DEBUG << "MuonSimDataCnv_p2::TransToPers" << endmsg;
37  persObj->m_word = transObj->word();
38  Amg::Vector3D pos = transObj->globalPosition();
39  persObj->x = pos.x();
40  persObj->y = pos.y();
41  persObj->z = pos.z();
42  persObj->t = transObj->getTime();
43  persObj->m_deposits.clear();
44  persObj->m_deposits.reserve(transObj->getdeposits().size());
45  for (const MuonSimData::Deposit& d : transObj->getdeposits()) {
46  HepMcParticleLink_p2 persMcPartLink;
47  m_mcpartlinkCnv.transToPers(&d.first, &persMcPartLink, log);
48  Muon::MuonMCData_p1 persMcData;
49  m_mcdataCnv.transToPers(&d.second, &persMcData, log);
50  persObj->m_deposits.emplace_back(persMcPartLink, persMcData);
51  }
52 }
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
MuonSimData::word
int word() const
Definition: MuonSimData.h:89
MuonSimData::Deposit
std::pair< HepMcParticleLink, MuonMCData > Deposit
Definition: MuonSimData.h:66
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
hist_file_dump.d
d
Definition: hist_file_dump.py:137
MuonSimData::setPosition
void setPosition(const Amg::Vector3D &pos)
Definition: MuonSimData.h:106
Muon::MuonSimData_p2::y
float y
Definition: MuonSimData_p2.h:21
Muon::MuonMCData_p1
Definition: MuonMCData_p1.h:9
MuonSimData::getdeposits
const std::vector< Deposit > & getdeposits() const
Definition: MuonSimData.h:94
Muon::MuonSimData_p2
Definition: MuonSimData_p2.h:13
MuonSimDataCnv_p2::m_mcpartlinkCnv
HepMcParticleLinkCnv_p2 m_mcpartlinkCnv
Definition: MuonSimDataCnv_p2.h:24
MuonSimData::setTime
void setTime(const float &time)
Definition: MuonSimData.h:119
MuonSimDataCnv_p2::transToPers
void transToPers(const MuonSimData *transObj, Muon::MuonSimData_p2 *persObj, MsgStream &log)
Definition: MuonSimDataCnv_p2.cxx:35
Muon::MuonSimData_p2::m_word
int m_word
Definition: MuonSimData_p2.h:18
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::MuonSimData_p2::z
float z
Definition: MuonSimData_p2.h:22
Muon::MuonSimData_p2::t
float t
Definition: MuonSimData_p2.h:23
MuonMCDataCnv_p1::persToTrans
void persToTrans(const Muon::MuonMCData_p1 *persObj, MuonMCData *transObj, MsgStream &log)
Definition: MuonMCDataCnv_p1.cxx:8
MuonSimData
Definition: MuonSimData.h:62
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Muon::MuonSimData_p2::x
float x
Definition: MuonSimData_p2.h:20
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonSimDataCnv_p2.h
Muon::MuonSimData_p2::m_deposits
std::vector< std::pair< HepMcParticleLink_p2, MuonMCData_p1 > > m_deposits
Definition: MuonSimData_p2.h:19
MuonMCDataCnv_p1::transToPers
void transToPers(const MuonMCData *transObj, Muon::MuonMCData_p1 *persObj, MsgStream &log)
Definition: MuonMCDataCnv_p1.cxx:15
MuonSimDataCnv_p2::persToTrans
void persToTrans(const Muon::MuonSimData_p2 *persObj, MuonSimData *transObj, MsgStream &log)
Definition: MuonSimDataCnv_p2.cxx:8
MuonMCData
Definition: MuonSimData.h:42
MuonSimDataCnv_p2::m_mcdataCnv
MuonMCDataCnv_p1 m_mcdataCnv
Definition: MuonSimDataCnv_p2.h:25
MuonSimData.h
MuonSimData::globalPosition
const Amg::Vector3D globalPosition() const
Definition: MuonSimData.h:113
MuonSimData::getTime
float getTime() const
Definition: MuonSimData.h:124