ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
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 (IOVSVC_CALLBACK_ARGS) override final
 
virtual GeoVDetectorManager * manager ()
 The Detector Node corresponding to this tool. More...
 
virtual const GeoVDetectorManager * manager () const
 

Protected Attributes

GeoVDetectorManager * m_detector
 

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  :
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 }

Member Function Documentation

◆ align()

StatusCode HGTD_DetectorTool::align ( IOVSVC_CALLBACK_ARGS  )
finaloverridevirtual

Reimplemented from GeoModelTool.

Definition at line 107 of file HGTD_DetectorTool.cxx.

107  {
108 
109  // The call-back routine, which just calls the real call-back routine from the manager.
110 
111  if ( ! m_detectorManager ) {
112  ATH_MSG_WARNING( "Manager does not exist for " << I <<" "<< keys );
113  return StatusCode::FAILURE;
114  }
115 
116  ATH_MSG_INFO( "No align method yet implemented for HGTD_DetectorManager. Nothing to do." );
117 
118  return StatusCode::SUCCESS;
119 }

◆ ATLAS_NOT_THREAD_SAFE()

virtual StatusCode registerCallback HGTD_DetectorTool::ATLAS_NOT_THREAD_SAFE ( )
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
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->());
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 
66  theExpt->addManager(m_detectorManager);
67  return StatusCode::SUCCESS;
68 }

◆ manager() [1/2]

GeoVDetectorManager * GeoModelTool::manager ( )
virtualinherited

The Detector Node corresponding to this tool.

Definition at line 21 of file GeoModelTool.cxx.

21  {
22  return m_detector;
23 }

◆ manager() [2/2]

const GeoVDetectorManager * GeoModelTool::manager ( ) const
virtualinherited

Definition at line 24 of file GeoModelTool.cxx.

24  {
25  return m_detector;
26 }

Member Data Documentation

◆ m_alignable

BooleanProperty HGTD_DetectorTool::m_alignable {this, "Alignable", false}
private

Definition at line 45 of file HGTD_DetectorTool.h.

◆ m_athenaComps

HGTD_GeoModelAthenaComps HGTD_DetectorTool::m_athenaComps
private

Definition at line 52 of file HGTD_DetectorTool.h.

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector
protectedinherited

Definition at line 36 of file GeoModelTool.h.

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

◆ 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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
HGTD_DetectorTool::m_detectorManager
const HGTD_DetectorManager * m_detectorManager
Definition: HGTD_DetectorTool.h:50
HGTD_DetectorTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: HGTD_DetectorTool.h:47
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
HGTD_DetectorTool::m_athenaComps
HGTD_GeoModelAthenaComps m_athenaComps
Definition: HGTD_DetectorTool.h:52
GeoModelExperiment
Definition: GeoModelExperiment.h:32
GeoModelTool::GeoModelTool
GeoModelTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor(s)
Definition: GeoModelTool.cxx:12
InDetDD::AthenaComps::setGeoDbTagSvc
void setGeoDbTagSvc(IGeoDbTagSvc *)
Definition: InDetDDAthenaComps.cxx:22
InDetDD::AthenaComps::setDetStore
void setDetStore(StoreGateSvc *)
Definition: InDetDDAthenaComps.cxx:17
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
HGTD_DetectorFactory
Definition: HGTD_DetectorFactory.h:70
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDetDD::AthenaComps::setRDBAccessSvc
void setRDBAccessSvc(IRDBAccessSvc *)
Definition: InDetDDAthenaComps.cxx:27
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
HGTD_ID
Definition: HGTD_ID.h:47
HGTD_DetectorTool::m_printIDdict
bool m_printIDdict
Definition: HGTD_DetectorTool.h:54
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
GeoModelTool::m_detector
GeoVDetectorManager * m_detector
Definition: GeoModelTool.h:36
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
HGTD_DetectorTool::m_rdbAccessSvc
ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc
Definition: HGTD_DetectorTool.h:48
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
HGTD_GeoModelAthenaComps::setIdHelper
void setIdHelper(const HGTD_ID *idHelper)
Definition: HGTD_GeoModelAthenaComps.cxx:13
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
I
#define I(x, y, z)
Definition: MD5.cxx:116
SG::DataProxy
Definition: DataProxy.h:44