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  std::unique_ptr<HGCalGeomParameters> geom = std::make_unique<HGCalGeomParameters>();
93  attribute = "OnlyForHGCalNumbering";
94  value = namet;
95  DDValue val2(attribute, value, 0.0);
96  DDSpecificsMatchesValueFilter filter2{val2};
97  DDFilteredView fv2(*cpv, filter2);
98  bool ok2 = fv2.firstChild();
99  if (ok2) {
100  DDsvalues_type sv2(fv2.mergedSpecifics());
101  mode = getGeometryWaferMode("WaferMode", sv2);
102 #ifdef EDM_ML_DEBUG
103  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
105 #endif
106  }
107  php.minTileSize_ = 0;
108  php.waferMaskMode_ = 0;
109  php.waferZSide_ = 0;
110  }
113  php.levelT_ = dbl_to_int(getDDDArray("LevelTop", sv));
114  php.levelZSide_ = static_cast<int>(getDDDValue("LevelZSide", sv));
115  php.nCellsFine_ = php.nCellsCoarse_ = 0;
116  php.firstLayer_ = 1;
117  php.firstMixedLayer_ = static_cast<int>(getDDDValue("FirstMixedLayer", sv));
118  php.detectorType_ = static_cast<int>(getDDDValue("DetectorType", sv));
119  php.minTileSize_ = 0;
120  php.waferMaskMode_ = static_cast<int>(getDDDValue("WaferMaskMode", sv));
121  php.waferZSide_ = static_cast<int>(getDDDValue("WaferZside", sv));
122 #ifdef EDM_ML_DEBUG
123  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " ZSide Level "
124  << php.levelZSide_ << " first layers " << php.firstLayer_ << ":"
125  << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " Wafer Mask Mode "
126  << php.waferMaskMode_ << " Zside " << php.waferZSide_;
127 #endif
128  attribute = "OnlyForHGCalNumbering";
129  value = namet;
130  DDValue val2(attribute, value, 0.0);
131  DDSpecificsMatchesValueFilter filter2{val2};
132  DDFilteredView fv2(*cpv, filter2);
133  bool ok2 = fv2.firstChild();
134  if (ok2) {
135  DDsvalues_type sv2(fv2.mergedSpecifics());
136  mode = getGeometryWaferMode("WaferMode", sv2);
137  php.nCellsFine_ = static_cast<int>(getDDDValue("NumberOfCellsFine", sv2));
138  php.nCellsCoarse_ = static_cast<int>(getDDDValue("NumberOfCellsCoarse", sv2));
139  php.waferSize_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferSize", sv2);
140  php.waferThick_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferThickness", sv2);
141  php.sensorSeparation_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("SensorSeparation", sv2);
142  php.mouseBite_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MouseBite", sv2);
143  php.waferR_ = HGCalParameters::k_ScaleToDDD * php.waferSize_ * tan30deg_;
144  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsFine_);
145  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsCoarse_);
146 #ifdef EDM_ML_DEBUG
147  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
148  << HGCalGeometryMode::ExtrudedPolygon << " # of cells|size for fine/coarse "
149  << php.nCellsFine_ << ":" << php.cellSize_[0] << ":" << php.nCellsCoarse_ << ":"
150  << php.cellSize_[1] << " wafer Params " << php.waferSize_ << ":" << php.waferR_
151  << ":" << php.waferThick_ << ":" << php.sensorSeparation_ << ":" << php.mouseBite_
152  << ":" << php.waferR_;
153 #endif
154  for (int k = 0; k < 2; ++k)
155  getCellPosition(php, k);
156  }
157  }
158  if (php.mode_ == HGCalGeometryMode::Hexagon) {
159  // Load the SpecPars
160  php.firstLayer_ = 1;
161  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
162  // Load the Geometry parameters
163  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
164  // Load cell parameters
165  geom->loadCellParsHexagon(cpv, php);
166  // Set complete fill mode
167  php.defineFull_ = false;
168  } else if (php.mode_ == HGCalGeometryMode::HexagonFull) {
169  // Load the SpecPars
170  php.firstLayer_ = 1;
171  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
172  // Load the Geometry parameters
173  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
174  // Modify some constants
175  geom->loadWaferHexagon(php);
176  // Load cell parameters
177  geom->loadCellParsHexagon(cpv, php);
178  // Set complete fill mode
179  php.defineFull_ = true;
180  } else if (php.mode_ == HGCalGeometryMode::Hexagon8) {
181  // Load the SpecPars
182  geom->loadSpecParsHexagon8(fv, php);
183  // Load Geometry parameters
184  geom->loadGeometryHexagon8(fv, php, 1);
185  // Set complete fill mode
186  php.defineFull_ = false;
187  // Load wafer positions
188  geom->loadWaferHexagon8(php);
190  // Load the SpecPars
191  geom->loadSpecParsHexagon8(fv, php);
192  // Load Geometry parameters
193  geom->loadGeometryHexagon8(fv, php, 1);
194  // Set complete fill mode
195  php.defineFull_ = true;
196  // Load wafer positions
197  geom->loadWaferHexagon8(php);
198  } else if (php.mode_ == HGCalGeometryMode::Hexagon8Module) {
199  // Load the SpecPars
200  geom->loadSpecParsHexagon8(fv, php);
201  // Load Geometry parameters
202  geom->loadGeometryHexagonModule(cpv, php, name, namec, 1);
203  // Set complete fill mode
204  php.defineFull_ = true;
205  // Load wafer positions
206  geom->loadWaferHexagon8(php);
209  // Load maximum eta & top level
210  php.levelT_ = dbl_to_int(getDDDArray("LevelTop", sv));
211  php.firstLayer_ = (int)(getDDDValue("FirstLayer", sv));
212  php.firstMixedLayer_ = (int)(getDDDValue("FirstMixedLayer", sv));
213  php.detectorType_ = (int)(getDDDValue("DetectorType", sv));
214  php.waferThick_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferThickness", sv);
215  php.minTileSize_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MinimumTileSize", sv);
216  php.waferSize_ = php.waferR_ = 0;
217  php.sensorSeparation_ = php.mouseBite_ = 0;
218  php.waferMaskMode_ = static_cast<int>(getDDDValue("WaferMaskMode", sv));
219  php.waferZSide_ = static_cast<int>(getDDDValue("WaferZside", sv));
220 #ifdef EDM_ML_DEBUG
221  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers "
222  << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type "
223  << php.detectorType_ << " thickenss " << php.waferThick_ << " Tile Mask Mode "
224  << php.waferMaskMode_ << " Zside " << php.waferZSide_;
225 #endif
226  // Load the SpecPars
227  geom->loadSpecParsTrapezoid(fv, php);
228  // Load Geometry parameters
229  geom->loadGeometryHexagon8(fv, php, php.firstLayer_);
230  // Load cell positions
231  geom->loadCellTrapezoid(php);
232  } else {
233  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew
234  << ":" << namec;
235  throw cms::Exception("DDException")
236  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew << ":" << namec;
237  }
238  } else {
239  edm::LogError("HGCalGeom") << " Attribute " << val << " not found but needed.";
240  throw cms::Exception("DDException") << "Attribute " << val << " not found but needed.";
241  }
242 #ifdef EDM_ML_DEBUG
243  edm::LogVerbatim("HGCalGeom") << "Return from HGCalParametersFromDD::build"
244  << " with flag " << ok;
245 #endif
246  return ok;
247 }
248 
250  HGCalParameters& php,
251  const std::string& name,
252  const std::string& namew,
253  const std::string& namec,
254  const std::string& namet,
255  const std::string& name2) {
256 #ifdef EDM_ML_DEBUG
257  edm::LogVerbatim("HGCalGeom") << "HGCalParametersFromDD (DD4Hep)::build called with "
258  << "names " << name << ":" << namew << ":" << namec << ":" << namet << ":" << name2;
259 #endif
260  cms::DDVectorsMap vmap = cpv->detector()->vectors();
261  const cms::DDFilter filter("Volume", name);
262  cms::DDFilteredView fv((*cpv), filter);
263  std::vector<std::string> tempS;
264  std::vector<double> tempD;
265  bool ok = fv.firstChild();
266  tempS = fv.get<std::vector<std::string> >(name2, "GeometryMode");
267  if (tempS.empty()) {
268  tempS = fv.get<std::vector<std::string> >(name, "GeometryMode");
269  }
270  std::string sv = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::Hexagon8Full";
272 
273  if (ok) {
274  php.mode_ = getGeometryMode(sv);
275 #ifdef EDM_ML_DEBUG
276  edm::LogVerbatim("HGCalGeom") << "Volume " << name << " GeometryMode " << php.mode_ << ":"
282 #endif
283  php.levelZSide_ = 3; // Default level for ZSide
284  php.detectorType_ = 0; // These two parameters are
285  php.firstMixedLayer_ = -1; // defined for post TDR geometry
286  std::unique_ptr<HGCalGeomParameters> geom = std::make_unique<HGCalGeomParameters>();
288  tempS = fv.get<std::vector<std::string> >(namet, "WaferMode");
289  std::string sv2 = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::Polyhedra";
290  mode = getGeometryWaferMode(sv2);
291 #ifdef EDM_ML_DEBUG
292  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
294 #endif
295  php.minTileSize_ = 0;
296  php.waferMaskMode_ = 0;
297  php.waferZSide_ = 0;
298  }
301  php.levelT_ = dbl_to_int(fv.get<std::vector<double> >(name, "LevelTop"));
302  tempD = fv.get<std::vector<double> >(name, "LevelZSide");
303  php.levelZSide_ = static_cast<int>(tempD[0]);
304  php.nCellsFine_ = php.nCellsCoarse_ = 0;
305  php.firstLayer_ = 1;
306  tempD = fv.get<std::vector<double> >(name, "FirstMixedLayer");
307  php.firstMixedLayer_ = static_cast<int>(tempD[0]);
308  tempD = fv.get<std::vector<double> >(name, "DetectorType");
309  php.detectorType_ = static_cast<int>(tempD[0]);
310  php.minTileSize_ = 0;
311  tempD = fv.get<std::vector<double> >(name, "WaferMaskMode");
312  php.waferMaskMode_ = static_cast<int>(tempD[0]);
313  tempD = fv.get<std::vector<double> >(name, "WaferZside");
314  php.waferZSide_ = static_cast<int>(tempD[0]);
315 #ifdef EDM_ML_DEBUG
316  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " ZSide Level "
317  << php.levelZSide_ << " first layers " << php.firstLayer_ << ":"
318  << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " Wafer Mask Mode "
319  << php.waferMaskMode_ << " ZSide " << php.waferZSide_;
320 #endif
321 
322  tempS = fv.get<std::vector<std::string> >(namet, "WaferMode");
323  std::string sv2 = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::ExtrudedPolygon";
324  mode = getGeometryWaferMode(sv2);
325  tempD = fv.get<std::vector<double> >(namet, "NumberOfCellsFine");
326  php.nCellsFine_ = static_cast<int>(tempD[0]);
327  tempD = fv.get<std::vector<double> >(namet, "NumberOfCellsCoarse");
328  php.nCellsCoarse_ = static_cast<int>(tempD[0]);
329  tempD = fv.get<std::vector<double> >(namet, "WaferSize");
331  tempD = fv.get<std::vector<double> >(namet, "WaferThickness");
333  tempD = fv.get<std::vector<double> >(namet, "SensorSeparation");
335  tempD = fv.get<std::vector<double> >(namet, "MouseBite");
337  php.waferR_ = HGCalParameters::k_ScaleToDDD * php.waferSize_ * tan30deg_;
338  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsFine_);
339  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsCoarse_);
340 #ifdef EDM_ML_DEBUG
341  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
342  << HGCalGeometryMode::ExtrudedPolygon << " # of cells|size for fine/coarse "
343  << php.nCellsFine_ << ":" << php.cellSize_[0] << ":" << php.nCellsCoarse_ << ":"
344  << php.cellSize_[1] << " wafer Params " << php.waferSize_ << ":" << php.waferR_
345  << ":" << php.waferThick_ << ":" << php.sensorSeparation_ << ":" << php.mouseBite_
346  << ":" << php.waferR_;
347 #endif
348  for (int k = 0; k < 2; ++k)
349  getCellPosition(php, k);
350  }
351  if (php.mode_ == HGCalGeometryMode::Hexagon) {
352  // Load the SpecPars
353  php.firstLayer_ = 1;
354  geom->loadSpecParsHexagon(fv, php, name, namew, namec, name2);
355  // Load the Geometry parameters
356  geom->loadGeometryHexagon(cpv, php, name, namew, namec, mode);
357  // Load cell parameters
358  geom->loadCellParsHexagon(vmap, php);
359  // Set complete fill mode
360  php.defineFull_ = false;
361  } else if (php.mode_ == HGCalGeometryMode::HexagonFull) {
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  // Modify some constants
368  geom->loadWaferHexagon(php);
369  // Load cell parameters
370  geom->loadCellParsHexagon(vmap, php);
371  // Set complete fill mode
372  php.defineFull_ = true;
373  } else if (php.mode_ == HGCalGeometryMode::Hexagon8) {
374  // Load the SpecPars
375  geom->loadSpecParsHexagon8(fv, vmap, php, name);
376  // Load Geometry parameters
377  geom->loadGeometryHexagon8(cpv, php, name, 1);
378  // Set complete fill mode
379  php.defineFull_ = false;
380  // Load wafer positions
381  geom->loadWaferHexagon8(php);
383  // Load the SpecPars
384  geom->loadSpecParsHexagon8(fv, vmap, php, name);
385  // Load Geometry parameters
386  geom->loadGeometryHexagon8(cpv, php, name, 1);
387  // Set complete fill mode
388  php.defineFull_ = true;
389  // Load wafer positions
390  geom->loadWaferHexagon8(php);
391  } else if (php.mode_ == HGCalGeometryMode::Hexagon8Module) {
392  // Load the SpecPars
393  geom->loadSpecParsHexagon8(fv, vmap, php, name);
394  // Load Geometry parameters
395  geom->loadGeometryHexagonModule(cpv, php, name, namec, 1);
396  // Set complete fill mode
397  php.defineFull_ = true;
398  // Load wafer positions
399  geom->loadWaferHexagon8(php);
402  // Load maximum eta & top level
403  php.levelT_ = dbl_to_int(fv.get<std::vector<double> >(name, "LevelTop"));
404  tempD = fv.get<std::vector<double> >(name, "LevelZSide");
405  php.levelZSide_ = static_cast<int>(tempD[0]);
406  php.nCellsFine_ = php.nCellsCoarse_ = 0;
407  tempD = fv.get<std::vector<double> >(name, "FirstLayer");
408  php.firstLayer_ = static_cast<int>(tempD[0]);
409  tempD = fv.get<std::vector<double> >(name, "FirstMixedLayer");
410  php.firstMixedLayer_ = static_cast<int>(tempD[0]);
411  tempD = fv.get<std::vector<double> >(name, "DetectorType");
412  php.detectorType_ = static_cast<int>(tempD[0]);
413  tempD = fv.get<std::vector<double> >(name, "WaferThickness");
415  tempD = fv.get<std::vector<double> >(name, "MinimumTileSize");
417  php.waferSize_ = php.waferR_ = 0;
418  php.sensorSeparation_ = php.mouseBite_ = 0;
419  tempD = fv.get<std::vector<double> >(name, "WaferMaskMode");
420  php.waferMaskMode_ = static_cast<int>(tempD[0]);
421  tempD = fv.get<std::vector<double> >(name, "WaferZside");
422  php.waferZSide_ = static_cast<int>(tempD[0]);
423 #ifdef EDM_ML_DEBUG
424  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers "
425  << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type "
426  << php.detectorType_ << " thickenss " << php.waferThick_ << " min tile size "
427  << php.minTileSize_ << " Tile Mask Mode " << php.waferMaskMode_ << " ZSide "
428  << php.waferZSide_;
429 #endif
430  // Load the SpecPars
431  geom->loadSpecParsTrapezoid(fv, vmap, php, name);
432  // Load Geometry parameters
433  geom->loadGeometryHexagon8(cpv, php, name, php.firstLayer_);
434  // Load cell positions
435  geom->loadCellTrapezoid(php);
436  } else {
437  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew
438  << ":" << namec;
439  throw cms::Exception("DDException")
440  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew << ":" << namec;
441  }
442  } else {
443  edm::LogError("HGCalGeom") << " Attribute Volume:" << name << " not found but needed.";
444  throw cms::Exception("DDException") << "Attribute Volume:" << name << " not found but needed.";
445  }
446 #ifdef EDM_ML_DEBUG
447  edm::LogVerbatim("HGCalGeom") << "Return from HGCalParametersFromDD::build"
448  << " with flag " << ok;
449 #endif
450  return ok;
451 }
452 
454  if (type == 1) {
455  php.cellCoarseX_.clear();
456  php.cellCoarseY_.clear();
457  } else {
458  php.cellFineX_.clear();
459  php.cellFineY_.clear();
460  }
461  HGCalParameters::wafer_map cellIndex;
462 #ifdef EDM_ML_DEBUG
463  std::vector<int> indtypes;
464 #endif
465  int N = (type == 1) ? php.nCellsCoarse_ : php.nCellsFine_;
466  double R = php.waferSize_ / (3 * N);
467  double r = 0.5 * R * sqrt(3.0);
468  int n2 = N / 2;
469  int ipos(0);
470  for (int u = 0; u < 2 * N; ++u) {
471  for (int v = 0; v < 2 * N; ++v) {
472  if (((v - u) < N) && (u - v) <= N) {
473  double yp = (u - 0.5 * v - n2) * 2 * r;
474  double xp = (1.5 * (v - N) + 1.0) * R;
475  int id = v * 100 + u;
476 #ifdef EDM_ML_DEBUG
477  indtypes.emplace_back(id);
478 #endif
479  if (type == 1) {
480  php.cellCoarseX_.emplace_back(xp);
481  php.cellCoarseY_.emplace_back(yp);
482  } else {
483  php.cellFineX_.emplace_back(xp);
484  php.cellFineY_.emplace_back(yp);
485  }
486  cellIndex[id] = ipos;
487  ++ipos;
488  }
489  }
490  }
491  if (type == 1)
492  php.cellCoarseIndex_ = cellIndex;
493  else
494  php.cellFineIndex_ = cellIndex;
495 #ifdef EDM_ML_DEBUG
496  if (type == 1) {
497  edm::LogVerbatim("HGCalGeom") << "CellPosition for type " << type << " for " << php.cellCoarseX_.size()
498  << " cells";
499  for (unsigned int k = 0; k < php.cellCoarseX_.size(); ++k) {
500  int id = indtypes[k];
501  edm::LogVerbatim("HGCalGeom") << "[" << k << "] ID " << id << ":" << php.cellCoarseIndex_[id] << " X "
502  << php.cellCoarseX_[k] << " Y " << php.cellCoarseY_[k];
503  }
504  } else {
505  edm::LogVerbatim("HGCalGeom") << "CellPosition for type " << type << " for " << php.cellFineX_.size() << " cells";
506  for (unsigned int k = 0; k < php.cellFineX_.size(); ++k) {
507  int id = indtypes[k];
508  edm::LogVerbatim("HGCalGeom") << "[" << k << "] ID " << id << ":" << php.cellFineIndex_[k] << " X "
509  << php.cellFineX_[k] << " Y " << php.cellFineY_[k];
510  }
511  }
512 #endif
513 }
514 
516  DDValue val(s);
517  if (DDfetch(&sv, val)) {
518  const std::vector<double>& fvec = val.doubles();
519  if (fvec.empty()) {
520  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag.";
521  }
522  return fvec[0];
523  } else {
524  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag";
525  }
526 }
527 
528 std::vector<double> HGCalParametersFromDD::getDDDArray(const char* s, const DDsvalues_type& sv) {
529  DDValue val(s);
530  if (DDfetch(&sv, val)) {
531  const std::vector<double>& fvec = val.doubles();
532  if (fvec.empty()) {
533  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag.";
534  }
535  return fvec;
536  } else {
537  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag";
538  }
539 }
HGCalGeometryMode::TrapezoidFile
Definition: HGCalGeometryMode.h:33
HGCalParameters::firstLayer_
int firstLayer_
Definition: HGCalParameters.h:172
cms::DDDetector::vectors
cms::DDVectorsMap const & vectors() const
Definition: DDDetector.h:17
HGCalParameters::levelZSide_
int levelZSide_
Definition: HGCalParameters.h:136
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:180
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
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:37
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:515
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:528
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:453
HGCalParameters::waferThick_
double waferThick_
Definition: HGCalParameters.h:145
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:179
HGCalParameters::defineFull_
bool defineFull_
Definition: HGCalParameters.h:150
DDValue
Definition: DDValue.h:21
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:14
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:173
HGCalParameters::minTileSize_
double minTileSize_
Definition: HGCalParameters.h:165
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