CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ME0GeometryBuilder Class Reference

#include <ME0GeometryBuilder.h>

Public Member Functions

ME0Geometrybuild (const cms::DDCompactView *cview, const cms::MuonNumbering &muonConstants)
 
ME0Geometrybuild (const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
 
 ME0GeometryBuilder ()
 
 ~ME0GeometryBuilder ()
 

Private Types

typedef ReferenceCountingPointer< BoundPlaneME0BoundPlane
 

Private Member Functions

ME0BoundPlane boundPlane (const cms::DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
 
ME0BoundPlane boundPlane (const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
 
ME0ChamberbuildChamber (cms::DDFilteredView &fv, ME0DetId detId) const
 
ME0ChamberbuildChamber (DDFilteredView &fv, ME0DetId detId) const
 
ME0EtaPartitionbuildEtaPartition (cms::DDFilteredView &fv, ME0DetId detId) const
 
ME0EtaPartitionbuildEtaPartition (DDFilteredView &fv, ME0DetId detId) const
 
ME0GeometrybuildGeometry (cms::DDFilteredView &fview, const cms::MuonNumbering &muonConstants)
 
ME0GeometrybuildGeometry (DDFilteredView &fview, const MuonGeometryConstants &muonConstants)
 
ME0LayerbuildLayer (cms::DDFilteredView &fv, ME0DetId detId) const
 
ME0LayerbuildLayer (DDFilteredView &fv, ME0DetId detId) const
 

Private Attributes

std::map< ME0DetId, std::vector< ME0DetId > > chids
 

Detailed Description

Definition at line 34 of file ME0GeometryBuilder.h.

Member Typedef Documentation

◆ ME0BoundPlane

Definition at line 48 of file ME0GeometryBuilder.h.

Constructor & Destructor Documentation

◆ ME0GeometryBuilder()

ME0GeometryBuilder::ME0GeometryBuilder ( )

Definition at line 38 of file ME0GeometryBuilder.cc.

38 {}

◆ ~ME0GeometryBuilder()

ME0GeometryBuilder::~ME0GeometryBuilder ( )

Definition at line 40 of file ME0GeometryBuilder.cc.

40 {}

Member Function Documentation

◆ boundPlane() [1/2]

ME0GeometryBuilder::ME0BoundPlane ME0GeometryBuilder::boundPlane ( const cms::DDFilteredView fv,
Bounds bounds,
bool  isOddChamber 
) const
private

Definition at line 489 of file ME0GeometryBuilder.cc.

491  {
492  // extract the position
493  const Double_t* trans = fv.trans();
494  Surface::PositionType posResult(trans[0], trans[1], trans[2]);
495 
496  // now the rotation
498  fv.rot(rotation);
499  DD3Vector x, y, z;
500  rotation.GetComponents(x, y, z);
501  Surface::RotationType rotResult(float(x.X()),
502  float(x.Y()),
503  float(x.Z()),
504  float(y.X()),
505  float(y.Y()),
506  float(y.Z()),
507  float(z.X()),
508  float(z.Y()),
509  float(z.Z()));
510 
511  //Change of axes for the forward
512  Basic3DVector<float> newX(1., 0., 0.);
513  Basic3DVector<float> newY(0., 0., 1.);
514  Basic3DVector<float> newZ(0., 1., 0.);
515  newY *= -1;
516 
517  rotResult.rotateAxes(newX, newY, newZ);
518 
519  return ME0BoundPlane(new BoundPlane(posResult, rotResult, bounds));
520 }

References cms::DDFilteredView::rot(), TkRotation< T >::rotateAxes(), idealTransformation::rotation, and cms::DDFilteredView::trans().

◆ boundPlane() [2/2]

ME0GeometryBuilder::ME0BoundPlane ME0GeometryBuilder::boundPlane ( const DDFilteredView fv,
Bounds bounds,
bool  isOddChamber 
) const
private

Definition at line 333 of file ME0GeometryBuilder.cc.

335  {
336  // extract the position
337  const DDTranslation& trans(fv.translation());
338  const Surface::PositionType posResult(
339  float(convertMmToCm(trans.x())), float(convertMmToCm(trans.y())), float(convertMmToCm(trans.z())));
340 
341  const DDRotationMatrix& rotation = fv.rotation();
342  DD3Vector x, y, z;
343  rotation.GetComponents(x, y, z);
344 
345  Surface::RotationType rotResult(float(x.X()),
346  float(x.Y()),
347  float(x.Z()),
348  float(y.X()),
349  float(y.Y()),
350  float(y.Z()),
351  float(z.X()),
352  float(z.Y()),
353  float(z.Z()));
354 
355  //Change of axes for the forward
356  Basic3DVector<float> newX(1., 0., 0.);
357  Basic3DVector<float> newY(0., 0., 1.);
358  Basic3DVector<float> newZ(0., 1., 0.);
359  newY *= -1;
360 
361  rotResult.rotateAxes(newX, newY, newZ);
362 
363  return ME0BoundPlane(new BoundPlane(posResult, rotResult, bounds));
364 }

References geant_units::operators::convertMmToCm(), dqmMemoryStats::float, TkRotation< T >::rotateAxes(), idealTransformation::rotation, DDFilteredView::rotation(), and DDFilteredView::translation().

◆ build() [1/2]

ME0Geometry * ME0GeometryBuilder::build ( const cms::DDCompactView cview,
const cms::MuonNumbering muonConstants 
)

Definition at line 51 of file ME0GeometryBuilder.cc.

51  {
52  std::string attribute = "MuStructure";
53  std::string value = "MuonEndCapME0";
54  cms::DDFilteredView fview(cview->detector(), cview->detector()->worldVolume());
55  cms::DDSpecParRefs refs;
56  const cms::DDSpecParRegistry& mypar = cview->specpars();
57  mypar.filter(refs, attribute, value);
58  fview.mergedSpecifics(refs);
59  return this->buildGeometry(fview, muonConstants);
60 }

References cms::DDCompactView::detector(), cms::DDSpecParRegistry::filter(), cms::DDCompactView::specpars(), AlCaHLTBitMon_QueryRunRegistry::string, and cms::DDDetector::worldVolume().

◆ build() [2/2]

ME0Geometry * ME0GeometryBuilder::build ( const DDCompactView cview,
const MuonGeometryConstants muonConstants 
)

Definition at line 42 of file ME0GeometryBuilder.cc.

42  {
43  std::string attribute = "MuStructure";
44  std::string value = "MuonEndCapME0";
46  DDFilteredView fview(*cview, filter);
47  return this->buildGeometry(fview, muonConstants);
48 }

References ALCARECOTkAlBeamHalo_cff::filter, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ME0GeometryESModule::produce().

◆ buildChamber() [1/2]

ME0Chamber * ME0GeometryBuilder::buildChamber ( cms::DDFilteredView fv,
ME0DetId  detId 
) const
private

Definition at line 433 of file ME0GeometryBuilder.cc.

433  {
434  std::vector<double> dpar = fv.parameters();
435 
436  double L = dpar[3];
437  double T = dpar[2];
438  double b = dpar[0];
439  double B = dpar[1];
440  bool isOdd = false;
441  ME0BoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(b, B, L, T), isOdd));
442  ME0Chamber* chamber = new ME0Chamber(detId.chamberId(), surf);
443 
444  return chamber;
445 }

References TtFullHadDaughter::B, b, relativeConstraints::chamber, ME0DetId::chamberId(), dttmaxenums::L, and cms::DDFilteredView::parameters().

◆ buildChamber() [2/2]

ME0Chamber * ME0GeometryBuilder::buildChamber ( DDFilteredView fv,
ME0DetId  detId 
) const
private

Definition at line 226 of file ME0GeometryBuilder.cc.

226  {
227  LogTrace("ME0GeometryBuilder") << "buildChamber " << fv.logicalPart().name().name() << " " << detId << std::endl;
229 
230  std::vector<double> dpar = solid.parameters();
231 
232  double L = convertMmToCm(dpar[0]); // length is along local Y
233  double T = convertMmToCm(dpar[3]); // thickness is long local Z
234  double b = convertMmToCm(dpar[4]); // bottom width is along local X
235  double B = convertMmToCm(dpar[8]); // top width is along local X
236 
237 #ifdef EDM_ML_DEBUG
238  LogTrace("ME0GeometryBuilder") << " name of logical part = " << fv.logicalPart().name().name() << std::endl;
239  LogTrace("ME0GeometryBuilder") << " dpar is vector with size = " << dpar.size() << std::endl;
240  for (unsigned int i = 0; i < dpar.size(); ++i) {
241  LogTrace("ME0GeometryBuilder") << " dpar [" << i << "] = " << convertMmToCm(dpar[i]) << " cm " << std::endl;
242  }
243  LogTrace("ME0GeometryBuilder") << "size b: " << b << "cm, B: " << B << "cm, L: " << L << "cm, T: " << T << "cm "
244  << std::endl;
245 #endif
246 
247  bool isOdd = false; // detId.chamber()%2;
248  ME0BoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(b, B, L, T), isOdd));
249  ME0Chamber* chamber = new ME0Chamber(detId.chamberId(), surf);
250  return chamber;
251 }

