Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AtlasIDDetDescrCnv.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 /***************************************************************************
6  InDet DetDescrCnv package
7  -----------------------------------------
8  ***************************************************************************/
9 
10 #include "AtlasIDDetDescrCnv.h"
11 
14 #include "GaudiKernel/MsgStream.h"
16 #include "StoreGate/StoreGateSvc.h"
17 
20 
21 //--------------------------------------------------------------------
22 
23 long int
25 {
26  return (storageType());
27 }
28 
29 //--------------------------------------------------------------------
30 
33 {
34  // First call parent init
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 
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>();
69  atlas_id->setMessageSvc(msgSvc());
70 
71  ATH_CHECK( idDictMgr->initializeHelper(*atlas_id) == 0 );
72 
73  // Pass a pointer to the container to the Persistency service by reference.
74  pObj = SG::asStorable(std::move(atlas_id));
75 
76  return StatusCode::SUCCESS;
77 
78 }
79 
80 //--------------------------------------------------------------------
81 
82 long int
84 {
85  return DetDescr_StorageType;
86 }
87 
88 //--------------------------------------------------------------------
89 const CLID&
92 }
93 
94 //--------------------------------------------------------------------
96  : DetDescrConverter(ClassID_traits<AtlasDetectorID>::ID(), svcloc, "AtlasIDDetDescrCnv")
97 {}
98 
99 
100 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DetDescr_StorageType
const long DetDescr_StorageType
Definition: DetDescrCnvSvc.cxx:20
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
StorableConversions.h
convert to and from a SG storable
initialize
void initialize()
Definition: run_EoverP.cxx:894
AtlasIDDetDescrCnv::repSvcType
virtual long int repSvcType() const override
Definition: AtlasIDDetDescrCnv.cxx:24
AtlasIDDetDescrCnv::initialize
virtual StatusCode initialize() override
Definition: AtlasIDDetDescrCnv.cxx:32
DetDescrAddress.h
IdDictManager.h
DetDescrConverter::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Handle to DetectorStore.
Definition: DetDescrConverter.h:33
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition: DataObjectSharedPtr.h:65
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
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
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:37
AtlasIDDetDescrCnv::storageType
static long int storageType()
Definition: AtlasIDDetDescrCnv.cxx:83
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AtlasIDDetDescrCnv::AtlasIDDetDescrCnv
AtlasIDDetDescrCnv(ISvcLocator *svcloc)
Definition: AtlasIDDetDescrCnv.cxx:95
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
AtlasIDDetDescrCnv::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj) override
Definition: AtlasIDDetDescrCnv.cxx:59
IdDictManager
IdDictManager is the interface to identifier dictionaries.
Definition: IdDictManager.h:36
AtlasIDDetDescrCnv::classID
static const CLID & classID()
Definition: AtlasIDDetDescrCnv.cxx:90
DetDescrConverter.h
ClassID_traits::ID
static CLID ID()
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
StoreGateSvc.h
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
AtlasIDDetDescrCnv.h