ATLAS Offline Software
SiliconIDDetDescrCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "SiliconIDDetDescrCnv.h"
6 
9 #include "GaudiKernel/MsgStream.h"
10 #include "StoreGate/StoreGateSvc.h"
11 
15 #include "InDetIdentifier/SCT_ID.h"
16 
17 
18 //--------------------------------------------------------------------
19 
20 long int
22 {
23  return (storageType());
24 }
25 
26 //--------------------------------------------------------------------
27 
30 {
32  return StatusCode::SUCCESS;
33 }
34 
35 //--------------------------------------------------------------------
36 
38 SiliconIDDetDescrCnv::createObj(IOpaqueAddress* /*pAddr*/, DataObject*& pObj)
39 {
40  // Get the dictionary manager from the detector store
41  const IdDictManager* idDictMgr = nullptr;
42  ATH_CHECK( detStore()->retrieve(idDictMgr, "IdDict") );
43 
44  // Get both Pixel and SCT id helpers
45  const PixelID* pixelID = nullptr;
46  ATH_CHECK( detStore()->retrieve(pixelID, "PixelID") );
47 
48  const SCT_ID* sctID = nullptr;
49  ATH_CHECK( detStore()->retrieve(sctID, "SCT_ID") );
50 
51  if (!m_siliconId) {
52  // create the helper only once
53  ATH_MSG_DEBUG(" Create SiliconID. ");
54  m_siliconId = new SiliconID(pixelID, sctID);
56  }
57 
58  ATH_CHECK( idDictMgr->initializeHelper(*m_siliconId) == 0 );
59 
60  // Pass a pointer to the container to the Persistency service by reference.
62 
63  return StatusCode::SUCCESS;
64 
65 }
66 
67 //--------------------------------------------------------------------
68 
69 long
71 {
72  return DetDescr_StorageType;
73 }
74 
75 //--------------------------------------------------------------------
76 const CLID&
79 }
80 
81 //--------------------------------------------------------------------
83  :
84  DetDescrConverter(ClassID_traits<SiliconID>::ID(), svcloc, "SiliconIDDetDescrCnv"),
85  m_siliconId(nullptr)
86 
87 {}
88 
89 
90 
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...
SiliconIDDetDescrCnv::initialize
virtual StatusCode initialize() override
Definition: SiliconIDDetDescrCnv.cxx:29
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
AtlasDetectorID::setMessageSvc
virtual void setMessageSvc(IMessageSvc *msgSvc) override
Definition: AtlasDetectorID.cxx:748
DetDescr_StorageType
const long DetDescr_StorageType
Definition: DetDescrCnvSvc.cxx:20
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
initialize
void initialize()
Definition: run_EoverP.cxx:894
DetDescrAddress.h
SiliconIDDetDescrCnv::m_siliconId
SiliconID * m_siliconId
The helper - only will create it once.
Definition: SiliconIDDetDescrCnv.h:36
IdDictManager.h
DetDescrConverter::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
Definition: DetDescrConverter.h:33
SiliconIDDetDescrCnv::repSvcType
virtual long int repSvcType() const override
Definition: SiliconIDDetDescrCnv.cxx:21
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition: DataObjectSharedPtr.h:65
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
DetDescrConverter
Definition: DetDescrConverter.h:25
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
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
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
SiliconID.h
This is an Identifier helper class for both the Pixel and SCT subdetectors. This class defines identi...
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SiliconIDDetDescrCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
Definition: SiliconIDDetDescrCnv.cxx:38
IdDictManager::initializeHelper
int initializeHelper(IdHelper &helper) const
Return value: 0 OK, >0 error.
Definition: IdDictManager.cxx:44
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SiliconIDDetDescrCnv::classID
static const CLID & classID()
Definition: SiliconIDDetDescrCnv.cxx:77
IdDictManager
IdDictManager is the interface to identifier dictionaries.
Definition: IdDictManager.h:36
SiliconID
This is an Identifier helper class for both the Pixel and SCT subdetectors. This class defines identi...
Definition: SiliconID.h:44
SiliconIDDetDescrCnv::storageType
static long storageType()
Definition: SiliconIDDetDescrCnv.cxx:70
SCT_ID
Definition: SCT_ID.h:68
DetDescrConverter.h
SiliconIDDetDescrCnv::SiliconIDDetDescrCnv
SiliconIDDetDescrCnv(ISvcLocator *svcloc)
Definition: SiliconIDDetDescrCnv.cxx:82
PixelID
Definition: PixelID.h:67
SiliconIDDetDescrCnv.h
StoreGateSvc.h