2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
6 #include "GaudiKernel/MsgStream.h"
9 #include "Identifier/IdentifierHash.h"
12 template <class T, class P, class CONV>
13 MuonRdoContainerTPCnv<T,P, CONV >::MuonRdoContainerTPCnv(ISvcLocator* svcloc)
14 : T_AthenaPoolCustomCnv<T,P >(svcloc)
20 template <class T, class P, class CONV>
22 MuonRdoContainerTPCnv<T,P, CONV >::createPersistent(T* rdoC)
24 MsgStream log(this->msgSvc(), "MuonRdoContainerTPCnv" );
26 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << " **** Entered MuonRdoContainerTPCnv::createPersistent()" << endmsg;
28 P *persObj = m_TPconverter.createPersistent( rdoC, log );
30 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Write RDO vector, size " << persObj->size()
37 // has to be inlined to prevent gcc3.2 problem/bug? of multiple definitons for specialized templates
38 template <class T, class P, class CONV>
41 MuonRdoContainerTPCnv<T,P, CONV >
44 MsgStream log(this->msgSvc(), "MuonRdoContainerTPCnv" );
45 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << " **** Warning: using default createTransient() - (possibly missing specialized version of this method" << endmsg;
46 //std::cout << " **** Warning: using default createTransient() - (possibly missing specialized version of this method" << std::endl;
48 return createTransientFrom_p0( this->poolReadObject(), log );
51 template <class T, class P, class CONV>
54 MuonRdoContainerTPCnv<T,P, CONV >
56 return T_AthenaPoolCustomCnv<T,P>::initialize();
60 // invoked from persToTrans_impl to read old data from before TP separation
61 template <class T, class P, class CONV>
63 MuonRdoContainerTPCnv<T,P, CONV >
64 ::createTransientFrom_p0(COLL_vector* col_vect, MsgStream &log)
66 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Using old RDO container converter" << endmsg;
68 std::unique_ptr<T> rdoC( new T(col_vect->size()) );
69 //COLL_vector *col_vect = (COLL_vector*) colV;
70 typename COLL_vector::const_iterator it_Coll = col_vect->begin();
71 typename COLL_vector::const_iterator it_CollE = col_vect->end();
72 for(; it_Coll != it_CollE; ++it_Coll) {
73 const COLLECTION_t *col = *it_Coll;
75 // register the rdo collection in IDC
76 //unsigned int id_hash = rdoC->idToHash((unsigned int)col->identify());
77 IdentifierHash id_hash = col->identifyHash();
78 if( rdoC->addCollection(col, id_hash).isFailure() ) {
79 throw std::runtime_error("Transient RDOs could not be created");
82 return rdoC.release();