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

#include <BuildNSWReadoutGeometry.h>

Collaboration diagram for BuildNSWReadoutGeometry:

Public Member Functions

 BuildNSWReadoutGeometry ()

Static Public Member Functions

static bool BuildReadoutGeometry (MuonGM::MuonDetectorManager *mgr)

Detailed Description

Definition at line 15 of file BuildNSWReadoutGeometry.h.

Constructor & Destructor Documentation

◆ BuildNSWReadoutGeometry()

BuildNSWReadoutGeometry::BuildNSWReadoutGeometry ( )
default

Member Function Documentation

◆ BuildReadoutGeometry()

bool BuildNSWReadoutGeometry::BuildReadoutGeometry ( MuonGM::MuonDetectorManager * mgr)
static

Definition at line 23 of file BuildNSWReadoutGeometry.cxx.

23 {
24 bool geoBuilt = true;
25 ServiceHandle<IAGDDtoGeoSvc> svc("AGDDtoGeoSvc", "MMDetectorHelper");
26 if (svc.retrieve().isFailure()) { std::abort(); }
27 IAGDDtoGeoSvc::LockedController c = svc->getController();
28 detectorList& dList = c->GetDetectorStore().GetDetectorList();
29 detectorList::const_iterator it;
30 for (it = dList.begin(); it != dList.end(); ++it) {
31 std::vector<AGDDDetectorPositioner*>& dPos = ((*it).second)->GetDetectorPositioners();
32 for (unsigned int i = 0; i < dPos.size(); i++) {
33 std::string chTag = dPos[i]->ID.detectorAddress;
34 GeoFullPhysVol* vol = dPos[i]->theVolume;
35
36 std::string stName = chTag.substr(0, 4);
37
38 int etaIndex{999}, phiIndex{999}, mLayer{999}, iSide{0};
39 int iLS = atoi((chTag.substr(3, 1)).c_str()); // sTG3 and sMD3 are small chambers for small sectors
40 if (iLS == 3)
41 iLS = 1; // small
42 else
43 iLS = 0; // large
44 if (chTag.substr(13, 1) == "A")
45 iSide = 1;
46 else if (chTag.substr(13, 1) == "C")
47 iSide = -1;
48 etaIndex = iSide * atoi((chTag.substr(5, 1)).c_str());
49 phiIndex = atoi((chTag.substr(12, 1)).c_str());
50 mLayer = atoi((chTag.substr(7, 1)).c_str());
51 std::string vName = vol->getLogVol()->getName();
52 std::string sName = vName.substr(vName.find('-') + 1);
53
54 if (chTag.substr(0, 3) == "sMD") {
55 std::unique_ptr<MMReadoutElement> re = std::make_unique<MMReadoutElement>(vol, sName, etaIndex, phiIndex, mLayer, mgr);
56 re->initDesign();
57 re->fillCache();
58 mgr->addMMReadoutElement(std::move(re));
59 } else if (chTag.substr(0, 3) == "sTG") {
60 std::unique_ptr<sTgcReadoutElement> re = std::make_unique<sTgcReadoutElement>(vol, sName, etaIndex, phiIndex, mLayer, mgr);
61 std::string myVolName = (chTag.substr(0, 8)).c_str();
62 re->initDesign(2.6);
63 re->fillCache();
64 mgr->addsTgcReadoutElement(std::move(re));
65 }
66 }
67 }
68 return geoBuilt;
69}
std::map< std::string, AGDDDetector * > detectorList
const boost::regex re(r_e)
CxxUtils::LockedPointer< AGDDController > LockedController
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
AthROOTErrorHandlerSvc * svc
const std::string & stName(StIndex index)
convert StIndex into a string
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23

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