ATLAS Offline Software
DistortedMaterialManager.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 
11 #include "GaudiKernel/Bootstrap.h"
12 #include "GaudiKernel/MsgStream.h"
13 #include "GaudiKernel/ISvcLocator.h"
15 
16 namespace InDetDD {
18  ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap
19 
20  MsgStream log(Athena::getMessageSvc(), "ExtraMaterialManager");
21  log << MSG::DEBUG << "Initialized InDet Distorted Material Manager" << endmsg;
22 
23  StoreGateSvc* detStore{nullptr};
24  StatusCode sc = svcLocator->service("DetectorStore", detStore);
25  if (sc.isFailure()) log << MSG::FATAL << "Could not locate DetectorStore" << endmsg;
26 
27  IGeoDbTagSvc* geoDbTag{nullptr};
28  sc = svcLocator->service("GeoDbTagSvc",geoDbTag);
29  if (sc.isFailure()) log << MSG::FATAL << "Could not locate GeoDbTagSvc" << endmsg;
30 
31  IRDBAccessSvc* rdbSvc{nullptr};
32  sc = svcLocator->service(geoDbTag->getParamSvcName(), rdbSvc);
33  if (sc.isFailure()) log << MSG::FATAL << "Could not locate " << geoDbTag->getParamSvcName() << endmsg;
34 
35  // Get version tag and node for InDet.
36  DecodeVersionKey versionKey("InnerDetector");
37  const std::string& detectorKey = versionKey.tag();
38  const std::string& detectorNode = versionKey.node();
39 
40  log << MSG::DEBUG << "Retrieving Record Sets from database ..." << endmsg;
41  log << MSG::DEBUG << "Key = " << detectorKey << " Node = " << detectorNode << endmsg;
42 
43  m_xMatTable = rdbSvc->getRecordsetPtr("InDetExtraMaterial", detectorKey, detectorNode);
44  m_materialManager = detStore->tryRetrieve<StoredMaterialManager>("MATERIALS");
45  }
46 } // end namespace
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
InDetDD::DistortedMaterialManager::m_xMatTable
IRDBRecordset_ptr m_xMatTable
Definition: DistortedMaterialManager.h:22
DecodeVersionKey::node
const std::string & node() const
Return the version node.
Definition: DecodeVersionKey.cxx:99
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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:93
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
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
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
StoreGateSvc.h
InDetDD::DistortedMaterialManager::m_materialManager
StoredMaterialManager * m_materialManager
Definition: DistortedMaterialManager.h:21
IGeoDbTagSvc.h
DistortedMaterialManager.h