ATLAS Offline Software
DistortedMaterialManager.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
10 #include "GaudiKernel/Bootstrap.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/ISvcLocator.h"
15 
16 namespace InDetDD {
18  : AthMessaging("ExtraMaterialManager")
19  {
20  if(initialize().isFailure())
21  throw std::runtime_error("Failed to initialize DistortedMaterialManager!");
22  }
23 
25  ISvcLocator* svcLocator = Gaudi::svcLocator();
26 
27  SmartIF<StoreGateSvc> detStore{svcLocator->service("DetectorStore")};
28  ATH_CHECK(detStore.isValid());
29 
30  SmartIF<IGeoDbTagSvc> geoDbTag{svcLocator->service("GeoDbTagSvc")};
31  ATH_CHECK(geoDbTag.isValid());
32 
33  SmartIF<IRDBAccessSvc> rdbSvc{svcLocator->service(geoDbTag->getParamSvcName())};
34  ATH_CHECK(rdbSvc.isValid());
35 
36  // Get version tag and node for InDet.
37  DecodeVersionKey versionKey("InnerDetector");
38  const std::string& detectorKey = versionKey.tag();
39  const std::string& detectorNode = versionKey.node();
40 
41  ATH_MSG_DEBUG("Retrieving Record Sets from database ...");
42  ATH_MSG_DEBUG("Key = " << detectorKey << " Node = " << detectorNode);
43 
44  m_xMatTable = rdbSvc->getRecordsetPtr("InDetExtraMaterial", detectorKey, detectorNode);
45  m_materialManager = detStore->tryRetrieve<StoredMaterialManager>("MATERIALS");
46 
47  ATH_MSG_DEBUG("Initialized InDet Distorted Material Manager");
48 
49  return StatusCode::SUCCESS;
50  }
51 
52 } // end namespace
AthCheckMacros.h
InDetDD::DistortedMaterialManager::m_xMatTable
IRDBRecordset_ptr m_xMatTable
Definition: DistortedMaterialManager.h:25
DecodeVersionKey::node
const std::string & node() const
Return the version node.
Definition: DecodeVersionKey.cxx:97
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition: DecodeVersionKey.h:18
DecodeVersionKey::tag
const std::string & tag() const
Return version tag.
Definition: DecodeVersionKey.cxx:91
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDetDD::DistortedMaterialManager::DistortedMaterialManager
DistortedMaterialManager()
Definition: DistortedMaterialManager.cxx:17
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
StoredMaterialManager.h
DecodeVersionKey.h
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
InDetDD::DistortedMaterialManager::initialize
StatusCode initialize()
Definition: DistortedMaterialManager.cxx:24
StoreGateSvc.h
InDetDD::DistortedMaterialManager::m_materialManager
StoredMaterialManager * m_materialManager
Definition: DistortedMaterialManager.h:24
IGeoDbTagSvc.h
DistortedMaterialManager.h