ATLAS Offline Software
Lvl1ResultCnv.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 #ifndef XAOD_ANALYSIS
6 
7 #include "Lvl1ResultCnv.h"
12 
14 {
17 };
18 
19 Lvl1ResultCnv::Lvl1ResultCnv (ISvcLocator* svcloc) :
20  Lvl1ResultCnvBase(svcloc),
21  m_impl (new Lvl1ResultCnv_impl)
22 {
23 }
24 
26 {
27  delete m_impl;
28 }
29 
30 //create persistent
32 {
33  MsgStream mlog(msgSvc(), "Lvl1ResultConverter" );
34 
36 
37  return persObj;
38 }
39 
40 //create transient
42 {
43  MsgStream mlog(msgSvc(), "Lvl1ResultConverter" );
44 
45  static const pool::Guid p2_guid("F4208CCF-9FAA-4F01-9C0B-26E9E59CE49F");
46  static const pool::Guid p1_guid("226FF990-4D6A-4957-AAAD-42172D174773");
47  static const pool::Guid p0_guid("18DE165E-3DB5-4EAC-867D-807DA3E217C0");
48 
49  if ( compareClassGuid(p1_guid) ) {
50  // using unique_ptr ensures deletion of the persistent object
51  std::unique_ptr< LVL1CTP::Lvl1Result_p1 > col_vect( poolReadObject< LVL1CTP::Lvl1Result_p1 >() );
52  return m_impl->m_TPConverter_p1.createTransient( col_vect.get(), mlog );
53  } else if( compareClassGuid(p0_guid) ){
54  // old version from before TP separation, just return it
55  return this->poolReadObject<LVL1CTP::Lvl1Result>();
56  } else if ( compareClassGuid(p2_guid) ) {
57  // using unique_ptr ensures deletion of the persistent object
58  std::unique_ptr< LVL1CTP::Lvl1Result_p2 > col_vect( poolReadObject< LVL1CTP::Lvl1Result_p2 >() );
59  return m_impl->m_TPConverter_p2.createTransient( col_vect.get(), mlog );
60  }
61 
62  throw std::runtime_error("Unsupported persistent version of Lvl1Result");
63 }
64 
65 #endif
Lvl1ResultCnv::~Lvl1ResultCnv
~Lvl1ResultCnv()
Definition: Lvl1ResultCnv.cxx:25
Lvl1ResultCnv::createPersistent
virtual Lvl1Result_PERS * createPersistent(LVL1CTP::Lvl1Result *transCont)
Definition: Lvl1ResultCnv.cxx:31
Lvl1ResultCnv::createTransient
virtual LVL1CTP::Lvl1Result * createTransient()
Definition: Lvl1ResultCnv.cxx:41
Lvl1Result_p2.h
Lvl1ResultCnv_p1.h
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
LVL1CTP::Lvl1ResultCnv_p2
Definition: Lvl1ResultCnv_p2.h:32
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
Lvl1ResultCnv::m_impl
Lvl1ResultCnv_impl * m_impl
Definition: Lvl1ResultCnv.h:53
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
Lvl1Result_p1.h
Lvl1ResultCnv_impl::m_TPConverter_p1
LVL1CTP::Lvl1ResultCnv_p1 m_TPConverter_p1
Definition: Lvl1ResultCnv.cxx:15
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
python.InDetPriVxFinderConfig.mlog
mlog
Definition: InDetPriVxFinderConfig.py:134
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
Lvl1ResultCnv::Lvl1ResultCnv
Lvl1ResultCnv(ISvcLocator *svcloc)
Definition: Lvl1ResultCnv.cxx:19
LVL1CTP::Lvl1Result_p2
Definition: Lvl1Result_p2.h:45
Lvl1ResultCnv.h
LVL1CTP::Lvl1Result
Definition: Lvl1Result.h:32
Lvl1ResultCnv_impl
Definition: Lvl1ResultCnv.cxx:14
Lvl1ResultCnv_p2.h
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
Lvl1ResultCnv_impl::m_TPConverter_p2
LVL1CTP::Lvl1ResultCnv_p2 m_TPConverter_p2
Definition: Lvl1ResultCnv.cxx:16
LVL1CTP::Lvl1ResultCnv_p1
Definition: Lvl1ResultCnv_p1.h:32