ATLAS Offline Software
CscSimDataCnv_p3.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 void CscSimDataCnv_p3::persToTrans(const Muon::CscSimData_p3 * persObj, CscSimData * transObj, MsgStream & log){
9  log << MSG::DEBUG << "CscSimDataCnv_p3::persToTrans" << endmsg;
10 
11  std::vector<CscSimData::Deposit> deposits;
12  deposits.reserve(persObj->m_deposits.size());
13  for (const std::pair<HepMcParticleLink_p3, Muon::CscMcData_p1>& p :
14  persObj->m_deposits)
15  {
16  HepMcParticleLink transMcPartLink;
17  m_mcpartlinkCnv.persToTrans(&p.first, &transMcPartLink, log);
18  CscMcData transMcData;
19  m_mcdataCnv.persToTrans(&p.second, &transMcData, log);
20  deposits.emplace_back(transMcPartLink, transMcData);
21  }
22 
23  *transObj = CscSimData (std::move(deposits),
24  persObj->m_word);
25 }
26 
27 void CscSimDataCnv_p3::transToPers( const CscSimData * transObj, Muon::CscSimData_p3 * persObj, MsgStream & log){
28  log << MSG::DEBUG << "CscSimDataCnv_p3::transToPers" << endmsg;
29  persObj->m_word = transObj->word();
30  log << MSG::VERBOSE << "\tconverting m_word:\t" << transObj->word() << "\tto\t" << persObj->m_word << endmsg;
31  persObj->m_deposits.clear();
32  persObj->m_deposits.reserve(transObj->getdeposits().size());
33  for (const CscSimData::Deposit& d : transObj->getdeposits()) {
34  HepMcParticleLink_p3 persMcPartLink;
35  m_mcpartlinkCnv.transToPers(&d.first, &persMcPartLink, log);
36  Muon::CscMcData_p1 persMcData;
37  m_mcdataCnv.transToPers(&d.second, &persMcData, log);
38  persObj->m_deposits.emplace_back (persMcPartLink, persMcData);
39  }
40 }
HepMcParticleLinkCnv_p3::persToTrans
virtual void persToTrans(const HepMcParticleLink_p3 *persObj, HepMcParticleLink *transObj, MsgStream &msg) const override
Method creating the transient representation of HepMcParticleLink from its persistent representation ...
Definition: HepMcParticleLinkCnv_p3.cxx:15
hist_file_dump.d
d
Definition: hist_file_dump.py:137
CscSimDataCnv_p3::m_mcpartlinkCnv
HepMcParticleLinkCnv_p3 m_mcpartlinkCnv
Definition: CscSimDataCnv_p3.h:24
CscSimDataCnv_p3.h
CscMcData
Definition: CscSimData.h:23
Muon::CscMcData_p1
Definition: CscMcData_p1.h:9
CscSimData::word
int word() const
Definition: CscSimData.h:63
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CscSimData
Definition: CscSimData.h:44
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::CscSimData_p3::m_word
int m_word
Definition: CscSimData_p3.h:18
HepMcParticleLinkCnv_p3::transToPers
virtual void transToPers(const HepMcParticleLink *transObj, HepMcParticleLink_p3 *persObj, MsgStream &msg) const override
Method creating the persistent representation HepMcParticleLink_p3 from its transient representation ...
Definition: HepMcParticleLinkCnv_p3.cxx:33
CscMcDataCnv_p1::transToPers
void transToPers(const CscMcData *transObj, Muon::CscMcData_p1 *persObj, MsgStream &log)
Definition: CscMcDataCnv_p1.cxx:22
CscSimDataCnv_p3::transToPers
void transToPers(const CscSimData *transObj, Muon::CscSimData_p3 *persObj, MsgStream &log)
Definition: CscSimDataCnv_p3.cxx:27
CscMcDataCnv_p1::persToTrans
void persToTrans(const Muon::CscMcData_p1 *persObj, CscMcData *transObj, MsgStream &log)
Definition: CscMcDataCnv_p1.cxx:8
CscSimData::Deposit
std::pair< HepMcParticleLink, CscMcData > Deposit
Definition: CscSimData.h:47
CscSimDataCnv_p3::m_mcdataCnv
CscMcDataCnv_p1 m_mcdataCnv
Definition: CscSimDataCnv_p3.h:25
Muon::CscSimData_p3
Definition: CscSimData_p3.h:13
CscSimDataCnv_p3::persToTrans
void persToTrans(const Muon::CscSimData_p3 *persObj, CscSimData *transObj, MsgStream &log)
Definition: CscSimDataCnv_p3.cxx:8
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CscSimData::getdeposits
const std::vector< Deposit > & getdeposits() const
Definition: CscSimData.h:67
CscSimData.h
Muon::CscSimData_p3::m_deposits
std::vector< std::pair< HepMcParticleLink_p3, CscMcData_p1 > > m_deposits
Definition: CscSimData_p3.h:19
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14