ATLAS Offline Software
TBTrackCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TBTrackCnv.h"
6 
8  MsgStream log(msgSvc(), "TBTrackConverter" );
9  TBTrack_PERS *persObj = m_TPConverter.createPersistent( transCont, log );
10  log << MSG::DEBUG << "Success" << endmsg;
11  return persObj;
12 }
13 
15  MsgStream log(msgSvc(), "TBTrackConverter" );
16  static const pool::Guid p1_guid("9E50CAA3-CCDF-4BB9-96E9-E376B16963E8"); // GUID of the persistent object
17  static const pool::Guid p0_guid("37E880D7-EBCB-4F53-8B14-490A4CEB71BD"); // GUID of the transient object
18  if( compareClassGuid(p1_guid) ) {
19  // using unique_ptr ensures deletion of the persistent object
20  std::unique_ptr< TBTrack_p1 > col_vect( poolReadObject< TBTrack_p1 >() );
21  return m_TPConverter.createTransient( col_vect.get(), log );
22  }
23  else if( compareClassGuid(p0_guid) ) {
24  // regular object from before TP separation, just return it
25  return poolReadObject< TBTrack >();
26  }
27  throw std::runtime_error("Unsupported persistent version of Data Collection");
28 }
29 
30 
TBTrack
Definition: TBTrack.h:20
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
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
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
TBTrackCnv.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TBTrackCnv::createPersistent
virtual TBTrack_PERS * createPersistent(TBTrack *transCont)
Definition: TBTrackCnv.cxx:7
TBTrackCnv::createTransient
virtual TBTrack * createTransient()
Definition: TBTrackCnv.cxx:14
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TBTrack_p1
Definition: TBTrack_p1.h:15
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
TBTrackCnv::m_TPConverter
TBTrackCnv_p1 m_TPConverter
Definition: TBTrackCnv.h:32