ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
9
11#include <GeoModelKernel/GeoPhysVol.h>
13
14
16 const std::string &name,
17 const IInterface *parent)
18 : GeoModelXmlTool(type, name, parent)
19{
20}
21
22
24{
25 // retrieve the common stuff
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();
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
67
68 ATH_CHECK(detStore()->record(m_detManager, m_detManager->getName()));
69 theExpt->addManager(m_detManager);
70
71 return StatusCode::SUCCESS;
72}
73
74
76{
78 if (proxy) {
79 proxy->reset();
80 m_detManager = nullptr;
81 }
82 return StatusCode::SUCCESS;
83}
84
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
virtual StatusCode clear() override final
const InDetDD::BCMPrimeDetectorManager * m_detManager
BCMPrimeDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode create() override final
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
virtual GeoVDetectorManager * manager()
StatusCode createBaseTool()
bool isAvailable(const std::string &versionNode, const std::string &tableNode) const
GeoModelXmlTool(const std::string &type, const std::string &name, const IInterface *parent)
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
Gaudi::Property< std::string > m_detectorName
GeoModelIO::ReadGeoModel * getSqliteReader() const
Definition node.h:24