ATLAS Offline Software
Loading...
Searching...
No Matches
BuildNSWReadoutGeometry.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <TString.h> // for Form
8
9#include <fstream>
10
15#include "GaudiKernel/ServiceHandle.h"
18
19using namespace MuonGM;
20
22
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)
static bool BuildReadoutGeometry(MuonGM::MuonDetectorManager *mgr)
CxxUtils::LockedPointer< AGDDController > LockedController
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27