ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_DetectorTool Class Reference

#include <SCT_DetectorTool.h>

Inheritance diagram for SCT_DetectorTool:
Collaboration diagram for SCT_DetectorTool:

Public Member Functions

 SCT_DetectorTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode create () override final
virtual StatusCode clear () override final
virtual StatusCode align ATLAS_NOT_THREAD_SAFE (IOVSVC_CALLBACK_ARGS) override
virtual GeoVDetectorManager * manager ()
virtual const GeoVDetectorManager * manager () const
virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override

Protected Attributes

GeoVDetectorManager * m_detector {nullptr}

Private Attributes

BooleanProperty m_alignable {this, "Alignable", true}
BooleanProperty m_useDynamicAlignFolders {this, "useDynamicAlignFolders", false}
bool m_cosmic {false}
const InDetDD::SCT_DetectorManagerm_manager {nullptr}
SCT_GeoModelAthenaComps m_athenaComps
ServiceHandle< IGeoDbTagSvcm_geoDbTagSvc {this,"GeoDbTagSvc","GeoDbTagSvc"}
ServiceHandle< IGeometryDBSvcm_geometryDBSvc {this,"GeometryDBSvc","InDetGeometryDBSvc"}

Detailed Description

Definition at line 24 of file SCT_DetectorTool.h.

Constructor & Destructor Documentation

◆ SCT_DetectorTool()

SCT_DetectorTool::SCT_DetectorTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 22 of file SCT_DetectorTool.cxx.

25 : GeoModelTool(type, name, parent)
26{
27}

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/2]

virtual StatusCode registerCallback GeoModelTool::ATLAS_NOT_THREAD_SAFE ( )
inlineoverridevirtualinherited

Reimplemented in BCMPrimeDetectorTool, HGTD_DetectorTool, HGTD_GMX_DetectorTool, PLRDetectorTool, and TRT_DetectorTool.

Definition at line 26 of file GeoModelTool.h.

26{return StatusCode::FAILURE;}

◆ ATLAS_NOT_THREAD_SAFE() [2/2]

virtual StatusCode align SCT_DetectorTool::ATLAS_NOT_THREAD_SAFE ( IOVSVC_CALLBACK_ARGS )
overridevirtual

Reimplemented from GeoModelTool.

◆ clear()

StatusCode SCT_DetectorTool::clear ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

Definition at line 138 of file SCT_DetectorTool.cxx.

139{
140 SG::DataProxy* proxy{detStore()->proxy(ClassID_traits<SCT_DetectorManager>::ID(), m_manager->getName())};
141 if (proxy) {
142 proxy->reset();
143 m_manager = nullptr;
144 }
145 return StatusCode::SUCCESS;
146}
const InDetDD::SCT_DetectorManager * m_manager

◆ create()

StatusCode SCT_DetectorTool::create ( )
finaloverridevirtual

Definition at line 32 of file SCT_DetectorTool.cxx.

