ATLAS Offline Software
ServiceExtensionTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "ServiceExtensionTool.h"
5 
6 #include <GeoModelKernel/GeoPhysVol.h>
8 #include "GeoModelXml/GmxInterface.h"
9 #include <SGTools/DataProxy.h>
11 
12 namespace ITk
13 {
14 
16  const std::string &name,
17  const IInterface *parent)
19 {
20 }
21 
23 {
24  // retrieve the common stuff
26 
27  GeoModelExperiment *theExpt = nullptr;
28  ATH_CHECK(detStore()->retrieve(theExpt, "ATLAS"));
30 
31  const GeoModelIO::ReadGeoModel* sqlreader = getSqliteReader();
32 
33  if(!sqlreader){
34  if (!isAvailable(m_node, m_table)) {
35  ATH_MSG_ERROR("No ServiceExtension geometry found. ServiceExtension can not be built.");
36  return StatusCode::FAILURE;
37  }
38  }
39  ATH_MSG_INFO("Building Service Extension");
40 
41  GeoPhysVol *world = &*theExpt->getPhysVol();
42 
43  // Load the geometry, create the volume,
44  // node,table are the location in the DB to look for the clob
45  // empty strings are the (optional) containing detector and envelope names
46  // allowed to pass a null sqlreader ptr - it will be used to steer the source of the geometry
47  GmxInterface gmxInterface;
48  const GeoVPhysVol * topVol = createTopVolume(world, gmxInterface, m_node,m_table, m_containingDetectorName, m_envelopeVolumeName,sqlreader);
49  if (!topVol) {
50  ATH_MSG_FATAL("Could not find the Top Volume!!!");
51  return StatusCode::FAILURE;
52  }
53 
54  manager->addTreeTop(topVol);
56 
57  ATH_CHECK(detStore()->record(m_detManager, m_detManager->getName()));
58  theExpt->addManager(m_detManager);
59 
60  return StatusCode::SUCCESS;
61 }
62 
63 
64 } // namespace ITk
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
GeoModelXmlTool::createBaseTool
StatusCode createBaseTool()
Definition: GeoModelXmlTool.cxx:26
ITk::ServiceExtensionTool::create
virtual StatusCode create() override final
Definition: ServiceExtensionTool.cxx:22
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ITk::ServiceExtensionTool::m_table
Gaudi::Property< std::string > m_table
Definition: ServiceExtensionTool.h:31
ServiceExtensionTool.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
GeoModelExperiment
Definition: GeoModelExperiment.h:32
GeoModelXmlTool::isAvailable
bool isAvailable(const std::string &versionNode, const std::string &tableNode) const
Definition: GeoModelXmlTool.cxx:78
ITk::ServiceExtensionTool::m_node
Gaudi::Property< std::string > m_node
Definition: ServiceExtensionTool.h:30
ITk::ServiceExtensionTool::m_detManager
const ServiceExtensionManager * m_detManager
Definition: ServiceExtensionTool.h:27
GeoModelExperiment.h
GeoModelXmlTool::createTopVolume
const GeoVPhysVol * createTopVolume(GeoPhysVol *worldVol, GmxInterface &interface, const std::string &versionNode, const std::string &tableNode, const std::string &containingDetector="", const std::string &envelopeName="", const GeoModelIO::ReadGeoModel *sqlreader=nullptr) const
Definition: GeoModelXmlTool.cxx:35
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
GeoModelXmlTool::getSqliteReader
GeoModelIO::ReadGeoModel * getSqliteReader() const
Definition: GeoModelXmlTool.cxx:174
ITk::ServiceExtensionTool::m_ServiceExtensionManagerName
Gaudi::Property< std::string > m_ServiceExtensionManagerName
Definition: ServiceExtensionTool.h:32
GeoModelTool::manager
virtual GeoVDetectorManager * manager()
The Detector Node corresponding to this tool.
Definition: GeoModelTool.cxx:21
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ITk::ServiceExtensionTool::ServiceExtensionTool
ServiceExtensionTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ServiceExtensionTool.cxx:15
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
ITk
Definition: ITkPixelOfflineCalibCondAlg.cxx:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
ITk::ServiceExtensionManager
Definition: ServiceExtensionManager.h:22
ServiceExtensionManager.h
GeoModelXmlTool
Definition: GeoModelXmlTool.h:21
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ITk::ServiceExtensionTool::m_containingDetectorName
Gaudi::Property< std::string > m_containingDetectorName
Definition: ServiceExtensionTool.h:28
ITk::ServiceExtensionTool::m_envelopeVolumeName
Gaudi::Property< std::string > m_envelopeVolumeName
Definition: ServiceExtensionTool.h:29
DataProxy.h