ATLAS Offline Software
TRT_DriftCircleContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <memory>
9 
10 #include <iostream>
11 
13  : TRT_DriftCircleContainerCnvBase(svcloc, "TRT_DriftCircleContainerCnv"),
14  m_converter_p0()
15  {}
16 
17 
19  ATH_MSG_INFO("TRT_DriftCircleContainerCnv::initialize()");
20 
22 
23  // Get the trt helper from the detector store
24  const TRT_ID* idhelper(nullptr);
25  ATH_CHECK( detStore()->retrieve(idhelper, "TRT_ID") );
26 
28 
29  ATH_MSG_DEBUG("Converter initialized");
30 
31  return StatusCode::SUCCESS;
32 }
33 
34 
36 
37  static const pool::Guid p0_guid("A99630C5-3D7C-4DB4-9E6C-FC3CEF981895"); // before t/p split
38  static const pool::Guid p1_guid("42B48D79-AF4E-4D45-AAA9-A2BA5A033534"); // with TRT_DriftCircle_tlp1
39  static const pool::Guid p2_guid("36195EDE-941C-424B-81A1-E04C867C35D8"); // with TRT_DriftCircle_p2
40  ATH_MSG_DEBUG("createTransient(): main converter");
41  InDet::TRT_DriftCircleContainer* p_collection(nullptr);
42  if( compareClassGuid(p2_guid) ) {
43  ATH_MSG_DEBUG("createTransient(): T/P version 2 detected");
44  std::unique_ptr< InDet::TRT_DriftCircleContainer_p2 > col_vect( poolReadObject< InDet::TRT_DriftCircleContainer_p2 >() );
45  ATH_MSG_DEBUG("Delegate TP converter ");
46  p_collection = m_TPConverter2.createTransient( col_vect.get(), msg() );
47  }
48  else if( compareClassGuid(p1_guid) ) {
49  ATH_MSG_DEBUG("createTransient(): T/P version 1 detected");
50  std::unique_ptr< InDet::TRT_DriftCircleContainer_tlp1 > p_coll( poolReadObject< InDet::TRT_DriftCircleContainer_tlp1 >() );
51  p_collection = m_TPConverter.createTransient( p_coll.get(), msg() );
52  }
53  //----------------------------------------------------------------
54  else if( compareClassGuid(p0_guid) ) {
55  ATH_MSG_DEBUG("createTransient(): Old input file");
56  std::unique_ptr< TRT_DriftCircleContainer_p0 > col_vect( poolReadObject< TRT_DriftCircleContainer_p0 >() );
57  p_collection = m_converter_p0.createTransient( col_vect.get(), msg() );
58  }
59  else {
60  throw std::runtime_error("Unsupported persistent version of TRT_DriftCircleContainer");
61 
62  }
63  return p_collection;
64 }
65 
66 
69  return trtdc_p;
70 }
71 
72 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
InDet::TRT_DriftCircleContainer_p2
Definition: TRT_DriftCircleContainer_p2.h:21
TRT_DriftCircleContainerCnv::TRT_DriftCircleContainerCnv
TRT_DriftCircleContainerCnv(ISvcLocator *svcloc)
Definition: TRT_DriftCircleContainerCnv.cxx:12
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TRT_DriftCircleContainerCnv::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
Definition: TRT_DriftCircleContainerCnv.cxx:18
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
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
TRT_DriftCircleContainerCnv::m_TPConverter
TRT_DriftCircleContainerCnv_tlp1 m_TPConverter
Definition: TRT_DriftCircleContainerCnv.h:30
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT_DriftCircleContainerCnv.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TRT_DriftCircleContainerCnv::createPersistent
virtual TRT_DriftCircleContainer_PERS * createPersistent(InDet::TRT_DriftCircleContainer *transCont) override
Definition: TRT_DriftCircleContainerCnv.cxx:67
TRT_DriftCircleContainerCnv::m_TPConverter2
TRT_DriftCircleContainerCnv_p2 m_TPConverter2
Definition: TRT_DriftCircleContainerCnv.h:31
AthenaPoolConverter::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
Definition: AthenaPoolConverter.h:69
TRT_DriftCircleContainerCnv_p2::createTransient
virtual InDet::TRT_DriftCircleContainer * createTransient(const InDet::TRT_DriftCircleContainer_p2 *persObj, MsgStream &log)
Definition: TRT_DriftCircleContainerCnv_p2.cxx:200
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
InDet::TRT_DriftCircleContainer
Trk::PrepRawDataContainer< TRT_DriftCircleCollection > TRT_DriftCircleContainer
Definition: TRT_DriftCircleContainer.h:27
TRT_DriftCircleContainerCnv::createTransient
virtual InDet::TRT_DriftCircleContainer * createTransient() override
Definition: TRT_DriftCircleContainerCnv.cxx:35
TRT_DriftCircleContainerCnv_p0::createTransient
virtual InDet::TRT_DriftCircleContainer * createTransient(const TRT_DriftCircleContainer_p0 *, MsgStream &) override
Definition: TRT_DriftCircleContainerCnv_p0.h:38
TRT_DriftCircleContainerCnv::m_converter_p0
TRT_DriftCircleContainerCnv_p0 m_converter_p0
Definition: TRT_DriftCircleContainerCnv.h:29
TRT_ID
Definition: TRT_ID.h:84
TRT_DriftCircleContainerCnv_p0::initialize
StatusCode initialize(MsgStream &log)
Definition: TRT_DriftCircleContainerCnv_p0.cxx:26
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: