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. 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 GeoVDetectorManager * manager ()
virtual const GeoVDetectorManager * manager () const
virtual StatusCode align () override

Protected Attributes

GeoVDetectorManager * m_detector {nullptr}

Private Attributes

StringProperty m_detectorName {this, "DetectorName", "HGTD"}
BooleanProperty m_printIDdict {this, "PrintModuleNumberPerRow", false}
ServiceHandle< IGeoDbTagSvcm_geoDbTagSvc {this, "GeoDbTagSvc", "GeoDbTagSvc"}
ServiceHandle< IRDBAccessSvcm_rdbAccessSvc {this, "RDBAccessSvc", "RDBAccessSvc"}
const HGTD_DetectorManagerm_detectorManager {nullptr}
HGTD_GeoModelAthenaComps m_athenaComps

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.

Definition at line 26 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{
24}

Member Function Documentation

◆ align()

virtual StatusCode GeoModelTool::align ( )
inlineoverridevirtualinherited

Reimplemented in ALFA_DetectorTool, LArDetectorToolNV, PixelDetectorTool, SCT_DetectorTool, and TRT_DetectorTool.

Definition at line 25 of file GeoModelTool.h.

25{return StatusCode::SUCCESS;}

◆ clear()

StatusCode HGTD_DetectorTool::clear ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

Definition at line 63 of file HGTD_DetectorTool.cxx.

63 {
64
65 // Release manager from the detector store
66 SG::DataProxy* proxy = detStore()->proxy(ClassID_traits< HGTD_DetectorManager >::ID(),m_detectorManager->getName());
67 if (proxy) {
68 proxy->reset();
69 m_detectorManager = nullptr;
70 }
71
72 return StatusCode::SUCCESS;
73}
const HGTD_DetectorManager * m_detectorManager

◆ create()

StatusCode HGTD_DetectorTool::create ( )
finaloverridevirtual

Definition at line 26 of file HGTD_DetectorTool.cxx.

26 {
27
28 ATH_CHECK(m_geoDbTagSvc.retrieve());
29 ATH_CHECK(m_rdbAccessSvc.retrieve());
30
31 // Get their interfaces to pass to the DetectorFactory
32 m_athenaComps.setDetStore(detStore().operator->());
33 m_athenaComps.setGeoDbTagSvc(&*m_geoDbTagSvc);
34 m_athenaComps.setRDBAccessSvc(&*m_rdbAccessSvc);
35 const HGTD_ID* idHelper{nullptr};
36 ATH_CHECK(detStore()->retrieve(idHelper, "HGTD_ID"));
37 m_athenaComps.setIdHelper(idHelper);
38
39 GeoModelExperiment *theExpt = nullptr;
40 ATH_CHECK(detStore()->retrieve(theExpt, "ATLAS"));
41
42 // The * converts a ConstPVLink to a ref to a GeoVPhysVol, the & takes the address of the GeoVPhysVol
43 GeoPhysVol *world = &*theExpt->getPhysVol();
44
45 HGTD_DetectorFactory theHGTDFactory(&m_athenaComps);
46 theHGTDFactory.setPrintIdentifierDict(m_printIDdict);
47 theHGTDFactory.create(world);
48
49 // Get the manager from the factory and store it in the detector store.
50 m_detectorManager = theHGTDFactory.getDetectorManager();
51 if (!m_detectorManager) {
52 ATH_MSG_ERROR( "HGTD_DetectorManager not found; not created in HGTD_DetectorFactory?" );
53 return(StatusCode::FAILURE);
54 }
55
56 ATH_MSG_DEBUG("Registering HGTD_DetectorManager as " << m_detectorManager->getName() );
57 ATH_CHECK( detStore()->record(m_detectorManager, m_detectorManager->getName()) );
58
60 return StatusCode::SUCCESS;
61}
#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
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc
BooleanProperty m_printIDdict
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ manager() [1/2]

virtual GeoVDetectorManager * GeoModelTool::manager ( )
inlinevirtualinherited

Definition at line 21 of file GeoModelTool.h.

21{return m_detector;}
GeoVDetectorManager * m_detector

◆ manager() [2/2]

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

Definition at line 22 of file GeoModelTool.h.

22{return m_detector;}

Member Data Documentation

◆ m_athenaComps

HGTD_GeoModelAthenaComps HGTD_DetectorTool::m_athenaComps
private

Definition at line 44 of file HGTD_DetectorTool.h.

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector {nullptr}
protectedinherited

Definition at line 28 of file GeoModelTool.h.

28{nullptr};

◆ m_detectorManager

const HGTD_DetectorManager* HGTD_DetectorTool::m_detectorManager {nullptr}
private

Definition at line 42 of file HGTD_DetectorTool.h.

42{nullptr};

◆ m_detectorName

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

Definition at line 36 of file HGTD_DetectorTool.h.

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

◆ m_geoDbTagSvc

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

Definition at line 39 of file HGTD_DetectorTool.h.

39{this, "GeoDbTagSvc", "GeoDbTagSvc"};

◆ m_printIDdict

BooleanProperty HGTD_DetectorTool::m_printIDdict {this, "PrintModuleNumberPerRow", false}
private

Definition at line 37 of file HGTD_DetectorTool.h.

37{this, "PrintModuleNumberPerRow", false};

◆ m_rdbAccessSvc

ServiceHandle<IRDBAccessSvc> HGTD_DetectorTool::m_rdbAccessSvc {this, "RDBAccessSvc", "RDBAccessSvc"}
private

Definition at line 40 of file HGTD_DetectorTool.h.

40{this, "RDBAccessSvc", "RDBAccessSvc"};

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