References TtFullHadDaughter::B, b, relativeConstraints::chamber, ME0DetId::chamberId(), geant_units::operators::convertMmToCm(), mps_fire::i, dttmaxenums::L, DDFilteredView::logicalPart(), LogTrace, DDName::name(), DDBase< N, C >::name(), DDSolid::parameters(), and DDLogicalPart::solid().

◆ buildEtaPartition() [1/2]

ME0EtaPartition * ME0GeometryBuilder::buildEtaPartition ( cms::DDFilteredView fv,
ME0DetId  detId 
) const
private

Definition at line 461 of file ME0GeometryBuilder.cc.

461  {
462  // auto nStrips = fv.get<double>("nStrips"); //it doesn't work
463  // auto nPads = fv.get<double>("nPads"); //it doesn't work
464 
465  auto nStrips = 384; // from GEMSpecs
466  auto nPads = 192; // from GEMSpecs
467 
468  std::vector<double> dpar = fv.parameters();
469 
470  double b = dpar[0];
471  double B = dpar[1];
472  double L = dpar[3];
473  double t = dpar[2];
474 
475  const std::vector<float> pars{float(dpar[0]), float(dpar[1]), float(dpar[3]), float(nStrips), float(nPads)};
476 
477  bool isOdd = false;
478  ME0BoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(b, B, L, t), isOdd));
479 
480  std::string_view name = fv.name();
481 
483 
484  ME0EtaPartition* etaPartition = new ME0EtaPartition(detId, surf, e_p_specs);
485 
486  return etaPartition;
487 }

