ATLAS Offline Software
Loading...
Searching...
No Matches
MuonGMR4::ToroidDetectorTool Class Referencefinal

#include <ToroidDetectorTool.h>

Inheritance diagram for MuonGMR4::ToroidDetectorTool:
Collaboration diagram for MuonGMR4::ToroidDetectorTool:

Public Member Functions

virtual ~ToroidDetectorTool () override final
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

Gaudi::Property< std::string > m_mgrName {this, "ManagerName", "Toroid"}
 Under what name the detector manager can be found in store gate.
Gaudi::Property< std::vector< std::string > > m_treeTops {this, "TreeTops", {}}
 Name of the tree tops.
ToroidDetectorManagerm_manager {nullptr}
 Reference to the detector manger.

Detailed Description

Definition at line 13 of file ToroidDetectorTool.h.

Constructor & Destructor Documentation

◆ ~ToroidDetectorTool()

MuonGMR4::ToroidDetectorTool::~ToroidDetectorTool ( )
finaloverridevirtualdefault

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 MuonGMR4::ToroidDetectorTool::clear ( )
finaloverridevirtual

Reimplemented from GeoModelTool.

Definition at line 49 of file ToroidDetectorTool.cxx.

49 {
50 if (!m_manager) {
51 return StatusCode::SUCCESS;
52 }
53 SG::DataProxy *proxy = detStore()->proxy(ClassID_traits<ToroidDetectorManager>::ID(),
54 m_manager->getName());
55 if (proxy) {
56 proxy->reset();
57 m_manager = nullptr;
58 }
59 return StatusCode::SUCCESS;
60 }
ToroidDetectorManager * m_manager
Reference to the detector manger.

◆ create()

StatusCode MuonGMR4::ToroidDetectorTool::create ( )
finaloverridevirtual

Definition at line 12 of file ToroidDetectorTool.cxx.

12 {
13 GeoModelExperiment *theExpt = nullptr;
14 ATH_CHECK(detStore()->retrieve(theExpt, "ATLAS"));
15
16 const std::vector<std::string>& nodeNames{m_treeTops};
17 if (nodeNames.empty()) {
18 return StatusCode::SUCCESS;
19 }
20 std::vector<PVConstLink> treeTops{};
21
22 GeoVolumeCursor cursor{theExpt->getPhysVol()};
23
24 while (!cursor.atEnd()) {
25 std::string volName = cursor.getName();
26 ATH_MSG_VERBOSE("Check whether \""<<volName<<"\" belongs to the muon world. ");
27 if (std::ranges::find(nodeNames, volName) != nodeNames.end()) {
28 treeTops.push_back(cursor.getVolume());
29 }
30 cursor.next();
31 }
32 ATH_MSG_DEBUG("Include "<<treeTops.size()<<"/"<<nodeNames.size()
33 <<" nodes into the toroid manager ("<<m_mgrName<<").");
34 if (treeTops.empty()) {
35 ATH_MSG_ERROR("No top node could be found");
36 return StatusCode::FAILURE;
37
38 }
39 m_manager = new ToroidDetectorManager(m_mgrName);
40 for (const auto& link : treeTops) {
41 m_manager->addTreeTop(link);
42 }
43 ATH_CHECK(detStore()->record(m_manager, m_manager->getName()));
44 theExpt->addManager(m_manager);
45
46 return StatusCode::SUCCESS;
47 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
GeoPhysVol * getPhysVol()
Destructor.
void addManager(const GeoVDetectorManager *)
Gaudi::Property< std::string > m_mgrName
Under what name the detector manager can be found in store gate.
Gaudi::Property< std::vector< std::string > > m_treeTops
Name of the tree tops.
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_detector

GeoVDetectorManager* GeoModelTool::m_detector {nullptr}
protectedinherited

Definition at line 28 of file GeoModelTool.h.

28{nullptr};

◆ m_manager

ToroidDetectorManager* MuonGMR4::ToroidDetectorTool::m_manager {nullptr}
private

Reference to the detector manger.

Definition at line 31 of file ToroidDetectorTool.h.

31{nullptr};

◆ m_mgrName

Gaudi::Property<std::string> MuonGMR4::ToroidDetectorTool::m_mgrName {this, "ManagerName", "Toroid"}
private

Under what name the detector manager can be found in store gate.

Definition at line 27 of file ToroidDetectorTool.h.

27{this, "ManagerName", "Toroid"};

◆ m_treeTops

Gaudi::Property<std::vector<std::string> > MuonGMR4::ToroidDetectorTool::m_treeTops {this, "TreeTops", {}}
private

Name of the tree tops.

Definition at line 29 of file ToroidDetectorTool.h.

29{this, "TreeTops", {}};

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