ATLAS Offline Software
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 
19 using namespace MuonGM;
20 
22 
24  bool geoBuilt = true;
25 
26  ServiceHandle<IAGDDtoGeoSvc> svc("AGDDtoGeoSvc", "MMDetectorHelper");
27  if (svc.retrieve().isFailure()) { std::abort(); }
28  IAGDDtoGeoSvc::LockedController c = svc->getController();
29  detectorList& dList = c->GetDetectorStore().GetDetectorList();
30  detectorList::const_iterator it;
31  for (it = dList.begin(); it != dList.end(); ++it) {
32  std::vector<AGDDDetectorPositioner*>& dPos = ((*it).second)->GetDetectorPositioners();
33  for (unsigned int i = 0; i < dPos.size(); i++) {
34  std::string chTag = dPos[i]->ID.detectorAddress;
35  GeoFullPhysVol* vol = dPos[i]->theVolume;
36 
37  std::string stName = chTag.substr(0, 4);
38 
39  int etaIndex{999}, phiIndex{999}, mLayer{999}, iSide{0};
40  int iLS = atoi((chTag.substr(3, 1)).c_str()); // sTG3 and sMD3 are small chambers for small sectors
41  if (iLS == 3)
42  iLS = 1; // small
43  else
44  iLS = 0; // large
45  if (chTag.substr(13, 1) == "A")
46  iSide = 1;
47  else if (chTag.substr(13, 1) == "C")
48  iSide = -1;
49  etaIndex = iSide * atoi((chTag.substr(5, 1)).c_str());
50  phiIndex = atoi((chTag.substr(12, 1)).c_str());
51  mLayer = atoi((chTag.substr(7, 1)).c_str());
52  std::string vName = vol->getLogVol()->getName();
53  std::string sName = vName.substr(vName.find('-') + 1);
54 
55  if (chTag.substr(0, 3) == "sMD") {
56  std::unique_ptr<MMReadoutElement> re = std::make_unique<MMReadoutElement>(vol, sName, etaIndex, phiIndex, mLayer, mgr, passivData);
57  re->initDesign();
58  re->fillCache();
59  mgr->addMMReadoutElement(std::move(re));
60  } else if (chTag.substr(0, 3) == "sTG") {
61  std::unique_ptr<sTgcReadoutElement> re = std::make_unique<sTgcReadoutElement>(vol, sName, etaIndex, phiIndex, mLayer, mgr);
62  std::string myVolName = (chTag.substr(0, 8)).c_str();
63  re->initDesign(2.6);
64  re->fillCache();
65  mgr->addsTgcReadoutElement(std::move(re));
66  }
67  }
68  }
69  return geoBuilt;
70 }
AGDDController.h
BuildNSWReadoutGeometry.h
AGDDDetectorStore.h
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
CxxUtils::LockedPointer
A pointer together with a movable lock.
Definition: LockedPointer.h:35
BuildNSWReadoutGeometry::BuildReadoutGeometry
static bool BuildReadoutGeometry(MuonGM::MuonDetectorManager *mgr, const NswPassivationDbData *)
Definition: BuildNSWReadoutGeometry.cxx:23
sTgcReadoutElement.h
skel.it
it
Definition: skel.GENtoEVGEN.py:423
python.compareNtuple.vName
vName
Definition: compareNtuple.py:23
detectorList
std::map< std::string, AGDDDetector * > detectorList
Definition: AGDDDetectorStore.h:9
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
MMReadoutElement.h
NswPassivationDbData
Definition: NswPassivationDbData.h:20
lumiFormat.i
int i
Definition: lumiFormat.py:92
BuildNSWReadoutGeometry::BuildNSWReadoutGeometry
BuildNSWReadoutGeometry()
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
AGDDDetector.h
IAGDD2GeoSvc.h
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
re
const boost::regex re(r_e)
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
python.compressB64.c
def c
Definition: compressB64.py:93
ServiceHandle< IAGDDtoGeoSvc >