ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
BCMPrimeGeoModelXml
src
BCMPrimeDetectorTool.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 "
BCMPrimeDetectorTool.h
"
6
#include "
BCMPrimeGmxInterface.h
"
7
8
#include <
BCMPrimeReadoutGeometry/BCMPrimeDetectorManager.h
>
9
10
#include <
DetDescrConditions/AlignableTransformContainer.h
>
11
#include <GeoModelKernel/GeoPhysVol.h>
12
#include <
GeoModelUtilities/GeoModelExperiment.h
>
13
14
15
BCMPrimeDetectorTool::BCMPrimeDetectorTool
(
const
std::string &
type
,
16
const
std::string &name,
17
const
IInterface *parent)
18
:
GeoModelXmlTool
(
type
, name, parent)
19
{
20
}
21
22
23
StatusCode
BCMPrimeDetectorTool::create
()
24
{
25
// retrieve the common stuff
26
ATH_CHECK
(
createBaseTool
());
27
28
GeoModelExperiment
*theExpt =
nullptr
;
29
ATH_CHECK
(detStore()->retrieve(theExpt,
"ATLAS"
));
30
31
//
32
// Check the availability
33
//
34
std::string
node
{
"InnerDetector"
};
35
std::string table{
"BCMPrimeXDD"
};
36
37
const
GeoModelIO::ReadGeoModel* sqlreader =
getSqliteReader
();
38
if
(!sqlreader){
39
if
(!
isAvailable
(
node
, table)) {
40
ATH_MSG_ERROR
(
"No BCMPrime geometry found. BCMPrime can not be built."
);
41
return
StatusCode::FAILURE;
42
}
43
}
44
//
45
// Create the detector manager
46
//
47
// The * converts a ConstPVLink to a ref to a GeoVPhysVol
48
// The & takes the address of the GeoVPhysVol
49
GeoPhysVol *world = &*theExpt->
getPhysVol
();
50
auto
*
manager
=
new
InDetDD::BCMPrimeDetectorManager
(
m_detectorName
);
51
InDetDD::BCMPrimeGmxInterface
gmxInterface;
52
53
// Load the geometry, create the volume,
54
// node,table are the location in the DB to look for the clob
55
// empty strings are the (optional) containing detector and envelope names
56
// allowed to pass a null sqlreader ptr - it will be used to steer the source of the geometry
57
const
GeoVPhysVol* topVolume =
createTopVolume
(world, gmxInterface,
node
, table,
"ITkPixel"
,
"ITkPixelDetector"
,sqlreader);
58
if
(topVolume) {
//see that a valid pointer is returned
59
manager
->addTreeTop(topVolume);
60
}
else
{
61
ATH_MSG_FATAL
(
"Could not find the BCMPrime Top Volume!!!"
);
62
return
StatusCode::FAILURE;
63
}
64
65
// set the manager
66
m_detManager
=
manager
;
67
68
ATH_CHECK
(detStore()->record(
m_detManager
,
m_detManager
->getName()));
69
theExpt->
addManager
(
m_detManager
);
70
71
return
StatusCode::SUCCESS;
72
}
73
74
75
StatusCode
BCMPrimeDetectorTool::clear
()
76
{
77
SG::DataProxy
* proxy = detStore()->proxy(
ClassID_traits<InDetDD::BCMPrimeDetectorManager>::ID
(),
m_detManager
->getName());
78
if
(proxy) {
79
proxy->reset();
80
m_detManager
=
nullptr
;
81
}
82
return
StatusCode::SUCCESS;
83
}
84
AlignableTransformContainer.h
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:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
BCMPrimeDetectorManager.h
BCMPrimeDetectorTool.h
BCMPrimeGmxInterface.h
GeoModelExperiment.h
BCMPrimeDetectorTool::clear
virtual StatusCode clear() override final
Definition
BCMPrimeDetectorTool.cxx:75
BCMPrimeDetectorTool::m_detManager
const InDetDD::BCMPrimeDetectorManager * m_detManager
Definition
BCMPrimeDetectorTool.h:32
BCMPrimeDetectorTool::BCMPrimeDetectorTool
BCMPrimeDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
BCMPrimeDetectorTool.cxx:15
BCMPrimeDetectorTool::create
virtual StatusCode create() override final
Definition
BCMPrimeDetectorTool.cxx:23
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::m_detectorName
Gaudi::Property< std::string > m_detectorName
Definition
GeoModelXmlTool.h:42
GeoModelXmlTool::getSqliteReader
GeoModelIO::ReadGeoModel * getSqliteReader() const
Definition
GeoModelXmlTool.cxx:174
InDetDD::BCMPrimeDetectorManager
Definition
BCMPrimeDetectorManager.h:25
InDetDD::BCMPrimeGmxInterface
Definition
BCMPrimeGmxInterface.h:17
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