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