CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GEMGeometryBuilder.cc
Go to the documentation of this file.
1 /*
2 //\class GEMGeometryBuilder
3 
4  Description: GEM Geometry builder from DD and DD4hep
5  DD4hep part added to the original old file (DD version) made by M. Maggi (INFN Bari)
6  Sergio Lo Meo (sergio.lo.meo@cern.ch) following what Ianna Osburne made for DTs (DD4hep migration)
7  Updated by Sunanda Banerjee (Fermilab) to make it working for dd4hep
8  Updated: 7 August 2020
9  Updated by Ian J. Watson (ian.james.watson@cern.ch) to allow GE2/1 demonstrator to be built
10  Updated: 7 December 2021
11 */
15 
21 
26 
29 
31 
33 
34 #include <algorithm>
35 #include <iostream>
36 #include <string>
37 
38 using namespace geant_units::operators;
39 
40 //#define EDM_ML_DEBUG
41 
43 
45 
46 // DDD
48  const DDCompactView* cview,
49  const MuonGeometryConstants& muonConstants) {
50  std::string attribute = "MuStructure";
51  std::string value = "MuonEndCapGEM";
52 
53  // Asking only for the MuonGEM's
54  DDSpecificsMatchesValueFilter filterGE2{DDValue(attribute, value, 0.0)};
55  DDFilteredView fvGE2(*cview, filterGE2);
56 
57  MuonGeometryNumbering mdddnum(muonConstants);
58  GEMNumberingScheme gemNum(muonConstants);
59 
60  // Check for the demonstrator geometry (only 1 chamber of GE2/1)
61  int nGE21 = 0;
62  bool doSuper = fvGE2.firstChild();
63  while (doSuper) {
64  // getting chamber id from eta partitions
65  fvGE2.firstChild();
66  fvGE2.firstChild();
67  int rawidCh = gemNum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fvGE2.geoHistory()));
68  GEMDetId detIdCh = GEMDetId(rawidCh);
69  if (detIdCh.station() == 2)
70  nGE21++;
71 
72  // back to chambers
73  fvGE2.parent();
74  fvGE2.parent();
75  doSuper = fvGE2.nextSibling();
76  }
77  bool demonstratorGeometry = nGE21 == 1;
78 
79 #ifdef EDM_ML_DEBUG
80  edm::LogVerbatim("Geometry") << "Found " << nGE21 << " GE2/1 chambers. Demonstrator geometry on? "
81  << demonstratorGeometry;
82 #endif
83 
84  // Asking only for the MuonGEM's
85  DDSpecificsMatchesValueFilter filter{DDValue(attribute, value, 0.0)};
86  DDFilteredView fv(*cview, filter);
87 
88 #ifdef EDM_ML_DEBUG
89  edm::LogVerbatim("Geometry") << "Building the geometry service";
90  edm::LogVerbatim("Geometry") << "About to run through the GEM structure\n"
91  << " First logical part " << fv.logicalPart().name().name();
92 #endif
93  doSuper = fv.firstChild();
94 
95 #ifdef EDM_ML_DEBUG
96  edm::LogVerbatim("Geometry") << "doSuperChamber = " << doSuper << " with " << fv.geoHistory() << " Levels "
97  << mdddnum.geoHistoryToBaseNumber(fv.geoHistory()).getLevels();
98  ;
99 #endif
100  // loop over superchambers
101  std::vector<GEMSuperChamber*> superChambers;
102  while (doSuper) {
103  // getting chamber id from eta partitions
104  fv.firstChild();
105  fv.firstChild();
106 
107 #ifdef EDM_ML_DEBUG
108  edm::LogVerbatim("Geometry") << "MuonGeometry 1 " << fv.geoHistory() << " Levels "
109  << mdddnum.geoHistoryToBaseNumber(fv.geoHistory()).getLevels();
110 #endif
111  int rawidCh = gemNum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
112  GEMDetId detIdCh = GEMDetId(rawidCh);
113 
114  // back to chambers
115 
116  fv.parent();
117  fv.parent();
118 #ifdef EDM_ML_DEBUG
119  edm::LogVerbatim("Geometry") << "MuonGeometry 2 " << fv.geoHistory() << " Levels "
120  << mdddnum.geoHistoryToBaseNumber(fv.geoHistory()).getLevels();
122 #endif
123  // currently there is no superchamber in the geometry
124  // only 2 chambers are present separated by a gap.
125  // making superchamber out of the first chamber layer including the gap between chambers
126 
127  // In Run 3 we also have a GE2/1 station at layer 2. We make sure
128  // the superchamber gets built but also we build on the first
129  // layer for the other stations so the superchamber is in the
130  // right position there.
131  if ((detIdCh.layer() == 1) || (detIdCh.layer() == 2 and detIdCh.station() == 2 and demonstratorGeometry)) {
132  GEMSuperChamber* gemSuperChamber = buildSuperChamber(fv, detIdCh);
133  superChambers.push_back(gemSuperChamber);
134  }
135  GEMChamber* gemChamber = ((detIdCh.station() == GEMDetId::minStationId0) ? nullptr : buildChamber(fv, detIdCh));
136 
137  // loop over chambers
138  // only 1 chamber
139  bool doChambers = fv.firstChild();
140  bool loopExecuted = false;
141 
142  while (doChambers) {
143  loopExecuted = true;
144 
145  if (detIdCh.station() == GEMDetId::minStationId0) {
146  fv.firstChild();
147  int rawId = gemNum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
148  GEMDetId detId = GEMDetId(rawId);
149  fv.parent();
150 #ifdef EDM_ML_DEBUG
151  edm::LogVerbatim("Geometry") << "MuonGeometry 3 " << fv.geoHistory() << " Levels "
152  << mdddnum.geoHistoryToBaseNumber(fv.geoHistory()).getLevels();
154 #endif
155  gemChamber = buildChamber(fv, detId);
156  }
157 
158  // loop over GEMEtaPartitions
159  bool doEtaPart = fv.firstChild();
160 
161  while (doEtaPart) {
162 #ifdef EDM_ML_DEBUG
163  edm::LogVerbatim("Geometry") << "MuonGeometry 4 " << fv.geoHistory() << " Levels "
164  << mdddnum.geoHistoryToBaseNumber(fv.geoHistory()).getLevels();
165 #endif
166  int rawid = gemNum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
167  GEMDetId detId = GEMDetId(rawid);
168  GEMEtaPartition* etaPart = buildEtaPartition(fv, detId);
169  gemChamber->add(etaPart);
170  theGeometry.add(etaPart);
171  doEtaPart = fv.nextSibling();
172  }
173 
174  fv.parent();
175 
176  theGeometry.add(gemChamber);
177 
178  doChambers = fv.nextSibling();
179  }
180  fv.parent();
181 
182  doSuper = fv.nextSibling();
183 
184  if (!loopExecuted) {
185  delete gemChamber;
186  }
187  }
188 
189  buildRegions(theGeometry, superChambers, demonstratorGeometry);
190 }
191 
193 #ifdef EDM_ML_DEBUG
194  edm::LogVerbatim("Geometry") << "buildSuperChamber " << fv.logicalPart().name().name() << " " << detId;
195 #endif
197  bool ge0Station = detId.station() == GEMDetId::minStationId0;
198  std::vector<double> dpar = ge0Station ? solid.parameters() : solid.solidA().parameters();
199 
200  double dy = convertMmToCm(dpar[0]); //length is along local Y
201  double dz = convertMmToCm(dpar[3]); // thickness is long local Z
202  double dx1 = convertMmToCm(dpar[4]); // bottom width is along local X
203  double dx2 = convertMmToCm(dpar[8]); // top width is along local X
204 
205  if (!ge0Station) {
206  const int nch = 2;
207  const double chgap = 2.105;
208 
209  dpar = solid.solidB().parameters();
210 
211  dz += convertMmToCm(dpar[3]); // chamber thickness
212  dz *= nch; // 2 chambers in superchamber
213  dz += chgap; // gap between chambers
214  }
215 
216  bool isOdd = detId.chamber() % 2;
217  RCPBoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(dx1, dx2, dy, dz), isOdd));
218 
219 #ifdef EDM_ML_DEBUG
220  edm::LogVerbatim("Geometry") << "size " << dx1 << " " << dx2 << " " << dy << " " << dz;
221 #endif
222  GEMSuperChamber* superChamber = new GEMSuperChamber(detId.superChamberId(), surf);
223  return superChamber;
224 }
225 
227 #ifdef EDM_ML_DEBUG
228  edm::LogVerbatim("Geometry") << "buildChamber " << fv.logicalPart().name().name() << " " << detId;
229 #endif
231  bool ge0Station = detId.station() == GEMDetId::minStationId0;
232  std::vector<double> dpar = ge0Station ? solid.parameters() : solid.solidA().parameters();
233 
234  double dy = convertMmToCm(dpar[0]); //length is along local Y
235  double dz = convertMmToCm(dpar[3]); // thickness is long local Z
236  double dx1 = convertMmToCm(dpar[4]); // bottom width is along local X
237  double dx2 = convertMmToCm(dpar[8]); // top width is along local X
238 
239  if (!ge0Station) {
240  dpar = solid.solidB().parameters();
241  dz += convertMmToCm(dpar[3]); // chamber thickness
242  }
243 
244  bool isOdd = ge0Station ? false : detId.chamber() % 2;
245 
246  RCPBoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(dx1, dx2, dy, dz), isOdd));
247 
248 #ifdef EDM_ML_DEBUG
249  edm::LogVerbatim("Geometry") << "size " << dx1 << " " << dx2 << " " << dy << " " << dz;
250 #endif
251  GEMChamber* chamber = new GEMChamber(detId.chamberId(), surf);
252  return chamber;
253 }
254 
256 #ifdef EDM_ML_DEBUG
257  edm::LogVerbatim("Geometry") << "buildEtaPartition " << fv.logicalPart().name().name() << " " << detId;
258 #endif
259  // EtaPartition specific parameter (nstrips and npads)
260  DDValue numbOfStrips("nStrips");
261  DDValue numbOfPads("nPads");
262  DDValue delPhi("dPhi");
263  std::vector<const DDsvalues_type*> specs(fv.specifics());
264  std::vector<const DDsvalues_type*>::iterator is = specs.begin();
265  double nStrips = 0., nPads = 0., dPhi = 0.;
266  for (; is != specs.end(); is++) {
267  if (DDfetch(*is, numbOfStrips))
268  nStrips = numbOfStrips.doubles()[0];
269  if (DDfetch(*is, numbOfPads))
270  nPads = numbOfPads.doubles()[0];
271  if (DDfetch(*is, delPhi))
272  dPhi = delPhi.doubles()[0];
273  }
274 #ifdef EDM_ML_DEBUG
275  edm::LogVerbatim("Geometry") << ((nStrips == 0.) ? ("No nStrips found!!")
276  : ("Number of strips: " + std::to_string(nStrips)));
277  edm::LogVerbatim("Geometry") << ((nPads == 0.) ? ("No nPads found!!") : ("Number of pads: " + std::to_string(nPads)));
278 #endif
279  // EtaPartition specific parameter (size)
280  std::vector<double> dpar = fv.logicalPart().solid().parameters();
281 
282  double be = convertMmToCm(dpar[4]); // half bottom edge
283  double te = convertMmToCm(dpar[8]); // half top edge
284  double ap = convertMmToCm(dpar[0]); // half apothem
285  double ti = 0.4; // half thickness
286 
287  std::vector<float> pars;
288  pars.emplace_back(be);
289  pars.emplace_back(te);
290  pars.emplace_back(ap);
291  pars.emplace_back(nStrips);
292  pars.emplace_back(nPads);
293  pars.emplace_back(dPhi);
294 
295  bool isOdd = detId.chamber() % 2;
296  RCPBoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(be, te, ap, ti), isOdd));
297  std::string name = fv.logicalPart().name().name();
299 
300 #ifdef EDM_ML_DEBUG
301  edm::LogVerbatim("Geometry") << "size " << be << " " << te << " " << ap << " " << ti;
302 #endif
303  GEMEtaPartition* etaPartition = new GEMEtaPartition(detId, surf, e_p_specs);
304  return etaPartition;
305 }
306 
308  Bounds* bounds,
309  bool isOddChamber) const {
310  // extract the position
311  const DDTranslation& trans(fv.translation());
312  const Surface::PositionType posResult(convertMmToCm(trans.x()), convertMmToCm(trans.y()), convertMmToCm(trans.z()));
313 
314  // now the rotation
315  const DDRotationMatrix& rotation = fv.rotation();
316  DD3Vector x, y, z;
317  rotation.GetComponents(x, y, z);
318 
319  Surface::RotationType rotResult(float(x.X()),
320  float(x.Y()),
321  float(x.Z()),
322  float(y.X()),
323  float(y.Y()),
324  float(y.Z()),
325  float(z.X()),
326  float(z.Y()),
327  float(z.Z()));
328 
329  //Change of axes for the forward
330  Basic3DVector<float> newX(1., 0., 0.);
331  Basic3DVector<float> newY(0., 0., -1.);
332  Basic3DVector<float> newZ(0., 1., 0.);
333 
334  rotResult.rotateAxes(newX, newY, newZ);
335 
336  return RCPBoundPlane(new BoundPlane(posResult, rotResult, bounds));
337 }
338 
339 // DD4hep
340 
342  const cms::DDCompactView* cview,
343  const MuonGeometryConstants& muonConstants) {
344  std::string attribute = "MuStructure";
345  std::string value = "MuonEndCapGEM";
346  const cms::DDFilter filterGE2(attribute, value);
347  cms::DDFilteredView fvGE2(*cview, filterGE2);
348 
349  MuonGeometryNumbering mdddnum(muonConstants);
350  GEMNumberingScheme gemNum(muonConstants);
351  static constexpr uint32_t levelChamb = 7;
352  int chamb(0), region(0);
353  int theLevelPart = muonConstants.getValue("level");
354  int theRingLevel = muonConstants.getValue("mg_ring") / theLevelPart;
355  int theSectorLevel = muonConstants.getValue("mg_sector") / theLevelPart;
356 
357  // Check for the demonstrator geometry (only 1 chamber of GE2/1)
358  int nGE21 = 0;
359  while (fvGE2.firstChild()) {
360  const auto& history = fvGE2.history();
362  GEMDetId detId(gemNum.baseNumberToUnitNumber(num));
363  if (detId.station() == GEMDetId::minStationId0) {
364  } else {
365  if (fvGE2.level() == levelChamb) {
366  if (detId.station() == 2)
367  nGE21++;
368  }
369  }
370  }
371 
372  bool demonstratorGeometry = nGE21 == 1;
373 #ifdef EDM_ML_DEBUG
374  edm::LogVerbatim("Geometry") << "Found " << nGE21 << " GE2/1 chambers. Demonstrator geometry on? "
375  << demonstratorGeometry;
376 #endif
377 
378  const cms::DDFilter filter(attribute, value);
379  cms::DDFilteredView fv(*cview, filter);
380  std::vector<GEMSuperChamber*> superChambers;
381  std::vector<GEMChamber*> chambers;
382 
383  while (fv.firstChild()) {
384  const auto& history = fv.history();
386  GEMDetId detId(gemNum.baseNumberToUnitNumber(num));
387 #ifdef EDM_ML_DEBUG
388  edm::LogVerbatim("Geometry") << fv.name() << " with " << history.tags.size() << " Levels and ID " << detId
389  << " Mask " << std::hex << GEMDetId::chamberIdMask << std::dec << " and "
390  << GEMDetId(((detId.rawId()) & GEMDetId::chamberIdMask)) << " Levels " << theRingLevel
391  << ":" << theSectorLevel << ":" << history.tags.size() << ":" << fv.level();
392  for (unsigned int k = 0; k < history.tags.size(); ++k)
393  edm::LogVerbatim("Geometry") << "[" << k << "] Tag " << history.tags[k] << " Offset " << history.offsets[k]
394  << " copy " << history.copyNos[k];
395 #endif
396 
397  if (detId.station() == GEMDetId::minStationId0) {
398  if (num.getLevels() == theRingLevel) {
399  if (detId.region() != region) {
400  region = detId.region();
401  chamb = 0;
402  }
403  ++chamb;
404  detId = GEMDetId(detId.region(), detId.ring(), detId.station(), detId.layer(), chamb, 0);
405  GEMSuperChamber* gemSuperChamber = buildSuperChamber(fv, detId);
406  superChambers.emplace_back(gemSuperChamber);
407  } else if (num.getLevels() == theSectorLevel) {
408  GEMChamber* gemChamber = buildChamber(fv, detId);
409  chambers.emplace_back(gemChamber);
410  } else {
411  GEMEtaPartition* etaPart = buildEtaPartition(fv, detId);
412  theGeometry.add(etaPart);
413  }
414  } else {
415  if (fv.level() == levelChamb) {
416  if ((detId.layer() == 1) || (detId.layer() == 2 and detId.station() == 2 and demonstratorGeometry)) {
417  GEMSuperChamber* gemSuperChamber = buildSuperChamber(fv, detId);
418  superChambers.emplace_back(gemSuperChamber);
419  }
420  GEMChamber* gemChamber = buildChamber(fv, detId);
421  chambers.emplace_back(gemChamber);
422  } else if (num.getLevels() > theSectorLevel) {
423  GEMEtaPartition* etaPart = buildEtaPartition(fv, detId);
424  theGeometry.add(etaPart);
425  }
426  }
427  }
428 
429  auto& partitions = theGeometry.etaPartitions();
430  for (auto& gemChamber : chambers) {
431  uint32_t id0 = ((gemChamber->id().rawId()) & GEMDetId::chamberIdMask);
432  for (auto& etaPart : partitions) {
433  if (((etaPart->id().rawId()) & GEMDetId::chamberIdMask) == id0) {
434  gemChamber->add(etaPart);
435  }
436  }
437  theGeometry.add(gemChamber);
438  }
439 
440  buildRegions(theGeometry, superChambers, demonstratorGeometry);
441 }
442 
444  cms::DDSolid solid(fv.solid());
445  auto solidA = solid.solidA();
446  std::vector<double> dpar = solidA.dimensions();
447 
448  double dy = k_ScaleFromDD4hep * dpar[3]; //length is along local Y
449  double dz = k_ScaleFromDD4hep * dpar[2]; // thickness is long local Z
450  double dx1 = k_ScaleFromDD4hep * dpar[0]; // bottom width is along local X
451  double dx2 = k_ScaleFromDD4hep * dpar[1]; // top width is along loc
452 
453  auto solidB = solid.solidB();
454  dpar = solidB.dimensions();
455  const int nch = 2;
456  const double chgap = 2.105;
457 
458  dz += (k_ScaleFromDD4hep * dpar[2]); // chamber thickness
459  dz *= nch; // 2 chambers in superchamber
460  dz += chgap; // gap between chambers
461 
462  bool isOdd = detId.chamber() % 2;
463  RCPBoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(dx1, dx2, dy, dz), isOdd));
464 
465  GEMSuperChamber* superChamber = new GEMSuperChamber(detId.superChamberId(), surf);
466  return superChamber;
467 }
468 
470  cms::DDSolid solid(fv.solid());
471  auto solidA = solid.solidA();
472  std::vector<double> dpar = solidA.dimensions();
473 
474  double dy = k_ScaleFromDD4hep * dpar[3]; //length is along local Y
475  double dz = k_ScaleFromDD4hep * dpar[2]; // thickness is long local Z
476  double dx1 = k_ScaleFromDD4hep * dpar[0]; // bottom width is along local X
477  double dx2 = k_ScaleFromDD4hep * dpar[1]; // top width is along local X
478 
479  auto solidB = solid.solidB();
480  dpar = solidB.dimensions();
481 
482  dz += (k_ScaleFromDD4hep * dpar[2]); // chamber thickness
483 
484  bool isOdd = detId.chamber() % 2;
485  RCPBoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(dx1, dx2, dy, dz), isOdd));
486 
487  GEMChamber* chamber = new GEMChamber(detId.chamberId(), surf);
488  return chamber;
489 }
490 
492  // EtaPartition specific parameter (nstrips and npads)
493 
494  auto nStrips = fv.get<double>("nStrips");
495  auto nPads = fv.get<double>("nPads");
496  auto dPhi = fv.get<double>("dPhi");
497  // EtaPartition specific parameter (size)
498 
499  std::vector<double> dpar = fv.parameters();
500 
501  double ti = 0.4; // half thickness
502 
503  const std::vector<float> pars{float(k_ScaleFromDD4hep * dpar[0]),
504  float(k_ScaleFromDD4hep * dpar[1]),
505  float(k_ScaleFromDD4hep * dpar[3]),
506  float(nStrips),
507  float(nPads),
508  float(dPhi)};
509 
510  bool isOdd = detId.chamber() % 2;
511  RCPBoundPlane surf(
512  boundPlane(fv,
514  k_ScaleFromDD4hep * dpar[0], k_ScaleFromDD4hep * dpar[1], k_ScaleFromDD4hep * dpar[3], ti),
515  isOdd));
516 
517  std::string_view name = fv.name();
518 
520 
521  GEMEtaPartition* etaPartition = new GEMEtaPartition(detId, surf, e_p_specs);
522  return etaPartition;
523 }
524 
526  Bounds* bounds,
527  bool isOddChamber) const {
528  // extract the position
529  const Double_t* tran = fv.trans();
530  Surface::PositionType posResult(
531  k_ScaleFromDD4hep * tran[0], k_ScaleFromDD4hep * tran[1], k_ScaleFromDD4hep * tran[2]);
532 
533  // now the rotation
534  DDRotationMatrix rota;
535  fv.rot(rota);
536  DD3Vector x, y, z;
537  rota.GetComponents(x, y, z);
538  Surface::RotationType rotResult(float(x.X()),
539  float(x.Y()),
540  float(x.Z()),
541  float(y.X()),
542  float(y.Y()),
543  float(y.Z()),
544  float(z.X()),
545  float(z.Y()),
546  float(z.Z()));
547 
548  //Change of axes for the forward
549  Basic3DVector<float> newX(1., 0., 0.);
550  Basic3DVector<float> newY(0., 0., -1.);
551  Basic3DVector<float> newZ(0., 1., 0.);
552 
553  rotResult.rotateAxes(newX, newY, newZ);
554 
555  return RCPBoundPlane(new BoundPlane(posResult, rotResult, bounds));
556 }
557 
559  const std::vector<GEMSuperChamber*>& superChambers,
560  bool demonstratorGeometry) {
561  // construct the regions, stations and rings.
562  for (int re = -1; re <= 1; re = re + 2) {
563  GEMRegion* region = new GEMRegion(re);
564  for (int st = GEMDetId::minStationId0; st <= GEMDetId::maxStationId; ++st) {
565  bool ge0Station = st == GEMDetId::minStationId0;
566  GEMStation* station = new GEMStation(re, st);
567  std::string sign(re == -1 ? "-" : "");
568  std::string suffix = ge0Station ? "" : "/1";
569  std::string name = "GE" + sign + std::to_string(st) + suffix;
570  station->setName(name);
571  bool foundSuperChamber = false;
572  for (int ri = 1; ri <= 1; ++ri) {
573  GEMRing* ring = new GEMRing(re, st, ri);
574  for (auto superChamber : superChambers) {
575  const GEMDetId detId(superChamber->id());
576  if (detId.region() != re || detId.station() != st || detId.ring() != ri)
577  continue;
578 
579  foundSuperChamber = true;
581 
582  // GEMDetId::minLayerId is to id the superchamber, so minLayerId+1 is the first layer
583  for (int la = GEMDetId::minLayerId + 1; la <= nlayers; ++la) {
584  GEMDetId chId(detId.region(), detId.ring(), detId.station(), la, detId.chamber(), 0);
585  auto chamber = theGeometry.chamber(chId);
586  if (!chamber) {
587  // this particular layer 1 chamber *should* be missing in the demonstrator geometry (we only have layer 2)
588  if (!demonstratorGeometry or
589  not(chId.region() == 1 and chId.station() == 2 and chId.chamber() == 16 and chId.layer() == 1)) {
590  edm::LogWarning("GEMGeometryBuilder") << "Missing chamber " << chId;
591  }
592  } else {
593  superChamber->add(chamber);
594  }
595  }
596  ring->add(superChamber);
597  theGeometry.add(superChamber);
598 #ifdef EDM_ML_DEBUG
599  edm::LogVerbatim("Geometry") << "Adding super chamber " << detId << " to ring: "
600  << "re " << re << " st " << st << " ri " << ri;
601 #endif
602  }
603 #ifdef EDM_ML_DEBUG
604  edm::LogVerbatim("Geometry") << "Adding ring " << ri << " to station "
605  << "re " << re << " st " << st;
606 #endif
607  if (foundSuperChamber) {
608  station->add(ring);
609  theGeometry.add(ring);
610  }
611  }
612  if (!foundSuperChamber) {
613 #ifdef EDM_ML_DEBUG
614  edm::LogVerbatim("Geometry") << "No superchamber found: re:" << re << " st:" << st;
615 #endif
616  delete station;
617  } else {
618 #ifdef EDM_ML_DEBUG
619  edm::LogVerbatim("Geometry") << "Adding station " << st << " to region " << re;
620 #endif
621  region->add(station);
622  theGeometry.add(station);
623  }
624  }
625 #ifdef EDM_ML_DEBUG
626  edm::LogVerbatim("Geometry") << "Adding region " << re << " to the geometry ";
627 #endif
628  theGeometry.add(region);
629  }
630 }
Log< level::Info, true > LogVerbatim
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
bool parent()
set the current node to the parent node ...
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history) const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
Definition: DDValue.cc:111
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> DD3Vector
int getValue(const std::string &name) const
const N & name() const
Definition: DDBase.h:59
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool nextSibling()
set the current node to the next sibling ...
dd4hep::Solid solidA() const
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
double sign(double x)
Plane BoundPlane
Definition: Plane.h:94
GEMEtaPartition * buildEtaPartition(DDFilteredView &fv, GEMDetId detId) const
std::string to_string(const V &value)
Definition: OMSAccess.h:71
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
void add(GEMRing *ring)
Add ring to the station which takes ownership.
Definition: GEMStation.cc:22
void add(GEMSuperChamber *ch)
Add super chamber to the ring which takes ownership.
Definition: GEMRing.cc:14
static constexpr int32_t maxLayerId0
Definition: GEMDetId.h:31
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
DDSolid solidB(void) const
Definition: DDSolid.cc:472
static double delPhi(const double phi1, const double phi2)
RCPBoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const ExpandedNodes & history()
The numbering history of the current node.
static constexpr uint32_t chamberIdMask
Definition: GEMDetId.h:70
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
static constexpr int32_t maxStationId
Definition: GEMDetId.h:27
const Double_t * rot() const
The absolute rotation of the current node.
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:204
void setName(std::string name)
Set the station name.
Definition: GEMStation.cc:66
std::string_view name() const
bool firstChild()
set the current node to the first child
DDSolid solidA(void) const
Definition: DDSolid.cc:470
T get(const std::string &)
extract attribute value
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
const Double_t * trans() const
The absolute translation of the current node.
GEMChamber * buildChamber(DDFilteredView &fv, GEMDetId detId) const
constexpr int chamber() const
Definition: GEMDetId.h:183
constexpr int layer() const
Definition: GEMDetId.h:190
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:73
constexpr int station() const
Definition: GEMDetId.h:179
static constexpr int32_t maxLayerId
Definition: GEMDetId.h:32
void buildRegions(GEMGeometry &, const std::vector< GEMSuperChamber * > &, bool demonstratorGeometry)
bool firstChild()
set the current node to the first child ...
float x
int baseNumberToUnitNumber(const MuonBaseNumber &) const override
void add(GEMStation *st)
Add station to the region which takes ownership.
Definition: GEMRegion.cc:20
GEMSuperChamber * buildSuperChamber(DDFilteredView &fv, GEMDetId detId) const
Definition: Bounds.h:18
const std::vector< double > parameters() const
extract shape parameters
const DDTranslation & translation() const
The absolute translation of the current node.
constexpr GEMDetId superChamberId() const
Definition: GEMDetId.h:207
std::vector< const DDsvalues_type * > specifics() const
Log< level::Warning, false > LogWarning
const int level() const
get Iterator level
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
void add(const GEMEtaPartition *roll)
Add EtaPartition to the chamber which takes ownership.
Definition: GEMChamber.cc:21
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
static constexpr int32_t minLayerId
Definition: GEMDetId.h:30
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
dd4hep::Solid solid() const
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.
Definition: GEMGeometry.cc:81