ATLAS Offline Software
ALFA_HitCollectionCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 
11  MsgStream mlog(msgSvc(), "ALFA_HitCollectionConverter" );
12  ALFA_HitCollectionCnv_p1 TPConverter;
13  ALFA_HitCollection_PERS *persObj = TPConverter.createPersistent( transCont, mlog );
14  return persObj;
15 }
16 
17 
19  MsgStream mlog(msgSvc(), "ALFA_HitCollectionConverter" );
20 
21  ALFA_HitCollectionCnv_p1 TPConverter_p1;
22 
23  ALFA_HitCollection *trans_cont(nullptr); // probably inicialization
24  static const pool::Guid p1_guid("96320556-17C7-4E8D-9D15-DF955193F002");
25 
26  if( this->compareClassGuid(p1_guid)) {
27  std::unique_ptr< ALFA_HitCollection_p1 > col_vect( this->poolReadObject< ALFA_HitCollection_p1 >() );
28  trans_cont = TPConverter_p1.createTransient( col_vect.get(), mlog );
29  }
30 // else if( m_token.find("CLID=35722E01-C4E3-420E-8A7E-E375C5E7989D") != std::string::npos) {
31  // old version from before TP separation, just return it
32 // trans_cont = this->poolReadObject<ALFA_HitCollection>();
33 // }
34  else {
35  throw std::runtime_error("nazdar, Unsupported persistent version of Data container");
36  }
37  return trans_cont;
38 }
ALFA_HitCollectionCnv::createTransient
ALFA_HitCollection * createTransient()
Definition: ALFA_HitCollectionCnv.cxx:18
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
ALFA_HitCollectionCnv_p1.h
ALFA_HitCollectionCnv::createPersistent
ALFA_HitCollection_PERS * createPersistent(ALFA_HitCollection *transCont)
Definition: ALFA_HitCollectionCnv.cxx:10
AtlasHitsVector
Definition: AtlasHitsVector.h:33
ALFA_Hit_p1.h
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
ALFA_HitCollectionCnv.h
python.InDetPriVxFinderConfig.mlog
mlog
Definition: InDetPriVxFinderConfig.py:139
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
T_AtlasHitsVectorCnv
Definition: TPConverter.h:1234
T_AthenaPoolCustCnv< ALFA_HitCollection, ALFA_HitCollection_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
ALFA_HitCollection_p1
Definition: ALFA_HitCollection_p1.h:23