ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
ServiceExtensionGeoModelXml
src
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>
7
#include <
GeoModelUtilities/GeoModelExperiment.h
>
8
#include "GeoModelXml/GmxInterface.h"
9
#include <
SGTools/DataProxy.h
>
10
#include "
ServiceExtensionManager.h
"
11
12
namespace
ITk
13
{
14
15
ServiceExtensionTool::ServiceExtensionTool
(
const
std::string &
type
,
16
const
std::string &name,
17
const
IInterface *parent)
18
:
GeoModelXmlTool
(
type
, name, parent)
19
{
20
}
21
22
StatusCode
ServiceExtensionTool::create
()
23
{
24
// retrieve the common stuff
25
ATH_CHECK
(
createBaseTool
());
26
27
GeoModelExperiment
*theExpt =
nullptr
;
28
ATH_CHECK
(detStore()->retrieve(theExpt,
"ATLAS"
));
29
auto
*
manager
=
new
ServiceExtensionManager
(
m_ServiceExtensionManagerName
);
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);
55
m_detManager
=
manager
;
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
DataProxy.h
GeoModelExperiment.h
ServiceExtensionManager.h
ServiceExtensionTool.h
GeoModelExperiment
Definition
GeoModelExperiment.h:32
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition
GeoModelExperiment.cxx:21
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition
GeoModelExperiment.cxx:40
GeoModelTool::manager
virtual GeoVDetectorManager * manager()
Definition
GeoModelTool.h:21
GeoModelXmlTool::createBaseTool
StatusCode createBaseTool()
Definition
GeoModelXmlTool.cxx:26
GeoModelXmlTool::isAvailable
bool isAvailable(const std::string &versionNode, const std::string &tableNode) const
Definition
GeoModelXmlTool.cxx:78
GeoModelXmlTool::GeoModelXmlTool
GeoModelXmlTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
GeoModelXmlTool.cxx:19
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
GeoModelXmlTool::getSqliteReader
GeoModelIO::ReadGeoModel * getSqliteReader() const
Definition
GeoModelXmlTool.cxx:174
ITk::ServiceExtensionManager
Definition
ServiceExtensionManager.h:22
ITk::ServiceExtensionTool::ServiceExtensionTool
ServiceExtensionTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
ServiceExtensionTool.cxx:15
ITk::ServiceExtensionTool::m_table
Gaudi::Property< std::string > m_table
Definition
ServiceExtensionTool.h:31
ITk::ServiceExtensionTool::m_detManager
const ServiceExtensionManager * m_detManager
Definition
ServiceExtensionTool.h:27
ITk::ServiceExtensionTool::m_envelopeVolumeName
Gaudi::Property< std::string > m_envelopeVolumeName
Definition
ServiceExtensionTool.h:29
ITk::ServiceExtensionTool::m_ServiceExtensionManagerName
Gaudi::Property< std::string > m_ServiceExtensionManagerName
Definition
ServiceExtensionTool.h:32
ITk::ServiceExtensionTool::m_node
Gaudi::Property< std::string > m_node
Definition
ServiceExtensionTool.h:30
ITk::ServiceExtensionTool::m_containingDetectorName
Gaudi::Property< std::string > m_containingDetectorName
Definition
ServiceExtensionTool.h:28
ITk::ServiceExtensionTool::create
virtual StatusCode create() override final
Definition
ServiceExtensionTool.cxx:22
ITk
Definition
ITkPixelOfflineCalibCondAlg.cxx:13
type
Generated on
for ATLAS Offline Software by
1.17.0