References TtFullHadDaughter::B, b, dqmMemoryStats::float, dttmaxenums::L, GeomDetEnumerators::ME0, Skims_PA_cff::name, cms::DDFilteredView::name(), me0TriggerPseudoDigis_cff::nStrips, cms::DDFilteredView::parameters(), AlCaHLTBitMon_QueryRunRegistry::string, and OrderedSet::t.

◆ buildEtaPartition() [2/2]

ME0EtaPartition * ME0GeometryBuilder::buildEtaPartition ( DDFilteredView fv,
ME0DetId  detId 
) const
private

Definition at line 280 of file ME0GeometryBuilder.cc.

280  {
281  LogTrace("ME0GeometryBuilder") << "buildEtaPartition " << fv.logicalPart().name().name() << " " << detId << std::endl;
282 
283  // EtaPartition specific parameter (nstrips and npads)
284  DDValue numbOfStrips("nStrips");
285  DDValue numbOfPads("nPads");
286  std::vector<const DDsvalues_type*> specs(fv.specifics());
287  double nStrips = 0., nPads = 0.;
288  for (const auto& is : specs) {
289  if (DDfetch(is, numbOfStrips))
290  nStrips = numbOfStrips.doubles()[0];
291  if (DDfetch(is, numbOfPads))
292  nPads = numbOfPads.doubles()[0];
293  }
294 
295  LogTrace("ME0GeometryBuilder") << ((nStrips == 0.) ? ("No nStrips found!!")
296  : ("Number of strips: " + std::to_string(nStrips)));
297  LogTrace("ME0GeometryBuilder") << ((nPads == 0.) ? ("No nPads found!!")
298  : ("Number of pads: " + std::to_string(nPads)));
299 
300  // EtaPartition specific parameter (size)
301  std::vector<double> dpar = fv.logicalPart().solid().parameters();
302  double b = convertMmToCm(dpar[4]); // half bottom edge
303  double B = convertMmToCm(dpar[8]); // half top edge
304  double L = convertMmToCm(dpar[0]); // half apothem
305  double t = convertMmToCm(dpar[3]); // half thickness
306 
307 #ifdef EDM_ML_DEBUG
308  LogTrace("ME0GeometryBuilder") << " name of logical part = " << fv.logicalPart().name().name() << std::endl;
309  LogTrace("ME0GeometryBuilder") << " dpar is vector with size = " << dpar.size() << std::endl;
310  for (unsigned int i = 0; i < dpar.size(); ++i) {
311  LogTrace("ME0GeometryBuilder") << " dpar [" << i << "] = " << convertMmToCm(dpar[i]) << " cm " << std::endl;
312  }
313  LogTrace("ME0GeometryBuilder") << "size b: " << b << "cm, B: " << B << "cm, L: " << L << "cm, t: " << t << "cm "
314  << std::endl;
315 #endif
316 
317  std::vector<float> pars;
318  pars.emplace_back(b);
319  pars.emplace_back(B);
320  pars.emplace_back(L);
321  pars.emplace_back(nStrips);
322  pars.emplace_back(nPads);
323 
324  bool isOdd = false; // detId.chamber()%2;
325  ME0BoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(b, B, L, t), isOdd));
326  std::string name = fv.logicalPart().name().name();
328 
329  ME0EtaPartition* etaPartition = new ME0EtaPartition(detId, surf, e_p_specs);
330  return etaPartition;
331 }

