diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h index 1d4249e409c3bbedcd5a312710159dba4b5b9c1a..c4521126f442a9c84b48fb075ec7c4fc9d949f86 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/InDetEventAthenaPool/InDetEventAthenaPoolCnvDict.h @@ -24,10 +24,10 @@ namespace InDetEventAthenaPoolCnvDict { - std::pair<unsigned int, InDetSimData_p1> t1; - std::pair<unsigned long long, InDetSimData_p1> t2; - std::vector<std::pair<unsigned int, InDetSimData_p1> > t3; - std::vector<std::pair<unsigned long long, InDetSimData_p1> > t4; + std::pair<unsigned int, InDetSimData_p2> t1; + std::pair<unsigned long long, InDetSimData_p2> t2; + std::vector<std::pair<unsigned int, InDetSimData_p2> > t3; + std::vector<std::pair<unsigned long long, InDetSimData_p2> > t4; } #endif diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p1.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p1.cxx index df32aa4e292408d5ba8c9c6fb03b28b5132905ce..56c9df08ce5c73854332a276151782c261582325 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p1.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p1.cxx @@ -23,10 +23,11 @@ void InDetSimDataCnv_p1::persToTrans(const InDetSimData_p1* persObj, InDetSimData* transObj, MsgStream &log) { MSG_VERBOSE(log,"InDetSimDataCnv_p1::persToTrans called "); - HepMcParticleLink mcLink (m_sg); + HepMcParticleLinkCnv_p1 HepMcPLCnv; std::vector<InDetSimData::Deposit> deposits; deposits.reserve( persObj->m_enDeposits.size() ); for (unsigned int icount=0; icount < persObj->m_enDeposits.size(); icount++) { + HepMcParticleLink mcLink(m_sg); //FIXME This is left as a note to make the new implementation thread-safe HepMcPLCnv.persToTrans(&(persObj->m_links[icount]),&mcLink, log); deposits.emplace_back (mcLink, persObj->m_enDeposits[icount]); } @@ -36,7 +37,7 @@ InDetSimDataCnv_p1::persToTrans(const InDetSimData_p1* persObj, InDetSimData* tr } void -InDetSimDataCnv_p1::transToPers(const InDetSimData* transObj, InDetSimData_p1* persObj, MsgStream &log) +InDetSimDataCnv_p1::transToPers(const InDetSimData* transObj, InDetSimData_p1* persObj, MsgStream &log) { MSG_VERBOSE(log,"InDetSimDataCnv_p1::transToPers called "); diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p2.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p2.cxx index 4d0d44214a4bc4c9746be9cc062aa66f9f7bb59d..3cbfe0c090e4e47a0122f5bcae98009677f78e5f 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p2.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCnv_p2.cxx @@ -36,9 +36,21 @@ InDetSimDataCnv_p2::persToTrans(const InDetSimData_p2* persObj, InDetSimData* tr } void -InDetSimDataCnv_p2::transToPers(const InDetSimData*, InDetSimData_p2*, MsgStream &/*log*/) +InDetSimDataCnv_p2::transToPers(const InDetSimData* transObj, InDetSimData_p2* persObj, MsgStream &log) { - throw std::runtime_error("InDetSimDataCnv_p2::transToPers is not supported in this release!");} + MSG_VERBOSE(log,"InDetSimDataCnv_p2::transToPers called "); + HepMcParticleLinkCnv_p2 HepMcPLCnv; + + persObj->m_word = transObj->word(); + const std::vector<InDetSimData::Deposit> &dep(transObj->getdeposits()); + persObj->m_links.resize(dep.size() ); + persObj->m_enDeposits.resize(dep.size() ); + depositIterator it=dep.begin(); + for (int icount=0; it != dep.end(); it++, icount++) { + HepMcPLCnv.transToPers(&(dep[icount].first), &(persObj->m_links[icount]), log); + persObj->m_enDeposits[icount] = dep[icount].second; + } +} void InDetSimDataCnv_p2::setCurrentStore (IProxyDict* store) { diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.h b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.h index 653b709f79667dd3731c1b7b5f93c112553a1365..478a44d21f8a1c38da0ae12b1a88843681e62163 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.h +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv.h @@ -15,8 +15,8 @@ // Gaudi #include "GaudiKernel/MsgStream.h" // typedef to the latest persistent version -typedef InDetSimDataCollection_p2 InDetSimDataCollection_PERS; -typedef InDetSimDataCollectionCnv_p2 InDetSimDataCollectionCnv_PERS; +typedef InDetSimDataCollection_p3 InDetSimDataCollection_PERS; +typedef InDetSimDataCollectionCnv_p3 InDetSimDataCollectionCnv_PERS; // base class typedef T_AthenaPoolCustomCnv<InDetSimDataCollection, InDetSimDataCollection_PERS > InDetSimDataCollectionCnvBase; diff --git a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv_p3.cxx b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv_p3.cxx index 18268fe191b7028c3609f681e37672814c9e6500..111926bfeaa0eb9e5c1b9c0fe5285dd2f471ca0c 100644 --- a/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv_p3.cxx +++ b/InnerDetector/InDetEventCnv/InDetEventAthenaPool/src/InDetSimDataCollectionCnv_p3.cxx @@ -11,9 +11,26 @@ #include "SGTools/CurrentEventStore.h" #include "MsgUtil.h" -void InDetSimDataCollectionCnv_p3::transToPers(const InDetSimDataCollection*, InDetSimDataCollection_p3*, MsgStream &/*log*/) +void InDetSimDataCollectionCnv_p3::transToPers(const InDetSimDataCollection* transCont, InDetSimDataCollection_p3* persCont, MsgStream &log) { - throw std::runtime_error("InDetSimDataCollectionCnv_p3::transToPers is not supported in this release!"); + + + typedef InDetSimDataCollection TRANS; + + InDetSimDataCnv_p2 simDataCnv; + + TRANS::const_iterator it_Coll = transCont->begin(); + TRANS::const_iterator it_CollEnd = transCont->end(); + persCont->m_simdata.resize(transCont->size()); + MSG_DEBUG(log," Preparing " << persCont->m_simdata.size() << "Collections"); + for (int collIndex=0 ; it_Coll != it_CollEnd; it_Coll++, collIndex++) { + // Add in new collection + (persCont->m_simdata[collIndex]).first = (*it_Coll).first.get_compact(); + const InDetSimData& simData = (*it_Coll).second; + InDetSimData_p2& psimData = persCont->m_simdata[collIndex].second; + simDataCnv.transToPers(&simData,&psimData,log); + } + MSG_DEBUG(log," *** Writing InDetSimdataCollection"); } void InDetSimDataCollectionCnv_p3::persToTrans(const InDetSimDataCollection_p3* persCont, InDetSimDataCollection* transCont, MsgStream &log)