ATLAS Offline Software
MuonChamber.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 #include "MuonGeoModel/Csc.h"
7 #include "MuonGeoModel/Cutout.h"
8 #include "MuonGeoModel/Ded.h"
9 #include "MuonGeoModel/FPVMAP.h"
10 #include "MuonGeoModel/Mdt.h"
12 #include "MuonGeoModel/Position.h"
13 #include "MuonGeoModel/Rpc.h"
14 #include "MuonGeoModel/Spacer.h"
16 #include "MuonGeoModel/Station.h"
17 #include "MuonGeoModel/Tgc.h"
21 //
34 
35 // just to check subtype, cutout:
39 #include "MuonGeoModel/MYSQL.h"
42 //
47 //
48 #include "GaudiKernel/SystemOfUnits.h"
49 #include "GeoModelKernel/GeoBox.h"
50 #include "GeoModelKernel/GeoDefinitions.h"
51 #include "GeoModelKernel/GeoFullPhysVol.h"
52 #include "GeoModelKernel/GeoIdentifierTag.h"
53 #include "GeoModelKernel/GeoLogVol.h"
54 #include "GeoModelKernel/GeoMaterial.h"
55 #include "GeoModelKernel/GeoNameTag.h"
56 #include "GeoModelKernel/GeoPhysVol.h"
57 #include "GeoModelKernel/GeoSerialDenominator.h"
58 #include "GeoModelKernel/GeoShapeIntersection.h"
59 #include "GeoModelKernel/GeoShapeShift.h"
60 #include "GeoModelKernel/GeoShapeSubtraction.h"
61 #include "GeoModelKernel/GeoShapeUnion.h"
62 #include "GeoModelKernel/GeoTransform.h"
63 #include "GeoModelKernel/GeoTrd.h"
64 #include "GeoModelKernel/GeoTube.h"
65 
66 #include <fstream>
67 #include <iomanip>
68 #include <vector>
69 
70 #define RPCON true
71 #define useAssemblies false
72 
73 namespace {
74  // const maps holding the y/z translation for BIS RPCs (since they cannot be parsed by amdb)
75  const std::map<std::string, float> rpcYTrans = {
76  std::make_pair<std::string, float>("RPC26", -9.1), // big RPC7
77  std::make_pair<std::string, float>("RPC27", -9.1), // small RPC7
78  std::make_pair<std::string, float>("RPC28", -27.7), // big RPC8
79  std::make_pair<std::string, float>("RPC29", -8.8), // small RPC8
80  };
81  const std::map<std::string, float> rpcZTrans = {
82  std::make_pair<std::string, float>("RPC26", 3.22), // big RPC7
83  std::make_pair<std::string, float>("RPC27", 3.06), // small RPC7
84  std::make_pair<std::string, float>("RPC28", 3.11), // big RPC8
85  std::make_pair<std::string, float>("RPC29", 3.11), // small RPC8
86  };
87 } // namespace
88 
89 namespace MuonGM {
90 
91  // cutouts for BMS at eta=+-1 and phi=4 (RPC/DED/MDT) ok //16 tubes shorter + entire RPC and DED (of dbz1) narrower
92 
94  DetectorElement(s->GetName()),
95  AthMessaging{"MuGM::MuonChamber"} {
96  width = s->GetWidth1();
97  longWidth = s->GetWidth2();
98  thickness = s->GetThickness(mysql);
99  length = s->GetLength();
100  m_station = s;
101 
102  // CSL envelope is too small for its components - enlarge it slightly
103  std::string stname(m_station->GetName(), 0, 3);
104  if (stname == "CSL")
105  longWidth *= 1.015;
106 
107  }
108 
109  GeoVPhysVol *MuonChamber::build(StoredMaterialManager& matManager,
110  const MYSQL& mysql,
111  MuonDetectorManager *manager, int zi, int fi, bool is_mirrored, bool &isAssembly) {
112  ATH_MSG_VERBOSE( " Building a MuonChamber for m_station " << m_station->GetName() << " at zi, fi " << zi << " " << fi + 1 << " is_mirrored " << is_mirrored
113  << " is assembly = " << isAssembly );
114 
115  std::string stname(m_station->GetName(), 0, 3);
116 
117  double halfpitch = m_station->mdtHalfPitch(mysql);
118  const std::string stName = m_station->GetName();
119 
120  const MdtIdHelper *mdt_id = manager->mdtIdHelper();
121  int stationType = mdt_id->stationNameIndex(stName.substr(0, 3));
122  bool is_barrel = (stName.compare(0, 1, "B") == 0);
123 
124  std::string geometry_version = manager->geometryVersion();
125  double extratop = m_station->GetExtraTopThickness();
126  double extrabottom = m_station->GetExtraBottomThickness();
127  double totthick = thickness + extratop + extrabottom;
128 
129  GeoTrd *maintrd;
130  maintrd = new GeoTrd(totthick / 2, totthick / 2, width / 2, longWidth / 2, length / 2);
131 
132  if (length <= 0) {
133  ATH_MSG_ERROR( " Invalid length " << length << " for m_station " << m_station->GetName() << " fi/zi " << fi + 1 << "/" << zi );
134  }
135 
136  ATH_MSG_VERBOSE( " MuonChamber size thick,w,lw,l " << totthick << ", " << width << ", " << longWidth << ", " << length );
137 
138  const GeoShape *strd = nullptr;
139  double dx = 0.;
140  if ((extratop + extrabottom) != 0.) {
141  // sup on top & bottom
142  dx = extratop / 2. - extrabottom / 2.;
143 
144  ATH_MSG_VERBOSE( " m_station name " << m_station->GetName() << " extra top, bottom, dx = " << extratop << " " << extrabottom );
145  strd = &((*maintrd) << GeoTrf::Translate3D(dx, 0., 0.));
146  } else {
147  strd = maintrd;
148  }
149 
150  double amdbOrigine_along_length = m_station->getAmdbOrigine_along_length();
151  double amdbOrigine_along_thickness = m_station->getAmdbOrigine_along_thickness(mysql);
152 
153  // Fix clash of EIS1 and CSS1. Cut out upper corner of CSS1 envelope (along long width)
154  if (stname == "CSS") {
155  StandardComponent *comp = nullptr;
156  double clen = 0;
157  double cthick = 0;
158  double cypos = 0;
159  double cxpos = 0;
160  for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
162  if ((comp->name).compare(0, 3, "CSC") == 0) {
163  clen = comp->dy;
164  cthick = comp->GetThickness(mysql);
165  cypos = clen - comp->posy + 1.0 - length / 2.;
166  cxpos = -totthick / 2. + comp->posz + cthick / 2. + 0.1;
167  break;
168  }
169  }
170  GeoIntrusivePtr<GeoShape> box{new GeoBox(cthick / 2., longWidth / 2., (length - clen) / 2.)};
171  strd = &(strd->subtract((*box) << GeoTrf::Translate3D(cxpos, 0., cypos)));
172  }
173 
174  if (m_enableFineClashFixing > 0) {
175  // Mother volume modifications for specific chambers
176 
177  // Fix clashes of non-cutout BMS with BTWingRib
178  if ((stname == "BMS" && std::abs(zi) == 5) || (stname == "BMS" && std::abs(zi) == 1 && fi != 3)) {
179  StandardComponent *comp = nullptr;
180  double cutlen = 0.;
181  double cutthick = 0.;
182  double top_edge = 0.;
183  for (int i = m_station->GetNrOfComponents() - 2; i > -1; i--) {
185  top_edge = comp->posy + comp->dy;
186  cutlen = length - top_edge;
187  if ((comp->posy != 0 && cutlen > 0.1) || comp->dy > 0.75 * length) {
188  cutthick = comp->GetThickness(mysql) + 1.;
189  break;
190  }
191  }
192  GeoIntrusivePtr<GeoShape> box1{new GeoBox(cutthick / 2., (longWidth + 2.) / 2., cutlen)};
193  strd = &(strd->subtract((*box1) << GeoTrf::Translate3D((totthick - cutthick) / 2., 0., length / 2.)));
194  }
195  }
196 
197  // Skip mother volume modifications for assembly volumes since they cannot cause clash
198  if (!isAssembly) {
199  bool testEIL = (stname == "EIL" && std::abs(zi) != 1 && (std::abs(zi) != 4 || fi == 0 || fi == 4));
200 
201  if ((m_enableFineClashFixing && (stname == "BML" || stname == "BIL" || stname == "BOL" || stname == "BMS" || stname == "BIS" || stname == "BOS")) || testEIL) {
202  double root3 = 1.7320508;
203  StandardComponent *comp = nullptr;
204  double mdt_half_thick = -1.;
205  double mdt_pos = 0.;
206  double xtube1 = 0;
207  double xtube2 = 0;
208 
209  int index = 0;
210  int mdt_index[4] = {0, 0, 0, 0};
211  for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
213  if (comp->name.compare(0,3,"MDT") == 0) {
214  mdt_index[index] = i;
215  index += 1;
216  }
217  }
218 
219  // Prepare boxes and cylinders for chamber volume mods
220  GeoIntrusivePtr<GeoShape> box{new GeoBox((totthick + 2.) / 2., (longWidth + 2.) / 2., halfpitch)};
221  GeoIntrusivePtr<const GeoShape> frontcyl{new GeoTube(0.0, halfpitch + 0.001, longWidth / 2.)};
222  frontcyl = &((*frontcyl) << GeoTrf::RotateX3D(90. * Gaudi::Units::deg));
223  GeoIntrusivePtr<const GeoShape> backcyl{new GeoTube(0.0, halfpitch - 0.001, (longWidth + 2.) / 2.)};
224  backcyl = &((*backcyl) << GeoTrf::RotateX3D(90. * Gaudi::Units::deg));
225 
226  if (index > 0) {
227  // If chamber has MDTs, shorten length by halfpitch (remove what was added in DBReader.h)
228  strd = &(strd->subtract((*box) << GeoTrf::Translate3D(0., 0., length / 2.)));
229  double sign = 1.;
230  for (int i = 0; i < index; i++) {
231  comp = (StandardComponent *)m_station->GetComponent(mdt_index[i]);
232  mdt_half_thick = comp->GetThickness(mysql) / 2.;
233  mdt_pos = -totthick / 2. + comp->posz + mdt_half_thick;
234  mdt_pos += amdbOrigine_along_thickness;
235  xtube1 = sign * (mdt_half_thick - (root3 + 1.) * halfpitch);
236  xtube2 = sign * (mdt_half_thick - (3 * root3 + 1.) * halfpitch);
237  strd = &(strd->add((*frontcyl) << GeoTrf::Translate3D(mdt_pos + xtube1, 0., length / 2. - halfpitch)));
238  strd = &(strd->subtract((*backcyl) << GeoTrf::Translate3D(mdt_pos + xtube1, 0., -length / 2.)));
239 
240  if (stname == "BIL" || (stname == "BIS" && std::abs(zi) != 8) || testEIL) {
241  strd = &(strd->add((*frontcyl) << GeoTrf::Translate3D(mdt_pos + xtube2, 0., length / 2. - halfpitch)));
242  strd = &(strd->subtract((*backcyl) << GeoTrf::Translate3D(mdt_pos + xtube2, 0., -length / 2.)));
243  }
244 
245  sign *= -1.;
246  }
247  }
248  if (stname != "EIL") {
249  if (zi < 0 && !is_mirrored)
250  strd = &((*strd) << GeoTrf::RotateX3D(180. * Gaudi::Units::deg));
251  }
252 
253  } // fine clash fixing
254  } // !isAssembly
255 
256  // This will allow the MDT tube structure to be mirrored w.r.t. the chamber at z>0
257  // and to correctly place any other component in the m_station
258  if (zi < 0 && !is_mirrored && stName[0] == 'B') {
259  if (m_station->hasMdts()) {
260  amdbOrigine_along_length += halfpitch;
261  }
262  }
263  ATH_MSG_VERBOSE( "amdb origine: in the length direction = " << amdbOrigine_along_length
264  << " in the thickness direction = " << amdbOrigine_along_thickness);
265 
266  if (isAssembly) {
267  ATH_MSG_DEBUG( "Station " << stName << " at zi, fi " << zi << " " << fi + 1 << " will be described as Assembly" );
268  }
269 
270  // for BOG in layout Q we will have to shorten CHV, CMI as these
271  // are not shortened in AMDB
272  // double lengthShiftCP = 0.;
273 
274  // if this is a BOG, we want to make cutouts in the MOTHER VOLUME
275  if (stName.compare(0, 3, "BOG") == 0 && (manager->IncludeCutoutsBogFlag() || manager->IncludeCutoutsFlag())) {
276 
277  ATH_MSG_VERBOSE( "amdb org: length= " << amdbOrigine_along_length << " thickness= " << amdbOrigine_along_thickness );
278 
279  std::string statType = stName.substr(0, 3);
280  if (m_station->GetNrOfCutouts() > 0) {
281  ATH_MSG_DEBUG( "Station " << stName << " at zi, fi " << zi << " " << fi + 1 << " has components with cutouts " );
282  isAssembly = true;
283 
284  // look for FIRST component with cutouts and loop over all of the cutouts:
285  bool foundCutouts = false;
286  for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
288 
289  if (!foundCutouts) {
290  for (int ii = 0; ii < m_station->GetNrOfCutouts(); ii++) {
291  Cutout *cut = m_station->GetCutout(ii);
292  // if this is a BOG in layout Q, set the CP param:
293  // (both cuts have same length so ok to reset it)
294  // also do here some tweaking to prevent undershoot
295  // of the cutouts wrt mother volume:
296  if (std::abs(cut->dx - 600.7) < 0.1) {
297  cut->dx = cut->dx + 10. * Gaudi::Units::mm;
298  cut->widthXs = cut->widthXs + 20. * Gaudi::Units::mm;
299  cut->widthXl = cut->widthXl + 20. * Gaudi::Units::mm;
300  }
301  if (std::abs(cut->dx + 600.7) < 0.1) {
302  cut->dx = cut->dx - 10. * Gaudi::Units::mm;
303  cut->widthXs = cut->widthXs + 20. * Gaudi::Units::mm;
304  cut->widthXl = cut->widthXl + 20. * Gaudi::Units::mm;
305  }
306  if (std::abs(cut->lengthY - 180.2) < 0.001) {
307  cut->lengthY = cut->lengthY + (0.010) * Gaudi::Units::mm;
308  }
309  if (std::abs(cut->dy - 1019.8) < 0.001) {
310  cut->dy = 1216.4185 - cut->lengthY;
311  }
312  // create the cutout with the full thickness of the STATION
313  cut->setThickness(totthick * 1.01); // extra to be sure
314  if ((cut->subtype == mysql.allocPosFindSubtype(std::string(statType), fi, zi)) && (cut->icut == mysql.allocPosFindCutout(std::string(statType), fi, zi)) &&
315  (cut->ijob == c->index)) {
316 
317  foundCutouts = true;
318  }
319  } // Loop over cutouts
320  } // If no cutouts
321  } // Loop over components
322  }
323  } // end of special loop just for cutouts
324 
325  // remove overlaps between end-cap and forward region of TGC stations,
326  // T[1-3]E1_station and T[1-3]F1_station
327  if (stName.compare(0, 1, "T") == 0 && stName.compare(2, 1, "E") == 0 && stName.compare(1, 1, "4") != 0) {
328  GeoTrd *strdoverlap = new GeoTrd(totthick / 4, totthick / 4, width / 2, longWidth / 2, 400. / 2);
329  strd = &(strd->subtract((*strdoverlap) << GeoTrf::Translate3D(-totthick / 4., 0., -length / 2 + 400. / 2.)));
330  }
331 
332  const GeoMaterial *mtrd = nullptr;
333  if (useAssemblies || isAssembly) {
334  mtrd = matManager.getMaterial("special::Ether");
335  } else {
336  mtrd = matManager.getMaterial("std::Air");
337  }
338  GeoLogVol *ltrd = new GeoLogVol(std::string(stName) + "_Station", strd, mtrd);
339  GeoPhysVol *ptrd = new GeoPhysVol(ltrd);
340 
341  double ypos{0.}, zpos{0.}, xpos{0.}, irad{0.};
342  std::array<int, 2> ndbz{0, 0};
343 
344  // Compute how many RPC modules there are in the m_station
345  int nDoubletR{0}, nRpc{0}, nTgc{0}, nCsc{0}, nMdt{0};
346  double previous_depth = 0.;
347  ATH_MSG_VERBOSE( " Station Name = " << stName << " fi/zi " << fi << "/" << zi << " defining the n. of DoubletR to " );
348 
349  for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
351  std::string_view cn = std::string_view(d->name).substr(0, 3);
352  if (cn == "RPC") {
353  nRpc++;
354  if (nRpc == 1)
355  nDoubletR++;
356  double depth = -thickness / 2. + d->posz + d->GetThickness(mysql) / 2.;
357  // std::cerr << " nRpc, nDoubletR, depth " << nRpc << " " << nDoubletR
358  // << " " << depth;
359  // BI RPC Chambers have one one doubletR
360  if (!(stname.compare(0, 2, "BI") == 0) && nDoubletR == 1 && nRpc > 1 && depth * previous_depth < 0)
361  nDoubletR++;
362  // std::cerr<<" updated to "<<nDoubletR<<std::endl;
363 
364  previous_depth = depth;
365  }
366  if (cn == "CSC") {
367  nCsc++;
368  }
369  if (cn == "TGC") {
370  nTgc++;
371  }
372  if (cn == "MDT") {
373  nMdt++;
374  }
375  }
376  ATH_MSG_DEBUG( " " << nDoubletR<<" nMdt/Rpc/Tgc/Csc " << nMdt << "/" << nRpc << "/" << nTgc << "/" << nCsc );
377 
378  // Get location and dimensions of long beams and pass them to cross beams
379  // in order to make holes
380  int numLB = -1;
381  double LBheight{0.}, LBwidth{0.}, LByShift{0.};
382  std::array<double, 2> LBpos{-1, -1};
383  for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
385  std::string_view cname = std::string_view(c->name).substr(0, 2);
386  if (cname == "LB") {
387  const LBI *lb = dynamic_cast<const LBI *>(mysql.GetTechnology(c->name));
388  LByShift = lb->yShift;
389 
390  numLB++;
391  LBpos[numLB] = c->posy + c->dy / 2.;
392  LBheight = lb->height;
393  LBwidth = c->dy;
394  }
395  if (numLB > 0)
396  break; // only 2 LBs per chamber
397  }
398 
399  for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
401  std::string_view cname = std::string_view(c->name).substr(0, 3);
402  if (cname == "CRO" || cname == "CMI" || cname == "CHV") {
403  CbmComponent *ccbm = (CbmComponent *)c;
404  ccbm->lb_height = LBheight;
405  ccbm->lb_width = LBwidth;
406  ccbm->hole_pos1 = LBpos[0];
407  ccbm->hole_pos2 = LBpos[1];
408  }
409  }
410 
411  // Look for the subtype of the CMI in the chamber to let LB know ...
412  std::string CMIcomponentNumber = "";
413  for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
415  std::string_view cn = std::string_view(d->name).substr(0, 3);
416  if (cn == "CMI") {
417  CMIcomponentNumber = (d->name).substr(3, 2);
418  break;
419  }
420  }
421 
422  for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
424  std::string_view cn = std::string_view(d->name).substr(0, 2);
425  if (cn == "LB") {
426  LbiComponent *lbic = (LbiComponent *)d;
427  if (lbic) {
428  lbic->associated_CMIsubtype = CMIcomponentNumber;
429  } else
430  ATH_MSG_ERROR( "MuonChamber :: cannot associate a CMI subtype to the LB component " );
431  }
432  }
433 
434  // Build the MuonStation(readout-geometry) corresponding to this MuonChamber(raw-geometry)
435  MuonStation *mstat{nullptr};
436  if (stName.compare(0, 1, "B") == 0) {
437  mstat = new MuonStation(stName.substr(0, 3), width, totthick, length, longWidth, totthick, length, zi, fi + 1,
438  (zi < 0 && !is_mirrored));
439  } else {
440  mstat = new MuonStation(stName.substr(0, 3), width, length, totthick, longWidth, length, totthick, zi, fi + 1,
441  (zi < 0 && !is_mirrored));
442  }
443  mstat->setPhysVol(ptrd);
444  manager->addMuonStation(std::unique_ptr<MuonStation>(mstat));
445  ATH_MSG_DEBUG( " Building a MuonStation for this MuonChamber "
446  << m_station->GetName() << " at zi, fi " << zi << " " << fi + 1 << " is_mirrored " << is_mirrored);
447 
448  // here the big loop over the components !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
449 
450  for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
452  ATH_MSG_VERBOSE( " Component index " << c->index << " in loop for " << stName << " " << stationType << " at zi, fi " << zi << " " << fi + 1 << " cName "
453  << c->name << " thickness " << c->GetThickness(mysql) << " length " << c->dy << " w, lw " << c->dx1 << " " << c->dx2 );
454  ATH_MSG_VERBOSE( " Component local (amdb) coords " << c->posx << " " << c->posy << " " << c->posz );
455 
456  ypos = -thickness / 2. + c->posz + c->GetThickness(mysql) / 2.;
457  zpos = 0.;
458  xpos = 0.;
459 
460  ypos = -thickness / 2. + (c->posz + amdbOrigine_along_thickness) + c->GetThickness(mysql) / 2.;
461  zpos = -length / 2. + amdbOrigine_along_length + c->posy + c->dy / 2.;
462  xpos = c->posx;
463 
464  const std::string &techname = c->name;
465  std::string_view type = std::string_view(techname).substr(0, 3);
466 
467  GeoVPhysVol *lv = nullptr;
468  GeoVPhysVol *lvd = nullptr;
469  GeoVPhysVol *lvs = nullptr;
470  GeoVPhysVol *lvo = nullptr;
471  GeoFullPhysVol *lvm = nullptr;
472  GeoFullPhysVol *lvr = nullptr;
473  GeoFullPhysVol *lvt = nullptr;
474  GeoFullPhysVol *lvc = nullptr;
475 
476  double BeamHeight;
477 
478  // Are there cutouts?
479  std::string statType = stName.substr(0, 3);
480  double cthickness = c->GetThickness(mysql);
481  int ncutouts = 0;
482  std::vector<Cutout *> vcutdef;
483  std::vector<std::unique_ptr<Cutout>> vcutdef_todel;
484  for (int ii = 0; ii < m_station->GetNrOfCutouts(); ii++) {
485  Cutout *cut = m_station->GetCutout(ii);
486  cut->setThickness(cthickness * 1.01); // extra thickness to be sure
487 
488  if ((cut->subtype == mysql.allocPosFindSubtype(std::string(statType), fi, zi)) && (cut->icut == mysql.allocPosFindCutout(std::string(statType), fi, zi)) && (cut->ijob == c->index)) {
489 
490  double tempdx = cut->dx;
491  double tempdy = cut->dy;
492  double templengthY = cut->lengthY;
493  cut->dx = 0.;
494  cut->dy = 0.;
495 
496  if (stName.compare(0, 3, "BOG") == 0) {
497  // make the cutouts a bit longer
498  cut->lengthY = templengthY + 31.;
499  }
500 
501  cut->dx = tempdx;
502  cut->dy = tempdy;
503 
504  if (std::abs(cut->dead1) > 1. && techname == "MDT03")
505  cut->dy = cut->dy + 15.0 * cos(cut->dead1 * Gaudi::Units::deg);
506  // should compensate for the dy position defined in amdb at the bottom of the foam in ML 1 of EMS1,3 and BOS 6
507  // can be applied only for layout >=r.04.04 in rel 15.6.X.Y due to the frozen Tier0 policy
508 
509  cut->lengthY = templengthY;
510  // in thickness, cutout will coincide with component
511  // not needed (DHW) double xposcut = 0.; // rel. to component thickness
512  // double yposcut = -xpos+cut->dx; // rel. to component width
513  // double zposcut = -zpos+cut->dy; // rel. to component length
514  // if (stName.substr(0,3)=="BOG")
515  // {
516  // move the extended cut region out a little
517  // if (cut->dy < 10.) zposcut = -zpos+cut->dy - 15.5;
518  // }
519  ncutouts++;
520  ATH_MSG_VERBOSE( "A new cutout for this component " );
521  ATH_MSG_VERBOSE( *cut );
522 
523  // Corrected cutout values for BMS7, BMS14
524  if (stName.compare(0, 3, "BMS") == 0) {
525  if (fi == 3) { // stationPhi = 4
526  if (std::abs(zi) == 1) { // stationEta = +-1
527  double margin = 1.0; // make cutout a little bigger to avoid coincident boundaries
528 
529  if (type == "RPC" || type == "DED") {
530  cut->widthXl += 2 * margin;
531  cut->widthXs += 2 * margin;
532  cut->dx += margin;
533  cut->lengthY += 2 * margin;
534 
535  if (zi > 0)
536  cut->dy = -margin;
537  }
538  }
539 
540  if (zi == -1) {
541  if (type == "MDT")
542  cut->dy = 0.;
543  }
544  }
545  }
546 
547  // the following is a fine tuning ----- MUST CHECK for a better solution
548  if (stName.compare(0, 3,"BOS") == 0 && zi == -6 && type == "MDT") {
549  cut->dy = c->dy - cut->dy - cut->lengthY - halfpitch;
550  cut->dead1 = 30.; // why this is not 30. or -30. already ?????
551  if (techname == "MDT03")
552  cut->dy = cut->dy + 30.0; // *cos(cut->dead1*Gaudi::Units::deg);
553 
554  ATH_MSG_VERBOSE( "Cut dead1 for BOS 6 on C side is " << cut->dead1 );
555 
556  }
557 
558  // this mirroring of the cutout is necessary only for barrel MDT chambers; for EC the cutout will be automatically mirrored
559  // this fix cannot be applied in 15.6.X.Y for layout < r.04.04 due to the frozen tier0 policy
560 
561  if (type == "MDT" && (is_mirrored || zi < 0) && stName.compare(0, 1, "B") == 0) {
562  // MDT in chambers explicitly described at z<0 have to be
563  // rotated by 180deg to adj. tube staggering
564  // reverse the position (x amdb) of the cutout if the m_station is mirrored
565  Cutout *cutmirr = new Cutout(*cut);
566  cutmirr->dx = -cutmirr->dx;
567  // this way, after the rotation by 180 Gaudi::Units::deg, the cut will be at the same global phi
568  // it has for the m_station at z>0
569  vcutdef.push_back(cutmirr);
570  vcutdef_todel.emplace_back(cutmirr);
571  ATH_MSG_VERBOSE( "adding for application mirrored cut \n" << *cutmirr );
572 
573  } else if (type == "RPC" || type == "DED") {
574  Cutout *cutRpcType = new Cutout(*cut);
575  // temporary for testing fixes to r.03.09
576  if (stName.compare(0, 3, "BMS") == 0 && zi == 4 && (c->index == 20 || c->index == 21 || c->index == 24 || c->index == 25)) {
577  cutRpcType->dy = 1102.5;
578  }
579 
580  if (stName.compare(0, 3, "BOS") == 0 && zi == 6 && type == "DED")
581  cutRpcType->dy = 706.;
582 
583  cutRpcType->dy = cutRpcType->dy - c->posy;
584  cutRpcType->dx = cutRpcType->dx - c->posx;
585 
586  if (type == "RPC") {
588  if (rp->iswap == -1) {
589  cutRpcType->dy = c->dy - (cutRpcType->dy + cutRpcType->lengthY);
590  }
591  }
592 
593  ATH_MSG_VERBOSE( " Rpc or ded cutout redefined as follows \n" << *cutRpcType );
594  vcutdef.push_back(cutRpcType);
595  vcutdef_todel.emplace_back(cutRpcType);
596  } else if (type == "TGC") {
597  // In AMDB, y coordinates of cutout and component are given by
598  // radius from detector z-axis. To get standard y value of cutout,
599  // subtract radius of component from radius of cutout
600  Cutout *tgccut = new Cutout(*cut);
601  tgccut->dy -= c->posy; //
602 
603  ATH_MSG_VERBOSE( " Tgc cutout redefined as follows \n" << *tgccut );
604  vcutdef.push_back(tgccut);
605  vcutdef_todel.emplace_back(tgccut);
606  } else {
607  vcutdef.push_back(cut);
608  }
609  }
610  } // Loop over cutouts in m_station
611 
612  if (ncutouts > 0) {
613  ATH_MSG_DEBUG( c->name << " of station " << stName << " at fi/zi " << fi + 1 << "/" << zi << " has " << ncutouts << " cutouts " );
614 
615  }
616  // define here the total transform that will be applied to component:
617  GeoTrf::Transform3D htcomponent(GeoTrf::Transform3D::Identity());
618  GeoTransform *xfcomponent{nullptr};
619  GeoAlignableTransform *xfaligncomponent{nullptr};
620  // for RPCs we need a vector of transforms for M28 geometry...
621 
622  if (type == "CRO") {
623  if (stName.compare(0, 1, "B") != 0 && is_mirrored)
624  mstat->setxAmdbCRO(-xpos);
625  else
626  mstat->setxAmdbCRO(xpos);
627  }
628 
629  if (type == "MDT") {
630  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateZ3D(zpos) * GeoTrf::TranslateY3D(xpos);
631 
632  if (zi < 0 && !is_mirrored && stName[0] == 'B') {
633  // this (rotation + shift of halfpitch) will mirror the tube structure w.r.t. the chamber at z>0
634  htcomponent = htcomponent * GeoTrf::RotateX3D(180. * Gaudi::Units::deg);
635  htcomponent = htcomponent * GeoTrf::TranslateZ3D(halfpitch);
636  }
637 
638  // ss - 24-05-2006 I don't really understand if this is needed at all
639  // it was introduced by Isabel T.
640  if (zi < 0 && stName.compare(0, 3, "BOG") == 0 && is_mirrored) {
641  // htcomponent = htcomponent*GeoTrf::RotateX3D(180.*Gaudi::Units::deg);
642  // tubes OK but chambers wrong
643  // htcomponent = GeoTrf::RotateX3D(180.*Gaudi::Units::deg)*htcomponent;
644  // chambers OK but tubes wrong
645  htcomponent = GeoTrf::RotateX3D(180. * Gaudi::Units::deg) * htcomponent * GeoTrf::RotateX3D(180. * Gaudi::Units::deg); // turn chambers but go back for tubes
646  } // ss - 24-05-2006 I don't really understand if this is needed at all
647 
648  xfaligncomponent = new GeoAlignableTransform(htcomponent);
649  std::string key =std::string( stName) + techname;
650 
651  // for cutouts:
652  // MDT cutouts for BOS1,5, BMS7,14, (problem with BMS4,10), EMS, BMG and BIS MDT14
653  bool mdtCutoutFlag = ((stname == "BOS" && std::abs(zi) == 6) || stname == "BMG" || techname == "MDT14" || (stname == "BMS" && (std::abs(zi) == 1 && fi == 3)) ||
654  (stname == "EMS" && (std::abs(zi) == 1 || std::abs(zi) == 3)));
655  if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
656  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
657  } else if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG")) == 0) && zi < 0) {
658  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
659  }
660 
661  GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
662  if (fpv == nullptr) {
663  std::unique_ptr<Mdt> r = std::make_unique<Mdt>(mysql, c, stName + techname);
664  ATH_MSG_DEBUG( " Building an MDT for station " << key << " component name is " << c->name <<
665  " stName "<<stName<<" techName: "<<techname<< " manager->IncludeCutoutsFlag() "
666  << manager->IncludeCutoutsFlag() << " manager->IncludeCutoutsBogFlag() " << manager->IncludeCutoutsBogFlag() );
667 
668 
669  if ((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
670  lvm = r->build(matManager, mysql, vcutdef);
671  } else {
672  lvm = r->build(matManager, mysql);
673  }
674  m_FPVMAP->StoreDetector(lvm, key);
675  } else {
676  GeoFullPhysVol *rfpv = (GeoFullPhysVol *)fpv;
677  ATH_MSG_VERBOSE( " This MDT for station " << key << " component name is " << c->name << " already exists; clone it " );
678  lvm = rfpv->clone();
679  }
680 
681  } else if (type == "SPA" && manager->MinimalGeoFlag() == 0) {
682  if (techname == "SPA01" && stName.compare(0, 1, "C") == 0) {
683  ATH_MSG_DEBUG( "Ficticious spacer SPA01 in CSC chamber - skip it " );
684  // ignore SPA 1 component of CSS/CSL chambers in R02.03 (it is there only for AMDB convenience,
685  // leaving the CSC envelop => global position of the m_station unchanged)
686  continue;
687  }
688 
689  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateZ3D(zpos);
690  xfcomponent = new GeoTransform(htcomponent);
691  std::string key = std::string(stName) + techname;
692  if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
693  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
694  } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3,"BOG") == 0)) && zi < 0) {
695  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
696  }
697 
698  GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
699  if (fpv == nullptr) {
700  std::unique_ptr<Spacer>r = std::make_unique<Spacer>(mysql, c);
701  ATH_MSG_DEBUG( " Building a SPA for m_station "<< key << " component name is " << c->name );
702  if (manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
703  lv = r->build(matManager, 1);
704  } else {
705  lv = r->build(matManager);
706  }
707  ATH_MSG_DEBUG( " Storing in FPVMAP with key " << key );
708  m_FPVMAP->StoreDetector(lv, key);
709  } else {
710  lv = fpv;
711  }
712  } else if ((type == "CHV" || type == "CRO" || type == "CMI" || type == "LB0" || type == "LBI") && manager->MinimalGeoFlag() == 0) {
713  std::unique_ptr<SpacerBeam> r = std::make_unique<SpacerBeam>(mysql, c);
714  BeamHeight = r->height;
715  ypos = c->posx;
716  double xpos = (c->posz + amdbOrigine_along_thickness) - thickness / 2. + BeamHeight / 2.;
717  if (type.compare(0, 2, "LB") == 0)
718  xpos -= LByShift;
719 
720  double angle = 0.;
721  if (std::abs(c->excent) > 0.001) {
722  angle = atan((longWidth - width) / length / 2.);
723  if (c->excent < 0.)
724  angle = -angle;
725  }
726 
727  // This is an attempt to provide some info to LB construction in order
728  // to avoid the clash of LB with CXx in the endcaps ...
729  if (type == "LB0") {
730  if (stName == "EML1" || stName == "EML6") {
731  if ((c->dx1 > width) && zpos < 0.) {
732  r->width = 0.98 * width;
733  }
734  if ((c->dx1 / longWidth) > 0.98 && zpos > 0.) {
735  double mywidth = 0.93 * longWidth;
736  r->width = mywidth;
737  }
738  }
739  }
740 
741  if (type == "CMI" || type == "CHV" || type == "CRO") {
742  // Shorten CHV, CMI lengths to fit in BOL4 envelope
743  if (stname == "BOL" && zi == 1 && (fi + 1) == 3) {
744  r->length = length - halfpitch;
745  zpos = -halfpitch / 2.;
746  }
747  }
748 
749  if (!is_mirrored) {
750  htcomponent = GeoTrf::Translate3D(xpos, ypos, zpos) * GeoTrf::RotateX3D(angle);
751  } else {
752  htcomponent = GeoTrf::Translate3D(xpos, -ypos, zpos) * GeoTrf::RotateX3D(-angle);
753  }
754  xfcomponent = new GeoTransform(htcomponent);
755 
756  std::string key = stName + techname;
757  if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
758  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
759  } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi < 0) {
760  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
761  }
762  // can have LB of different length in same m_station:
763  if (type.substr(0, 2) == "LB")
764  key += buildString(int(c->dx1), 0);
765 
766  ATH_MSG_DEBUG( " Building a SpacerBeam for m_station "<< key << " component name is "<< c->name );
767  GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
768  if (fpv == nullptr || (stName.compare(0, 3, "BOG") == 0 && type == "CMI")) {
769  if (stName.compare(0, 3, "BOG") == 0) {
770  ATH_MSG_VERBOSE( " Building a SpacerBeam for station " << key << " component name is " << c->name );
771  }
772  if (manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
773  lvo = r->build(matManager, 1, is_barrel);
774  } else {
775  lvo = r->build(matManager, is_barrel);
776  }
777  m_FPVMAP->StoreDetector(lvo, key);
778  // AMDB origin is in bottom centre of bottom cross-piece at
779  // end of bar.
780  // From centre, it is -height/2 in x, 0 in y, -length/2 in z
781  } else {
782  if (stName.compare(0, 3,"BOG") == 0)
783  ATH_MSG_VERBOSE( " This spacerbeam for station " << key << " component name is " << c->name << " already exists; re-use it " );
784  lvo = fpv;
785  }
786 
787  } else if (type == "RPC") {
788  // position stuff needed for cutout, used to be below:
790  int ndivy = rp->ndivy;
791  int ndivz = rp->ndivz;
792 
793  if (ndivz != 1 || ndivy != 1) {
794  ATH_MSG_ERROR( " RPC segmentation z,y " << ndivz << " " << ndivy );
795  }
796 
797  double xpos = c->posx;
798  // implement really the mirror symmetry
799  if (is_mirrored)
800  xpos = -xpos;
801 
802  ATH_MSG_VERBOSE( " In station " << stName << " with " << nDoubletR << " doubletR,"
803  << " RPC " << (c->name).substr(3, 2) << " has swap flag = " << rp->iswap << " ypos, zpos " << ypos << " " << zpos << " " );
804 
805  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateY3D(xpos) * GeoTrf::TranslateZ3D(zpos);
806  if (rp->iswap == -1) { // this is like amdb iswap
807  htcomponent = htcomponent * GeoTrf::RotateY3D(180 * Gaudi::Units::deg);
808  }
809  xfaligncomponent = new GeoAlignableTransform(htcomponent);
810 
811  // end of position stuff
812 
813  bool rpcCutoutFlag = (stname == "BOS" && std::abs(zi) == 6) || (stname == "BMS" && (std::abs(zi) == 2 || std::abs(zi) == 4 || std::abs(zi) == 6)) ||
814  (stname == "BMS" && std::abs(zi) == 1 && fi == 3);
815  std::string key = stName + techname;
816  if (((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
817  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0) + "_" +
818  buildString(vcutdef.size(), 0) + "_" + buildString(rp->iswap, 0);
819  } else if (((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi < 0) {
820  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0) + "_" +
821  buildString(vcutdef.size(), 0) + "_" + buildString(rp->iswap, 0);
822  }
823  GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
824  if (fpv == nullptr) {
825  std::unique_ptr<Rpc> r = std::make_unique<Rpc>(mysql, c);
826  r->setLogVolName(std::string(stName) + techname);
827  if (stName.find("BI") != std::string::npos) {
828  std::map<std::string, float>::const_iterator yItr = rpcYTrans.find(techname);
829  if (yItr != rpcYTrans.end())
830  r->y_translation = yItr->second;
831  std::map<std::string, float>::const_iterator zItr = rpcZTrans.find(techname);
832  if (zItr != rpcZTrans.end())
833  r->z_translation = zItr->second;
834  }
835 
836  if ((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
837  lvr = r->build(matManager, mysql, manager->MinimalGeoFlag(), 1, vcutdef);
838  } else {
839  lvr = r->build(matManager, mysql, manager->MinimalGeoFlag());
840  }
841 
842  m_FPVMAP->StoreDetector(lvr, key);
843  } else {
844  GeoFullPhysVol *rfpv = (GeoFullPhysVol *)fpv;
845  lvr = rfpv->clone();
846  }
847 
848  } else if (type == "DED" && manager->MinimalGeoFlag() == 0) {
849  double xpos = c->posx;
850  if (is_mirrored)
851  xpos = -xpos;
852  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateY3D(xpos) * GeoTrf::TranslateZ3D(zpos);
853 
854  xfcomponent = new GeoTransform(htcomponent);
855 
856  bool dedCutoutFlag = (stname == "BOS" && std::abs(zi) == 6) || (stname == "BMS" && (std::abs(zi) == 2 || std::abs(zi) == 4 || std::abs(zi) == 6)) ||
857  (stname == "BMS" && std::abs(zi) == 1 && fi == 3);
858  std::string key = std::string(stName) + techname;
859  if (((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3,"BOG") == 0)) && zi >= 0) {
860  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0) + "_" +
861  buildString(vcutdef.size(), 0);
862  } else if (((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi < 0) {
863  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0) + "_" +
864  buildString(vcutdef.size(), 0);
865  }
866  key += buildString(int(c->dy), 0) + "_" + buildString(int(c->dx1), 0);
867  GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
868 
869  if (fpv == nullptr) {
870  std::unique_ptr<Ded> r = std::make_unique<Ded>(mysql, c);
871  ATH_MSG_VERBOSE( " Building a DED for station " << key << " component name is " << c->name );
872  if ((manager->IncludeCutoutsFlag() && dedCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
873  lvd = r->build(matManager, mysql, 1, vcutdef);
874  } else {
875  lvd = r->build(matManager, mysql);
876  }
877 
878  m_FPVMAP->StoreDetector(lvd, key);
879  } else {
880  lvd = fpv;
881  ATH_MSG_VERBOSE( " Re-using DED for station " << key << " component name is " << c->name );
882  }
883 
884  } else if (type == "SUP" && manager->MinimalGeoFlag() == 0) {
885  ypos = -thickness / 2. + c->posz;
886  double zpos = -length / 2. + c->posy + c->dy / 2. - SupComponent::zAMDB0(mysql, *c);
887  ypos = ypos - SupComponent::xAMDB0(mysql, *c);
888  double xpos = c->posx - SupComponent::yAMDB0(mysql, *c);
889 
890  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateY3D(xpos) * GeoTrf::TranslateZ3D(zpos);
891  std::string key = std::string(stName) + techname;
892  if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3,"BOG") == 0)) && zi >= 0) {
893  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
894  } else if ((manager->IncludeCutoutsFlag() || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3,"BOG") == 0)) && zi < 0) {
895  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
896  }
897 
898  GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
899  if (fpv == nullptr) {
900  m_FPVMAP->StoreDetector(lvs, key);
901  } else {
902  lvs = fpv;
903  }
904 
905  } else if (type == "TGC") {
908  irad = tgInner->posy;
910  double orad = tgOuter->posy + tgOuter->dy;
911  double start = -(orad - irad) / 2. + (tg->posy - irad) + tg->dy / 2;
912  double xstart = -thickness / 2. + tg->GetThickness(mysql) / 2.;
913  htcomponent = GeoTrf::TranslateX3D(xstart + tg->posz) * GeoTrf::TranslateZ3D(start);
914  xfaligncomponent = new GeoAlignableTransform(htcomponent);
915 
916  // Define key for this TGC component
917  std::string key = std::string(stName) + techname;
918  if (manager->IncludeCutoutsFlag()) {
919  if (mysql.allocPosFindCutout(statType, fi, zi) > 0) {
920  // If there is a cutout for this chamber, give it a special key
921  if (zi >= 0) {
922  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
923  } else if (zi < 0) {
924  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
925  }
926  }
927  }
928 
929  char chswidth[32];
930  sprintf(chswidth, "%i", int(10 * c->dx1));
931  key += chswidth;
932 
933  GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
934  if (fpv == nullptr) {
935  std::unique_ptr<Tgc> t = std::make_unique<Tgc>(mysql, c);
936  t->setLogVolName(std::string(stName) + techname);
937  if (manager->IncludeCutoutsFlag()) {
938  lvt = t->build(matManager, mysql, manager->MinimalGeoFlag(), 1, vcutdef);
939  } else {
940  lvt = t->build(matManager, mysql, manager->MinimalGeoFlag());
941  }
942  m_FPVMAP->StoreDetector(lvt, key);
943  } else {
944  GeoFullPhysVol *rfpv = (GeoFullPhysVol *)fpv;
945  lvt = rfpv->clone();
946  }
947 
948  } else if (type == "CSC") {
949  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateZ3D(zpos);
950  xfaligncomponent = new GeoAlignableTransform(htcomponent);
951  // Here define the key for this CSC component
952  std::string key = std::string(stName) + techname;
953  if (manager->IncludeCutoutsFlag() && zi >= 0) {
954  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
955  } else if (manager->IncludeCutoutsFlag() && zi < 0) {
956  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
957  }
958 
959  GeoVPhysVol *fpv = m_FPVMAP->GetDetector(key);
960  if (fpv == nullptr) {
961  std::unique_ptr<Csc> t = std::make_unique<Csc>(mysql, c);
962  t->setLogVolName(std::string(stName) + techname);
963 
964  if (manager->IncludeCutoutsFlag()) {
965  lvc = t->build(matManager, mysql, manager->MinimalGeoFlag(), 1, vcutdef);
966  } else {
967  lvc = t->build(matManager, mysql, manager->MinimalGeoFlag());
968  }
969 
970  m_FPVMAP->StoreDetector(lvc, key);
971  } else {
972  GeoFullPhysVol *rfpv = (GeoFullPhysVol *)fpv;
973  lvc = rfpv->clone();
974  }
975 
976  } else {
977  if (type != "MDT" && type != "RPC" && type != "TGC" && type != "SUP" && type != "DED" && type != "SPA" && type != "CHV" && type != "CRO" && type != "CMI" &&
978  type != "LB0" && type != "LBI") {
979  ATH_MSG_INFO( "Unknown component " << type );
980  }
981  }
982 
983  // Place components in chamber envelope
984  if (lvm && manager->mdtIdHelper()) {
985  int stationEta = zi;
986  int stationPhi = fi + 1;
987  int ml = 1;
988  int tubel = 1;
989  int tube = 1;
990  if (ypos > 5.)
991  ml = 2; // Need >5 instead of >0 because BIS78 is not perfectly centered
992  std::string stag = "ml[" + MuonGM::buildString(ml, 0) + "]" + techname + "component";
993 
994  GeoNameTag *nm = new GeoNameTag(stag);
995  ptrd->add(new GeoIdentifierTag(c->index));
996  ptrd->add(nm);
997 
998  xfaligncomponent->setDelta(GeoTrf::Transform3D::Identity());
999  // delete xfcomponent;
1000  ptrd->add(xfaligncomponent);
1001  ptrd->add(lvm);
1002  const MdtIdHelper *mdt_id = manager->mdtIdHelper();
1003  std::unique_ptr<MdtReadoutElement> det = std::make_unique<MdtReadoutElement>(lvm, stName, manager);
1004  Position ip = mysql.GetStationPosition(stName.substr(0, 3), fi, zi);
1005  setMdtReadoutGeom(mysql, det.get(), (MdtComponent *)c, ip);
1006  det->setHasCutouts(ncutouts > 0);
1007  det->setNMdtInStation(nMdt);
1008  Identifier id = mdt_id->channelID(stationType, stationEta, stationPhi, ml, tubel, tube);
1009  det->setIdentifier(id);
1010  det->setMultilayer(ml);
1011  det->setParentStationPV(PVConstLink(ptrd));
1012  det->setParentMuonStation(mstat);
1013  det->geoInitDone();
1014 
1015  if (ml == 1) {
1016  // set fixed point for MDT deformations: s0,z0,t0 for the point at lowest t,z (z,y amdb) and s=x=0
1017  mstat->setBlineFixedPointInAmdbLRS(c->posx, c->posy, c->posz);
1018  } else {
1019  Amg::Vector3D b0 = mstat->getBlineFixedPointInAmdbLRS();
1020  if (c->posy < b0.y())
1021  mstat->setBlineFixedPointInAmdbLRS(b0.x(), c->posy, b0.z());
1022  }
1023 
1024  int jobIndex = c->index;
1025 
1026  mstat->addMuonReadoutElementWithAlTransf(det.get(), xfaligncomponent, jobIndex);
1027  ATH_MSG_DEBUG( std::string(stName + techname) << " trying to build a MDT Id from stType/eta/phi/ml/tl/t " << stationType << "/" << stationEta << "/"
1028  << stationPhi << "/" << ml << "/" << tubel << "/" << tube << endmsg << " Copy number is " << c->index << " tagName " << stag );
1029 
1030 
1031  manager->addMdtReadoutElement(std::move(det));
1032  }
1033 
1034  if (lvc && manager->cscIdHelper()) {
1036  int stationEta = zi;
1037  int stationPhi = fi + 1;
1038  int chamberLayer = 1;
1039  if (ypos > 0.)
1040  chamberLayer = 2;
1041  std::string stag = "cl[" + MuonGM::buildString(chamberLayer, 0) + "]" + techname + "component";
1042  GeoNameTag *nm = new GeoNameTag(stag);
1043  ptrd->add(new GeoIdentifierTag(c->index));
1044  ptrd->add(nm);
1045 
1046  xfaligncomponent->setDelta(GeoTrf::Transform3D::Identity());
1047  // delete xfcomponent;
1048  ptrd->add(xfaligncomponent);
1049  ptrd->add(lvc);
1050 
1051  std::unique_ptr<CscReadoutElement> det = std::make_unique<CscReadoutElement>(lvc, stName, manager);
1052  Position ip = mysql.GetStationPosition(stName.substr(0, 3), fi, zi);
1053  setCscReadoutGeom(mysql, det.get(), cs, ip);
1054 
1055  const CscIdHelper *csc_id = manager->cscIdHelper();
1056  det->setHasCutouts(ncutouts > 0);
1057  Identifier id = csc_id->channelID(stationType, stationEta, stationPhi, chamberLayer, 1, 0, 1);
1058  det->setIdentifier(id);
1059  det->setChamberLayer(chamberLayer);
1060  det->setParentStationPV(PVConstLink(ptrd));
1061  det->setParentMuonStation(mstat);
1062 
1063  int jobIndex = c->index;
1064  // mstat->addMuonReadoutElement(det,jobIndex);
1065  mstat->addMuonReadoutElementWithAlTransf(det.get(), xfaligncomponent, jobIndex);
1066  ATH_MSG_DEBUG( stName << techname << " trying to build a CSC Id from stType/eta/phi/ml " << stationType << "/" << stationEta << "/"
1067  << stationPhi << "/" << chamberLayer << "/ and /1/0/1" << endmsg << " Copy number is " << c->index << " tagName " << stag );
1068 
1069  // set alignment parameters for the wire layers
1070  manager->addCscReadoutElement(std::move(det));
1071  }
1072 
1073  if (lvt && manager->tgcIdHelper()) {
1074  ATH_MSG_DEBUG( " Adding a TGC chamber to the tree zi,fi, is_mirrored " << zi << " " << fi + 1 << " " << is_mirrored );
1075 
1077  ATH_MSG_VERBOSE( "There's a TGC named " << techname << " of thickness " << tg->GetThickness(mysql) );
1078 
1079  const TgcIdHelper *tgc_id = manager->tgcIdHelper();
1080  int stationEta = 0;
1081  stationEta = tg->index;
1082  if (zi < 0)
1083  stationEta = -stationEta;
1084  int stationPhi = 0;
1085  stationPhi = MuonGM::stationPhiTGC(stName, fi + 1, zi);
1086  int ttag = 1000 * stationPhi + tg->index;
1087  std::string stag = "stPhiJob[" + MuonGM::buildString(ttag, 0) + "]" + techname + "tgccomponent";
1088  GeoNameTag *nm = new GeoNameTag(stag);
1089  int geoid = 0;
1090  if (useAssemblies || isAssembly) {
1091  geoid = c->index;
1092  } else {
1093  if (zi < 0)
1094  ttag = -ttag;
1095  geoid = ttag;
1096  }
1097  ptrd->add(new GeoIdentifierTag(geoid));
1098  ptrd->add(nm);
1099 
1100  xfaligncomponent->setDelta(GeoTrf::Transform3D::Identity());
1101 
1102  // delete xfcomponent;
1103  ptrd->add(xfaligncomponent);
1104  ptrd->add(lvt);
1105 
1106  std::unique_ptr<TgcReadoutElement> det = std::make_unique<TgcReadoutElement>(lvt, stName, manager);
1107  Position ip = mysql.GetStationPosition(stName.substr(0, 3), fi, zi);
1108  setTgcReadoutGeom(mysql, det.get(), tg, ip, stName);
1109  det->setHasCutouts(ncutouts > 0);
1110  Identifier id = tgc_id->channelID(stationType, stationEta, stationPhi, 1, false, 1);
1111  det->setIdentifier(id);
1112  det->setParentStationPV(PVConstLink(ptrd));
1113  det->setParentMuonStation(mstat);
1114 
1115  int jobIndex = c->index;
1116 
1117  mstat->addMuonReadoutElementWithAlTransf(det.get(), xfaligncomponent, jobIndex);
1118 
1119  ATH_MSG_DEBUG( stName << techname << " trying to build a TGC Id from stType/eta/phi " << stationType << "/" << stationEta << "/" << stationPhi
1120  << "/ and /1/0/1" << endmsg << " Copy number is " << geoid << " tagName = " << stag );
1121  manager->addTgcReadoutElement(std::move(det));
1122  }
1123 
1124  if (lvr && RPCON && manager->rpcIdHelper()) {
1125  RpcComponent *rp = (RpcComponent *)c;
1126  int ndivy = rp->ndivy;
1127  int ndivz = rp->ndivz;
1128 
1129  if (ndivz != 1 || ndivy != 1) {
1130  ATH_MSG_ERROR( " RPC segmentation z,y " << ndivz << " " << ndivy );
1131  }
1132 
1133  double zpos = -length / 2. + c->posy + c->dy / 2.;
1134  double xpos = c->posx;
1135 
1136  // implement really the mirror symmetry
1137  if (is_mirrored)
1138  xpos = -xpos;
1139  // ... putting back to here!
1140 
1141  const RpcIdHelper *rpc_id = manager->rpcIdHelper();
1142  int stationEta = zi;
1143  int stationPhi = fi + 1;
1144  int doubletR = 1;
1145  int doubletZ = 1;
1146 
1147  if (nRpc > 1 && nDoubletR == 2 && ypos > 0.)
1148  doubletR = 2;
1149  ndbz[doubletR - 1]++;
1150 
1151  // the BI RPCs are 3-gap RPCs mounted inside of the BI (s)MDTs
1152  if (stname.find("BI") != std::string::npos) {
1153  if (stname.find("BIS") != std::string::npos) {
1154  // for BIS78, there is a second RPC doubletZ at amdb-y (MuonGeoModel-z)=144mm inside the station
1155  if (std::abs(stationEta)>= 7){
1156  ATH_MSG_DEBUG("BIS78 station eta: "<<stationEta<<" phi: "<<stationPhi<<" dR: "<<doubletR<<" dZ:"<< doubletZ <<" rp: "<<rp->posz);
1157  }
1158  if (std::abs(stationEta) >= 7 && rp->posz > 80)
1159  doubletZ = 2;
1160  else
1161  doubletZ = 1;
1162  } else {
1163  // for BIL/BIM/BIR, we have 10 RPCs put on 6 MDT stations, thus, need to exploit doubletZ as additional variable on top of stationEta
1164  // only for BIL, there are sometimes 2 RPCs per 1 MDT station, namely for stationEta 1,3,4,6
1165  if (stname.find("BIL") != std::string::npos && std::abs(stationEta) < 7 && std::abs(stationEta) != 2 && std::abs(stationEta) != 5) {
1166  if (rp->posy > 1)
1167  doubletZ = 2; // put the chamber with positive amdb-z to doubletZ=2
1168  } else
1169  doubletZ = 1;
1170  }
1171  } else {
1172  if (zi <= 0 && !is_mirrored) {
1173  if (zpos < -100 * Gaudi::Units::mm)
1174  doubletZ = 2;
1175  } else {
1176  if (zpos > 100 * Gaudi::Units::mm)
1177  doubletZ = 2;
1178  }
1179  }
1180 
1181  // BMS (BOG) RPCs can have |xpos|=950 (|xpos|=350)
1182  if (std::abs(xpos) > 100. * Gaudi::Units::mm) {
1183  if (ndbz[doubletR - 1] > 2) {
1184  doubletZ = 3;
1185  }
1186  ndbz[doubletR - 1]--;
1187  }
1188 
1189  int dbphi = 1;
1190 
1191  // this special patch is needed for BMS in the ribs where xpos is ~950mm;
1192  // the theshold to 100mm (too low) caused a bug
1193  // in BOG at eta +/-4 and stationEta 7 (not 6) ==>> 28 Jan 2016 raising the threshold to 400.mm
1194  // doublet phi not aware of pos. in space !!!
1195  if (xpos > 400. * Gaudi::Units::mm)
1196  dbphi = 2;
1197 
1198  int doubletPhi = dbphi;
1199  // doublet phi aware of pos. in space !!!
1200  if (zi < 0 && is_mirrored && doubletZ == 3) {
1201  doubletPhi++;
1202  if (doubletPhi > 2)
1203  doubletPhi = 1;
1204  } else if (zi < 0 && is_mirrored && doubletZ == 2 && doubletR == 1 && stName == "BMS6") {
1205  doubletPhi++;
1206  if (doubletPhi > 2)
1207  doubletPhi = 1;
1208  }
1209  // never defined fields: set to the lower limit
1210  int gasGap = 1;
1211  int measuresPhi = 0;
1212  int strip = 1;
1213 
1214  int geoid = 0;
1215  std::string stag;
1216  int tag = doubletZ + doubletR * 100 + dbphi * 1000;
1217  if (rp->iswap == -1)
1218  tag = -1 * tag;
1219  stag = "SwapdbPdbRdbZ[" + MuonGM::buildString(tag, 0) + "]" + techname + "rpccomponent";
1220  if (useAssemblies || isAssembly) {
1221  geoid = c->index;
1222  } else {
1223  int tag = rp->index + doubletR * 100 + dbphi * 1000;
1224  if (rp->iswap == -1)
1225  tag = -1 * tag;
1226  geoid = tag;
1227  }
1228 
1229  GeoNameTag *nm = new GeoNameTag(stag);
1230  ptrd->add(new GeoIdentifierTag(geoid));
1231  ptrd->add(nm);
1232 
1233  xfaligncomponent->setDelta(GeoTrf::Transform3D::Identity());
1234  // delete xfcomponent;
1235  ptrd->add(xfaligncomponent);
1236  ptrd->add(lvr);
1237 
1238  std::unique_ptr<RpcReadoutElement> det = std::make_unique<RpcReadoutElement>(lvr, stName, zi, fi + 1, is_mirrored, manager);
1239  Position ip = mysql.GetStationPosition(stName.substr(0, 3), fi, zi);
1240  setRpcReadoutGeom(mysql, det.get(), rp, ip);
1241  Identifier id = rpc_id->channelID(stationType, stationEta, stationPhi, doubletR, doubletZ, doubletPhi, gasGap, measuresPhi, strip);
1242  det->setIdentifier(id);
1243  det->setHasCutouts(ncutouts > 0);
1244  det->setDoubletR(doubletR);
1245  det->setDoubletZ(doubletZ);
1246  det->setDoubletPhi(doubletPhi);
1247 
1248  ATH_MSG_DEBUG( stName << techname << " trying to build a RPC Id from stType/eta/phi/dbR/dbZ/dbP " << stationType << "/" << stationEta << "/"
1249  << stationPhi << "/" << doubletR << "/" << doubletZ << "/" << doubletPhi << "///" << gasGap << "/" << measuresPhi << "/" << strip << endmsg
1250  << " Copy number " << geoid << " tagName= " << stag );
1251  det->setParentStationPV(PVConstLink(ptrd));
1252  det->setParentMuonStation(mstat);
1253 
1254  int jobIndex = c->index;
1255 
1256  mstat->addMuonReadoutElementWithAlTransf(det.get(), xfaligncomponent, jobIndex);
1257 
1258 
1259  if (stName.find("BI") != std::string::npos) {
1260  std::map<std::string, float>::const_iterator yItr = rpcYTrans.find(techname);
1261  if (yItr != rpcYTrans.end())
1262  det->setYTranslation(yItr->second);
1263  std::map<std::string, float>::const_iterator zItr = rpcZTrans.find(techname);
1264  if (zItr != rpcZTrans.end())
1265  det->setZTranslation(zItr->second);
1266  }
1267 
1268  det->fillCache(); // fill temporary cache (global position on known yet)
1269  det->initDesign();
1270  det->clearCache(); // clear temporary cache
1271  manager->addRpcReadoutElement(std::move(det));
1272  } // if (lvr && RPCON && manager->rpcIdHelper()) {
1273 
1274  if (lvs && RPCON) {
1275  std::string cname = c->name;
1276  ATH_MSG_VERBOSE( " yes, the component is a SupComponent named " << cname );
1277  GeoNameTag *nm = new GeoNameTag(stName + "_stName " + techname + " supcomponent");
1278  ptrd->add(new GeoIdentifierTag(c->index));
1279  ptrd->add(nm);
1280  ptrd->add(xfcomponent);
1281  ATH_MSG_VERBOSE( " register x" );
1282  ATH_MSG_VERBOSE( " register y" );
1283  ATH_MSG_VERBOSE( " register z" );
1284 
1285  ptrd->add(lvs);
1286  ATH_MSG_VERBOSE( " register lvs" );
1287  }
1288 
1289  if (lvd && RPCON) {
1290  GeoNameTag *nm = new GeoNameTag(stName + "_stName " + techname + " dedcomponent");
1291  ptrd->add(new GeoIdentifierTag(c->index));
1292  ptrd->add(nm);
1293 
1294  ptrd->add(xfcomponent);
1295  ptrd->add(lvd);
1296  }
1297 
1298  if (lvo) {
1299  // translate from AMDB chamber coordinates:
1300  // (move chamber origin and swap axes around)
1301  // D-line gives AMDB coords of AMDB component origin
1302  // we need MuonGM coords of MuonGM component origin...
1303  // take off length/2, thickness/2 to get to AMDB chamber org
1304  // then put back GetLength()/2, GetThickness()/2 to get to
1305  // component org.
1306  GeoNameTag *nm = new GeoNameTag(stName + "_stName " + techname + " component");
1307  ptrd->add(new GeoIdentifierTag(c->index));
1308  ptrd->add(nm);
1309 
1310  ptrd->add(xfcomponent);
1311  ptrd->add(lvo);
1312  }
1313 
1314  if (lv) {
1315  GeoNameTag *nm = new GeoNameTag(stName + "_stName " + techname + " component");
1316  ptrd->add(new GeoIdentifierTag(c->index));
1317  ptrd->add(nm);
1318  ptrd->add(xfcomponent);
1319  ptrd->add(lv);
1320  }
1321 
1322  } // End big loop over components
1323  mstat->updateBlineFixedPointInAmdbLRS();
1324 
1325  return ptrd;
1326  }
1327 
1329  CscReadoutElement *re, const CscComponent *cc, const Position &ip) {
1330 
1331  re->m_Ssize = cc->dx1;
1332  re->m_LongSsize = cc->dx2;
1333  re->m_Rsize = cc->dy;
1334  re->m_LongRsize = cc->dy;
1335  re->m_Zsize = cc->GetThickness(mysql);
1336  re->m_LongZsize = cc->GetThickness(mysql);
1337  re->m_RlengthUpToMaxWidth = cc->maxwdy;
1338  re->m_excent = cc->excent;
1339 
1340  // Csc features specific to this readout element
1341  std::string tname = cc->name;
1342  re->setTechnologyName(tname);
1343 
1344  if (ip.isAssigned) {
1345  re->setStationS(ip.shift);
1346  } else {
1347  ATH_MSG_ERROR( " MuonChamber::setCscReadoutGeom: position not found " );
1348  assert(0);
1349  }
1350 
1351  const CSC *thisc = dynamic_cast<const CSC*>(mysql.GetTechnology(tname));
1352  re->m_anodecathode_distance = thisc->anocathodist;
1353  re->m_ngasgaps = thisc->numOfLayers;
1354  re->m_nstriplayers = thisc->numOfLayers;
1355  re->m_nwirelayers = thisc->numOfLayers;
1356  re->m_roxacellwidth = thisc->roxacellwith;
1357  re->m_nEtastripsperlayer = thisc->nEtastrips;
1358  re->m_nPhistripsperlayer = thisc->nPhistrips;
1359  re->m_Etastrippitch = thisc->cathreadoutpitch;
1360  re->m_Phistrippitch = thisc->phireadoutpitch;
1361  re->m_Etastripwidth = re->m_Etastrippitch;
1362  re->m_Phistripwidth = re->m_Phistrippitch;
1363  }
1364 
1366  MdtReadoutElement *re, const MdtComponent *cc, const Position &ip) {
1367 
1368  re->m_Ssize = cc->dx1;
1369  re->m_LongSsize = cc->dx2;
1370 
1371  if (re->m_inBarrel) {
1372  re->m_Rsize = cc->GetThickness(mysql);
1373  re->m_LongRsize = cc->GetThickness(mysql);
1374  re->m_Zsize = cc->dy;
1375  re->m_LongZsize = cc->dy;
1376  } else {
1377  re->m_Rsize = cc->dy;
1378  re->m_LongRsize = cc->dy;
1379  re->m_Zsize = cc->GetThickness(mysql);
1380  re->m_LongZsize = cc->GetThickness(mysql);
1381  }
1382 
1383  re->m_cutoutShift = cc->cutoutTubeXShift;
1384  re->m_tubelenStepSize = cc->tubelenStepSize;
1385 
1386  if (ip.isAssigned) {
1387  re->setStationS(ip.shift);
1388  } else {
1389  ATH_MSG_ERROR( " MuonChamber::setMdtReadoutGeom: position not found " );
1390  assert(0);
1391  }
1392 
1393  std::string tname = cc->name;
1394  re->setTechnologyName(tname);
1395  const MDT *thism = dynamic_cast<const MDT*>(mysql.GetTechnology(tname));
1396  re->m_nlayers = thism->numOfLayers;
1397  re->m_tubepitch = thism->pitch;
1398  re->m_tubelayerpitch = thism->y[1] - thism->y[0];
1399  re->m_endpluglength = thism->tubeEndPlugLength;
1400  re->m_deadlength = cc->deadx; // thism->tubeDeadLength;
1401  re->m_innerRadius = thism->innerRadius;
1402  re->m_tubeWallThickness = thism->tubeWallThickness;
1403 
1404  if (re->m_inBarrel) {
1405  re->m_ntubesperlayer = int(re->m_Zsize / re->m_tubepitch);
1406  re->m_nsteps = 1; // all tubes have the same length
1407  re->m_ntubesinastep = re->m_ntubesperlayer;
1408  re->m_tubelength[0] = re->m_Ssize;
1409  } else {
1410  re->m_ntubesperlayer = int(re->m_Rsize / re->m_tubepitch);
1411  re->m_nsteps = int(re->m_Rsize / re->m_tubelenStepSize);
1412  re->m_ntubesinastep = int(re->m_tubelenStepSize / re->m_tubepitch);
1413  re->m_tubelength[0] = re->m_Ssize;
1414  double diff = (re->m_LongSsize - re->m_Ssize) * (re->m_LongRsize - re->m_tubepitch / 2.) / re->m_LongRsize;
1415  for (int is = 0; is < re->m_nsteps; ++is) {
1416  double len = re->m_Ssize + is * diff / re->m_nsteps;
1417  re->m_tubelength[is] = len;
1418  }
1419  }
1420 
1421  for (int tl = 0; tl < re->m_nlayers; ++tl) {
1422  re->m_firstwire_x[tl] = thism->x[tl];
1423  re->m_firstwire_y[tl] = thism->y[tl];
1424  }
1425  }
1426 
1429  const RpcComponent *cc,
1430  const Position &ip) {
1431  re->m_Ssize = cc->dx1;
1432  re->m_LongSsize = cc->dx2;
1433  re->m_Rsize = cc->GetThickness(mysql);
1434  re->m_LongRsize = cc->GetThickness(mysql);
1435  re->m_Zsize = cc->dy;
1436  re->m_LongZsize = cc->dy;
1437 
1438  re->m_hasDEDontop = true;
1439  if (cc->iswap == -1)
1440  re->m_hasDEDontop = false;
1441 
1442  if (ip.isAssigned) {
1443  re->setStationS(ip.shift);
1444  } else {
1445  ATH_MSG_ERROR( " MuonChamber::setRpcReadoutGeom: position not found " );
1446  assert(0);
1447  }
1448 
1449  std::string tname = cc->name;
1450  re->setTechnologyName(tname);
1451  const RPC *thisr = dynamic_cast<const RPC*>(mysql.GetTechnology(tname));
1452  re->m_nphigasgaps = thisr->NGasGaps_in_s;
1453  re->m_gasgapssize = re->m_Ssize / re->m_nphigasgaps - 2. * thisr->bakeliteframesize;
1454  re->m_gasgapzsize = re->m_Zsize - 2. * thisr->bakeliteframesize;
1455  re->m_nphistrippanels = thisr->NstripPanels_in_s;
1456  re->m_phistrippitch = thisr->stripPitchS;
1457  re->m_etastrippitch = thisr->stripPitchZ;
1458 
1459  if (re->getStationName().find("BI") != std::string::npos) {
1460  re->setNumberOfLayers(3); // all BI RPCs always have 3 gas gaps
1461 
1462  }
1463  const RPC* genericRpc = dynamic_cast<const RPC*>(mysql.GetATechnology("RPC0"));
1464 
1465  if (re->numberOfLayers() == 3) {
1466  constexpr double rpc3GapLayerThickness = 11.8; // gas vol. + ( bakelite + graphite + PET )x2
1467  for (int gasGap =1 ; gasGap <= re->numberOfLayers(); ++gasGap) {
1470  re->m_gasGap_xPos[gasGap -1] = (gasGap - 2) * rpc3GapLayerThickness - 0.74;
1471  }
1472  } else {
1473  re->m_gasGap_xPos[0] = -re->m_Rsize / 2. + thisr->externalSupPanelThickness + genericRpc->stripPanelThickness
1474  + genericRpc->GasGapThickness / 2;
1475  re->m_gasGap_xPos[1] = re->m_gasGap_xPos[0] + genericRpc->rpcLayerThickness +
1476  genericRpc->centralSupPanelThickness;
1477  if (!re->m_hasDEDontop) {
1478  std::swap(re->m_gasGap_xPos[0], re->m_gasGap_xPos[1]);
1479  }
1480  }
1481 
1482  re->m_phistripwidth = re->m_phistrippitch - genericRpc->stripSeparation;
1483  re->m_etastripwidth = re->m_etastrippitch - genericRpc->stripSeparation;
1484  re->m_nphistripsperpanel = int((re->m_Ssize / re->m_nphistrippanels) / re->m_phistrippitch);
1485  if (re->getStationName().compare(0, 3, "BME") != 0) {
1486  re->m_nphistripsperpanel-=(re->m_nphistripsperpanel % 8) ;
1487  }
1488  re->m_netastripsperpanel = int((re->m_Zsize) / re->m_etastrippitch);
1489  re->m_netastripsperpanel -= (re->m_netastripsperpanel % 8);
1490 
1491  re->m_phipaneldead = re->m_Ssize / re->m_nphistrippanels -
1492  re->m_nphistripsperpanel * re->m_phistrippitch +
1493  genericRpc->stripSeparation;
1494  re->m_phipaneldead = re->m_phipaneldead / 2.;
1495  re->m_etapaneldead = re->m_Zsize - re->m_netastripsperpanel * re->m_etastrippitch + genericRpc->stripSeparation;
1496  re->m_etapaneldead = re->m_etapaneldead / 2.;
1497  re->m_phistriplength = re->m_LongZsize;
1498  re->m_etastriplength = re->m_LongSsize / re->m_nphistrippanels;
1499 
1500  re->m_first_phistrip_s[0] = -re->m_Ssize / 2. + re->m_phipaneldead + re->m_phistripwidth / 2.;
1501  if (re->m_nphistrippanels == 2) {
1502  re->m_first_phistrip_s[1] = re->m_phipaneldead + re->m_phistripwidth / 2.;
1503  }
1504 
1505  double offset = 0.;
1506  re->m_phistrip_z = -re->m_Zsize / 2. + offset + re->m_phistriplength / 2.;
1507 
1508  // first strip position on each eta panel
1509  re->m_first_etastrip_z = -re->m_Zsize / 2. + re->m_etapaneldead + re->m_etastripwidth / 2.;
1510  re->m_etastrip_s[0] = -re->m_Ssize / 2. + offset + re->m_etastriplength / 2.;
1511  if (re->m_nphistrippanels == 2) {
1512  re->m_etastrip_s[1] = re->m_Ssize / 2. - offset - re->m_etastriplength / 2.;
1513  }
1514  }
1515 
1518  const TgcComponent *cc,
1519  const Position &ip,
1520  const std::string& stName) {
1521 
1522  re->setSsize(cc->dx1);
1523  re->setLongSsize(cc->dx2);
1524  re->setRsize(cc->dy);
1525  re->setLongRsize(cc->dy);
1526  re->setZsize(cc->GetThickness(mysql));
1527  re->setLongZsize(cc->GetThickness(mysql));
1528 
1529  const TGC *genericTgc = dynamic_cast<const TGC*>(mysql.GetATechnology("TGC0"));
1530  re->setFrameThickness(genericTgc->frame_h,
1531  genericTgc->frame_ab);
1532 
1533 
1534  const std::string &tname = cc->name;
1535  int tname_index = MuonGM::strtoint(tname, 3, 2);
1536  re->setTechnologyName(tname);
1537 
1538  if (ip.isAssigned) {
1539  re->setStationS(ip.shift);
1540  } else {
1541  throw std::runtime_error(" MuonChamberLite::setTgcReadoutGeom position not found ");
1542  }
1543 
1544  char index[2];
1545  sprintf(index, "%i", cc->index);
1546 
1547  re->setReadOutName(stName.substr(0, 4) + '_' + index);
1548  re->setReadOutParams(mysql.GetTgcRPars(tname_index));
1549 
1550  const TGC *thist = dynamic_cast<const TGC*>(mysql.GetTechnology(tname));
1551  const std::size_t ncomp = (thist->materials).size();
1552 
1553  unsigned int gasGap{0};
1554  for (std::size_t i = 0; i < ncomp; ++i) {
1555  double newpos = -re->getZsize() / 2. + thist->positions[i] + thist->tck[i] / 2.;
1556  if ( thist->materials[i].find("TGCGas") != std::string::npos) {
1557  re->setPlaneZ(newpos, ++gasGap);
1558  }
1559  }
1560  }
1561 
1562  void MuonChamber::print() const {
1563  ATH_MSG_INFO( "MuonChamber " << name << " :" );
1564  }
1566  void MuonChamber::setFPVMAP(FPVMAP *fpvmap) { m_FPVMAP = fpvmap; }
1567 
1568 
1569 } // namespace MuonGM
CscIdHelper.h
MuonGM::CbmComponent::lb_width
double lb_width
Definition: CbmComponent.h:16
MuonGM::CbmComponent::hole_pos1
double hole_pos1
Definition: CbmComponent.h:17
MuonGM::Station::hasMdts
bool hasMdts() const
Definition: Station.h:88
MuonGM::MuonChamber::setFineClashFixingFlag
void setFineClashFixingFlag(int value)
Definition: MuonChamber.cxx:1565
plotting.yearwise_luminosity_vs_mu.comp
comp
Definition: yearwise_luminosity_vs_mu.py:23
MuonIdHelper::stationNameIndex
int stationNameIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:842
beamspotman.r
def r
Definition: beamspotman.py:676
MuonGM::RPC::bakeliteframesize
double bakeliteframesize
Definition: RPC_Technology.h:47
MuonGM::MYSQL::GetTechnology
Technology * GetTechnology(const std::string &name)
Definition: MYSQL.cxx:105
MuonGM::MuonChamber::print
virtual void print() const override
Definition: MuonChamber.cxx:1562
MdtReadoutElement.h
MuonGM::TGC::materials
std::vector< std::string > materials
Definition: TGC_Technology.h:20
MuonGM::StandardComponent::index
int index
Definition: StandardComponent.h:27
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonGM::DetectorElement::name
std::string name
Definition: DetectorElement.h:17
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
MuonGM::TgcComponent
Definition: TgcComponent.h:14
MuonGM::CSC::phireadoutpitch
double phireadoutpitch
Definition: CSC_Technology.h:38
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CscComponent.h
MuonGM::Station::GetExtraBottomThickness
double GetExtraBottomThickness() const
Definition: Station.cxx:155
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MuonGM::CbmComponent
Definition: CbmComponent.h:12
MuonGM::MYSQL::allocPosFindSubtype
int allocPosFindSubtype(const std::string &statType, int fi, int zi) const
Definition: MYSQL.cxx:196
MuonGM::TGC::frame_ab
double frame_ab
Definition: TGC_Technology.h:19
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
TgcIdHelper
Definition: TgcIdHelper.h:50
MuonGM::Station::getAmdbOrigine_along_thickness
double getAmdbOrigine_along_thickness(const MYSQL &mysql) const
Definition: Station.cxx:558
RPCON
#define RPCON
Definition: MuonChamber.cxx:70
MuonGM::StandardComponent::GetThickness
double GetThickness(const MYSQL &mysql) const
Definition: StandardComponent.cxx:27
MuonGM::MuonChamber::setTgcReadoutGeom
void setTgcReadoutGeom(const MYSQL &mysql, TgcReadoutElement *re, const TgcComponent *cc, const Position &p, const std::string &statname)
Definition: MuonChamber.cxx:1516
index
Definition: index.py:1
hist_file_dump.d
d
Definition: hist_file_dump.py:137
MuonGM::MuonChamber::m_station
Station * m_station
Definition: MuonChamber.h:58
MuonGM::TGC::tck
std::vector< double > tck
Definition: TGC_Technology.h:22
Rpc.h
Spacer.h
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
FPVMAP.h
MuonGM::Cutout::dx
double dx
Definition: Cutout.h:23
MuonGM::MuonChamber::width
double width
Definition: MuonChamber.h:32
MuonGM::Station
Definition: Station.h:40
createCablingJSON.doubletR
int doubletR
Definition: createCablingJSON.py:10
MuonGM::MDT::tubeEndPlugLength
double tubeEndPlugLength
Definition: MDT_Technology.h:22
MuonGM::RPC::stripPitchS
double stripPitchS
Definition: RPC_Technology.h:64
deg
#define deg
Definition: SbPolyhedron.cxx:17
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
MuonGM::MDT::numOfLayers
int numOfLayers
Definition: MDT_Technology.h:17
MuonGM::MYSQL
Definition: MYSQL.h:43
MuonGM::CscComponent
Definition: CscComponent.h:11
MuonGM::RPC::NGasGaps_in_s
int NGasGaps_in_s
Definition: RPC_Technology.h:43
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:55
Csc.h
MuonGM::MuonChamber::setCscReadoutGeom
void setCscReadoutGeom(const MYSQL &mysql, CscReadoutElement *re, const CscComponent *cc, const Position &p)
Definition: MuonChamber.cxx:1328
athena.value
value
Definition: athena.py:124
MuonGM::MDT::tubeWallThickness
double tubeWallThickness
Definition: MDT_Technology.h:23
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonGM::MYSQL::allocPosFindCutout
int allocPosFindCutout(const std::string &statType, int fi, int zi) const
Definition: MYSQL.cxx:201
RpcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
Definition: RpcIdHelper.cxx:939
MuonGM::LBI
Definition: LBI_Technology.h:13
MuonGM::MYSQL::GetStationPosition
Position GetStationPosition(const std::string &nameType, int fi, int zi) const
Definition: MYSQL.cxx:71
MuonGM::MuonChamber::MuonChamber
MuonChamber(const MYSQL &mysql, Station *s)
Definition: MuonChamber.cxx:93
MuonGM::CSC::roxacellwith
double roxacellwith
Definition: CSC_Technology.h:29
RpcIdHelper
Definition: RpcIdHelper.h:51
MuonGM::DetectorElement
Definition: DetectorElement.h:15
MuonGM::StandardComponent
Definition: StandardComponent.h:15
RpcIdHelper.h
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
MuonGM::CbmComponent::lb_height
double lb_height
Definition: CbmComponent.h:15
Ded.h
Station.h
MuonGM::CSC
Definition: CSC_Technology.h:13
MuonGM::CSC::anocathodist
double anocathodist
Definition: CSC_Technology.h:23
MuonGM::CSC::nEtastrips
int nEtastrips
Definition: CSC_Technology.h:39
MuonGM::RPC::GasGapThickness
double GasGapThickness
Definition: RPC_Technology.h:45
MuonGM::SupComponent::xAMDB0
static double xAMDB0(const MYSQL &mysql, const StandardComponent &c)
Definition: SupComponent.cxx:12
MuonGM::MDT
Definition: MDT_Technology.h:15
TgcComponent.h
MuonGM::TGC::frame_h
double frame_h
Definition: TGC_Technology.h:18
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
GeoPrimitives.h
MuonGM::MuonChamber::m_enableFineClashFixing
int m_enableFineClashFixing
Definition: MuonChamber.h:59
MuonChamber.h
MuonGM::MdtComponent
Definition: MdtComponent.h:12
MuonGM::Component::dy
double dy
Definition: Component.h:21
MuonGM::MuonChamber::setMdtReadoutGeom
void setMdtReadoutGeom(const MYSQL &mysql, MdtReadoutElement *re, const MdtComponent *cc, const Position &p)
Definition: MuonChamber.cxx:1365
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
MuonGM::Position
Definition: Position.h:11
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
StandardComponent.h
CbmComponent.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonGM::LbiComponent
Definition: LbiComponent.h:12
TGC
Definition: TgcBase.h:6
MuonGM::CbmComponent::hole_pos2
double hole_pos2
Definition: CbmComponent.h:18
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonGM::FPVMAP
Definition: FPVMAP.h:17
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
MuonGM::MDT::y
std::array< double, 4 > y
Definition: MDT_Technology.h:25
MuonGM::RpcComponent
Definition: RpcComponent.h:12
Cutout.h
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
RPC_Technology.h
MuonGM::MuonStation
Definition: MuonStation.h:51
MuonGM::Station::getAmdbOrigine_along_length
double getAmdbOrigine_along_length() const
Definition: Station.cxx:553
CscReadoutElement.h
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
MuonGM::Cutout::dy
double dy
Definition: Cutout.h:24
MdtIdHelper
Definition: MdtIdHelper.h:61
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MdtIdHelper.h
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
MuonGM::Station::GetExtraTopThickness
double GetExtraTopThickness() const
Definition: Station.cxx:151
SpacerBeam.h
MuonGM::MuonChamber::longWidth
double longWidth
Definition: MuonChamber.h:35
MuonGM::CSC::cathreadoutpitch
double cathreadoutpitch
Definition: CSC_Technology.h:37
MuonGM::RPC::centralSupPanelThickness
double centralSupPanelThickness
Definition: RPC_Technology.h:28
MuonGM::MDT::innerRadius
double innerRadius
Definition: MDT_Technology.h:19
CSC_Technology.h
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
GlobalUtilities.h
LBI_Technology.h
useAssemblies
#define useAssemblies
Definition: MuonChamber.cxx:71
MYSQL.h
MuonGM::StandardComponent::posy
double posy
Definition: StandardComponent.h:20
MuonGM::SupComponent::yAMDB0
static double yAMDB0(const MYSQL &mysql, const StandardComponent &c)
Definition: SupComponent.cxx:16
MuonGM::TGC::positions
std::vector< double > positions
Definition: TGC_Technology.h:21
CscIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip) const
Definition: CscIdHelper.cxx:706
MuonGM::MuonChamber::build
GeoVPhysVol * build(StoredMaterialManager &matManager, const MYSQL &mysql, MuonDetectorManager *manager, int ieta, int iphi, bool is_mirrored, bool &isAssembly)
Definition: MuonChamber.cxx:109
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:659
MuonGM::CSC::numOfLayers
int numOfLayers
Definition: CSC_Technology.h:16
LbiComponent.h
MuonGM::MDT::x
std::array< double, 4 > x
Definition: MDT_Technology.h:26
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGM::MuonChamber::m_FPVMAP
FPVMAP * m_FPVMAP
Definition: MuonChamber.h:61
MuonGM::SupComponent::zAMDB0
static double zAMDB0(const MYSQL &mysql, const StandardComponent &c)
Definition: SupComponent.cxx:20
MuonDetectorManager.h
MDT_Technology.h
MuonGM::RPC::stripPitchZ
double stripPitchZ
Definition: RPC_Technology.h:65
MuonGM::Station::GetNrOfCutouts
int GetNrOfCutouts() const
Definition: Station.cxx:324
MuonGM::strtoint
int strtoint(std::string_view str, unsigned int istart, unsigned int length)
Definition: GlobalUtilities.cxx:37
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
Position.h
MuonGM::RPC::externalSupPanelThickness
double externalSupPanelThickness
Definition: RPC_Technology.h:19
Mdt.h
DeMoScan.index
string index
Definition: DeMoScan.py:364
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
MuonGM::Station::GetNrOfComponents
int GetNrOfComponents() const
Definition: Station.cxx:322
MuonGM::RPC::rpcLayerThickness
double rpcLayerThickness
Definition: RPC_Technology.h:34
CscIdHelper
Definition: CscIdHelper.h:52
MuonGM::RPC::stripPanelThickness
double stripPanelThickness
Definition: RPC_Technology.h:67
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
re
const boost::regex re(r_e)
MuonGM::MuonChamber::thickness
double thickness
Definition: MuonChamber.h:34
MuonGM::MYSQL::GetATechnology
const Technology * GetATechnology(const std::string &name) const
Definition: MYSQL.cxx:162
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
MuonGM::RPC
Definition: RPC_Technology.h:14
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
MuonGM::stationPhiTGC
int stationPhiTGC(std::string_view stName, int fi, int zi_input)
Converts the AMDB phi index to the Identifier phi Index.
Definition: GlobalUtilities.cxx:44
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
MuonGM::Cutout::lengthY
double lengthY
Definition: Cutout.h:27
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
checkFileSG.fi
fi
Definition: checkFileSG.py:65
MuonGM::Station::GetCutout
Cutout * GetCutout(int i) const
Definition: Station.cxx:85
MuonGM::MYSQL::GetTgcRPars
GeoModel::TransientConstSharedPtr< TgcReadoutParams > GetTgcRPars(const std::string &name) const
Definition: MYSQL.cxx:88
createCablingJSON.doubletPhi
int doubletPhi
Definition: createCablingJSON.py:11
TgcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
Definition: TgcIdHelper.cxx:583
TgcReadoutElement.h
TgcIdHelper.h
MuonGM::RPC::NstripPanels_in_s
int NstripPanels_in_s
Definition: RPC_Technology.h:60
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
RpcComponent.h
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
TGC_Technology.h
MdtComponent.h
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
MuonGM::FPVMAP::GetDetector
GeoVPhysVol * GetDetector(const std::string &name)
Definition: FPVMAP.cxx:17
rp
ReadCards * rp
Definition: IReadCards.cxx:26
MuonGM::MDT::pitch
double pitch
Definition: MDT_Technology.h:18
MuonStation.h
MuonGM::Cutout
Definition: Cutout.h:14
MuonGM::buildString
std::string buildString(int i, int ncha)
Definition: GlobalUtilities.cxx:23
MuonGM::Station::GetComponent
Component * GetComponent(int i) const
Definition: Station.cxx:83
MuonGM::Station::GetName
const std::string & GetName() const
Definition: Station.cxx:110
MuonGM::Station::mdtHalfPitch
double mdtHalfPitch(const MYSQL &mysql) const
Definition: Station.cxx:343
MuonGM::RPC::stripSeparation
double stripSeparation
Definition: RPC_Technology.h:66
python.compressB64.c
def c
Definition: compressB64.py:93
MuonGM::FPVMAP::StoreDetector
void StoreDetector(GeoVPhysVol *s, const std::string &name)
Definition: FPVMAP.cxx:27
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
MuonGM::LbiComponent::associated_CMIsubtype
std::string associated_CMIsubtype
Definition: LbiComponent.h:14
MuonGM::MuonChamber::setRpcReadoutGeom
void setRpcReadoutGeom(const MYSQL &mysql, RpcReadoutElement *re, const RpcComponent *cc, const Position &p)
Definition: MuonChamber.cxx:1427
SupComponent.h
calibdata.tube
tube
Definition: calibdata.py:31
Tgc.h
python.handimod.cc
int cc
Definition: handimod.py:523
MuonGM::MuonChamber::setFPVMAP
void setFPVMAP(FPVMAP *fpvmap)
Definition: MuonChamber.cxx:1566
MuonGM::CSC::nPhistrips
int nPhistrips
Definition: CSC_Technology.h:40
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
MuonGM::StandardComponent::posz
double posz
Definition: StandardComponent.h:21
RpcReadoutElement.h
Identifier
Definition: IdentifierFieldParser.cxx:14
MuonGM::MuonChamber::length
double length
Definition: MuonChamber.h:33