References TtFullHadDaughter::B, b, geant_units::operators::convertMmToCm(), DDfetch(), DDValue::doubles(), mps_fire::i, dttmaxenums::L, DDFilteredView::logicalPart(), LogTrace, GeomDetEnumerators::ME0, Skims_PA_cff::name, DDName::name(), DDBase< N, C >::name(), me0TriggerPseudoDigis_cff::nStrips, DDSolid::parameters(), DDLogicalPart::solid(), DDFilteredView::specifics(), HistogramManager_cfi::specs, AlCaHLTBitMon_QueryRunRegistry::string, and OrderedSet::t.

◆ buildGeometry() [1/2]

ME0Geometry * ME0GeometryBuilder::buildGeometry ( cms::DDFilteredView fview,
const cms::MuonNumbering muonConstants 
)
private

Definition at line 368 of file ME0GeometryBuilder.cc.

368  {
370 
371  bool doChambers = fv.firstChild();
372  //loop over chambers
373  while (doChambers) {
374  MuonBaseNumber mbn = muonConstants.geoHistoryToBaseNumber(fv.history());
375  cms::ME0NumberingScheme me0Num(muonConstants.values());
376  me0Num.baseNumberToUnitNumber(mbn);
377  ME0DetId detId = ME0DetId(me0Num.getDetId());
378  ME0DetId detIdCh = detId.chamberId();
379 
380  // build chamber
381  ME0Chamber* me0Chamber = buildChamber(fv, detIdCh);
382  geometry->add(me0Chamber);
383 
384  bool doLayers = fv.nextSibling();
385  // loop over layers of the chamber
386  while (doLayers) {
387  MuonBaseNumber mbn = muonConstants.geoHistoryToBaseNumber(fv.history());
388  cms::ME0NumberingScheme me0Num(muonConstants.values());
389  me0Num.baseNumberToUnitNumber(mbn);
390  ME0DetId detId = ME0DetId(me0Num.getDetId());
391  ME0DetId detIdLa = detId.layerId();
392 
393  // build layer
394  ME0Layer* me0Layer = buildLayer(fv, detIdLa);
395  me0Chamber->add(me0Layer);
396  geometry->add(me0Layer);
397 
398  fv.down(); // down to the first eta partion
399 
400  // build first eta partition
401  MuonBaseNumber mbnbis = muonConstants.geoHistoryToBaseNumber(fv.history());
402  cms::ME0NumberingScheme me0Numbis(muonConstants.values());
403  me0Numbis.baseNumberToUnitNumber(mbnbis);
404  ME0DetId detIdbis = ME0DetId(me0Numbis.getDetId());
405  ME0EtaPartition* etaPart = buildEtaPartition(fv, detIdbis);
406  me0Layer->add(etaPart);
407  geometry->add(etaPart);
408 
409  bool doEtaParts = fv.sibling();
410  // loop over the other eta partions
411 
412  while (doEtaParts) {
413  MuonBaseNumber mbn = muonConstants.geoHistoryToBaseNumber(fv.history());
414  cms::ME0NumberingScheme me0Num(muonConstants.values());
415  me0Num.baseNumberToUnitNumber(mbn);
416  ME0DetId detId = ME0DetId(me0Num.getDetId());
417  // build other eta partitions
418  ME0EtaPartition* etaPart = buildEtaPartition(fv, detId);
419  me0Layer->add(etaPart);
420  geometry->add(etaPart);
421 
422  doEtaParts = fv.sibling();
423  }
424  doLayers = fv.nextSibling();
425  }
426  fv.parent();
427  doChambers = fv.firstChild();
428  }
429 
430  return geometry;
431 }

