ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
PLRGeoModelXml
src
PLRDetectorTool.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 "
PLRDetectorTool.h
"
6
#include "
AthenaBaseComps/AthMsgStreamMacros.h
"
7
#include "
PLRGmxInterface.h
"
8
9
#include <
PixelReadoutGeometry/PixelDetectorManager.h
>
10
11
#include <
DetDescrConditions/AlignableTransformContainer.h
>
12
#include <GeoModelKernel/GeoPhysVol.h>
13
#include <
GeoModelUtilities/GeoModelExperiment.h
>
14
#include <
InDetIdentifier/PLR_ID.h
>
15
#include <
SGTools/DataProxy.h
>
16
17
18
PLRDetectorTool::PLRDetectorTool
(
const
std::string &
type
,
19
const
std::string &name,
20
const
IInterface *parent)
21
:
GeoModelXmlTool
(
type
, name, parent)
22
{
23
}
24
25
26
StatusCode
PLRDetectorTool::create
()
27
{
28
// retrieve the common stuff
29
ATH_CHECK
(
createBaseTool
());
30
31
GeoModelExperiment
*theExpt =
nullptr
;
32
ATH_CHECK
(detStore()->retrieve(theExpt,
"ATLAS"
));
33
const
PLR_ID
*idHelper =
nullptr
;
34
ATH_CHECK
(detStore()->retrieve(idHelper,
"PLR_ID"
));
35
36
m_commonItems
= std::make_unique<InDetDD::SiCommonItems>(idHelper);
37
38
GeoModelIO::ReadGeoModel* sqlreader =
getSqliteReader
();
39
40
std::string
node
{
"InnerDetector"
};
41
std::string table{
"PLRXDD"
};
42
43
//
44
// Check the availability (if not running from SQLite)
45
//
46
if
(!sqlreader){
47
if
(!
isAvailable
(
node
, table)) {
48
ATH_MSG_ERROR
(
"No PLR geometry found. PLR can not be built."
);
49
return
StatusCode::FAILURE;
50
}
51
}
52
//
53
// Create the detector manager
54
//
55
// The * converts a ConstPVLink to a ref to a GeoVPhysVol
56
// The & takes the address of the GeoVPhysVol
57
GeoPhysVol *world = &*theExpt->
getPhysVol
();
58
auto
*
manager
=
new
InDetDD::PixelDetectorManager
(&*detStore(),
m_detectorName
,
"PLR_ID"
);
59
manager
->addFolder(
m_alignmentFolderName
);
60
// Load the geometry, create the volume,
61
// node,table are the location in the DB to look for the clob
62
// empty strings are the (optional) containing detector and envelope names
63
// allowed to pass a null sqlreader ptr - it will be used to steer the source of the geometry
64
InDetDD::PLRGmxInterface
gmxInterface(
manager
,
m_commonItems
.get(), &
m_moduleTree
);
65
66
const
GeoVPhysVol * topVol =
createTopVolume
(world, gmxInterface,
node
, table,
m_containingDetectorName
,
m_envelopeVolumeName
,sqlreader);
67
68
// if we are using SQLite inputs,
69
if
(sqlreader) {
70
ATH_MSG_INFO
(
"Building PLR Readout Geometry from SQLite using "
<<
m_geoDbTagSvc
->getParamSvcName());
71
gmxInterface.
buildReadoutGeometryFromSqlite
(
m_sqliteReadSvc
.operator->(), sqlreader);
72
}
73
74
if
(topVol){
75
manager
->addTreeTop(topVol);
76
manager
->initNeighbours();
77
}
else
{
78
ATH_MSG_FATAL
(
"Could not find the Top Volume!!!"
);
79
return
StatusCode::FAILURE;
80
}
81
82
// set the manager
83
m_detManager
=
manager
;
84
85
ATH_CHECK
(detStore()->record(
m_detManager
,
m_detManager
->getName()));
86
theExpt->
addManager
(
m_detManager
);
87
88
// Create a symLink to the SiDetectorManager base class so it can be accessed as either SiDetectorManager or
89
// PixelDetectorManager
90
const
InDetDD::SiDetectorManager
*siDetManager =
m_detManager
;
91
ATH_CHECK
(detStore()->symLink(
m_detManager
, siDetManager));
92
93
return
StatusCode::SUCCESS;
94
}
95
96
97
StatusCode
PLRDetectorTool::clear
()
98
{
99
SG::DataProxy
* proxy = detStore()->proxy(
ClassID_traits<InDetDD::PixelDetectorManager>::ID
(),
m_detManager
->getName());
100
if
(proxy) {
101
proxy->reset();
102
m_detManager
=
nullptr
;
103
}
104
return
StatusCode::SUCCESS;
105
106
}
107
108
void
PLRDetectorTool::doNumerology
()
109
{
110
InDetDD::SiNumerology
n;
111
112
ATH_MSG_INFO
(
"\n\nPLR Numerology:\n===============\n\nNumber of parts is "
<<
m_moduleTree
.nParts());
113
}
AlignableTransformContainer.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AthMsgStreamMacros.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
DataProxy.h
GeoModelExperiment.h
PLRDetectorTool.h
PLRGmxInterface.h
PLR_ID.h
PixelDetectorManager.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_detectorName
Gaudi::Property< std::string > m_detectorName
Definition
GeoModelXmlTool.h:42
GeoModelXmlTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition
GeoModelXmlTool.h:45
GeoModelXmlTool::getSqliteReader
GeoModelIO::ReadGeoModel * getSqliteReader() const
Definition
GeoModelXmlTool.cxx:174
InDetDD::PLRGmxInterface
Definition
PLRGmxInterface.h:26
InDetDD::PLRGmxInterface::buildReadoutGeometryFromSqlite
virtual void buildReadoutGeometryFromSqlite(IRDBAccessSvc *RDBAccessSvc, GeoModelIO::ReadGeoModel *sqlreader)
Definition
PLRGmxInterface.cxx:158
InDetDD::PixelDetectorManager
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
Definition
PixelDetectorManager.h:47
InDetDD::SiDetectorManager
Base class for Pixel and SCT Detector managers.
Definition
SiDetectorManager.h:60
InDetDD::SiNumerology
Class to extract numerology for Pixel and SCT.
Definition
SiNumerology.h:27
PLRDetectorTool::m_commonItems
std::unique_ptr< InDetDD::SiCommonItems > m_commonItems
Definition
PLRDetectorTool.h:35
PLRDetectorTool::PLRDetectorTool
PLRDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
PLRDetectorTool.cxx:18
PLRDetectorTool::m_moduleTree
WaferTree m_moduleTree
Definition
PLRDetectorTool.h:36
PLRDetectorTool::m_alignmentFolderName
Gaudi::Property< std::string > m_alignmentFolderName
Definition
PLRDetectorTool.h:39
PLRDetectorTool::doNumerology
void doNumerology()
Definition
PLRDetectorTool.cxx:108
PLRDetectorTool::m_detManager
const InDetDD::PixelDetectorManager * m_detManager
Definition
PLRDetectorTool.h:34
PLRDetectorTool::m_containingDetectorName
Gaudi::Property< std::string > m_containingDetectorName
Definition
PLRDetectorTool.h:43
PLRDetectorTool::m_envelopeVolumeName
Gaudi::Property< std::string > m_envelopeVolumeName
Definition
PLRDetectorTool.h:44
PLRDetectorTool::create
virtual StatusCode create() override final
Definition
PLRDetectorTool.cxx:26
PLRDetectorTool::clear
virtual StatusCode clear() override final
Definition
PLRDetectorTool.cxx:97
PLR_ID
This is a Identifier helper class for the PLR subdetector.
Definition
PLR_ID.h:22
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