ATLAS Offline Software
Loading...
Searching...
No Matches
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 "PLRGmxInterface.h"
7
9
11#include <GeoModelKernel/GeoPhysVol.h>
14#include <SGTools/DataProxy.h>
15
16
18 const std::string &name,
19 const IInterface *parent)
20 : GeoModelXmlTool(type, name, parent)
21{
22}
23
24
26{
27 // retrieve the common stuff
29
30 GeoModelExperiment *theExpt = nullptr;
31 ATH_CHECK(detStore()->retrieve(theExpt, "ATLAS"));
32 const PLR_ID *idHelper = nullptr;
33 ATH_CHECK(detStore()->retrieve(idHelper, "PLR_ID"));
34
35 m_commonItems = std::make_unique<InDetDD::SiCommonItems>(idHelper);
36
37 const GeoModelIO::ReadGeoModel* sqlreader = getSqliteReader();
38
39 std::string node{"InnerDetector"};
40 std::string table{"PLRXDD"};
41
42 //
43 // Check the availability (if not running from SQLite)
44 //
45 if(!sqlreader){
46 if (!isAvailable(node, table)) {
47 ATH_MSG_ERROR("No PLR geometry found. PLR 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 InDetDD::PixelDetectorManager(&*detStore(), m_detectorName, "PLR_ID");
59 // Load the geometry, create the volume,
60 // node,table are the location in the DB to look for the clob
61 // empty strings are the (optional) containing detector and envelope names
62 // allowed to pass a null sqlreader ptr - it will be used to steer the source of the geometry
64
65 const GeoVPhysVol * topVol = createTopVolume(world, gmxInterface, node, table, m_containingDetectorName, m_envelopeVolumeName,sqlreader);
66 if(topVol){
67 manager->addTreeTop(topVol);
68 manager->initNeighbours();
69 }
70 else{
71 ATH_MSG_FATAL("Could not find the Top Volume!!!");
72 return StatusCode::FAILURE;
73 }
74
75 // set the manager
77
78 ATH_CHECK(detStore()->record(m_detManager, m_detManager->getName()));
79 theExpt->addManager(m_detManager);
80
81 // Create a symLink to the SiDetectorManager base class so it can be accessed as either SiDetectorManager or
82 // PixelDetectorManager
83 const InDetDD::SiDetectorManager *siDetManager = m_detManager;
84 ATH_CHECK(detStore()->symLink(m_detManager, siDetManager));
85
86 return StatusCode::SUCCESS;
87}
88
89
91{
93 if (proxy) {
94 proxy->reset();
95 m_detManager = nullptr;
96 }
97 return StatusCode::SUCCESS;
98
99}
100
102{
104
105 ATH_MSG_INFO("\n\nPLR Numerology:\n===============\n\nNumber of parts is " << m_moduleTree.nParts());
106}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
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
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
Base class for Pixel and SCT Detector managers.
Class to extract numerology for Pixel and SCT.
std::unique_ptr< InDetDD::SiCommonItems > m_commonItems
PLRDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
WaferTree m_moduleTree
Gaudi::Property< std::string > m_alignmentFolderName
const InDetDD::PixelDetectorManager * m_detManager
Gaudi::Property< std::string > m_containingDetectorName
Gaudi::Property< std::string > m_envelopeVolumeName
virtual StatusCode create() override final
virtual StatusCode clear() override final
This is a Identifier helper class for the PLR subdetector.
Definition PLR_ID.h:22
Definition node.h:24