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"
7#include "PLRGmxInterface.h"
8
10
12#include <GeoModelKernel/GeoPhysVol.h>
15#include <SGTools/DataProxy.h>
16
17
19 const std::string &name,
20 const IInterface *parent)
21 : GeoModelXmlTool(type, name, parent)
22{
23}
24
25
27{
28 // retrieve the common stuff
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");
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
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
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
98{
100 if (proxy) {
101 proxy->reset();
102 m_detManager = nullptr;
103 }
104 return StatusCode::SUCCESS;
105
106}
107
109{
111
112 ATH_MSG_INFO("\n\nPLR Numerology:\n===============\n\nNumber of parts is " << m_moduleTree.nParts());
113}
#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()
ServiceHandle< IRDBAccessSvc > m_sqliteReadSvc
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
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
GeoModelIO::ReadGeoModel * getSqliteReader() const
virtual void buildReadoutGeometryFromSqlite(IRDBAccessSvc *RDBAccessSvc, GeoModelIO::ReadGeoModel *sqlreader)
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