References ME0Layer::add(), ME0Chamber::add(), cms::ME0NumberingScheme::baseNumberToUnitNumber(), ME0DetId::chamberId(), cms::DDFilteredView::down(), cms::DDFilteredView::firstChild(), cms::MuonNumbering::geoHistoryToBaseNumber(), geometry, cms::DDFilteredView::history(), ME0DetId::layerId(), cms::DDFilteredView::nextSibling(), cms::DDFilteredView::parent(), cms::DDFilteredView::sibling(), and cms::MuonNumbering::values().

◆ buildGeometry() [2/2]

ME0Geometry * ME0GeometryBuilder::buildGeometry ( DDFilteredView fview,
const MuonGeometryConstants muonConstants 
)
private

Definition at line 62 of file ME0GeometryBuilder.cc.

62  {
64 
65  LogTrace("ME0GeometryBuilder") << "Building the geometry service";
66  LogTrace("ME0GeometryBuilder") << "About to run through the ME0 structure\n"
67  << "Top level logical part: " << fv.logicalPart().name().name();
68 
69 // ==========================================
70 // === Test to understand the structure ===
71 // ==========================================
72 #ifdef EDM_ML_DEBUG
73  bool testChambers = fv.firstChild();
74  LogTrace("ME0GeometryBuilder") << "doChamber = fv.firstChild() = " << testChambers;
75 
76  while (testChambers) {
77  // to etapartitions
78  LogTrace("ME0GeometryBuilder") << "to layer " << fv.firstChild();
79  LogTrace("ME0GeometryBuilder") << "to etapt " << fv.firstChild();
80  MuonDDDNumbering mdddnum(muonConstants);
81  ME0NumberingScheme me0Num(muonConstants);
82  int rawId = me0Num.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
83  ME0DetId detId = ME0DetId(rawId);
84  ME0DetId detIdCh = detId.chamberId();
85  // back to chambers
86  LogTrace("ME0GeometryBuilder") << "back to layer " << fv.parent();
87  LogTrace("ME0GeometryBuilder") << "back to chamb " << fv.parent();
88 
89  LogTrace("ME0GeometryBuilder") << "In DoChambers Loop :: ME0DetId " << detId << " = " << detId.rawId()
90  << " (which belongs to ME0Chamber " << detIdCh << " = " << detIdCh.rawId() << ")";
91  LogTrace("ME0GeometryBuilder") << "Second level logical part: " << fv.logicalPart().name().name();
92  DDBooleanSolid solid2 = (DDBooleanSolid)(fv.logicalPart().solid());
93  std::vector<double> dpar2 = solid2.parameters();
94  std::stringstream parameters2;
95  for (unsigned int i = 0; i < dpar2.size(); ++i) {
96  parameters2 << " dpar[" << i << "]=" << convertMmToCm(dpar2[i]) << "cm ";
97  }
98  LogTrace("ME0GeometryBuilder") << "Second level parameters: vector with size = " << dpar2.size() << " and elements "
99  << parameters2.str();
100 
101  bool doLayers = fv.firstChild();
102 
103  LogTrace("ME0GeometryBuilder") << "doLayer = fv.firstChild() = " << doLayers;
104  while (doLayers) {
105  // to etapartitions
106  LogTrace("ME0GeometryBuilder") << "to etapt " << fv.firstChild();
107  MuonDDDNumbering mdddnum(muonConstants);
108  ME0NumberingScheme me0Num(muonConstants);
109  int rawId = me0Num.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
110  ME0DetId detId = ME0DetId(rawId);
111  ME0DetId detIdLa = detId.layerId();
112  // back to layers
113  LogTrace("ME0GeometryBuilder") << "back to layer " << fv.parent();
114  LogTrace("ME0GeometryBuilder") << "In DoLayers Loop :: ME0DetId " << detId << " = " << detId.rawId()
115  << " (which belongs to ME0Layer " << detIdLa << " = " << detIdLa.rawId() << ")";
116  LogTrace("ME0GeometryBuilder") << "Third level logical part: " << fv.logicalPart().name().name();
117  DDBooleanSolid solid3 = (DDBooleanSolid)(fv.logicalPart().solid());
118  std::vector<double> dpar3 = solid3.parameters();
119  std::stringstream parameters3;
120  for (unsigned int i = 0; i < dpar3.size(); ++i) {
121  parameters3 << " dpar[" << i << "]=" << convertMmToCm(dpar3[i]) << "cm ";
122  }
123  LogTrace("ME0GeometryBuilder") << "Third level parameters: vector with size = " << dpar3.size()
124  << " and elements " << parameters3.str();
125  bool doEtaParts = fv.firstChild();
126 
127  LogTrace("ME0GeometryBuilder") << "doEtaPart = fv.firstChild() = " << doEtaParts;
128  while (doEtaParts) {
129  LogTrace("ME0GeometryBuilder") << "In DoEtaParts Loop :: ME0DetId " << detId << " = " << detId.rawId();
130  LogTrace("ME0GeometryBuilder") << "Fourth level logical part: " << fv.logicalPart().name().name();
131  DDBooleanSolid solid4 = (DDBooleanSolid)(fv.logicalPart().solid());
132  std::vector<double> dpar4 = solid4.parameters();
133  std::stringstream parameters4;
134  for (unsigned int i = 0; i < dpar4.size(); ++i) {
135  parameters4 << " dpar[" << i << "]=" << convertMmToCm(dpar4[i]) << "cm ";
136  }
137  LogTrace("ME0GeometryBuilder") << "Fourth level parameters: vector with size = " << dpar4.size()
138  << " and elements " << parameters4.str();
139 
140  doEtaParts = fv.nextSibling();
141  LogTrace("ME0GeometryBuilder") << "doEtaPart = fv.nextSibling() = " << doEtaParts;
142  }
143  fv.parent();
144  LogTrace("ME0GeometryBuilder") << "went back to parent :: name = " << fv.logicalPart().name().name()
145  << " will now ask for nextSibling";
146  doLayers = fv.nextSibling();
147  LogTrace("ME0GeometryBuilder") << "doLayer = fv.nextSibling() = " << doLayers;
148  }
149  fv.parent();
150  LogTrace("ME0GeometryBuilder") << "went back to parent :: name = " << fv.logicalPart().name().name()
151  << " will now ask for nextSibling";
152  testChambers = fv.nextSibling();
153  LogTrace("ME0GeometryBuilder") << "doChamber = fv.nextSibling() = " << testChambers;
154  }
155  fv.parent();
156 #endif
157 
158  // ==========================================
159  // === Here the Real ME0 Geometry Builder ===
160  // ==========================================
161  bool doChambers = fv.firstChild();
162 
163  while (doChambers) {
164  // to etapartitions and back again to pick up DetId
165  fv.firstChild();
166  fv.firstChild();
167 
168  MuonDDDNumbering mdddnum(muonConstants);
169  ME0NumberingScheme me0Num(muonConstants);
170  int rawId = me0Num.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
171  ME0DetId detId = ME0DetId(rawId);
172  ME0DetId detIdCh = detId.chamberId();
173 
174  fv.parent();
175  fv.parent();
176 
177  // build chamber
178  ME0Chamber* me0Chamber = buildChamber(fv, detIdCh);
179  geometry->add(me0Chamber);
180 
181  // loop over layers of the chamber
182  bool doLayers = fv.firstChild();
183 
184  while (doLayers) {
185  // to etapartitions and back again to pick up DetId
186  fv.firstChild();
187  MuonDDDNumbering mdddnum(muonConstants);
188  ME0NumberingScheme me0Num(muonConstants);
189  int rawId = me0Num.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
190  ME0DetId detId = ME0DetId(rawId);
191  ME0DetId detIdLa = detId.layerId();
192  fv.parent();
193  // build layer
194  ME0Layer* me0Layer = buildLayer(fv, detIdLa);
195  me0Chamber->add(me0Layer);
196  geometry->add(me0Layer);
197 
198  // loop over etapartitions of the layer
199  bool doEtaParts = fv.firstChild();
200 
201  while (doEtaParts) {
202  // pick up DetId
203  MuonDDDNumbering mdddnum(muonConstants);
204  ME0NumberingScheme me0Num(muonConstants);
205  int rawId = me0Num.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
206  ME0DetId detId = ME0DetId(rawId);
207 
208  // build etapartition
209  ME0EtaPartition* etaPart = buildEtaPartition(fv, detId);
210  me0Layer->add(etaPart);
211  geometry->add(etaPart);
212 
213  doEtaParts = fv.nextSibling();
214  }
215  fv.parent();
216 
217  doLayers = fv.nextSibling();
218  }
219  fv.parent();
220 
221  doChambers = fv.nextSibling();
222  }
223  return geometry;
224 }

