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 MuonGeometryConstants &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 MuonGeometryConstants &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 31 of file ME0GeometryBuilder.h.

Member Typedef Documentation

◆ ME0BoundPlane

Definition at line 45 of file ME0GeometryBuilder.h.

Constructor & Destructor Documentation

◆ ME0GeometryBuilder()

ME0GeometryBuilder::ME0GeometryBuilder ( )

Definition at line 37 of file ME0GeometryBuilder.cc.

37 {}

◆ ~ME0GeometryBuilder()

ME0GeometryBuilder::~ME0GeometryBuilder ( )

Definition at line 39 of file ME0GeometryBuilder.cc.

39 {}

Member Function Documentation

◆ boundPlane() [1/2]

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

Definition at line 490 of file ME0GeometryBuilder.cc.

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

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 335 of file ME0GeometryBuilder.cc.

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

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 MuonGeometryConstants muonConstants 
)

Definition at line 50 of file ME0GeometryBuilder.cc.

50  {
51  std::string attribute = "MuStructure";
52  std::string value = "MuonEndCapME0";
53  const cms::DDFilter filter(attribute, value);
54  cms::DDFilteredView fview(*cview, filter);
55  return this->buildGeometry(fview, muonConstants);
56 }

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

◆ build() [2/2]

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

Definition at line 41 of file ME0GeometryBuilder.cc.

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

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 434 of file ME0GeometryBuilder.cc.

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

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 229 of file ME0GeometryBuilder.cc.

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

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 462 of file ME0GeometryBuilder.cc.

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

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 submitPVValidationJobs::t.

◆ buildEtaPartition() [2/2]

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

Definition at line 283 of file ME0GeometryBuilder.cc.

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

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 submitPVValidationJobs::t.

◆ buildGeometry() [1/2]

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

Definition at line 370 of file ME0GeometryBuilder.cc.

370  {
372  MuonGeometryNumbering mdddnum(muonConstants);
373  ME0NumberingScheme me0Num(muonConstants);
374 
375  static constexpr uint32_t levelChamber = 7;
376  static constexpr uint32_t levelLayer = 8;
377  uint32_t theLevelPart = muonConstants.getValue("level");
378  uint32_t theSectorLevel = muonConstants.getValue("m0_sector") / theLevelPart;
379  std::vector<ME0Chamber*> chambers;
380  std::vector<ME0Layer*> layers;
381 
382  while (fv.firstChild()) {
383  const auto& history = fv.history();
384  MuonBaseNumber num(mdddnum.geoHistoryToBaseNumber(history));
385  ME0DetId detId(me0Num.baseNumberToUnitNumber(num));
386 #ifdef EDM_ML_DEBUG
387  edm::LogVerbatim("ME0Geometry") << fv.name() << " with " << history.tags.size() << " Levels and ID " << detId
388  << " Mask " << std::hex << ME0DetId::chamberIdMask_ << ":" << ME0DetId::layerIdMask_
389  << std::dec << " and " << ME0DetId(((detId.rawId()) & ME0DetId::chamberIdMask_))
390  << ":" << ME0DetId(((detId.rawId()) & ME0DetId::layerIdMask_)) << " Sector Level "
391  << theSectorLevel << ":" << history.tags.size() << ":" << fv.level();
392  for (unsigned int k = 0; k < history.tags.size(); ++k)
393  edm::LogVerbatim("ME0Geometry") << "[" << k << "] Tag " << history.tags[k] << " Offset " << history.offsets[k]
394  << " copy " << history.copyNos[k];
395 #endif
396 
397  if (fv.level() == levelChamber) {
398  // build chamber
399  ME0Chamber* me0Chamber = buildChamber(fv, detId);
400  chambers.emplace_back(me0Chamber);
401  } else if (fv.level() == levelLayer) {
402  // build layer
403  ME0Layer* me0Layer = buildLayer(fv, detId);
404  layers.emplace_back(me0Layer);
405  } else if (history.tags.size() > theSectorLevel) {
406  // build first eta partition
407  ME0EtaPartition* etaPart = buildEtaPartition(fv, detId);
408  geometry->add(etaPart);
409  }
410  }
411 
412  auto const& partitions = geometry->etaPartitions();
413  for (auto& layer : layers) {
414  uint32_t id0 = ((layer->id().rawId()) & ME0DetId::layerIdMask_);
415  for (auto& etaPart : partitions) {
416  if (((etaPart->id().rawId()) & ME0DetId::layerIdMask_) == id0) {
417  layer->add(etaPart);
418  }
419  }
420  geometry->add(layer);
421  }
422  for (auto& chamber : chambers) {
423  uint32_t id0 = ((chamber->id().rawId()) & ME0DetId::chamberIdMask_);
424  for (auto& layer : layers) {
425  if (((layer->id().rawId()) & ME0DetId::chamberIdMask_) == id0) {
426  chamber->add(layer);
427  }
428  }
429  geometry->add(chamber);
430  }
431  return geometry;
432 }

