ATLAS Offline Software
Loading...
Searching...
No Matches
SiliconIDDetDescrCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9#include "GaudiKernel/MsgStream.h"
11
16
17
18//--------------------------------------------------------------------
19
20long int
22{
23 return (storageType());
24}
25
26//--------------------------------------------------------------------
27
28StatusCode
30{
31 ATH_CHECK( DetDescrConverter::initialize() );
32 return StatusCode::SUCCESS;
33}
34
35//--------------------------------------------------------------------
36
37StatusCode
38SiliconIDDetDescrCnv::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);
55 }
56
57 ATH_CHECK( idDictMgr->initializeHelper(*m_siliconId) == 0 );
58
59 // Pass a pointer to the container to the Persistency service by reference.
61
62 return StatusCode::SUCCESS;
63
64}
65
66//--------------------------------------------------------------------
67
68long
73
74//--------------------------------------------------------------------
75const CLID&
79
80//--------------------------------------------------------------------
82 :
83 DetDescrConverter(ClassID_traits<SiliconID>::ID(), svcloc, "SiliconIDDetDescrCnv"),
84 m_siliconId(nullptr)
85
86{}
87
88
89
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
std::vector< Identifier > ID
const long DetDescr_StorageType
uint32_t CLID
The Class ID type.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
This is an Identifier helper class for both the Pixel and SCT subdetectors.
DetDescrConverter(const CLID &myCLID, ISvcLocator *svcloc, const char *name=nullptr)
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
IdDictManager is the interface to identifier dictionaries.
int initializeHelper(IdHelper &helper) const
Return value: 0 OK, >0 error.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
SiliconID * m_siliconId
The helper - only will create it once.
SiliconIDDetDescrCnv(ISvcLocator *svcloc)
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
virtual long int repSvcType() const override
virtual StatusCode initialize() override
static const CLID & classID()
This is an Identifier helper class for both the Pixel and SCT subdetectors.
Definition SiliconID.h:42
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Default, invalid implementation of ClassID_traits.