References ME0Layer::add(), ME0Chamber::add(), ME0NumberingScheme::baseNumberToUnitNumber(), ME0DetId::chamberId(), geant_units::operators::convertMmToCm(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonDDDNumbering::geoHistoryToBaseNumber(), geometry, mps_fire::i, ME0DetId::layerId(), DDFilteredView::logicalPart(), LogTrace, DDName::name(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), DDSolid::parameters(), DDFilteredView::parent(), DetId::rawId(), and DDLogicalPart::solid().

◆ buildLayer() [1/2]

ME0Layer * ME0GeometryBuilder::buildLayer ( cms::DDFilteredView fv,
ME0DetId  detId 
) const
private

Definition at line 447 of file ME0GeometryBuilder.cc.

447  {
448  std::vector<double> dpar = fv.parameters();
449 
450  double L = dpar[3];
451  double t = dpar[2];
452  double b = dpar[0];
453  double B = dpar[1];
454  bool isOdd = false;
455  ME0BoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(b, B, L, t), isOdd));
456  ME0Layer* layer = new ME0Layer(detId.layerId(), surf);
457 
458  return layer;
459 }

References TtFullHadDaughter::B, b, dttmaxenums::L, ME0DetId::layerId(), cms::DDFilteredView::parameters(), and OrderedSet::t.

