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

HGTD_DetectorTool is a standard GeoModel tool, which calls HGTD_DetectorFactory::create(), stores HGTD_DetectorManager to the Detector Store and also registers a callback function align() which applies misalignments on top of the 'regular' geometry. More...

#include <HGTD_DetectorTool.h>

Inheritance diagram for HGTD_DetectorTool:
Collaboration diagram for HGTD_DetectorTool:

Public Member Functions

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

Protected Attributes

GeoVDetectorManager * m_detector {nullptr}

Private Attributes

StringProperty m_detectorName {this, "DetectorName", "HGTD"}
BooleanProperty m_alignable {this, "Alignable", false}
ServiceHandle< IGeoDbTagSvcm_geoDbTagSvc
ServiceHandle< IRDBAccessSvcm_rdbAccessSvc
const HGTD_DetectorManagerm_detectorManager
HGTD_GeoModelAthenaComps m_athenaComps
bool m_printIDdict

Detailed Description

HGTD_DetectorTool is a standard GeoModel tool, which calls HGTD_DetectorFactory::create(), stores HGTD_DetectorManager to the Detector Store and also registers a callback function align() which applies misalignments on top of the 'regular' geometry.

Definition at line 28 of file HGTD_DetectorTool.h.

Constructor & Destructor Documentation

◆ HGTD_DetectorTool()

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

Definition at line 19 of file HGTD_DetectorTool.cxx.

21 :
22 GeoModelTool(type, name, parent),
23 m_geoDbTagSvc("GeoDbTagSvc", name),
24 m_rdbAccessSvc("RDBAccessSvc", name),
25 m_detectorManager(nullptr),
26 m_printIDdict(false) {
27 // Get parameter values from the python configuration
28 declareProperty("GeoDbTagSvc", m_geoDbTagSvc);
29 declareProperty("RDBAccessSvc", m_rdbAccessSvc);
30 declareProperty("PrintModuleNumberPerRow", m_printIDdict);
31}
const HGTD_DetectorManager * m_detectorManager
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/2]

virtual StatusCode registerCallback HGTD_DetectorTool::ATLAS_NOT_THREAD_SAFE ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

◆ ATLAS_NOT_THREAD_SAFE() [2/2]

virtual StatusCode align HGTD_DetectorTool::ATLAS_NOT_THREAD_SAFE ( IOVSVC_CALLBACK_ARGS )
finaloverridevirtual

Reimplemented from GeoModelTool.

◆ clear()

StatusCode HGTD_DetectorTool::clear ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

Definition at line 70 of file HGTD_DetectorTool.cxx.

70 {
71
72 // Release manager from the detector store
73 SG::DataProxy* proxy = detStore()->proxy(ClassID_traits< HGTD_DetectorManager >::ID(),m_detectorManager->getName());
74 if (proxy) {
75 proxy->reset();
76 m_detectorManager = nullptr;
77 }
78
79 return StatusCode::SUCCESS;
80}

◆ create()

StatusCode HGTD_DetectorTool::create ( )
finaloverridevirtual

Definition at line 33 of file HGTD_DetectorTool.cxx.

33 {
34
35 ATH_CHECK(m_geoDbTagSvc.retrieve());
36 ATH_CHECK(m_rdbAccessSvc.retrieve());
37
38 // Get their interfaces to pass to the DetectorFactory
39 m_athenaComps.setDetStore(detStore().operator->());
40 m_athenaComps.setGeoDbTagSvc(&*m_geoDbTagSvc);
41 m_athenaComps.setRDBAccessSvc(&*m_rdbAccessSvc);
42 const HGTD_ID* idHelper{nullptr};
43 ATH_CHECK(detStore()->retrieve(idHelper, "HGTD_ID"));
44 m_athenaComps.setIdHelper(idHelper);
45
46 GeoModelExperiment *theExpt = nullptr;
47 ATH_CHECK(detStore()->retrieve(theExpt, "ATLAS"));
48
49 // The * converts a ConstPVLink to a ref to a GeoVPhysVol, the & takes the address of the GeoVPhysVol
50 GeoPhysVol *world = &*theExpt->getPhysVol();
51
52 HGTD_DetectorFactory theHGTDFactory(&m_athenaComps);
53 theHGTDFactory.setPrintIdentifierDict(m_printIDdict);
54 theHGTDFactory.create(world);
55
56 // Get the manager from the factory and store it in the detector store.
57 m_detectorManager = theHGTDFactory.getDetectorManager();
58 if (!m_detectorManager) {
59 ATH_MSG_ERROR( "HGTD_DetectorManager not found; not created in HGTD_DetectorFactory?" );
60 return(StatusCode::FAILURE);
61 }
62
63 ATH_MSG_DEBUG("Registering HGTD_DetectorManager as " << m_detectorManager->getName() );
64 ATH_CHECK( detStore()->record(m_detectorManager, m_detectorManager->getName()) );
65
67 return StatusCode::SUCCESS;
68}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
HGTD_GeoModelAthenaComps m_athenaComps
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 HGTD_DetectorTool::m_alignable {this, "Alignable", false}
private

Definition at line 45 of file HGTD_DetectorTool.h.

45{this, "Alignable", false};

◆ m_athenaComps

HGTD_GeoModelAthenaComps HGTD_DetectorTool::m_athenaComps
private

Definition at line 52 of file HGTD_DetectorTool.h.

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector {nullptr}
protectedinherited

Definition at line 30 of file GeoModelTool.h.

30{nullptr};

◆ m_detectorManager

const HGTD_DetectorManager* HGTD_DetectorTool::m_detectorManager
private

Definition at line 50 of file HGTD_DetectorTool.h.

◆ m_detectorName

StringProperty HGTD_DetectorTool::m_detectorName {this, "DetectorName", "HGTD"}
private

Definition at line 44 of file HGTD_DetectorTool.h.

44{this, "DetectorName", "HGTD"};

◆ m_geoDbTagSvc

ServiceHandle<IGeoDbTagSvc> HGTD_DetectorTool::m_geoDbTagSvc
private

Definition at line 47 of file HGTD_DetectorTool.h.

◆ m_printIDdict

bool HGTD_DetectorTool::m_printIDdict
private

Definition at line 54 of file HGTD_DetectorTool.h.

◆ m_rdbAccessSvc

ServiceHandle<IRDBAccessSvc> HGTD_DetectorTool::m_rdbAccessSvc
private

Definition at line 48 of file HGTD_DetectorTool.h.


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