ATLAS Offline Software
MdtPrepDataContainerCnv.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 // Gaudi
8 #include "GaudiKernel/StatusCode.h"
9 #include "GaudiKernel/MsgStream.h"
10 
11 // Athena
12 #include "StoreGate/StoreGateSvc.h"
13 
14 // Id includes
18 
19 
20 
23 {
24 }
25 
27 
29  // Call base clase initialize
30  if( !MdtPrepDataContainerCnvBase::initialize().isSuccess() )
31  return StatusCode::FAILURE;
32 
33  // msgSvc()->setOutputLevel( "MdtPrepDataContainerCnv", MSG::DEBUG );
34 
35  // Get the messaging service, print where you are
36  MsgStream log(msgSvc(), "MdtPrepDataContainerCnv");
37  log << MSG::INFO << "MdtPrepDataContainerCnv::initialize()" << endmsg;
38  return StatusCode::SUCCESS;
39 }
40 
42  MsgStream log(msgSvc(), "MdtPrepDataContainerCnv" );
43  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg;
45  return pixdc_p;
46 }
47 
49  MsgStream log(msgSvc(), "MdtPrepDataContainerCnv" );
50  static const pool::Guid p0_guid("7479AE0B-3E99-4344-E6A5-3DDF78E1A363"); // before t/p split
51  static const pool::Guid p1_guid("7E3F92F5-FAFF-45C3-A8F5-386B3CD56A7B"); // with MdtPrepDataContainerCnv_tlp1
52  static const pool::Guid p2_guid("BBC02355-570A-4C28-81A6-65F23779509E"); // with MdtPrepDataContainerCnv_p2
53  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): main converter"<<endmsg;
54  Muon::MdtPrepDataContainer* p_collection(nullptr);
55  if( compareClassGuid(p2_guid) ) {
56  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 2 detected"<<endmsg;
57  std::unique_ptr< MdtPrepDataContainer_PERS > col_vect( poolReadObject< MdtPrepDataContainer_PERS >() );
58  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Delegate TP converter " << endmsg;
59  p_collection = m_converter_p2.createTransient( col_vect.get(), log );
60  } else if( compareClassGuid(p1_guid) ) {
61  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 1 detected"<<endmsg;
62  poolReadObject< MdtPrepDataContainer_PERS >( m_converter_tlp1 );
63  p_collection = m_converter_tlp1.createTransient( log );
64  }
65  else {
66  throw std::runtime_error("Unsupported persistent version of MdtPrepDataContainer");
67  }
68  return p_collection;
69 }
MdtReadoutElement.h
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
MdtPrepDataContainerCnv::m_converter_tlp1
MdtPrepDataContainerCnv_tlp1 m_converter_tlp1
'Old style' top level convertor
Definition: MdtPrepDataContainerCnv.h:43
MdtPrepDataContainerCnv::MdtPrepDataContainerCnv
MdtPrepDataContainerCnv(ISvcLocator *svcloc)
Definition: MdtPrepDataContainerCnv.cxx:21
MdtPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: MdtPrepDataContainerCnv.cxx:28
MdtPrepDataContainerCnv::m_converter_p2
Muon::MdtPrepDataContainerCnv_p2 m_converter_p2
New, flattened convertor.
Definition: MdtPrepDataContainerCnv.h:44
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
MdtPrepDataContainer.h
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition: TopLevelTPConverter.h:62
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
MdtPrepDataContainerCnv::createTransient
virtual Muon::MdtPrepDataContainer * createTransient()
Definition: MdtPrepDataContainerCnv.cxx:48
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
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
MdtIdHelper.h
MdtPrepDataContainerCnv.h
Muon::MuonPRD_Container_p2
Class to contain the Muon Prep Raw Data.
Definition: MuonPRD_Container_p2.h:26
Muon::MdtPrepDataContainerCnv_p2::createTransient
virtual Muon::MdtPrepDataContainer * createTransient(const Muon::MdtPrepDataContainer_p2 *persObj, MsgStream &log)
Definition: MdtPrepDataContainerCnv_p2.cxx:187
MdtPrepDataContainerCnv::createPersistent
virtual MdtPrepDataContainer_PERS * createPersistent(Muon::MdtPrepDataContainer *transCont)
Definition: MdtPrepDataContainerCnv.cxx:41
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
T_AthenaPoolCustCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
StoreGateSvc.h
MdtPrepDataContainerCnv::~MdtPrepDataContainerCnv
virtual ~MdtPrepDataContainerCnv()