ATLAS Offline Software
Loading...
Searching...
No Matches
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
16namespace 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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Definition of the abstract IRDBAccessSvc interface.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
const std::string & tag() const
Return version tag.
const std::string & node() const
Return the version node.
This class holds one or more material managers and makes them storeable, under StoreGate.
Message Stream Member.