ATLAS Offline Software
DetectorGeometryBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4ATLASTOOLS_DETECTORGEOMETRYBASE_H
6 #define G4ATLASTOOLS_DETECTORGEOMETRYBASE_H
7 
8 // Base classes
11 
12 // Athena headers
15 
16 // Gaudi headers
17 #include "GaudiKernel/ServiceHandle.h" // For service handle
18 #include "GaudiKernel/ToolHandle.h" // For tool handle array
19 
20 // STL library
21 #include <string>
22 #include <vector>
23 
25 class DetectorGeometryBase : public extends<AthAlgTool, IDetectorGeometryTool>
26 {
27 public:
28  // Basic constructor and destructor
29  DetectorGeometryBase(const std::string& type, const std::string& name, const IInterface *parent);
30  virtual ~DetectorGeometryBase() {}
31 
33  StatusCode initialize() override;
34 
35 
37  virtual void Build() override;
38 
39  virtual void BuildGeometry() override;
40 
41  virtual void PositionInParent() override;
42 
43  virtual void SetRotationAndOffset(); //override; TODO add to IDetectorGeometryTool?
44 
45  virtual void BuildSubDetectors() override;
46 
47  virtual void SetEnvelope() override;
48 
49  virtual void ResetEnvelope() override;
50 
51  virtual void SetAsWorld() override;
52 
53  std::string GetDetectorName() const override;
54 
55  void SetDetectorName(const std::string&) override;
56 
57  void SetParent(IDetectorGeometryTool*) override;
58 
59  Envelope& GetEnvelope() override final;
60 
61  G4VPhysicalVolume* GetWorldVolume() override final;
62 
63 protected:
64  ToolHandleArray<IDetectorGeometryTool> m_subDetTools{this, "SubDetectors", {}, "Tool handle array of all subdetector tools"};
65 
66  ServiceHandle<IG4GeometryNotifierSvc> m_notifierSvc{this, "GeometryNotifierSvc", "G4GeometryNotifierSvc", "Detector name (same as the Tool name if not set"};
67 
69 
71  Gaudi::Property<std::string> m_detectorName{this, "DetectorName", "", "Detector name (same as the Tool name if not set"};
72  bool m_isWorld{false};
73  Gaudi::Property<double> m_rotateX{this, "RotateX" , 0.0, "Rotation around the X-axis"};
74  Gaudi::Property<double> m_rotateY{this, "RotateY" , 0.0, "Rotation around the Y-axis"};
75  Gaudi::Property<double> m_rotateZ{this, "RotateZ" , 0.0, "Rotation around the Z-axis"};
76  Gaudi::Property<double> m_offsetX{this, "OffsetX" , 0.0, "Offset in the X-direction"};
77  Gaudi::Property<double> m_offsetY{this, "OffsetY" , 0.0, "Offset in the Y-direction"};
78  Gaudi::Property<double> m_offsetZ{this, "OffsetZ" , 0.0, "Offset in the Z-direction"};
79 
80 };
81 
82 #endif
Envelope
Definition: IDetectorGeometryTool.h:17
DetectorGeometryBase::SetEnvelope
virtual void SetEnvelope() override
Definition: DetectorGeometryBase.cxx:167
DetectorGeometryBase::m_rotateX
Gaudi::Property< double > m_rotateX
Definition: DetectorGeometryBase.h:73
DetectorGeometryBase::GetDetectorName
std::string GetDetectorName() const override
Definition: DetectorGeometryBase.cxx:180
IEnvelopeDefSvc.h
DetectorGeometryBase::m_rotateZ
Gaudi::Property< double > m_rotateZ
Definition: DetectorGeometryBase.h:75
DetectorGeometryBase::BuildGeometry
virtual void BuildGeometry() override
Definition: DetectorGeometryBase.cxx:75
DetectorGeometryBase::SetDetectorName
void SetDetectorName(const std::string &) override
Definition: DetectorGeometryBase.cxx:175
DetectorGeometryBase::m_subDetTools
ToolHandleArray< IDetectorGeometryTool > m_subDetTools
Definition: DetectorGeometryBase.h:64
DetectorGeometryBase::initialize
StatusCode initialize() override
Athena method.
Definition: DetectorGeometryBase.cxx:19
DetectorGeometryBase::Build
virtual void Build() override
purely virtual methods being implemented here
Definition: DetectorGeometryBase.cxx:53
DetectorGeometryBase::m_isWorld
bool m_isWorld
Definition: DetectorGeometryBase.h:72
DetectorGeometryBase::SetRotationAndOffset
virtual void SetRotationAndOffset()
Definition: DetectorGeometryBase.cxx:80
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
DetectorGeometryBase::GetEnvelope
Envelope & GetEnvelope() override final
Definition: DetectorGeometryBase.cxx:195
DetectorGeometryBase::m_offsetZ
Gaudi::Property< double > m_offsetZ
Definition: DetectorGeometryBase.h:78
DetectorGeometryBase::SetAsWorld
virtual void SetAsWorld() override
Definition: DetectorGeometryBase.cxx:185
DetectorGeometryBase::GetWorldVolume
G4VPhysicalVolume * GetWorldVolume() override final
Definition: DetectorGeometryBase.cxx:200
DetectorGeometryBase::m_offsetY
Gaudi::Property< double > m_offsetY
Definition: DetectorGeometryBase.h:77
DetectorGeometryBase::SetParent
void SetParent(IDetectorGeometryTool *) override
Definition: DetectorGeometryBase.cxx:190
DetectorGeometryBase::m_offsetX
Gaudi::Property< double > m_offsetX
Definition: DetectorGeometryBase.h:76
DetectorGeometryBase::ResetEnvelope
virtual void ResetEnvelope() override
Definition: DetectorGeometryBase.cxx:171
IDetectorGeometryTool
Definition: IDetectorGeometryTool.h:34
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DetectorGeometryBase::DetectorGeometryBase
DetectorGeometryBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: DetectorGeometryBase.cxx:13
DetectorGeometryBase::m_notifierSvc
ServiceHandle< IG4GeometryNotifierSvc > m_notifierSvc
Definition: DetectorGeometryBase.h:66
IG4GeometryNotifierSvc.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
DetectorGeometryBase::~DetectorGeometryBase
virtual ~DetectorGeometryBase()
Definition: DetectorGeometryBase.h:30
DetectorGeometryBase::m_envelope
Envelope m_envelope
Definition: DetectorGeometryBase.h:70
DetectorGeometryBase::PositionInParent
virtual void PositionInParent() override
Definition: DetectorGeometryBase.cxx:120
DetectorGeometryBase::m_detectorName
Gaudi::Property< std::string > m_detectorName
Definition: DetectorGeometryBase.h:71
DetectorGeometryBase::BuildSubDetectors
virtual void BuildSubDetectors() override
Definition: DetectorGeometryBase.cxx:155
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DetectorGeometryBase
Definition: DetectorGeometryBase.h:26
IDetectorGeometryTool.h
DetectorGeometryBase::m_rotateY
Gaudi::Property< double > m_rotateY
Definition: DetectorGeometryBase.h:74
DetectorGeometryBase::m_theParent
IDetectorGeometryTool * m_theParent
Definition: DetectorGeometryBase.h:68
ServiceHandle< IG4GeometryNotifierSvc >