Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Protected Attributes | Private Attributes | List of all members
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 (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.

26 {
27 }

Member Function Documentation

◆ align()

StatusCode SCT_DetectorTool::align ( IOVSVC_CALLBACK_ARGS  )
overridevirtual

Reimplemented from GeoModelTool.

Definition at line 149 of file SCT_DetectorTool.cxx.

150 {
151  if (m_manager==nullptr) {
152  ATH_MSG_FATAL("Manager does not exist");
153  return StatusCode::FAILURE;
154  }
155  if (m_alignable.value()) {
156  return m_manager->align(I, keys);
157  } else {
158  ATH_MSG_DEBUG("Alignment disabled. No alignments applied");
159  return StatusCode::SUCCESS;
160  }
161 }

◆ ATLAS_NOT_THREAD_SAFE()

virtual StatusCode registerCallback GeoModelTool::ATLAS_NOT_THREAD_SAFE ( )
inlineoverridevirtualinherited

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

Definition at line 26 of file GeoModelTool.h.

26 {return StatusCode::FAILURE;}

◆ clear()

StatusCode SCT_DetectorTool::clear ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

Definition at line 138 of file SCT_DetectorTool.cxx.

139 {
141  if (proxy) {
142  proxy->reset();
143  m_manager = nullptr;
144  }
145  return StatusCode::SUCCESS;
146 }

◆ 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 
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->());
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 {
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 }

◆ manager() [1/2]

virtual GeoVDetectorManager* GeoModelTool::manager ( )
inlinevirtualinherited

Definition at line 22 of file GeoModelTool.h.

22 {return 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.

◆ 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.

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector {nullptr}
protectedinherited

Definition at line 30 of file GeoModelTool.h.

◆ m_geoDbTagSvc

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

Definition at line 45 of file SCT_DetectorTool.h.

◆ m_geometryDBSvc

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

Definition at line 46 of file SCT_DetectorTool.h.

◆ m_manager

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

Definition at line 41 of file SCT_DetectorTool.h.

◆ m_useDynamicAlignFolders

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

Definition at line 38 of file SCT_DetectorTool.h.


The documentation for this class was generated from the following files:
SCT_DetectorFactory
Definition: SCT_DetectorFactory.h:23
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
SCT_DetectorTool::m_useDynamicAlignFolders
BooleanProperty m_useDynamicAlignFolders
Definition: SCT_DetectorTool.h:38
SCT_DetectorTool::m_athenaComps
SCT_GeoModelAthenaComps m_athenaComps
Definition: SCT_DetectorTool.h:43
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:395
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SCT_DetectorFactoryLite
Definition: SCT_DetectorFactoryLite.h:34
SCT_DetectorTool::m_cosmic
bool m_cosmic
Definition: SCT_DetectorTool.h:39
GeoModelExperiment
Definition: GeoModelExperiment.h:32
SCT_GeoModelAthenaComps::setIdHelper
void setIdHelper(const SCT_ID *idHelper)
Definition: SCT_GeoModelAthenaComps.cxx:13
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
InDetDD::AthenaComps::setGeoDbTagSvc
void setGeoDbTagSvc(IGeoDbTagSvc *)
Definition: InDetDDAthenaComps.cxx:22
InDetDD::AthenaComps::setDetStore
void setDetStore(StoreGateSvc *)
Definition: InDetDDAthenaComps.cxx:17
SCT_Options
Definition: SCT_Options.h:12
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition: DecodeVersionKey.h:18
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:37
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GeoModelTool
Definition: GeoModelTool.h:16
InDetDD::AthenaComps::setRDBAccessSvc
void setRDBAccessSvc(IRDBAccessSvc *)
Definition: InDetDDAthenaComps.cxx:27
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.AtlRunQueryLib.options
options
Definition: AtlRunQueryLib.py:379
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
GeoModelTool::m_detector
GeoVDetectorManager * m_detector
Definition: GeoModelTool.h:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
InDetDD::InDetDetectorManager::align
StatusCode align(IOVSVC_CALLBACK_ARGS) const
SCT_DetectorTool::m_geometryDBSvc
ServiceHandle< IGeometryDBSvc > m_geometryDBSvc
Definition: SCT_DetectorTool.h:46
SCT_ID
Definition: SCT_ID.h:68
IRDBRecord
IRDBRecord is one record in the IRDBRecordset object.
Definition: IRDBRecord.h:27
InDetDD::AthenaComps::setGeometryDBSvc
void setGeometryDBSvc(IGeometryDBSvc *)
Definition: InDetDDAthenaComps.cxx:32
InDetDD::SiDetectorManager
Definition: SiDetectorManager.h:60
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
I
#define I(x, y, z)
Definition: MD5.cxx:116
SG::DataProxy
Definition: DataProxy.h:45
SCT_DetectorTool::m_manager
const InDetDD::SCT_DetectorManager * m_manager
Definition: SCT_DetectorTool.h:41
SCT_DetectorTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: SCT_DetectorTool.h:45
SCT_DetectorTool::m_alignable
BooleanProperty m_alignable
Definition: SCT_DetectorTool.h:37
ServiceHandle< IRDBAccessSvc >