ATLAS Offline Software
RpcPrepDataContainerCnv.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 
26 
28  // Call base clase initialize
29  if( !RpcPrepDataContainerCnvBase::initialize().isSuccess() )
30  return StatusCode::FAILURE;
31 
32  // msgSvc()->setOutputLevel( "RpcPrepDataContainerCnv", MSG::DEBUG );
33 
34  // Get the messaging service, print where you are
35  MsgStream log(msgSvc(), "RpcPrepDataContainerCnv");
36  log << MSG::INFO << "RpcPrepDataContainerCnv::initialize()" << endmsg;
37 
38  return StatusCode::SUCCESS;
39 }
40 
42  MsgStream log(msgSvc(), "RpcPrepDataContainerCnv" );
43  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createPersistent(): main converter"<<endmsg;
45  return pers;
46 }
47 
49  MsgStream log(msgSvc(), "RpcPrepDataContainerCnv" );
50  static const pool::Guid p0_guid("CCD4055C-2A39-CAFF-3F82-5A9116ADAFCB"); // before t/p split
51  static const pool::Guid p1_guid("F29233F8-F488-4D6D-97F9-4BCA1976BD9F"); // with RpcPrepData_tlp1
52  // static const pool::Guid p2_guid("F29233F8-F488-4D6D-97F9-4BCA1976BD9F"); // with RpcPrepData_tlp2
53  static const pool::Guid p3_guid("65496D1F-E660-42A9-84C9-2002D39B87CB"); // with RpcPrepDataContainer_p3
54 
55  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): main converter"<<endmsg;
56  Muon::RpcPrepDataContainer* p_collection(nullptr);
57  if( compareClassGuid(p3_guid) ) {
58  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 3 detected"<<endmsg;
59  std::unique_ptr< Muon::RpcPrepDataContainer_p3 > p_coll( poolReadObject< Muon::RpcPrepDataContainer_p3 >() );
60  p_collection = m_converter_p3.createTransient( p_coll.get(), log );
61  } else if( compareClassGuid(p1_guid) ) {
62  RpcPrepDataContainerCnv_tlp1 tpConvertor_p1;
63  std::unique_ptr< Muon::RpcPrepDataContainer_tlp1 > col_vect( poolReadObject< Muon::RpcPrepDataContainer_tlp1 >() );
64  p_collection = m_TPConverter.createTransient( col_vect.get(), log );
65  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): T/P version 1 detected"<<endmsg;
66  }
67  //----------------------------------------------------------------
68  else if( compareClassGuid(p0_guid) ) {
69  if (log.level() <= MSG::DEBUG) log<<MSG::DEBUG<<"createTransient(): Old input file"<<std::endl;
70  throw std::runtime_error("Not supporting reading non TP-split PRDs");
71  }
72  else {
73  throw std::runtime_error("Unsupported persistent version of RpcPrepDataContainer");
74 
75  }
76  return p_collection;
77 }
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
RpcPrepDataContainerCnv.h
RpcPrepDataContainerCnv::~RpcPrepDataContainerCnv
virtual ~RpcPrepDataContainerCnv()
RpcPrepDataContainer.h
RpcPrepDataContainerCnv::m_converter_p3
Muon::RpcPrepDataContainerCnv_p3 m_converter_p3
Definition: RpcPrepDataContainerCnv.h:46
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
RpcIdHelper.h
RpcPrepDataContainerCnv::createTransient
virtual Muon::RpcPrepDataContainer * createTransient()
Definition: RpcPrepDataContainerCnv.cxx:48
RpcPrepDataContainerCnv::createPersistent
virtual RpcPrepDataContainer_PERS * createPersistent(Muon::RpcPrepDataContainer *transCont)
Definition: RpcPrepDataContainerCnv.cxx:41
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
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
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
Muon::RpcPrepDataContainerCnv_p3::createTransient
virtual Muon::RpcPrepDataContainer * createTransient(const Muon::RpcPrepDataContainer_p3 *persObj, MsgStream &log)
Definition: RpcPrepDataContainerCnv_p3.cxx:237
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
RpcPrepDataContainerCnv::RpcPrepDataContainerCnv
RpcPrepDataContainerCnv(ISvcLocator *svcloc)
Definition: RpcPrepDataContainerCnv.cxx:21
RpcPrepDataContainerCnv::m_TPConverter
RpcPrepDataContainerCnv_tlp1 m_TPConverter
Definition: RpcPrepDataContainerCnv.h:45
Muon::MuonPRD_Container_p2
Class to contain the Muon Prep Raw Data.
Definition: MuonPRD_Container_p2.h:26
RpcPrepDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: RpcPrepDataContainerCnv.cxx:27
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RpcPrepDataContainerCnv_tlp1
Definition: RpcPrepDataContainerCnv_tlp1.h:23
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
RpcReadoutElement.h