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