ATLAS Offline Software
CavernInfraDetectorTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
12 
13 
15  const std::string& name,
16  const IInterface* parent )
18 {
19 }
20 
22 {
23  ServiceHandle<IGeoDbTagSvc> geoDbTag("GeoDbTagSvc", name());
24  ATH_CHECK(geoDbTag.retrieve());
25 
26  std::string cavernInfraVersion = geoDbTag->cavernInfraVersion();
27  if(cavernInfraVersion.empty()) {
28  ATH_MSG_INFO("No Cavern Infra version for the given configuration. Skip building CavernInfraGeoModel");
29  return StatusCode::SUCCESS;
30  }
31  else {
32  ATH_MSG_INFO("Building Cavern geometry version " << cavernInfraVersion);
33  }
34 
35  std::string versionNode = "CavernInfra";
36 
37  GeoModelExperiment* theExpt = nullptr;
38  ATH_CHECK(detStore()->retrieve(theExpt,"ATLAS"));
39 
40  GeoPhysVol *world=theExpt->getPhysVol();
41  ServiceHandle<IRDBAccessSvc> raccess("RDBAccessSvc",name());
42  ATH_CHECK(raccess.retrieve());
43 
44  if(!m_manager) {
45  CavernInfraDetectorFactory theCavernInfraFactory(detStore(),raccess);
46  theCavernInfraFactory.setTagNode(cavernInfraVersion,versionNode);
47  theCavernInfraFactory.create(world);
48  m_manager = theCavernInfraFactory.getDetectorManager();
49  }
50 
51  if(m_manager) {
52  theExpt->addManager(m_manager);
53  ATH_CHECK(detStore()->record(m_manager,m_manager->getName()));
54  }
55  else {
56  ATH_MSG_ERROR("ERROR. Failed to build Cavern Version " << cavernInfraVersion);
57  return StatusCode::FAILURE;
58  }
59 
60  return StatusCode::SUCCESS;
61 }
62 
64 {
66  if(proxy) {
67  proxy->reset();
68  m_manager = nullptr;
69  }
70  return StatusCode::SUCCESS;
71 }
72 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
CavernInfraDetectorTool::m_manager
const CavernInfraDetectorManager * m_manager
Definition: CavernInfraDetectorTool.h:21
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CavernInfraDetectorFactory
Definition: CavernInfraDetectorFactory.h:16
GeoModelExperiment
Definition: GeoModelExperiment.h:32
CavernInfraDetectorFactory.h
GeoModelExperiment.h
CavernInfraDetectorFactory::getDetectorManager
virtual const CavernInfraDetectorManager * getDetectorManager() const override
Definition: CavernInfraDetectorFactory.cxx:438
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GeoModelTool
Definition: GeoModelTool.h:17
CavernInfraDetectorTool.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CavernInfraDetectorFactory::create
virtual void create(GeoPhysVol *world) override
Definition: CavernInfraDetectorFactory.cxx:37
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CavernInfraDetectorTool::CavernInfraDetectorTool
CavernInfraDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CavernInfraDetectorTool.cxx:14
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CavernInfraDetectorTool::create
virtual StatusCode create() override
Definition: CavernInfraDetectorTool.cxx:21
CavernInfraDetectorManager.h
SG::DataProxy
Definition: DataProxy.h:44
CavernInfraDetectorTool::clear
virtual StatusCode clear() override
Definition: CavernInfraDetectorTool.cxx:63
CavernInfraDetectorFactory::setTagNode
void setTagNode(const std::string &tag, const std::string &node)
Definition: CavernInfraDetectorFactory.cxx:443
IGeoDbTagSvc.h
ServiceHandle< IGeoDbTagSvc >