ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
IdDictDetDescrCnv
src
AtlasIDDetDescrCnv.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
/***************************************************************************
6
InDet DetDescrCnv package
7
-----------------------------------------
8
***************************************************************************/
9
10
#include "
AtlasIDDetDescrCnv.h
"
11
12
#include "
DetDescrCnvSvc/DetDescrConverter.h
"
13
#include "
DetDescrCnvSvc/DetDescrAddress.h
"
14
#include "GaudiKernel/MsgStream.h"
15
#include "
AthenaKernel/StorableConversions.h
"
16
#include "
StoreGate/StoreGateSvc.h
"
17
18
#include "
IdDictDetDescr/IdDictManager.h
"
19
#include "
AtlasDetDescr/AtlasDetectorID.h
"
20
21
//--------------------------------------------------------------------
22
23
long
int
24
AtlasIDDetDescrCnv::repSvcType
()
const
25
{
26
return
(
storageType
());
27
}
28
29
//--------------------------------------------------------------------
30
31
StatusCode
32
AtlasIDDetDescrCnv::initialize
()
33
{
34
// First call parent init
35
ATH_CHECK
( DetDescrConverter::initialize() );
36
37
// The following is an attempt to "bootstrap" the loading of a
38
// proxy for AtlasDetectorID into the detector store. However,
39
// AtlasIDDetDescrCnv::initialize is NOT called by the conversion
40
// service. So for the moment, this cannot be use. Instead the
41
// DetDescrCnvSvc must do the bootstrap from a parameter list.
42
43
44
// // Add InDet_DetDescrManager proxy as entry point to the detector store
45
// // - this is ONLY needed for the manager of each system
46
// sc = addToDetStore(classID(), "PidelID");
47
// if (sc.isFailure()) {
48
// log << MSG::FATAL << "Unable to add proxy for AtlasDetectorID to the Detector Store!" << endmsg;
49
// return StatusCode::FAILURE;
50
// } else {}
51
52
return
StatusCode::SUCCESS;
53
}
54
55
56
//--------------------------------------------------------------------
57
58
StatusCode
59
AtlasIDDetDescrCnv::createObj
(IOpaqueAddress*
/*pAddr*/
, DataObject*& pObj)
60
{
61
ATH_MSG_INFO
(
"in createObj: creating a AtlasDetectorID helper object in the detector store"
);
62
63
// Get the dictionary manager from the detector store
64
const
IdDictManager
* idDictMgr;
65
ATH_CHECK
(
detStore
()->retrieve(idDictMgr,
"IdDict"
) );
66
67
// create the helper
68
auto
atlas_id = std::make_unique<AtlasDetectorID>(
"IdDict"
,
""
);
69
70
ATH_CHECK
( idDictMgr->
initializeHelper
(*atlas_id) == 0 );
71
72
// Pass a pointer to the container to the Persistency service by reference.
73
pObj =
SG::asStorable
(std::move(atlas_id));
74
75
return
StatusCode::SUCCESS;
76
77
}
78
79
//--------------------------------------------------------------------
80
81
long
int
82
AtlasIDDetDescrCnv::storageType
()
83
{
84
return
DetDescr_StorageType
;
85
}
86
87
//--------------------------------------------------------------------
88
CLID
89
AtlasIDDetDescrCnv::classID
() {
90
return
ClassID_traits<AtlasDetectorID>::ID
();
91
}
92
93
//--------------------------------------------------------------------
94
AtlasIDDetDescrCnv::AtlasIDDetDescrCnv
(ISvcLocator* svcloc)
95
:
DetDescrConverter
(
ClassID_traits
<
AtlasDetectorID
>::ID(), svcloc,
"AtlasIDDetDescrCnv"
)
96
{}
97
98
99
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
AtlasIDDetDescrCnv.h
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
StorableConversions.h
convert to and from a SG storable
StoreGateSvc.h
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition
AtlasDetectorID.h:53
AtlasIDDetDescrCnv::classID
static CLID classID()
Definition
AtlasIDDetDescrCnv.cxx:89
AtlasIDDetDescrCnv::AtlasIDDetDescrCnv
AtlasIDDetDescrCnv(ISvcLocator *svcloc)
Definition
AtlasIDDetDescrCnv.cxx:94
AtlasIDDetDescrCnv::initialize
virtual StatusCode initialize() override
Definition
AtlasIDDetDescrCnv.cxx:32
AtlasIDDetDescrCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
Definition
AtlasIDDetDescrCnv.cxx:59
AtlasIDDetDescrCnv::storageType
static long int storageType()
Definition
AtlasIDDetDescrCnv.cxx:82
AtlasIDDetDescrCnv::repSvcType
virtual long int repSvcType() const override
Definition
AtlasIDDetDescrCnv.cxx:24
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
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