CMS 3D CMS Logo

HGCalParametersFromDD.cc
Go to the documentation of this file.
2 
10 
11 //#define EDM_ML_DEBUG
12 using namespace geant_units::operators;
13 
14 namespace {
15  HGCalGeometryMode::GeometryMode getGeometryMode(const char* s, const DDsvalues_type& sv) {
16  DDValue val(s);
17  if (DDfetch(&sv, val)) {
18  const std::vector<std::string>& fvec = val.strings();
19  if (fvec.empty()) {
20  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag.";
21  }
22 
25  return result;
26  } else {
27  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag";
28  }
29  }
30  HGCalGeometryMode::GeometryMode getGeometryMode(const std::string& s) {
33  return result;
34  }
35  HGCalGeometryMode::WaferMode getGeometryWaferMode(const char* s, const DDsvalues_type& sv) {
36  DDValue val(s);
37  if (DDfetch(&sv, val)) {
38  const std::vector<std::string>& fvec = val.strings();
39  if (fvec.empty()) {
40  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag.";
41  }
42 
45  return result;
46  } else {
47  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag";
48  }
49  }
50  HGCalGeometryMode::WaferMode getGeometryWaferMode(std::string& s) {
53  return result;
54  }
55 } // namespace
56 
58  HGCalParameters& php,
59  const std::string& name,
60  const std::string& namew,
61  const std::string& namec,
62  const std::string& namet) {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HGCalGeom") << "HGCalParametersFromDD (DDD)::build called with "
65  << "names " << name << ":" << namew << ":" << namec << ":" << namet;
66 #endif
67 
68  // Special parameters at simulation level
69  std::string attribute = "Volume";
71  DDValue val(attribute, value, 0.0);
73  DDFilteredView fv(*cpv, filter);
74  bool ok = fv.firstChild();
76 
77  if (ok) {
79  php.mode_ = getGeometryMode("GeometryMode", sv);
80 #ifdef EDM_ML_DEBUG
81  edm::LogVerbatim("HGCalGeom") << "Volume " << name << " GeometryMode " << php.mode_ << ":"
87 #endif
88  php.levelZSide_ = 3; // Default level for ZSide
89  php.detectorType_ = 0; // These two parameters are
90  php.firstMixedLayer_ = -1; // defined for post TDR geometry
91  php.layerRotation_ = 0; // default layer rotation angle
92  std::unique_ptr<HGCalGeomParameters> geom = std::make_unique<HGCalGeomParameters>();
94  attribute = "OnlyForHGCalNumbering";
95  value = namet;
96  DDValue val2(attribute, value, 0.0);
97  DDSpecificsMatchesValueFilter filter2{val2};
98  DDFilteredView fv2(*cpv, filter2);
99  bool ok2 = fv2.firstChild();
100  if (ok2) {
101  DDsvalues_type sv2(fv2.mergedSpecifics());
102  mode = getGeometryWaferMode("WaferMode", sv2);
103 #ifdef EDM_ML_DEBUG
104  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
106 #endif
107  }
108  php.minTileSize_ = 0;
109  php.waferMaskMode_ = 0;
110  php.waferZSide_ = 0;
111  }
114  php.levelT_ = dbl_to_int(getDDDArray("LevelTop", sv));
115  php.levelZSide_ = static_cast<int>(getDDDValue("LevelZSide", sv));
116  php.nCellsFine_ = php.nCellsCoarse_ = 0;
117  php.firstLayer_ = 1;
118  php.firstMixedLayer_ = static_cast<int>(getDDDValue("FirstMixedLayer", sv));
119  php.detectorType_ = static_cast<int>(getDDDValue("DetectorType", sv));
120  php.minTileSize_ = 0;
121  php.waferMaskMode_ = static_cast<int>(getDDDValue("WaferMaskMode", sv));
122  php.waferZSide_ = static_cast<int>(getDDDValue("WaferZside", sv));
124  php.layerRotation_ = getDDDValue("LayerRotation", sv);
125 #ifdef EDM_ML_DEBUG
126  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " ZSide Level "
127  << php.levelZSide_ << " first layers " << php.firstLayer_ << ":"
128  << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " Wafer Mask Mode "
129  << php.waferMaskMode_ << " Zside " << php.waferZSide_ << " Layer Rotation "
131 #endif
132  attribute = "OnlyForHGCalNumbering";
133  value = namet;
134  DDValue val2(attribute, value, 0.0);
135  DDSpecificsMatchesValueFilter filter2{val2};
136  DDFilteredView fv2(*cpv, filter2);
137  bool ok2 = fv2.firstChild();
138  if (ok2) {
139  DDsvalues_type sv2(fv2.mergedSpecifics());
140  mode = getGeometryWaferMode("WaferMode", sv2);
141  php.nCellsFine_ = static_cast<int>(getDDDValue("NumberOfCellsFine", sv2));
142  php.nCellsCoarse_ = static_cast<int>(getDDDValue("NumberOfCellsCoarse", sv2));
143  php.waferSize_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferSize", sv2);
144  php.waferThick_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferThickness", sv2);
145  php.sensorSeparation_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("SensorSeparation", sv2);
146  php.mouseBite_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MouseBite", sv2);
147  php.waferR_ = HGCalParameters::k_ScaleToDDD * php.waferSize_ * tan30deg_;
148  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsFine_);
149  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsCoarse_);
150 #ifdef EDM_ML_DEBUG
151  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
152  << HGCalGeometryMode::ExtrudedPolygon << " # of cells|size for fine/coarse "
153  << php.nCellsFine_ << ":" << php.cellSize_[0] << ":" << php.nCellsCoarse_ << ":"
154  << php.cellSize_[1] << " wafer Params " << php.waferSize_ << ":" << php.waferR_
155  << ":" << php.waferThick_ << ":" << php.sensorSeparation_ << ":" << php.mouseBite_
156  << ":" << php.waferR_;
157 #endif
158  for (int k = 0; k < 2; ++k)
159  getCellPosition(php, k);
160  }
161  }
162  if (php.mode_ == HGCalGeometryMode::Hexagon) {
163  // Load the SpecPars
164  php.firstLayer_ = 1;
165  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
166  // Load the Geometry parameters
167  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
168  // Load cell parameters
169  geom->loadCellParsHexagon(cpv, php);
170  // Set complete fill mode
171  php.defineFull_ = false;
172  } else if (php.mode_ == HGCalGeometryMode::HexagonFull) {
173  // Load the SpecPars
174  php.firstLayer_ = 1;
175  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
176  // Load the Geometry parameters
177  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
178  // Modify some constants
179  geom->loadWaferHexagon(php);
180  // Load cell parameters
181  geom->loadCellParsHexagon(cpv, php);
182  // Set complete fill mode
183  php.defineFull_ = true;
184  } else if (php.mode_ == HGCalGeometryMode::Hexagon8) {
185  // Load the SpecPars
186  geom->loadSpecParsHexagon8(fv, php);
187  // Load Geometry parameters
188  geom->loadGeometryHexagon8(fv, php, 1);
189  // Set complete fill mode
190  php.defineFull_ = false;
191  // Load wafer positions
192  geom->loadWaferHexagon8(php);
194  // Load the SpecPars
195  geom->loadSpecParsHexagon8(fv, php);
196  // Load Geometry parameters
197  geom->loadGeometryHexagon8(fv, php, 1);
198  // Set complete fill mode
199  php.defineFull_ = true;
200  // Load wafer positions
201  geom->loadWaferHexagon8(php);
202  } else if (php.mode_ == HGCalGeometryMode::Hexagon8Module) {
203  // Load the SpecPars
204  geom->loadSpecParsHexagon8(fv, php);
205  // Load Geometry parameters
206  geom->loadGeometryHexagonModule(cpv, php, name, namec, 1);
207  // Set complete fill mode
208  php.defineFull_ = true;
209  // Load wafer positions
210  geom->loadWaferHexagon8(php);
213  // Load maximum eta & top level
214  php.levelT_ = dbl_to_int(getDDDArray("LevelTop", sv));
215  php.firstLayer_ = (int)(getDDDValue("FirstLayer", sv));
216  php.firstMixedLayer_ = (int)(getDDDValue("FirstMixedLayer", sv));
217  php.detectorType_ = (int)(getDDDValue("DetectorType", sv));
218  php.waferThick_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferThickness", sv);
219  php.minTileSize_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MinimumTileSize", sv);
220  php.waferSize_ = php.waferR_ = 0;
221  php.sensorSeparation_ = php.mouseBite_ = 0;
222  php.waferMaskMode_ = static_cast<int>(getDDDValue("WaferMaskMode", sv));
223  php.waferZSide_ = static_cast<int>(getDDDValue("WaferZside", sv));
224 #ifdef EDM_ML_DEBUG
225  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers "
226  << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type "
227  << php.detectorType_ << " thickenss " << php.waferThick_ << " Tile Mask Mode "
228  << php.waferMaskMode_ << " Zside " << php.waferZSide_;
229 #endif
230  // Load the SpecPars
231  geom->loadSpecParsTrapezoid(fv, php);
232  // Load Geometry parameters
233  geom->loadGeometryHexagon8(fv, php, php.firstLayer_);
234  // Load cell positions
235  geom->loadCellTrapezoid(php);
236  } else {
237  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew
238  << ":" << namec;
239  throw cms::Exception("DDException")
240  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew << ":" << namec;
241  }
242  } else {
243  edm::LogError("HGCalGeom") << " Attribute " << val << " not found but needed.";
244  throw cms::Exception("DDException") << "Attribute " << val << " not found but needed.";
245  }
246 #ifdef EDM_ML_DEBUG
247  edm::LogVerbatim("HGCalGeom") << "Return from HGCalParametersFromDD::build"
248  << " with flag " << ok;
249 #endif
250  return ok;
251 }
252 
254  HGCalParameters& php,
255  const std::string& name,
256  const std::string& namew,
257  const std::string& namec,
258  const std::string& namet,
259  const std::string& name2) {
260 #ifdef EDM_ML_DEBUG
261  edm::LogVerbatim("HGCalGeom") << "HGCalParametersFromDD (DD4Hep)::build called with "
262  << "names " << name << ":" << namew << ":" << namec << ":" << namet << ":" << name2;
263 #endif
264  cms::DDVectorsMap vmap = cpv->detector()->vectors();
265  const cms::DDFilter filter("Volume", name);
266  cms::DDFilteredView fv((*cpv), filter);
267  std::vector<std::string> tempS;
268  std::vector<double> tempD;
269  bool ok = fv.firstChild();
270  tempS = fv.get<std::vector<std::string> >(name2, "GeometryMode");
271  if (tempS.empty()) {
272  tempS = fv.get<std::vector<std::string> >(name, "GeometryMode");
273  }
274  std::string sv = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::Hexagon8Full";
276 
277  if (ok) {
278  php.mode_ = getGeometryMode(sv);
279 #ifdef EDM_ML_DEBUG
280  edm::LogVerbatim("HGCalGeom") << "Volume " << name << " GeometryMode " << php.mode_ << ":"
286 #endif
287  php.levelZSide_ = 3; // Default level for ZSide
288  php.detectorType_ = 0; // These two parameters are
289  php.firstMixedLayer_ = -1; // defined for post TDR geometry
290  php.layerRotation_ = 0; // default layer rotation angle
291  std::unique_ptr<HGCalGeomParameters> geom = std::make_unique<HGCalGeomParameters>();
293  tempS = fv.get<std::vector<std::string> >(namet, "WaferMode");
294  std::string sv2 = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::Polyhedra";
295  mode = getGeometryWaferMode(sv2);
296 #ifdef EDM_ML_DEBUG
297  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
299 #endif
300  php.minTileSize_ = 0;
301  php.waferMaskMode_ = 0;
302  php.waferZSide_ = 0;
303  }
306  php.levelT_ = dbl_to_int(fv.get<std::vector<double> >(name, "LevelTop"));
307  tempD = fv.get<std::vector<double> >(name, "LevelZSide");
308  php.levelZSide_ = static_cast<int>(tempD[0]);
309  php.nCellsFine_ = php.nCellsCoarse_ = 0;
310  php.firstLayer_ = 1;
311  tempD = fv.get<std::vector<double> >(name, "FirstMixedLayer");
312  php.firstMixedLayer_ = static_cast<int>(tempD[0]);
313  tempD = fv.get<std::vector<double> >(name, "DetectorType");
314  php.detectorType_ = static_cast<int>(tempD[0]);
315  php.minTileSize_ = 0;
316  tempD = fv.get<std::vector<double> >(name, "WaferMaskMode");
317  php.waferMaskMode_ = static_cast<int>(tempD[0]);
318  tempD = fv.get<std::vector<double> >(name, "WaferZside");
319  php.waferZSide_ = static_cast<int>(tempD[0]);
321  tempD = fv.get<std::vector<double> >(name, "LayerRotation");
322  php.layerRotation_ = tempD[0];
323  }
324 #ifdef EDM_ML_DEBUG
325  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " ZSide Level "
326  << php.levelZSide_ << " first layers " << php.firstLayer_ << ":"
327  << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " Wafer Mask Mode "
328  << php.waferMaskMode_ << " ZSide " << php.waferZSide_ << " Layer Rotation "
330 #endif
331 
332  tempS = fv.get<std::vector<std::string> >(namet, "WaferMode");
333  std::string sv2 = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::ExtrudedPolygon";
334  mode = getGeometryWaferMode(sv2);
335  tempD = fv.get<std::vector<double> >(namet, "NumberOfCellsFine");
336  php.nCellsFine_ = static_cast<int>(tempD[0]);
337  tempD = fv.get<std::vector<double> >(namet, "NumberOfCellsCoarse");
338  php.nCellsCoarse_ = static_cast<int>(tempD[0]);
339  tempD = fv.get<std::vector<double> >(namet, "WaferSize");
341  tempD = fv.get<std::vector<double> >(namet, "WaferThickness");
343  tempD = fv.get<std::vector<double> >(namet, "SensorSeparation");
345  tempD = fv.get<std::vector<double> >(namet, "MouseBite");
347  php.waferR_ = HGCalParameters::k_ScaleToDDD * php.waferSize_ * tan30deg_;
348  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsFine_);
349  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsCoarse_);
350 #ifdef EDM_ML_DEBUG
351  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
352  << HGCalGeometryMode::ExtrudedPolygon << " # of cells|size for fine/coarse "
353  << php.nCellsFine_ << ":" << php.cellSize_[0] << ":" << php.nCellsCoarse_ << ":"
354  << php.cellSize_[1] << " wafer Params " << php.waferSize_ << ":" << php.waferR_
355  << ":" << php.waferThick_ << ":" << php.sensorSeparation_ << ":" << php.mouseBite_
356  << ":" << php.waferR_;
357 #endif
358  for (int k = 0; k < 2; ++k)
359  getCellPosition(php, k);
360  }
361  if (php.mode_ == HGCalGeometryMode::Hexagon) {
362  // Load the SpecPars
363  php.firstLayer_ = 1;
364  geom->loadSpecParsHexagon(fv, php, name, namew, namec, name2);
365  // Load the Geometry parameters
366  geom->loadGeometryHexagon(cpv, php, name, namew, namec, mode);
367  // Load cell parameters
368  geom->loadCellParsHexagon(vmap, php);
369  // Set complete fill mode
370  php.defineFull_ = false;
371  } else if (php.mode_ == HGCalGeometryMode::HexagonFull) {
372  // Load the SpecPars
373  php.firstLayer_ = 1;
374  geom->loadSpecParsHexagon(fv, php, name, namew, namec, name2);
375  // Load the Geometry parameters
376  geom->loadGeometryHexagon(cpv, php, name, namew, namec, mode);
377  // Modify some constants
378  geom->loadWaferHexagon(php);
379  // Load cell parameters
380  geom->loadCellParsHexagon(vmap, php);
381  // Set complete fill mode
382  php.defineFull_ = true;
383  } else if (php.mode_ == HGCalGeometryMode::Hexagon8) {
384  // Load the SpecPars
385  geom->loadSpecParsHexagon8(fv, vmap, php, name);
386  // Load Geometry parameters
387  geom->loadGeometryHexagon8(cpv, php, name, 1);
388  // Set complete fill mode
389  php.defineFull_ = false;
390  // Load wafer positions
391  geom->loadWaferHexagon8(php);
393  // Load the SpecPars
394  geom->loadSpecParsHexagon8(fv, vmap, php, name);
395  // Load Geometry parameters
396  geom->loadGeometryHexagon8(cpv, php, name, 1);
397  // Set complete fill mode
398  php.defineFull_ = true;
399  // Load wafer positions
400  geom->loadWaferHexagon8(php);
401  } else if (php.mode_ == HGCalGeometryMode::Hexagon8Module) {
402  // Load the SpecPars
403  geom->loadSpecParsHexagon8(fv, vmap, php, name);
404  // Load Geometry parameters
405  geom->loadGeometryHexagonModule(cpv, php, name, namec, 1);
406  // Set complete fill mode
407  php.defineFull_ = true;
408  // Load wafer positions
409  geom->loadWaferHexagon8(php);
412  // Load maximum eta & top level
413  php.levelT_ = dbl_to_int(fv.get<std::vector<double> >(name, "LevelTop"));
414  tempD = fv.get<std::vector<double> >(name, "LevelZSide");
415  php.levelZSide_ = static_cast<int>(tempD[0]);
416  php.nCellsFine_ = php.nCellsCoarse_ = 0;
417  tempD = fv.get<std::vector<double> >(name, "FirstLayer");
418  php.firstLayer_ = static_cast<int>(tempD[0]);
419  tempD = fv.get<std::vector<double> >(name, "FirstMixedLayer");
420  php.firstMixedLayer_ = static_cast<int>(tempD[0]);
421  tempD = fv.get<std::vector<double> >(name, "DetectorType");
422  php.detectorType_ = static_cast<int>(tempD[0]);
423  tempD = fv.get<std::vector<double> >(name, "WaferThickness");
425  tempD = fv.get<std::vector<double> >(name, "MinimumTileSize");
427  php.waferSize_ = php.waferR_ = 0;
428  php.sensorSeparation_ = php.mouseBite_ = 0;
429  tempD = fv.get<std::vector<double> >(name, "WaferMaskMode");
430  php.waferMaskMode_ = static_cast<int>(tempD[0]);
431  tempD = fv.get<std::vector<double> >(name, "WaferZside");
432  php.waferZSide_ = static_cast<int>(tempD[0]);
433 #ifdef EDM_ML_DEBUG
434  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers "
435  << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type "
436  << php.detectorType_ << " thickenss " << php.waferThick_ << " min tile size "
437  << php.minTileSize_ << " Tile Mask Mode " << php.waferMaskMode_ << " ZSide "
438  << php.waferZSide_;
439 #endif
440  // Load the SpecPars
441  geom->loadSpecParsTrapezoid(fv, vmap, php, name);
442  // Load Geometry parameters
443  geom->loadGeometryHexagon8(cpv, php, name, php.firstLayer_);
444  // Load cell positions
445  geom->loadCellTrapezoid(php);
446  } else {
447  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew
448  << ":" << namec;
449  throw cms::Exception("DDException")
450  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew << ":" << namec;
451  }
452  } else {
453  edm::LogError("HGCalGeom") << " Attribute Volume:" << name << " not found but needed.";
454  throw cms::Exception("DDException") << "Attribute Volume:" << name << " not found but needed.";
455  }
456 #ifdef EDM_ML_DEBUG
457  edm::LogVerbatim("HGCalGeom") << "Return from HGCalParametersFromDD::build"
458  << " with flag " << ok;
459 #endif
460  return ok;
461 }
462 
464  if (type == 1) {
465  php.cellCoarseX_.clear();
466  php.cellCoarseY_.clear();
467  } else {
468  php.cellFineX_.clear();
469  php.cellFineY_.clear();
470  }
471  HGCalParameters::wafer_map cellIndex;
472 #ifdef EDM_ML_DEBUG
473  std::vector<int> indtypes;
474 #endif
475  int N = (type == 1) ? php.nCellsCoarse_ : php.nCellsFine_;
476  double R = php.waferSize_ / (3 * N);
477  double r = 0.5 * R * sqrt(3.0);
478  int n2 = N / 2;
479  int ipos(0);
480  for (int u = 0; u < 2 * N; ++u) {
481  for (int v = 0; v < 2 * N; ++v) {
482  if (((v - u) < N) && (u - v) <= N) {
483  double yp = (u - 0.5 * v - n2) * 2 * r;
484  double xp = (1.5 * (v - N) + 1.0) * R;
485  int id = v * 100 + u;
486 #ifdef EDM_ML_DEBUG
487  indtypes.emplace_back(id);
488 #endif
489  if (type == 1) {
490  php.cellCoarseX_.emplace_back(xp);
491  php.cellCoarseY_.emplace_back(yp);
492  } else {
493  php.cellFineX_.emplace_back(xp);
494  php.cellFineY_.emplace_back(yp);
495  }
496  cellIndex[id] = ipos;
497  ++ipos;
498  }
499  }
500  }
501  if (type == 1)
502  php.cellCoarseIndex_ = cellIndex;
503  else
504  php.cellFineIndex_ = cellIndex;
505 #ifdef EDM_ML_DEBUG
506  if (type == 1) {
507  edm::LogVerbatim("HGCalGeom") << "CellPosition for type " << type << " for " << php.cellCoarseX_.size()
508  << " cells";
509  for (unsigned int k = 0; k < php.cellCoarseX_.size(); ++k) {
510  int id = indtypes[k];
511  edm::LogVerbatim("HGCalGeom") << "[" << k << "] ID " << id << ":" << php.cellCoarseIndex_[id] << " X "
512  << php.cellCoarseX_[k] << " Y " << php.cellCoarseY_[k];
513  }
514  } else {
515  edm::LogVerbatim("HGCalGeom") << "CellPosition for type " << type << " for " << php.cellFineX_.size() << " cells";
516  for (unsigned int k = 0; k < php.cellFineX_.size(); ++k) {
517  int id = indtypes[k];
518  edm::LogVerbatim("HGCalGeom") << "[" << k << "] ID " << id << ":" << php.cellFineIndex_[k] << " X "
519  << php.cellFineX_[k] << " Y " << php.cellFineY_[k];
520  }
521  }
522 #endif
523 }
524 
526  DDValue val(s);
527  if (DDfetch(&sv, val)) {
528  const std::vector<double>& fvec = val.doubles();
529  if (fvec.empty()) {
530  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag.";
531  }
532  return fvec[0];
533  } else {
534  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag";
535  }
536 }
537 
538 std::vector<double> HGCalParametersFromDD::getDDDArray(const char* s, const DDsvalues_type& sv) {
539  DDValue val(s);
540  if (DDfetch(&sv, val)) {
541  const std::vector<double>& fvec = val.doubles();
542  if (fvec.empty()) {
543  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag.";
544  }
545  return fvec;
546  } else {
547  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag";
548  }
549 }
HGCalParameters::layerRotation_
double layerRotation_
Definition: HGCalParameters.h:176
HGCalGeometryMode::TrapezoidFile
Definition: HGCalGeometryMode.h:33
HGCalParameters::firstLayer_
int firstLayer_
Definition: HGCalParameters.h:173
cms::DDDetector::vectors
cms::DDVectorsMap const & vectors() const
Definition: DDDetector.h:17
HGCalParameters::levelZSide_
int levelZSide_
Definition: HGCalParameters.h:136
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
HGCalParameters::cellFineY_
std::vector< double > cellFineY_
Definition: HGCalParameters.h:121
HGCalGeometryMode.h
DDFilteredView::mergedSpecifics
DDsvalues_type mergedSpecifics() const
Definition: DDFilteredView.cc:42
HGCalStringToEnumParser
Definition: HGCalGeometryMode.h:10
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
HGCalParameters::nCellsCoarse_
int nCellsCoarse_
Definition: HGCalParameters.h:143
HGCalParameters::waferZSide_
int waferZSide_
Definition: HGCalParameters.h:183
HGCalParameters::waferSize_
double waferSize_
Definition: HGCalParameters.h:144
HGCalGeometryMode::Hexagon8Module
Definition: HGCalGeometryMode.h:34
geant_units::operators
Definition: GeantUnits.h:18
cms::DDFilteredView
Definition: DDFilteredView.h:70
findQualityFiles.v
v
Definition: findQualityFiles.py:179
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
HGCalParameters::sensorSeparation_
double sensorSeparation_
Definition: HGCalParameters.h:146
cms::DDFilteredView::get
T get(const std::string &)
extract attribute value
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HGCalGeometryMode::Trapezoid
Definition: HGCalGeometryMode.h:31
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDFilteredView.h
cms::DDFilter
Definition: DDFilteredView.h:59
HGCalParameters::wafer_map
std::unordered_map< int32_t, int32_t > wafer_map
Definition: HGCalParameters.h:31
HGCalGeometryMode::WaferMode
WaferMode
Definition: HGCalGeometryMode.h:37
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
HGCalParametersFromDD.h
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:268
N
#define N
Definition: blowfish.cc:9
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
DDFilteredView.h
dqmdumpme.k
k
Definition: dqmdumpme.py:60
callgraph.n2
n2
Definition: callgraph.py:50
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
HGCalParameters::cellSize_
std::vector< double > cellSize_
Definition: HGCalParameters.h:75
HGCalParameters::mouseBite_
double mouseBite_
Definition: HGCalParameters.h:147
HGCalParameters::nCellsFine_
int nCellsFine_
Definition: HGCalParameters.h:142
DDutils.h
HGCalGeometryMode::TrapezoidModule
Definition: HGCalGeometryMode.h:35
HGCalParameters::cellFineIndex_
wafer_map cellFineIndex_
Definition: HGCalParameters.h:122
HGCalParameters::mode_
HGCalGeometryMode::GeometryMode mode_
Definition: HGCalParameters.h:137
GeantUnits.h
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
HGCalParameters::cellCoarseY_
std::vector< double > cellCoarseY_
Definition: HGCalParameters.h:125
HGCalGeometryMode::Hexagon8Full
Definition: HGCalGeometryMode.h:30
HGCalParametersFromDD::getDDDValue
double getDDDValue(const char *s, const DDsvalues_type &sv)
Definition: HGCalParametersFromDD.cc:525
HGCalGeometryMode::GeometryMode
GeometryMode
Definition: HGCalGeometryMode.h:25
HGCalGeomParameters.h
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
HGCalParametersFromDD::getDDDArray
std::vector< double > getDDDArray(const char *s, const DDsvalues_type &sv)
Definition: HGCalParametersFromDD.cc:538
HGCalParameters::waferR_
double waferR_
Definition: HGCalParameters.h:134
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HGCalParametersFromDD::getCellPosition
void getCellPosition(HGCalParameters &php, int type)
Definition: HGCalParametersFromDD.cc:463
HGCalParameters::waferThick_
double waferThick_
Definition: HGCalParameters.h:145
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalGeometryMode::Hexagon
Definition: HGCalGeometryMode.h:27
HGCalParameters::k_ScaleFromDDD
static constexpr double k_ScaleFromDDD
Definition: HGCalParameters.h:36
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HGCalParameters
Definition: HGCalParameters.h:14
HGCalParameters::k_ScaleToDDD
static constexpr double k_ScaleToDDD
Definition: HGCalParameters.h:37
HGCalParametersFromDD::build
bool build(const DDCompactView *cpv, HGCalParameters &php, const std::string &name, const std::string &namew, const std::string &namec, const std::string &namet)
Definition: HGCalParametersFromDD.cc:57
HGCalParameters::k_ScaleFromDD4Hep
static constexpr double k_ScaleFromDD4Hep
Definition: HGCalParameters.h:40
HGCalGeometryMode::HexagonFull
Definition: HGCalGeometryMode.h:28
heppy_batch.val
val
Definition: heppy_batch.py:351
HGCalParameters::detectorType_
int detectorType_
Definition: HGCalParameters.h:72
HGCalParameters::waferMaskMode_
int waferMaskMode_
Definition: HGCalParameters.h:182
HGCalParameters::defineFull_
bool defineFull_
Definition: HGCalParameters.h:150
DDValue
Definition: DDValue.h:22
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
HGCalGeometryMode::Polyhedra
Definition: HGCalGeometryMode.h:37
Exception
Definition: hltDiff.cc:245
cms::DDVectorsMap
std::unordered_map< std::string, std::vector< double > > DDVectorsMap
Definition: DDNamespace.h:20
cms::DDCompactView
Definition: DDCompactView.h:31
HGCalGeometryMode::Hexagon8File
Definition: HGCalGeometryMode.h:32
HGCalGeometryMode::ExtrudedPolygon
Definition: HGCalGeometryMode.h:37
HGCalParameters::cellFineX_
std::vector< double > cellFineX_
Definition: HGCalParameters.h:120
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
HGCalParameters::firstMixedLayer_
int firstMixedLayer_
Definition: HGCalParameters.h:174
HGCalParameters::minTileSize_
double minTileSize_
Definition: HGCalParameters.h:166
HGCalGeometryMode::Hexagon8
Definition: HGCalGeometryMode.h:29
DDFilteredView
Definition: DDFilteredView.h:20
HGCalParameters::cellCoarseX_
std::vector< double > cellCoarseX_
Definition: HGCalParameters.h:124
mps_fire.result
result
Definition: mps_fire.py:311
dbl_to_int
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
HGCalParameters::cellCoarseIndex_
wafer_map cellCoarseIndex_
Definition: HGCalParameters.h:126
hfnoseParametersInitialization_cfi.name2
name2
Definition: hfnoseParametersInitialization_cfi.py:8
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
dttmaxenums::R
Definition: DTTMax.h:29
HGCalParameters.h
HGCalStringToEnumParser::parseString
T parseString(const std::string &value)
Definition: HGCalGeometryMode.h:16
HGCalParameters::levelT_
std::vector< int > levelT_
Definition: HGCalParameters.h:135
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:34