33{
34
35 // Get the detector configuration.
36 ATH_CHECK(m_geoDbTagSvc.retrieve());
37
38 ServiceHandle<IRDBAccessSvc> accessSvc(m_geoDbTagSvc->getParamSvcName(),name());
39 ATH_CHECK(accessSvc.retrieve());
40
41 // Print the SCT version tag:
42 std::string detectorTag{""};
43 std::string detectorNode{""};
44 GeoModelIO::ReadGeoModel* sqliteReader = m_geoDbTagSvc->getSqliteReader();
45
46 if(!sqliteReader) {
47 DecodeVersionKey versionKey{m_geoDbTagSvc.get(), "SCT"};
48 ATH_MSG_INFO("Building SCT with Version Tag: " << versionKey.tag() << " at Node: " << versionKey.node());
49
50 detectorTag = versionKey.tag();
51 detectorNode = versionKey.node();
52
53 std::string sctVersionTag{accessSvc->getChildTag("SCT", detectorTag, detectorNode)};
54
55 ATH_MSG_INFO("SCT Version: " << sctVersionTag);
56 if (sctVersionTag.empty()) {
57 ATH_MSG_INFO("No SCT Version. SCT will not be built.");
58 return StatusCode::SUCCESS;
59 }
60 else {
61 ATH_MSG_DEBUG("Keys for SCT Switches are " << detectorTag << " " << detectorNode);
62 }
63 }
64 std::string versionName;
65 IRDBRecordset_ptr switchSet{accessSvc->getRecordsetPtr("SctSwitches", detectorTag, detectorNode)};
66 const IRDBRecord* switches{(*switchSet)[0]};
67 if (not switches->isFieldNull("COSMICLAYOUT")) {
68 m_cosmic = switches->getInt("COSMICLAYOUT");
69 }
70 if (not switches->isFieldNull("VERSIONNAME")) {
71 versionName = switches->getString("VERSIONNAME");
72 }
73
74 if (versionName.empty() && m_cosmic) {
75 versionName = "SR1";
76 }
77
78 ATH_MSG_DEBUG("Creating the SCT");
79 ATH_MSG_DEBUG("SCT Geometry Options: ");
80 ATH_MSG_DEBUG(" Alignable: " << (m_alignable.value() ? "true" : "false"));
81 ATH_MSG_DEBUG(" CosmicLayout: " << (m_cosmic ? "true" : "false"));
82 ATH_MSG_DEBUG(" VersionName: " << versionName);
83
84 SCT_Options options;
85 options.setAlignable(m_alignable.value());
86 options.setDynamicAlignFolders(m_useDynamicAlignFolders.value());
87
88 // Locate the top level experiment node
89 GeoModelExperiment* theExpt{nullptr};
90 ATH_CHECK(detStore()->retrieve(theExpt, "ATLAS"));
91
92 // Retrieve the Geometry DB Interface
93 ATH_CHECK(m_geometryDBSvc.retrieve());
94
95 // Pass athena services to factory, etc
96 m_athenaComps.setDetStore(detStore().operator->());
97 m_athenaComps.setGeoDbTagSvc(&*m_geoDbTagSvc);
98 m_athenaComps.setGeometryDBSvc(&*m_geometryDBSvc);
99 m_athenaComps.setRDBAccessSvc(&*accessSvc);
100 const SCT_ID* idHelper{nullptr};
101 ATH_CHECK(detStore()->retrieve(idHelper, "SCT_ID"));
102 m_athenaComps.setIdHelper(idHelper);
103
104 GeoPhysVol* world{theExpt->getPhysVol()};
105
106 // If we are using the SQLite reader, then we are not building the raw geometry but
107 // just locating it and attaching to readout geometry and various other actions
108 // taken in this factory.
109 if (sqliteReader) {
110 ATH_MSG_INFO("Building the geometry from the SQLite file");
111 SCT_DetectorFactoryLite theSCT{sqliteReader, &m_athenaComps, options};
112 theSCT.create(world);
113 m_manager = theSCT.getDetectorManager();
114 }
115 else {
116 SCT_DetectorFactory theSCT{&m_athenaComps, options};
117 theSCT.create(world);
118 m_manager = theSCT.getDetectorManager();
119 }
120
121 if (m_manager==nullptr) {
122 ATH_MSG_FATAL("SCT_DetectorManager not created");
123 return StatusCode::FAILURE;
124 }
125
126 ATH_MSG_DEBUG("Registering SCT_DetectorManager. ");
127 ATH_CHECK(detStore()->record(m_manager, m_manager->getName()));
128 theExpt->addManager(m_manager);
129
130 // Create a symLink to the SiDetectorManager base class
131 const SiDetectorManager* siDetManager{m_manager};
132 ATH_CHECK(detStore()->symLink(m_manager, siDetManager));
133
134 return StatusCode::SUCCESS;
135}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
const std::string & tag() const
Return version tag.
const std::string & node() const
Return the version node.
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
virtual void create(GeoPhysVol *world) override
virtual const InDetDD::SCT_DetectorManager * getDetectorManager() const override
virtual void create(GeoPhysVol *world)
virtual const InDetDD::SCT_DetectorManager * getDetectorManager() const
BooleanProperty m_alignable
SCT_GeoModelAthenaComps m_athenaComps
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
ServiceHandle< IGeometryDBSvc > m_geometryDBSvc
BooleanProperty m_useDynamicAlignFolders
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ manager() [1/2]

virtual GeoVDetectorManager * GeoModelTool::manager ( )
inlinevirtualinherited

Definition at line 22 of file GeoModelTool.h.

22{return m_detector;}
GeoVDetectorManager * m_detector

◆ manager() [2/2]

virtual const GeoVDetectorManager * GeoModelTool::manager ( ) const
inlinevirtualinherited

Definition at line 23 of file GeoModelTool.h.

23{return m_detector;}

Member Data Documentation

◆ m_alignable

BooleanProperty SCT_DetectorTool::m_alignable {this, "Alignable", true}
private

Definition at line 37 of file SCT_DetectorTool.h.

37{this, "Alignable", true};

◆ m_athenaComps

SCT_GeoModelAthenaComps SCT_DetectorTool::m_athenaComps
private

Definition at line 43 of file SCT_DetectorTool.h.

◆ m_cosmic

bool SCT_DetectorTool::m_cosmic {false}
private

Definition at line 39 of file SCT_DetectorTool.h.

39{false};

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector {nullptr}
protectedinherited

Definition at line 30 of file GeoModelTool.h.

30{nullptr};

◆ m_geoDbTagSvc

ServiceHandle< IGeoDbTagSvc > SCT_DetectorTool::m_geoDbTagSvc {this,"GeoDbTagSvc","GeoDbTagSvc"}
private

Definition at line 45 of file SCT_DetectorTool.h.

45{this,"GeoDbTagSvc","GeoDbTagSvc"};

◆ m_geometryDBSvc

ServiceHandle< IGeometryDBSvc > SCT_DetectorTool::m_geometryDBSvc {this,"GeometryDBSvc","InDetGeometryDBSvc"}
private

Definition at line 46 of file SCT_DetectorTool.h.

46{this,"GeometryDBSvc","InDetGeometryDBSvc"};

◆ m_manager

const InDetDD::SCT_DetectorManager* SCT_DetectorTool::m_manager {nullptr}
private

Definition at line 41 of file SCT_DetectorTool.h.

41{nullptr};

◆ m_useDynamicAlignFolders

BooleanProperty SCT_DetectorTool::m_useDynamicAlignFolders {this, "useDynamicAlignFolders", false}
private

Definition at line 38 of file SCT_DetectorTool.h.

38{this, "useDynamicAlignFolders", false};

The documentation for this class was generated from the following files: