ATLAS Offline Software
STGC_RawDataContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
10  STGC_RawDataContainerCnvBase(svcloc, "STGC_RawDataContainerCnv")
11 {
12 }
13 
15 
17  // Call base clase initialize
19 
20  // Get the helper from the detector store
21  const sTgcIdHelper *idHelper;
22  ATH_CHECK( detStore()->retrieve(idHelper) );
23  m_TPConverter_p1.initialize(idHelper);
24  m_TPConverter_p2.initialize(idHelper);
25  m_TPConverter_p3.initialize(idHelper);
26 
27  return StatusCode::SUCCESS;
28 }
29 
31  return m_TPConverter_p3.createPersistent( transCont, msg() );
32 }
33 
36 {
37  using namespace Muon;
38 
39  STGC_RawDataContainer *transCont = nullptr;
40  static const pool::Guid p3_guid("693ACD72-6796-4251-A932-9ABAF679A2B3");
41  static const pool::Guid p2_guid("F66FDF31-1BFD-43DE-B793-93635D98597E");
42  static const pool::Guid p1_guid("E9229710-DB8A-447E-9546-4BAB079C7547");
43 
44  if( compareClassGuid(p3_guid) ) {
45  std::unique_ptr< STGC_RawDataContainer_p3 > cont( this->poolReadObject<STGC_RawDataContainer_p3>() );
46  const STGC_RawDataContainer_p3* constCont = cont.get();
47  transCont = m_TPConverter_p3.createTransient( constCont, msg() );
48 
49  } else if( compareClassGuid(p2_guid) ) {
50  std::unique_ptr< STGC_RawDataContainer_p2 > cont( this->poolReadObject<STGC_RawDataContainer_p2>() );
51  const STGC_RawDataContainer_p2* constCont = cont.get();
52  transCont = m_TPConverter_p2.createTransient( constCont, msg() );
53 
54  } else if( compareClassGuid(p1_guid) ) {
55  std::unique_ptr< STGC_RawDataContainer_p1 > cont( this->poolReadObject<STGC_RawDataContainer_p1>() );
56  const STGC_RawDataContainer_p1* constCont = cont.get();
57  transCont = m_TPConverter_p1.createTransient( constCont, msg() );
58 
59  } else {
60  throw std::runtime_error("Unsupported persistent version of STGC Raw Data (RDO) container");
61  }
62  return transCont;
63 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
STGC_RawDataContainerCnv::createTransient
virtual Muon::STGC_RawDataContainer * createTransient()
Definition: STGC_RawDataContainerCnv.cxx:35
Muon::STGC_RawDataContainerCnv_p2::initialize
void initialize(const sTgcIdHelper *idHelper)
Definition: STGC_RawDataContainerCnv_p2.cxx:74
Muon::STGC_RawDataContainer_p3
Definition: STGC_RawDataContainer_p3.h:14
STGC_RawDataContainerCnv::m_TPConverter_p1
Muon::STGC_RawDataContainerCnv_p1 m_TPConverter_p1
Definition: STGC_RawDataContainerCnv.h:33
sTgcIdHelper.h
STGC_RawDataContainerCnv::~STGC_RawDataContainerCnv
virtual ~STGC_RawDataContainerCnv()
STGC_RawDataContainerCnv.h
Muon::STGC_RawDataContainer_p2
Definition: STGC_RawDataContainer_p2.h:14
Muon::STGC_RawDataContainer
Definition: STGC_RawDataContainer.h:18
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
STGC_RawDataContainerCnv::STGC_RawDataContainerCnv
STGC_RawDataContainerCnv(ISvcLocator *svcloc)
Definition: STGC_RawDataContainerCnv.cxx:9
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
Muon::STGC_RawDataContainerCnv_p2::createTransient
virtual Muon::STGC_RawDataContainer * createTransient(const Muon::STGC_RawDataContainer_p2 *persObj, MsgStream &log) override final
Definition: STGC_RawDataContainerCnv_p2.cxx:63
Muon::STGC_RawDataContainer_p1
Definition: STGC_RawDataContainer_p1.h:14
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
STGC_RawDataContainerCnv::createPersistent
virtual STGC_RawDataContainer_PERS * createPersistent(Muon::STGC_RawDataContainer *transCont)
Definition: STGC_RawDataContainerCnv.cxx:30
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaPoolConverter::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
Definition: AthenaPoolConverter.h:69
STGC_RawDataContainerCnv::m_TPConverter_p2
Muon::STGC_RawDataContainerCnv_p2 m_TPConverter_p2
Definition: STGC_RawDataContainerCnv.h:34
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
Muon::STGC_RawDataContainerCnv_p3::createTransient
virtual Muon::STGC_RawDataContainer * createTransient(const Muon::STGC_RawDataContainer_p3 *persObj, MsgStream &log) override final
Definition: STGC_RawDataContainerCnv_p3.cxx:63
STGC_RawDataContainerCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: STGC_RawDataContainerCnv.cxx:16
sTgcIdHelper
Definition: sTgcIdHelper.h:55
Muon::STGC_RawDataContainerCnv_p1::createTransient
virtual Muon::STGC_RawDataContainer * createTransient(const Muon::STGC_RawDataContainer_p1 *persObj, MsgStream &log) override final
Definition: STGC_RawDataContainerCnv_p1.cxx:63
Muon::STGC_RawDataContainerCnv_p1::initialize
void initialize(const sTgcIdHelper *idHelper)
Definition: STGC_RawDataContainerCnv_p1.cxx:74
Muon::STGC_RawDataContainerCnv_p3::initialize
void initialize(const sTgcIdHelper *idHelper)
Definition: STGC_RawDataContainerCnv_p3.cxx:74
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
STGC_RawDataContainerCnv::m_TPConverter_p3
Muon::STGC_RawDataContainerCnv_p3 m_TPConverter_p3
Definition: STGC_RawDataContainerCnv.h:35