◆ buildLayer() [2/2]

ME0Layer * ME0GeometryBuilder::buildLayer ( DDFilteredView fv,
ME0DetId  detId 
) const
private

Definition at line 253 of file ME0GeometryBuilder.cc.

253  {
254  LogTrace("ME0GeometryBuilder") << "buildLayer " << fv.logicalPart().name().name() << " " << detId << std::endl;
255 
257 
258  std::vector<double> dpar = solid.parameters();
259  double L = convertMmToCm(dpar[0]); // length is along local Y
260  double t = convertMmToCm(dpar[3]); // thickness is long local Z
261  double b = convertMmToCm(dpar[4]); // bottom width is along local X
262  double B = convertMmToCm(dpar[8]); // top width is along local X
263 
264 #ifdef EDM_ML_DEBUG
265  LogTrace("ME0GeometryBuilder") << " name of logical part = " << fv.logicalPart().name().name() << std::endl;
266  LogTrace("ME0GeometryBuilder") << " dpar is vector with size = " << dpar.size() << std::endl;
267  for (unsigned int i = 0; i < dpar.size(); ++i) {
268  LogTrace("ME0GeometryBuilder") << " dpar [" << i << "] = " << convertMmToCm(dpar[i]) << " cm " << std::endl;
269  }
270  LogTrace("ME0GeometryBuilder") << "size b: " << b << "cm, B: " << B << "cm, L: " << L << "cm, t: " << t << "cm "
271  << std::endl;
272 #endif
273 
274  bool isOdd = false; // detId.chamber()%2;
275  ME0BoundPlane surf(boundPlane(fv, new TrapezoidalPlaneBounds(b, B, L, t), isOdd));
276  ME0Layer* layer = new ME0Layer(detId.layerId(), surf);
277  return layer;
278 }

References TtFullHadDaughter::B, b, geant_units::operators::convertMmToCm(), mps_fire::i, dttmaxenums::L, ME0DetId::layerId(), DDFilteredView::logicalPart(), LogTrace, DDName::name(), DDBase< N, C >::name(), DDSolid::parameters(), DDLogicalPart::solid(), and OrderedSet::t.

Member Data Documentation

◆ chids

std::map<ME0DetId, std::vector<ME0DetId> > ME0GeometryBuilder::chids
private

Definition at line 46 of file ME0GeometryBuilder.h.

