ATLAS Offline Software
sTgcPrepDataContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include "GaudiKernel/StatusCode.h"
8 #include "GaudiKernel/MsgStream.h"
11 
14 {
15 }
16 
18 
20  // Call base clase initialize
21  if( !sTgcPrepDataContainerCnvBase::initialize().isSuccess() )
22  return StatusCode::FAILURE;
23 
24  // Get the messaging service, print where you are
25  MsgStream log(msgSvc(), "sTgcPrepDataContainerCnv");
26  if (log.level() <= MSG::INFO) log << MSG::INFO << "sTgcPrepDataContainerCnv::initialize()" << endmsg;
27 
28  return StatusCode::SUCCESS;
29 }
30 
32  MsgStream log(msgSvc(), "sTgcPrepDataContainerCnv" );
33  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg;
35  return pers;
36 }
37 
39  MsgStream log(msgSvc(), "sTgcPrepDataContainerCnv" );
40  static const pool::Guid p1_guid("7AB87DDE-8D7C-11E2-AA7C-001517648C14");
41  static const pool::Guid p2_guid("9E1B8028-D22C-4E02-BA82-D0EC79DB4F6C");
42  static const pool::Guid p3_guid("F06F048C-878D-11EE-AFB6-5811229BAA38");
43 
44  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): main converter"<<endmsg;
45  Muon::sTgcPrepDataContainer* p_collection(nullptr);
46  if( compareClassGuid(p3_guid) ) {
47  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 3 detected"<<endmsg;
48  std::unique_ptr< Muon::sTgcPrepDataContainer_p3 > p_coll( poolReadObject< Muon::sTgcPrepDataContainer_p3 >() );
49  p_collection = m_converter_p3.createTransient( p_coll.get(), log );
50  } else if( compareClassGuid(p2_guid) ) {
51  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 2 detected"<<endmsg;
52  std::unique_ptr< Muon::sTgcPrepDataContainer_p2 > p_coll( poolReadObject< Muon::sTgcPrepDataContainer_p2 >() );
53  p_collection = m_converter_p2.createTransient( p_coll.get(), log );
54  } else if( compareClassGuid(p1_guid) ) {
55  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 1 detected"<<endmsg;
56  std::unique_ptr< Muon::sTgcPrepDataContainer_p1 > p_coll( poolReadObject< Muon::sTgcPrepDataContainer_p1 >() );
57  p_collection = m_converter_p1.createTransient( p_coll.get(), log );
58  } else {
59  throw std::runtime_error("Unsupported persistent version of sTgcPrepDataContainer");
60  }
61  return p_collection;
62 }
sTgcPrepDataContainerCnv::m_converter_p2
Muon::sTgcPrepDataContainerCnv_p2 m_converter_p2
Definition: sTgcPrepDataContainerCnv.h:41
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
sTgcPrepDataContainer.h
sTgcPrepDataContainerCnv::m_converter_p3
Muon::sTgcPrepDataContainerCnv_p3 m_converter_p3
Definition: sTgcPrepDataContainerCnv.h:42
sTgcPrepDataContainerCnv::createTransient
virtual Muon::sTgcPrepDataContainer * createTransient()
Definition: sTgcPrepDataContainerCnv.cxx:38
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
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
Muon::sTgcPrepDataContainerCnv_p3::createTransient
virtual Muon::sTgcPrepDataContainer * createTransient(const Muon::sTgcPrepDataContainer_p3 *persObj, MsgStream &log)
Definition: sTgcPrepDataContainerCnv_p3.cxx:268
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
sTgcPrepDataContainerCnv::createPersistent
virtual sTgcPrepDataContainer_PERS * createPersistent(Muon::sTgcPrepDataContainer *transCont)
Definition: sTgcPrepDataContainerCnv.cxx:31
sTgcPrepDataContainerCnv::~sTgcPrepDataContainerCnv
virtual ~sTgcPrepDataContainerCnv()
Muon::sTgcPrepDataContainerCnv_p1::createTransient
virtual Muon::sTgcPrepDataContainer * createTransient(const Muon::sTgcPrepDataContainer_p1 *persObj, MsgStream &log)
Definition: sTgcPrepDataContainerCnv_p1.cxx:268
Muon::MuonPRD_Container_p2
Class to contain the Muon Prep Raw Data.
Definition: MuonPRD_Container_p2.h:26
sTgcPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: sTgcPrepDataContainerCnv.cxx:19
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
sTgcPrepDataContainerCnv.h
sTgcPrepDataContainerCnv::sTgcPrepDataContainerCnv
sTgcPrepDataContainerCnv(ISvcLocator *svcloc)
Definition: sTgcPrepDataContainerCnv.cxx:12
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
Muon::sTgcPrepDataContainerCnv_p2::createTransient
virtual Muon::sTgcPrepDataContainer * createTransient(const Muon::sTgcPrepDataContainer_p2 *persObj, MsgStream &log)
Definition: sTgcPrepDataContainerCnv_p2.cxx:268
sTgcPrepDataContainerCnv::m_converter_p1
Muon::sTgcPrepDataContainerCnv_p1 m_converter_p1
Definition: sTgcPrepDataContainerCnv.h:40
T_AthenaPoolCustCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
StoreGateSvc.h