References ME0NumberingScheme::baseNumberToUnitNumber(), relativeConstraints::chamber, ME0DetId::chamberIdMask_, chambers, TauDecayModes::dec, cms::DDFilteredView::firstChild(), MuonGeometryNumbering::geoHistoryToBaseNumber(), geometry, MuonGeometryConstants::getValue(), cms::DDFilteredView::history(), dqmdumpme::k, ME0DetId::layerIdMask_, hgcalTopologyTester_cfi::layers, cms::DDFilteredView::level(), cms::DDFilteredView::name(), and EgammaValidation_cff::num.

◆ buildGeometry() [2/2]

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

Definition at line 58 of file ME0GeometryBuilder.cc.

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

References ME0Layer::add(), ME0Chamber::add(), ME0NumberingScheme::baseNumberToUnitNumber(), ME0DetId::chamberId(), geant_units::operators::convertMmToCm(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonGeometryNumbering::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 448 of file ME0GeometryBuilder.cc.

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

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

◆ buildLayer() [2/2]

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

Definition at line 256 of file ME0GeometryBuilder.cc.

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

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 submitPVValidationJobs::t.

Member Data Documentation

◆ chids

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

Definition at line 43 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 >
DDAxes::y
dttmaxenums::L
Definition: DTTMax.h:29
geometry
ESHandle< TrackerGeometry > geometry
Definition: TkLasBeamFitter.cc:200
ME0DetId::layerIdMask_
static constexpr uint32_t layerIdMask_
Definition: ME0DetId.h:94
mps_fire.i
i
Definition: mps_fire.py:428
cms::DDFilteredView::parameters
const std::vector< double > parameters() const
extract shape parameters
Definition: DDFilteredView.cc:536
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
ME0Chamber::add
void add(ME0Layer *layer)
Add Layer to the chamber which takes ownership.
Definition: ME0Chamber.cc:16
DDAxes::x
AlignmentPI::partitions
partitions
Definition: AlignmentPayloadInspectorHelper.h:48
cms::DDFilteredView
Definition: DDFilteredView.h:70
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:853
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::DDFilter
Definition: DDFilteredView.h:59
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
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ME0EtaPartitionSpecs
Definition: ME0EtaPartitionSpecs.h:18
Point3DBase< float, GlobalTag >
b
double b
Definition: hdecay.h:118
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
Definition: PGeometricDetBuilder.cc:19
ME0GeometryBuilder::buildChamber
ME0Chamber * buildChamber(DDFilteredView &fv, ME0DetId detId) const
Definition: ME0GeometryBuilder.cc:229
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
ME0Layer
Definition: ME0Layer.h:9
ME0Chamber
Definition: ME0Chamber.h:10
value
Definition: value.py:1
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
chambers
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
MuonGeometryConstants::getValue
int getValue(const std::string &name) const
Definition: MuonGeometryConstants.cc:8
ME0GeometryBuilder::ME0BoundPlane
ReferenceCountingPointer< BoundPlane > ME0BoundPlane
Definition: ME0GeometryBuilder.h:45
ME0DetId
Definition: ME0DetId.h:16
TrapezoidalPlaneBounds
Definition: TrapezoidalPlaneBounds.h:15
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
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
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DDValue
Definition: DDValue.h:21
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
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
ME0GeometryBuilder::buildEtaPartition
ME0EtaPartition * buildEtaPartition(DDFilteredView &fv, ME0DetId detId) const
Definition: ME0GeometryBuilder.cc:283
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
MuonGeometryNumbering
Definition: MuonGeometryNumbering.h:24
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:224
GeomDetEnumerators::ME0
Definition: GeomDetEnumerators.h:22
ME0DetId::chamberIdMask_
static constexpr uint32_t chamberIdMask_
Definition: ME0DetId.h:93
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Log
Definition: MessageLogger.h:70
ME0GeometryBuilder::buildLayer
ME0Layer * buildLayer(DDFilteredView &fv, ME0DetId detId) const
Definition: ME0GeometryBuilder.cc:256
ME0GeometryBuilder::buildGeometry
ME0Geometry * buildGeometry(DDFilteredView &fview, const MuonGeometryConstants &muonConstants)
Definition: ME0GeometryBuilder.cc:58
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
ME0GeometryBuilder::boundPlane
ME0BoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
Definition: ME0GeometryBuilder.cc:335
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
Basic3DVector< float >
ME0EtaPartition
Definition: ME0EtaPartition.h:12