ATLAS Offline Software
PixelClusterContainerCnv.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 
9 #include <memory>
10 
11 #include <iostream>
12 
14  : PixelClusterContainerCnvBase(svcloc, "PixelClusterContainerCnv"),
15  m_converter_p0()
16  {}
17 
18 
20  ATH_MSG_INFO("PixelClusterContainerCnv::initialize()");
21 
23 
24  // Get the pixel helper from the detector store
25  const PixelID* idhelper(nullptr);
26  ATH_CHECK( detStore()->retrieve(idhelper, "PixelID") );
27 
29 
30  ATH_MSG_DEBUG("Converter initialized");
31 
32  return StatusCode::SUCCESS;
33 }
34 
35 
37  static const pool::Guid p0_guid("37B00A31-EA80-45DF-9A3F-2721EC0F0DA6"); // before t/p split
38  static const pool::Guid p1_guid("9DB54746-8C4E-4A56-8B4C-0E5D42905218"); // with PixelCluster_tlp1
39  static const pool::Guid p2_guid("DE48E26B-9E03-4EAD-86B9-351AD88D060E"); // with pixelCluster_p2
40  static const pool::Guid p3_guid("7BF0F163-B227-434C-86A6-16130E005E6C"); // with pixelCluster_p3
41  ATH_MSG_DEBUG("createTransient(): main converter");
42  InDet::PixelClusterContainer* p_collection(nullptr);
43  if( compareClassGuid(p3_guid) ) {
44  ATH_MSG_DEBUG("createTransient(): T/P version 3 detected");
45  std::unique_ptr< InDet::PixelClusterContainer_p3 > p_coll( poolReadObject< InDet::PixelClusterContainer_p3 >() );
46  p_collection = m_converter_p3.createTransient( p_coll.get(), msg() );
47  } else if( compareClassGuid(p2_guid) ) {
48  ATH_MSG_DEBUG("createTransient(): T/P version 2 detected");
49  std::unique_ptr< InDet::PixelClusterContainer_p2 > p_coll( poolReadObject< InDet::PixelClusterContainer_p2 >() );
50  p_collection = m_converter_p2.createTransient( p_coll.get(), msg() );
51  } else if( compareClassGuid(p1_guid) ) {
52  ATH_MSG_DEBUG("createTransient(): T/P version 1 detected");
53  std::unique_ptr< InDet::PixelClusterContainer_tlp1 > p_coll( poolReadObject< InDet::PixelClusterContainer_tlp1 >() );
54  p_collection = m_TPConverter.createTransient( p_coll.get(), msg() );
55  }
56  //----------------------------------------------------------------
57  else if( compareClassGuid(p0_guid) ) {
58  ATH_MSG_DEBUG("createTransient(): Old input file");
59 
60  std::unique_ptr< PixelClusterContainer_p0 > col_vect( poolReadObject< PixelClusterContainer_p0 >() );
61  p_collection = m_converter_p0.createTransient( col_vect.get(), msg() );
62  }
63  else {
64  throw std::runtime_error("Unsupported persistent version of PixelClusterContainer");
65 
66  }
67  return p_collection;
68 }
69 
70 
73  return pixdc_p;
74 }
75 
76 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PixelClusterContainerCnv::m_TPConverter
PixelClusterContainerCnv_tlp1 m_TPConverter
Definition: PixelClusterContainerCnv.h:36
InDet::PixelClusterContainer
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelClusterContainer.h:28
PixelClusterContainerCnv::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
Definition: PixelClusterContainerCnv.cxx:19
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
PixelClusterContainerCnv_p0::createTransient
virtual InDet::PixelClusterContainer * createTransient(const PixelClusterContainer_p0 *, MsgStream &) override
Definition: PixelClusterContainerCnv_p0.h:32
PixelClusterContainerCnv.h
PixelClusterContainerCnv_p2::createTransient
virtual InDet::PixelClusterContainer * createTransient(const InDet::PixelClusterContainer_p2 *persObj, MsgStream &log)
Definition: PixelClusterContainerCnv_p2.cxx:168
PixelClusterContainerCnv_p0::initialize
StatusCode initialize(MsgStream &log)
Definition: PixelClusterContainerCnv_p0.cxx:33
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
PixelClusterContainerCnv::m_converter_p2
PixelClusterContainerCnv_p2 m_converter_p2
Definition: PixelClusterContainerCnv.h:34
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PixelClusterContainerCnv::m_converter_p0
PixelClusterContainerCnv_p0 m_converter_p0
Definition: PixelClusterContainerCnv.h:33
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaPoolConverter::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
Definition: AthenaPoolConverter.h:69
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
PixelClusterContainerCnv_p3::createTransient
virtual InDet::PixelClusterContainer * createTransient(const InDet::PixelClusterContainer_p3 *persObj, MsgStream &log)
Definition: PixelClusterContainerCnv_p3.cxx:187
PixelClusterContainerCnv::PixelClusterContainerCnv
PixelClusterContainerCnv(ISvcLocator *svcloc)
Definition: PixelClusterContainerCnv.cxx:13
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
PixelClusterContainerCnv::m_converter_p3
PixelClusterContainerCnv_p3 m_converter_p3
Definition: PixelClusterContainerCnv.h:35
InDet::PixelClusterContainer_p3
Definition: PixelClusterContainer_p3.h:21
T_AthenaPoolCustCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
PixelID
Definition: PixelID.h:67
StoreGateSvc.h
PixelClusterContainerCnv::createPersistent
virtual PixelClusterContainer_PERS * createPersistent(InDet::PixelClusterContainer *transCont) override
Definition: PixelClusterContainerCnv.cxx:71
PixelClusterContainerCnv::createTransient
virtual InDet::PixelClusterContainer * createTransient() override
Definition: PixelClusterContainerCnv.cxx:36