ME0Layer::add
void add(const ME0EtaPartition *roll)
Add EtaPartition to the layer which takes ownership.
Definition: ME0Layer.cc:15
cms::DDFilteredView::rot
const Double_t * rot() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:120
TkRotation< float >
MuonDDDNumbering
Definition: MuonDDDNumbering.h:24
DDAxes::y
dttmaxenums::L
Definition: DTTMax.h:29
cms::MuonNumbering::geoHistoryToBaseNumber
const MuonBaseNumber geoHistoryToBaseNumber(const cms::ExpandedNodes &) const
Definition: DD4hep_MuonNumbering.cc:8
geometry
ESHandle< TrackerGeometry > geometry
Definition: TkLasBeamFitter.cc:200
mps_fire.i
i
Definition: mps_fire.py:355
cms::DDFilteredView::parameters
const std::vector< double > parameters() const
extract shape parameters
Definition: DDFilteredView.cc:448
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
ME0Geometry
Definition: ME0Geometry.h:12
geometry
Definition: geometry.py:1
HistogramManager_cfi.specs
specs
Definition: HistogramManager_cfi.py:80
cms::DDSpecParRegistry
Definition: DDSpecParRegistry.h:32
ME0Chamber::add
void add(ME0Layer *layer)
Add Layer to the chamber which takes ownership.
Definition: ME0Chamber.cc:16
DDAxes::x
cms::DDFilteredView
Definition: DDFilteredView.h:65
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
ME0DetId::layerId
ME0DetId layerId() const
Return the corresponding LayerId (mask eta partition)
Definition: ME0DetId.h:55
cms::DDFilteredView::name
std::string_view name() const
Definition: DDFilteredView.cc:606
DDBooleanSolid
Definition: DDSolid.h:173
cms::DDFilteredView::trans
const Double_t * trans() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:101
cms::MuonNumbering::values
const MuonConstants & values() const
Definition: DD4hep_MuonNumbering.h:42
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDBase::name
const N & name() const
Definition: DDBase.h:59
DDAxes::z
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
ME0EtaPartitionSpecs
Definition: ME0EtaPartitionSpecs.h:18
Point3DBase< float, GlobalTag >
OrderedSet.t
t
Definition: OrderedSet.py:90
b
double b
Definition: hdecay.h:118
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
cms::DDSpecParRefs
std::vector< const DDSpecPar * > DDSpecParRefs
Definition: DDSpecParRegistry.h:30
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ME0GeometryBuilder::buildChamber
ME0Chamber * buildChamber(DDFilteredView &fv, ME0DetId detId) const
Definition: ME0GeometryBuilder.cc:226
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
ME0Layer
Definition: ME0Layer.h:9
cms::ME0NumberingScheme
Definition: DD4hep_ME0NumberingScheme.h:20
ME0Chamber
Definition: ME0Chamber.h:10
value
Definition: value.py:1
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:40
ME0GeometryBuilder::ME0BoundPlane
ReferenceCountingPointer< BoundPlane > ME0BoundPlane
Definition: ME0GeometryBuilder.h:48
ME0DetId
Definition: ME0DetId.h:16
TrapezoidalPlaneBounds
Definition: TrapezoidalPlaneBounds.h:15
cms::DDCompactView::specpars
DDSpecParRegistry const & specpars() const
Definition: DDCompactView.h:33
DDFilteredView::specifics
std::vector< const DDsvalues_type * > specifics() const
Definition: DDFilteredView.cc:32
me0TriggerPseudoDigis_cff.nStrips
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
Definition: me0TriggerPseudoDigis_cff.py:26
ME0NumberingScheme
Definition: ME0NumberingScheme.h:9
ME0DetId::chamberId
ME0DetId chamberId() const
Return the corresponding ChamberId (mask layers)
Definition: ME0DetId.h:53
MuonBaseNumber
Definition: MuonBaseNumber.h:21
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
BoundPlane
Plane BoundPlane
Definition: Plane.h:94
DDValue
Definition: DDValue.h:21
T
long double T
Definition: Basic3DVectorLD.h:48
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
cms::DDSpecParRegistry::filter
void filter(DDSpecParRefs &, const std::string &, const std::string &="") const
Definition: DDSpecparRegistry.cc:98
ME0GeometryBuilder::buildEtaPartition
ME0EtaPartition * buildEtaPartition(DDFilteredView &fv, ME0DetId detId) const
Definition: ME0GeometryBuilder.cc:280
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
DDFilteredView::rotation
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
Definition: DDFilteredView.cc:28
DDFilteredView
Definition: DDFilteredView.h:20
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
GeomDetEnumerators::ME0
Definition: GeomDetEnumerators.h:22
ME0GeometryBuilder::buildLayer
ME0Layer * buildLayer(DDFilteredView &fv, ME0DetId detId) const
Definition: ME0GeometryBuilder.cc:253
ME0GeometryBuilder::buildGeometry
ME0Geometry * buildGeometry(DDFilteredView &fview, const MuonGeometryConstants &muonConstants)
Definition: ME0GeometryBuilder.cc:62
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
cms::ME0NumberingScheme::baseNumberToUnitNumber
void baseNumberToUnitNumber(const MuonBaseNumber &)
Definition: DD4hep_ME0NumberingScheme.cc:34
ME0GeometryBuilder::boundPlane
ME0BoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
Definition: ME0GeometryBuilder.cc:333
cms::DDDetector::worldVolume
Volume worldVolume() const
Handle to the world volume containing everything.
Definition: DDDetector.cc:41
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:32
Basic3DVector< float >
ME0EtaPartition
Definition: ME0EtaPartition.h:12