ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
HighGranularityTimingDetector
HGTD_DetDescr
HGTD_GeoModelXml
src
HGTD_GMX_DetectorTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
HGTD_GMX_DetectorTool.h
"
6
#include "
HGTD_GmxInterface.h
"
7
8
#include <
HGTD_ReadoutGeometry/HGTD_DetectorManager.h
>
9
10
#include <GeoModelKernel/GeoPhysVol.h>
11
#include <
GeoModelUtilities/GeoModelExperiment.h
>
12
#include <
SGTools/DataProxy.h
>
13
#include <
DetDescrConditions/AlignableTransformContainer.h
>
14
15
16
HGTD_GMX_DetectorTool::HGTD_GMX_DetectorTool
(
const
std::string &
type
,
17
const
std::string &name,
18
const
IInterface *parent)
19
:
GeoModelXmlTool
(
type
, name, parent)
20
{
21
}
22
23
24
StatusCode
HGTD_GMX_DetectorTool::create
()
25
{
26
// retrieve the common stuff
27
ATH_CHECK
(
createBaseTool
());
28
29
const
HGTD_ID
*idHelper{};
30
ATH_CHECK
(detStore()->retrieve(idHelper,
"HGTD_ID"
));
31
32
GeoModelExperiment
*theExpt{};
33
ATH_CHECK
(detStore()->retrieve(theExpt,
"ATLAS"
));
34
35
m_commonItems
= std::make_unique<InDetDD::SiCommonItems>(idHelper);
36
37
//
38
// Check the availability
39
//
40
std::string
node
{
"InnerDetector"
};
41
std::string table{
"HGTDXDD"
};
42
43
GeoModelIO::ReadGeoModel* sqlreader =
getSqliteReader
();
44
45
if
(!sqlreader){
46
if
(!
isAvailable
(
node
, table)) {
47
ATH_MSG_ERROR
(
"No HGTD geometry found. HGTD can not be built."
);
48
return
StatusCode::FAILURE;
49
}
50
}
51
//
52
// Create the detector manager
53
//
54
// The * converts a ConstPVLink to a ref to a GeoVPhysVol
55
// The & takes the address of the GeoVPhysVol
56
GeoPhysVol *world = &*theExpt->
getPhysVol
();
57
auto
*
manager
=
new
HGTD_DetectorManager
(&*detStore());
58
59
// --------------------------------------------------
60
// Alignment folder setup
61
// --------------------------------------------------
62
if
(
m_alignable
) {
63
ATH_MSG_DEBUG
(
"HGTD alignment enabled (GeoModel level only)"
);
64
}
65
else
{
66
ATH_MSG_DEBUG
(
"HGTD alignment DISABLED"
);
67
}
68
69
HGTD_GmxInterface
gmxInterface(
manager
,
m_commonItems
.get());
70
71
// Load the geometry, create the volume,
72
// node,table are the location in the DB to look for the clob
73
// empty strings are the (optional) containing detector and envelope names
74
// allowed to pass a null sqlreader ptr - it will be used to steer the source of the geometry
75
const
GeoVPhysVol* topVolume =
createTopVolume
(world, gmxInterface,
node
, table,
""
,
""
,sqlreader);
76
// if we are using SQLite inputs,
77
if
(sqlreader){
78
bool
useNewIdentifierScheme = idHelper->
get_useNewIdentifierScheme
();
79
if
(useNewIdentifierScheme){
80
ATH_MSG_DEBUG
(
"Building HGTD Readout Geometry from SQLite using "
<<
m_geoDbTagSvc
->getParamSvcName());
81
gmxInterface.
buildReadoutGeometryFromSqlite
(
m_sqliteReadSvc
.operator->(),sqlreader);
82
}
else
{
83
ATH_MSG_FATAL
(
"SQLite workflow is unsupported for old HGTD identifier scheme!"
);
84
return
StatusCode::FAILURE;
85
}
86
}
87
88
if
(topVolume) {
//see that a valid pointer is returned
89
manager
->addTreeTop(topVolume);
90
}
else
{
91
ATH_MSG_FATAL
(
"Could not find the Top Volume!!!"
);
92
return
StatusCode::FAILURE;
93
}
94
95
// set the manager
96
m_detManager
=
manager
;
97
98
// getName here will return whatever is passed as name to DetectorFactory - make this more explicit?
99
ATH_CHECK
(detStore()->record(
m_detManager
,
m_detManager
->getName()));
100
theExpt->
addManager
(
m_detManager
);
101
102
return
StatusCode::SUCCESS;
103
}
104
105
106
StatusCode
HGTD_GMX_DetectorTool::clear
()
107
{
108
// Release manager from the detector store
109
SG::DataProxy
* proxy = detStore()->proxy(
ClassID_traits< HGTD_DetectorManager >::ID
(),
m_detManager
->getName());
110
if
(proxy) {
111
proxy->reset();
112
m_detManager
=
nullptr
;
113
}
114
115
return
StatusCode::SUCCESS;
116
}
AlignableTransformContainer.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
DataProxy.h
GeoModelExperiment.h
HGTD_DetectorManager.h
HGTD_GMX_DetectorTool.h
HGTD_GmxInterface.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::m_sqliteReadSvc
ServiceHandle< IRDBAccessSvc > m_sqliteReadSvc
Definition
GeoModelXmlTool.h:44
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::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition
GeoModelXmlTool.h:45
GeoModelXmlTool::getSqliteReader
GeoModelIO::ReadGeoModel * getSqliteReader() const
Definition
GeoModelXmlTool.cxx:174
HGTD_DetectorManager
The Detector manager has methods to retrieve the Identifier helper and methods to retrieve the detect...
Definition
HGTD_DetectorManager.h:42
HGTD_GMX_DetectorTool::m_commonItems
std::unique_ptr< InDetDD::SiCommonItems > m_commonItems
Definition
HGTD_GMX_DetectorTool.h:28
HGTD_GMX_DetectorTool::m_alignable
Gaudi::Property< bool > m_alignable
Definition
HGTD_GMX_DetectorTool.h:30
HGTD_GMX_DetectorTool::m_detManager
const HGTD_DetectorManager * m_detManager
Definition
HGTD_GMX_DetectorTool.h:27
HGTD_GMX_DetectorTool::clear
virtual StatusCode clear() override final
Definition
HGTD_GMX_DetectorTool.cxx:106
HGTD_GMX_DetectorTool::create
virtual StatusCode create() override final
Definition
HGTD_GMX_DetectorTool.cxx:24
HGTD_GMX_DetectorTool::HGTD_GMX_DetectorTool
HGTD_GMX_DetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
HGTD_GMX_DetectorTool.cxx:16
HGTD_GmxInterface
Definition
HGTD_GmxInterface.h:28
HGTD_GmxInterface::buildReadoutGeometryFromSqlite
void buildReadoutGeometryFromSqlite(IRDBAccessSvc *rdbAccessSvc, GeoModelIO::ReadGeoModel *sqlreader)
Definition
HGTD_GmxInterface.cxx:202
HGTD_ID
This is an Identifier helper class for the HGTD subdetector.
Definition
HGTD_ID.h:47
HGTD_ID::get_useNewIdentifierScheme
bool get_useNewIdentifierScheme() const
Definition
HGTD_ID.cxx:518
SG::DataProxy
Definition
DataProxy.h:45
node
Definition
node.h:24
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
type
Generated on
for ATLAS Offline Software by
1.17.0