ATLAS Offline Software
Loading...
Searching...
No Matches
AtlasIDDetDescrCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6 InDet DetDescrCnv package
7 -----------------------------------------
8 ***************************************************************************/
9
10#include "AtlasIDDetDescrCnv.h"
11
14#include "GaudiKernel/MsgStream.h"
17
20
21//--------------------------------------------------------------------
22
23long int
25{
26 return (storageType());
27}
28
29//--------------------------------------------------------------------
30
31StatusCode
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
58StatusCode
59AtlasIDDetDescrCnv::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
81long int
86
87//--------------------------------------------------------------------
88const CLID&
92
93//--------------------------------------------------------------------
95 : DetDescrConverter(ClassID_traits<AtlasDetectorID>::ID(), svcloc, "AtlasIDDetDescrCnv")
96{}
97
98
99
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
std::vector< Identifier > ID
const long DetDescr_StorageType
uint32_t CLID
The Class ID type.
convert to and from a SG storable
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
AtlasIDDetDescrCnv(ISvcLocator *svcloc)
virtual StatusCode initialize() override
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
static long int storageType()
static const CLID & classID()
virtual long int repSvcType() const override
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.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Default, invalid implementation of ClassID_traits.