ATLAS Offline Software
MuonSimDataCollectionCnv_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 
9 #include "Identifier/Identifier.h"
10 
12  log << MSG::DEBUG << "MuonSimDataCollectionCnv_p3::persToTrans" << endmsg;
13 
14  std::vector<std::pair<Identifier32::value_type, Muon::MuonSimData_p3 > >::const_iterator it_Coll = persCol->m_muonsimdata.begin();
15  std::vector<std::pair<Identifier32::value_type, Muon::MuonSimData_p3 > >::const_iterator it_CollEnd = persCol->m_muonsimdata.end();
16  log << MSG::DEBUG << " Preparing " << persCol->m_muonsimdata.size() << " Collections" << endmsg;
17 
18  for(int collIdx=0 ; it_Coll != it_CollEnd; ++it_Coll, ++collIdx) {
19  const Muon::MuonSimData_p3& perssimData = persCol->m_muonsimdata[collIdx].second;
20  MuonSimData transsimData;
21  m_muonsimdataCnv.persToTrans(&perssimData,&transsimData,log);
22  transCol->insert( transCol->end(), std::make_pair( Identifier( it_Coll->first ), transsimData ) );
23  }
24 
25  log << MSG::DEBUG << " Reading MuonSimDataCollection" << endmsg;
26 
27 }
28 
30 
31  log << MSG::DEBUG << "MuonSimDataCollectionCnv_p3::transToPers" << endmsg;
32  MuonSimDataCollection::const_iterator it_Coll = transCol->begin();
33  MuonSimDataCollection::const_iterator it_CollEnd = transCol->end();
34 
35  persCol->m_muonsimdata.resize(transCol->size());
36  log << MSG::DEBUG << " Preparing " << persCol->m_muonsimdata.size() << " Collections" << endmsg;
37 
38  for(int collIdx=0; it_Coll != it_CollEnd; ++it_Coll, ++collIdx){
39  (persCol->m_muonsimdata[collIdx]).first = (*it_Coll).first.get_identifier32().get_compact();
40  const MuonSimData &transsimData = (*it_Coll).second;
41  Muon::MuonSimData_p3 &perssimData = persCol->m_muonsimdata[collIdx].second;
42  m_muonsimdataCnv.transToPers(&transsimData, &perssimData, log);
43  }
44 
45  log << MSG::DEBUG << " Writing MuonSimDataCollection" << endmsg;
46 }
MuonSimDataCollectionCnv_p3::persToTrans
void persToTrans(const Muon::MuonSimDataCollection_p3 *persCol, MuonSimDataCollection *transCol, MsgStream &log)
Definition: MuonSimDataCollectionCnv_p3.cxx:11
MuonSimDataCollectionCnv_p3::transToPers
void transToPers(const MuonSimDataCollection *transCol, Muon::MuonSimDataCollection_p3 *persCol, MsgStream &log)
Definition: MuonSimDataCollectionCnv_p3.cxx:29
MuonSimDataCollectionCnv_p3::m_muonsimdataCnv
MuonSimDataCnv_p3 m_muonsimdataCnv
Definition: MuonSimDataCollectionCnv_p3.h:21
MuonSimDataCollectionCnv_p3.h
Muon::MuonSimData_p3
Definition: MuonSimData_p3.h:13
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonSimDataCollection
Definition: MuonSimDataCollection.h:21
MuonSimDataCnv_p3::persToTrans
void persToTrans(const Muon::MuonSimData_p3 *persObj, MuonSimData *transObj, MsgStream &log)
Definition: MuonSimDataCnv_p3.cxx:8
MuonSimData
Definition: MuonSimData.h:62
DeMoScan.first
bool first
Definition: DeMoScan.py:536
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::MuonSimDataCollection_p3
Definition: MuonSimDataCollection_p3.h:13
MuonSimDataCollection_p3.h
MuonSimDataCollection.h
Muon::MuonSimDataCollection_p3::m_muonsimdata
std::vector< std::pair< Identifier32::value_type, MuonSimData_p3 > > m_muonsimdata
Definition: MuonSimDataCollection_p3.h:16
MuonSimDataCnv_p3::transToPers
void transToPers(const MuonSimData *transObj, Muon::MuonSimData_p3 *persObj, MsgStream &log)
Definition: MuonSimDataCnv_p3.cxx:35
MuonSimData.h
Identifier
Definition: IdentifierFieldParser.cxx:14