CMS 3D CMS Logo

HcalGeomParameters.cc
Go to the documentation of this file.
2 
5 
14 
15 //#define EDM_ML_DEBUG
16 using namespace geant_units::operators;
17 
18 static const double tan10deg = std::tan(10._deg);
19 
20 void HcalGeomParameters::getConstRHO(std::vector<double>& rHO) const {
21  rHO.emplace_back(rminHO_);
22  for (double i : etaHO_)
23  rHO.emplace_back(i);
24 }
25 
26 std::vector<int> HcalGeomParameters::getModHalfHBHE(const int type) const {
27  std::vector<int> modHalf;
28  if (type == 0) {
29  modHalf.emplace_back(nmodHB_);
30  modHalf.emplace_back(nzHB_);
31  } else {
32  modHalf.emplace_back(nmodHE_);
33  modHalf.emplace_back(nzHE_);
34  }
35  return modHalf;
36 }
37 
39  DDFilteredView fv = _fv;
40  bool dodet = true;
41  bool hf = false;
42  clear(php);
43 
44  while (dodet) {
46  std::vector<int> copy = fv.copyNumbers();
47  const DDSolid& sol = fv.logicalPart().solid();
48  int idet = 0, lay = -1;
49  int nsiz = static_cast<int>(copy.size());
50  if (nsiz > 0)
51  lay = copy[nsiz - 1] / 10;
52  if (nsiz > 1)
53  idet = copy[nsiz - 2] / 1000;
54 #ifdef EDM_ML_DEBUG
55  edm::LogVerbatim("HCalGeom") << "Name " << fv.logicalPart().solid().name() << " Copy " << copy.size();
56 #endif
57  double dx = 0, dy = 0, dz = 0, dx1 = 0, dx2 = 0;
58  double alp(0);
59  if (sol.shape() == DDSolidShape::ddbox) {
60  const DDBox& box = static_cast<DDBox>(sol);
64  } else if (sol.shape() == DDSolidShape::ddtrap) {
65  const DDTrap& trp = static_cast<DDTrap>(sol);
68  dx = 0.25 * HcalGeomParameters::k_ScaleFromDDDToG4 * (trp.x1() + trp.x2() + trp.x3() + trp.x4());
69  dy = 0.5 * HcalGeomParameters::k_ScaleFromDDDToG4 * (trp.y1() + trp.y2());
71  alp = 0.5 * (trp.alpha1() + trp.alpha2());
72  } else if (sol.shape() == DDSolidShape::ddtubs) {
73  const DDTubs& tub = static_cast<DDTubs>(sol);
77  }
78  if (idet == 3) {
79  // HB
80 #ifdef EDM_ML_DEBUG
81  edm::LogVerbatim("HCalGeom") << "HB " << sol.name() << " Shape " << sol.shape() << " Layer " << lay << " R "
82  << t.Rho();
83 #endif
84  if (lay >= 0 && lay < maxLayer_) {
85  ib_[lay]++;
86  rb_[lay] += (HcalGeomParameters::k_ScaleFromDDDToG4 * t.Rho());
87  if (thkb_[lay] <= 0) {
88  if (lay < 17)
89  thkb_[lay] = dx;
90  else
91  thkb_[lay] = std::min(dx, dy);
92  }
93  if (lay < 17) {
94  bool found = false;
95  for (double k : rxb_) {
96  if (std::abs(k - (HcalGeomParameters::k_ScaleFromDDDToG4 * t.Rho())) < 0.01) {
97  found = true;
98  break;
99  }
100  }
101  if (!found) {
102  rxb_.emplace_back(HcalGeomParameters::k_ScaleFromDDDToG4 * t.Rho());
103  php.rhoxHB.emplace_back(HcalGeomParameters::k_ScaleFromDDDToG4 * t.Rho() * std::cos(t.phi()));
104  php.zxHB.emplace_back(HcalGeomParameters::k_ScaleFromDDDToG4 * std::abs(t.z()));
105  php.dyHB.emplace_back(2. * dy);
106  php.dxHB.emplace_back(2. * dz);
107  php.layHB.emplace_back(lay);
108  }
109  }
110  }
111  if (lay == 2) {
112  int iz = copy[nsiz - 5];
113  int fi = copy[nsiz - 4];
114  unsigned int it1 = find(iz, izb_);
115  if (it1 == izb_.size())
116  izb_.emplace_back(iz);
117  unsigned int it2 = find(fi, phib_);
118  if (it2 == phib_.size())
119  phib_.emplace_back(fi);
120  }
121  if (lay == 18) {
122  int ifi = -1, ich = -1;
123  if (nsiz > 2)
124  ifi = copy[nsiz - 3];
125  if (nsiz > 3)
126  ich = copy[nsiz - 4];
127  double z1 = std::abs((HcalGeomParameters::k_ScaleFromDDDToG4 * t.z()) + dz);
129  if (std::abs(z1 - z2) < 0.01)
130  z1 = 0;
131  if (ifi == 1 && ich == 4) {
132  if (z1 > z2) {
133  double tmp = z1;
134  z1 = z2;
135  z2 = tmp;
136  }
137  bool sok = true;
138  for (unsigned int kk = 0; kk < php.zHO.size(); kk++) {
139  if (std::abs(z2 - php.zHO[kk]) < 0.01) {
140  sok = false;
141  break;
142  } else if (z2 < php.zHO[kk]) {
143  php.zHO.resize(php.zHO.size() + 2);
144  for (unsigned int kz = php.zHO.size() - 1; kz > kk + 1; kz = kz - 2) {
145  php.zHO[kz] = php.zHO[kz - 2];
146  php.zHO[kz - 1] = php.zHO[kz - 3];
147  }
148  php.zHO[kk + 1] = z2;
149  php.zHO[kk] = z1;
150  sok = false;
151  break;
152  }
153  }
154  if (sok) {
155  php.zHO.emplace_back(z1);
156  php.zHO.emplace_back(z2);
157  }
158 #ifdef EDM_ML_DEBUG
159  edm::LogVerbatim("HCalGeom") << "Detector " << idet << " Lay " << lay << " fi " << ifi << " " << ich << " z "
160  << z1 << " " << z2;
161 #endif
162  }
163  }
164  } else if (idet == 4) {
165  // HE
166 #ifdef EDM_ML_DEBUG
167  edm::LogVerbatim("HCalGeom") << "HE " << sol.name() << " Shape " << sol.shape() << " Layer " << lay << " Z "
168  << t.z();
169 #endif
170  if (lay >= 0 && lay < maxLayer_) {
171  ie_[lay]++;
173  if (thke_[lay] <= 0)
174  thke_[lay] = dz;
175  double rinHE = HcalGeomParameters::k_ScaleFromDDDToG4 * t.Rho() * cos(alp) - dy;
176  double routHE = HcalGeomParameters::k_ScaleFromDDDToG4 * t.Rho() * cos(alp) + dy;
177  rminHE_[lay] += rinHE;
178  rmaxHE_[lay] += routHE;
179  bool found = false;
180  for (double k : php.zxHE) {
182  found = true;
183  break;
184  }
185  }
186  if (!found) {
187  php.zxHE.emplace_back(HcalGeomParameters::k_ScaleFromDDDToG4 * std::abs(t.z()));
188  php.rhoxHE.emplace_back(HcalGeomParameters::k_ScaleFromDDDToG4 * t.Rho() * std::cos(t.phi()));
189  php.dyHE.emplace_back(dy * std::cos(t.phi()));
190  dx1 -= 0.5 * (HcalGeomParameters::k_ScaleFromDDDToG4 * t.rho() - dy) * std::cos(t.phi()) * tan10deg;
191  dx2 -= 0.5 * (HcalGeomParameters::k_ScaleFromDDDToG4 * t.rho() + dy) * std::cos(t.phi()) * tan10deg;
192  php.dx1HE.emplace_back(-dx1);
193  php.dx2HE.emplace_back(-dx2);
194  php.layHE.emplace_back(lay);
195  }
196  }
197  if (copy[nsiz - 1] == kHELayer1_ || copy[nsiz - 1] == kHELayer2_) {
198  int iz = copy[nsiz - 7];
199  int fi = copy[nsiz - 5];
200  unsigned int it1 = find(iz, ize_);
201  if (it1 == ize_.size())
202  ize_.emplace_back(iz);
203  unsigned int it2 = find(fi, phie_);
204  if (it2 == phie_.size())
205  phie_.emplace_back(fi);
206  }
207  } else if (idet == 5) {
208  // HF
209  if (!hf) {
210  const std::vector<double>& paras = sol.parameters();
211 #ifdef EDM_ML_DEBUG
212  edm::LogVerbatim("HCalGeom") << "HF " << sol.name() << " Shape " << sol.shape() << " Z " << t.z() << " with "
213  << paras.size() << " Parameters";
214  for (unsigned j = 0; j < paras.size(); j++)
215  edm::LogVerbatim("HCalGeom") << "HF Parameter[" << j << "] = " << paras[j];
216 #endif
217  if (sol.shape() == DDSolidShape::ddpolycone_rrz) {
218  int nz = (int)(paras.size()) - 3;
219  dzVcal_ = 0.5 * HcalGeomParameters::k_ScaleFromDDDToG4 * (paras[nz] - paras[3]);
220  hf = true;
221  } else if (sol.shape() == DDSolidShape::ddtubs || sol.shape() == DDSolidShape::ddcons) {
222  dzVcal_ = HcalGeomParameters::k_ScaleFromDDDToG4 * paras[0];
223  hf = true;
224  }
225  }
226 #ifdef EDM_ML_DEBUG
227  } else {
228  edm::LogVerbatim("HCalGeom") << "Unknown Detector " << idet << " for " << sol.name() << " Shape " << sol.shape()
229  << " R " << t.Rho() << " Z " << t.z();
230 #endif
231  }
232  dodet = fv.next();
233  }
234 
235  loadfinal(php);
236 }
237 
239  const cms::DDFilter filter("OnlyForHcalSimNumbering", "HCAL");
240  cms::DDFilteredView fv(cpv, filter);
241  clear(php);
242  bool hf(false);
243  while (fv.firstChild()) {
244  auto t = fv.translation();
245  std::vector<double> paras = fv.parameters();
246  std::vector<int> copy = fv.copyNos();
247  int idet = 0, lay = -1;
248  int nsiz = static_cast<int>(copy.size());
249  if (nsiz > 0)
250  lay = copy[0] / 10;
251  if (nsiz > 1)
252  idet = copy[1] / 1000;
253 #ifdef EDM_ML_DEBUG
254  edm::LogVerbatim("HCalGeom") << "Name " << fv.name() << " Copy " << copy.size();
255  for (unsigned int n = 0; n < copy.size(); ++n)
256  edm::LogVerbatim("HCalGeom") << "[" << n << "] " << copy[n];
257  edm::LogVerbatim("HCalGeom") << "Detector " << idet << " Layer " << lay << " parameters: " << paras.size();
258  for (unsigned int n = 0; n < paras.size(); ++n)
259  edm::LogVerbatim("HCalGeom") << "[" << n << "] " << paras[n];
260 #endif
261  double dx = 0, dy = 0, dz = 0, dx1 = 0, dx2 = 0;
262  double alp(0);
263  if (dd4hep::isA<dd4hep::Box>(fv.solid())) {
267  } else if (dd4hep::isA<dd4hep::Trap>(fv.solid())) {
270  dx = 0.25 * HcalGeomParameters::k_ScaleFromDD4HepToG4 * (paras[4] + paras[5] + paras[8] + paras[9]);
271  dy = 0.5 * HcalGeomParameters::k_ScaleFromDD4HepToG4 * (paras[3] + paras[7]);
273  alp = 0.5 * (paras[6] + paras[10]);
274  } else if (dd4hep::isA<dd4hep::Tube>(fv.solid())) {
278  }
279  if (idet == 3) {
280  // HB
281 #ifdef EDM_ML_DEBUG
282  edm::LogVerbatim("HCalGeom") << "HB " << fv.name() << " Shape " << cms::dd::name(cms::DDSolidShapeMap, fv.shape())
283  << " Layer " << lay << " R " << t.Rho();
284 #endif
285  if (lay >= 0 && lay < maxLayer_) {
286  ib_[lay]++;
287  rb_[lay] += (HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho());
288  if (thkb_[lay] <= 0) {
289  if (lay < 17)
290  thkb_[lay] = dx;
291  else
292  thkb_[lay] = std::min(dx, dy);
293  }
294  if (lay < 17) {
295  bool found = false;
296  for (double k : rxb_) {
297  if (std::abs(k - (HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho())) < 0.01) {
298  found = true;
299  break;
300  }
301  }
302  if (!found) {
303  rxb_.emplace_back(HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho());
304  php.rhoxHB.emplace_back(HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho() * std::cos(t.phi()));
305  php.zxHB.emplace_back(std::abs(HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.z()));
306  php.dyHB.emplace_back(2. * dy);
307  php.dxHB.emplace_back(2. * dz);
308  php.layHB.emplace_back(lay);
309  }
310  }
311  }
312  if (lay == 2) {
313  int iz = copy[4];
314  int fi = copy[3];
315  unsigned int it1 = find(iz, izb_);
316  if (it1 == izb_.size())
317  izb_.emplace_back(iz);
318  unsigned int it2 = find(fi, phib_);
319  if (it2 == phib_.size())
320  phib_.emplace_back(fi);
321  }
322  if (lay == 18) {
323  int ifi = -1, ich = -1;
324  if (nsiz > 2)
325  ifi = copy[2];
326  if (nsiz > 3)
327  ich = copy[3];
330  if (std::abs(z1 - z2) < 0.01)
331  z1 = 0;
332  if (ifi == 1 && ich == 4) {
333  if (z1 > z2) {
334  double tmp = z1;
335  z1 = z2;
336  z2 = tmp;
337  }
338  bool sok = true;
339  for (unsigned int kk = 0; kk < php.zHO.size(); kk++) {
340  if (std::abs(z2 - php.zHO[kk]) < 0.01) {
341  sok = false;
342  break;
343  } else if (z2 < php.zHO[kk]) {
344  php.zHO.resize(php.zHO.size() + 2);
345  for (unsigned int kz = php.zHO.size() - 1; kz > kk + 1; kz = kz - 2) {
346  php.zHO[kz] = php.zHO[kz - 2];
347  php.zHO[kz - 1] = php.zHO[kz - 3];
348  }
349  php.zHO[kk + 1] = z2;
350  php.zHO[kk] = z1;
351  sok = false;
352  break;
353  }
354  }
355  if (sok) {
356  php.zHO.emplace_back(z1);
357  php.zHO.emplace_back(z2);
358  }
359 #ifdef EDM_ML_DEBUG
360  edm::LogVerbatim("HCalGeom") << "Detector " << idet << " Lay " << lay << " fi " << ifi << " " << ich << " z "
361  << z1 << " " << z2;
362 #endif
363  }
364  }
365  } else if (idet == 4) {
366  // HE
367 #ifdef EDM_ML_DEBUG
368  edm::LogVerbatim("HCalGeom") << "HE " << fv.name() << " Shape " << cms::dd::name(cms::DDSolidShapeMap, fv.shape())
369  << " Layer " << lay << " Z " << t.z();
370 #endif
371  if (lay >= 0 && lay < maxLayer_) {
372  ie_[lay]++;
374  if (thke_[lay] <= 0)
375  thke_[lay] = dz;
376  double rinHE = HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho() * cos(alp) - dy;
377  double routHE = HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho() * cos(alp) + dy;
378  rminHE_[lay] += rinHE;
379  rmaxHE_[lay] += routHE;
380  bool found = false;
381  for (double k : php.zxHE) {
383  found = true;
384  break;
385  }
386  }
387  if (!found) {
388  php.zxHE.emplace_back(std::abs(HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.z()));
389  php.rhoxHE.emplace_back(HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho() * std::cos(t.phi()));
390  php.dyHE.emplace_back(dy * std::cos(t.phi()));
391  dx1 -= 0.5 * (HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho() - dy) * std::cos(t.phi()) * tan10deg;
392  dx2 -= 0.5 * (HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho() + dy) * std::cos(t.phi()) * tan10deg;
393  php.dx1HE.emplace_back(-dx1);
394  php.dx2HE.emplace_back(-dx2);
395  php.layHE.emplace_back(lay);
396  }
397  }
398  if (copy[0] == kHELayer1_ || copy[0] == kHELayer2_) {
399  int iz = copy[6];
400  int fi = copy[4];
401  unsigned int it1 = find(iz, ize_);
402  if (it1 == ize_.size())
403  ize_.emplace_back(iz);
404  unsigned int it2 = find(fi, phie_);
405  if (it2 == phie_.size())
406  phie_.emplace_back(fi);
407  }
408  } else if (idet == 5) {
409  // HF
410  if (!hf) {
411 #ifdef EDM_ML_DEBUG
412  edm::LogVerbatim("HCalGeom") << "HF " << fv.name() << " Shape "
413  << cms::dd::name(cms::DDSolidShapeMap, fv.shape()) << " Z "
414  << HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.z() << " with " << paras.size()
415  << " Parameters";
416  for (unsigned j = 0; j < paras.size(); j++)
417  edm::LogVerbatim("HCalGeom") << "HF Parameter[" << j << "] = " << paras[j];
418 #endif
419  if (dd4hep::isA<dd4hep::Polycone>(fv.solid())) {
420  int nz = (int)(paras.size()) - 3;
421  dzVcal_ = 0.5 * HcalGeomParameters::k_ScaleFromDD4HepToG4 * (paras[nz] - paras[3]);
422  hf = true;
423  } else if (dd4hep::isA<dd4hep::Tube>(fv.solid()) || dd4hep::isA<dd4hep::ConeSegment>(fv.solid())) {
424  dzVcal_ = HcalGeomParameters::k_ScaleFromDD4HepToG4 * paras[2];
425  hf = true;
426  }
427  }
428 #ifdef EDM_ML_DEBUG
429  } else {
430  edm::LogVerbatim("HCalGeom") << "Unknown Detector " << idet << " for " << fv.name() << " Shape "
431  << cms::dd::name(cms::DDSolidShapeMap, fv.shape()) << " R "
432  << (HcalGeomParameters::k_ScaleFromDD4HepToG4 * t.Rho()) << " Z "
434 #endif
435  }
436  }
437  loadfinal(php);
438 }
439 
440 unsigned int HcalGeomParameters::find(int element, std::vector<int>& array) const {
441  unsigned int id = array.size();
442  for (unsigned int i = 0; i < array.size(); i++) {
443  if (element == array[i]) {
444  id = i;
445  break;
446  }
447  }
448  return id;
449 }
450 
451 double HcalGeomParameters::getEta(double r, double z) const {
452  double tmp = 0;
453  if (z != 0)
454  tmp = -log(tan(0.5 * atan(r / z)));
455 #ifdef EDM_ML_DEBUG
456  edm::LogVerbatim("HCalGeom") << "HcalGeomParameters::getEta " << r << " " << z << " ==> " << tmp;
457 #endif
458  return tmp;
459 }
460 
462  php.rhoxHB.clear();
463  php.zxHB.clear();
464  php.dyHB.clear();
465  php.dxHB.clear();
466  php.layHB.clear();
467  php.layHE.clear();
468  php.zxHE.clear();
469  php.rhoxHE.clear();
470  php.dyHE.clear();
471  php.dx1HE.clear();
472  php.dx2HE.clear();
473 
474  // Initialize all variables
475  nzHB_ = nmodHB_ = 0;
476  nzHE_ = nmodHE_ = 0;
477  for (int i = 0; i < 4; ++i)
478  etaHO_[i] = 0;
479  zVcal_ = dzVcal_ = dlShort_ = 0;
480  rminHO_ = dzVcal_ = -1.;
481  for (int i = 0; i < maxLayer_; ++i) {
482  rb_.emplace_back(0.0);
483  ze_.emplace_back(0.0);
484  thkb_.emplace_back(-1.0);
485  thke_.emplace_back(-1.0);
486  ib_.emplace_back(0);
487  ie_.emplace_back(0);
488  rminHE_.emplace_back(0.0);
489  rmaxHE_.emplace_back(0.0);
490  }
491 }
492 
494  int ibmx = 0, iemx = 0;
495  for (int i = 0; i < maxLayer_; i++) {
496  if (ib_[i] > 0) {
497  rb_[i] /= static_cast<double>(ib_[i]);
498  ibmx = i + 1;
499  }
500  if (ie_[i] > 0) {
501  ze_[i] /= static_cast<double>(ie_[i]);
502  rminHE_[i] /= static_cast<double>(ie_[i]);
503  rmaxHE_[i] /= static_cast<double>(ie_[i]);
504  iemx = i + 1;
505  }
506 #ifdef EDM_ML_DEBUG
507  edm::LogVerbatim("HCalGeom") << "Index " << i << " Barrel " << ib_[i] << " " << rb_[i] << " Endcap " << ie_[i]
508  << " " << ze_[i] << ":" << rminHE_[i] << ":" << rmaxHE_[i];
509 #endif
510  }
511  for (int i = 4; i >= 0; i--) {
512  if (ib_[i] == 0) {
513  rb_[i] = rb_[i + 1];
514  thkb_[i] = thkb_[i + 1];
515  }
516  if (ie_[i] == 0) {
517  ze_[i] = ze_[i + 1];
518  thke_[i] = thke_[i + 1];
519  }
520 #ifdef EDM_ML_DEBUG
521  if (ib_[i] == 0 || ie_[i] == 0)
522  edm::LogVerbatim("HCalGeom") << "Index " << i << " Barrel " << ib_[i] << " " << rb_[i] << " Endcap " << ie_[i]
523  << " " << ze_[i];
524 #endif
525  }
526 
527 #ifdef EDM_ML_DEBUG
528  for (unsigned int k = 0; k < php.layHB.size(); ++k)
529  edm::LogVerbatim("HCalGeom") << "HB: " << php.layHB[k] << " R " << rxb_[k] << " " << php.rhoxHB[k] << " Z "
530  << php.zxHB[k] << " DY " << php.dyHB[k] << " DZ " << php.dxHB[k];
531  for (unsigned int k = 0; k < php.layHE.size(); ++k)
532  edm::LogVerbatim("HCalGeom") << "HE: " << php.layHE[k] << " R " << php.rhoxHE[k] << " Z " << php.zxHE[k]
533  << " X1|X2 " << php.dx1HE[k] << "|" << php.dx2HE[k] << " DY " << php.dyHE[k];
534  edm::LogVerbatim("HCalGeom") << "HcalGeomParameters: Maximum Layer for HB " << ibmx << " for HE " << iemx
535  << " extent " << dzVcal_;
536 #endif
537 
538  if (ibmx > 0) {
539  php.rHB.resize(ibmx);
540  php.drHB.resize(ibmx);
541  for (int i = 0; i < ibmx; i++) {
542  php.rHB[i] = rb_[i];
543  php.drHB[i] = thkb_[i];
544 #ifdef EDM_ML_DEBUG
545  edm::LogVerbatim("HCalGeom") << "HcalGeomParameters: php.rHB[" << i << "] = " << php.rHB[i] << " php.drHB[" << i
546  << "] = " << php.drHB[i];
547 #endif
548  }
549  }
550  if (iemx > 0) {
551  php.zHE.resize(iemx);
552  php.dzHE.resize(iemx);
553  for (int i = 0; i < iemx; i++) {
554  php.zHE[i] = ze_[i];
555  php.dzHE[i] = thke_[i];
556 #ifdef EDM_ML_DEBUG
557  edm::LogVerbatim("HCalGeom") << "HcalGeomParameters: php.zHE[" << i << "] = " << php.zHE[i] << " php.dzHE[" << i
558  << "] = " << php.dzHE[i];
559 #endif
560  }
561  }
562 
563  nzHB_ = static_cast<int>(izb_.size());
564  nmodHB_ = static_cast<int>(phib_.size());
565 #ifdef EDM_ML_DEBUG
566  edm::LogVerbatim("HCalGeom") << "HcalGeomParameters::loadGeometry: " << nzHB_ << " barrel half-sectors";
567  for (int i = 0; i < nzHB_; i++)
568  edm::LogVerbatim("HCalGeom") << "Section " << i << " Copy number " << izb_[i];
569  edm::LogVerbatim("HCalGeom") << "HcalGeomParameters::loadGeometry: " << nmodHB_ << " barrel modules";
570  for (int i = 0; i < nmodHB_; i++)
571  edm::LogVerbatim("HCalGeom") << "Module " << i << " Copy number " << phib_[i];
572 #endif
573 
574  nzHE_ = static_cast<int>(ize_.size());
575  nmodHE_ = static_cast<int>(phie_.size());
576 #ifdef EDM_ML_DEBUG
577  edm::LogVerbatim("HCalGeom") << "HcalGeomParameters::loadGeometry: " << nzHE_ << " endcap half-sectors";
578  for (int i = 0; i < nzHE_; i++)
579  edm::LogVerbatim("HCalGeom") << "Section " << i << " Copy number " << ize_[i];
580  edm::LogVerbatim("HCalGeom") << "HcalGeomParameters::loadGeometry: " << nmodHE_ << " endcap modules";
581  for (int i = 0; i < nmodHE_; i++)
582  edm::LogVerbatim("HCalGeom") << "Module " << i << " Copy number " << phie_[i];
583 #endif
584 
585 #ifdef EDM_ML_DEBUG
586  edm::LogVerbatim("HCalGeom") << "HO has Z of size " << php.zHO.size();
587  for (unsigned int kk = 0; kk < php.zHO.size(); kk++)
588  edm::LogVerbatim("HCalGeom") << "ZHO[" << kk << "] = " << php.zHO[kk];
589 #endif
590  if (ibmx > 17 && php.zHO.size() > 4) {
591  rminHO_ = php.rHB[17] - 100.0;
592  etaHO_[0] = getEta(0.5 * (php.rHB[17] + php.rHB[18]), php.zHO[1]);
593  etaHO_[1] = getEta(php.rHB[18] + php.drHB[18], php.zHO[2]);
594  etaHO_[2] = getEta(php.rHB[18] - php.drHB[18], php.zHO[3]);
595  etaHO_[3] = getEta(php.rHB[18] + php.drHB[18], php.zHO[4]);
596  }
597 #ifdef EDM_ML_DEBUG
598  edm::LogVerbatim("HCalGeom") << "HO Eta boundaries " << etaHO_[0] << " " << etaHO_[1] << " " << etaHO_[2] << " "
599  << etaHO_[3];
600  edm::LogVerbatim("HCalGeom") << "HO Parameters " << rminHO_ << " " << php.zHO.size();
601  for (unsigned int i = 0; i < php.zHO.size(); ++i)
602  edm::LogVerbatim("HCalGeom") << " zho[" << i << "] = " << php.zHO[i];
603 #endif
604 }
DDTubs::zhalf
double zhalf(void) const
Definition: DDSolid.cc:450
mps_fire.i
i
Definition: mps_fire.py:428
HcalGeomParameters::getEta
double getEta(double r, double z) const
Definition: HcalGeomParameters.cc:451
cms::DDFilteredView::parameters
const std::vector< double > parameters() const
extract shape parameters
Definition: DDFilteredView.cc:536
MessageLogger.h
DDTrap::halfZ
double halfZ(void) const
half of the z-Axis
Definition: DDSolid.cc:131
HcalParameters::layHB
std::vector< int > layHB
Definition: HcalParameters.h:51
DDTrap::x4
double x4(void) const
Half-length along x of the side at y=+pDy2 of the face at +pDz.
Definition: DDSolid.cc:149
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DDSolidShape::ddtrap
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDTrap::x2
double x2(void) const
Half-length along x of the side at y=+pDy1 of the face at -pDz.
Definition: DDSolid.cc:141
min
T min(T a, T b)
Definition: MathUtil.h:58
DDBox::halfZ
double halfZ(void) const
Definition: DDSolid.cc:212
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
DDFilteredView::copyNumbers
nav_type copyNumbers() const
return the stack of copy numbers
Definition: DDFilteredView.cc:193
HcalParameters::zxHB
std::vector< double > zxHB
Definition: HcalParameters.h:24
HcalParameters.h
mps_check.array
array
Definition: mps_check.py:216
HcalParameters::zHO
std::vector< double > zHO
Definition: HcalParameters.h:21
geant_units::operators
Definition: GeantUnits.h:18
cms::DDFilteredView
Definition: DDFilteredView.h:70
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
cms::DDFilteredView::name
std::string_view name() const
Definition: DDFilteredView.cc:853
cms::DDFilteredView::translation
const Translation translation() const
Definition: DDFilteredView.cc:103
testProducerWithPsetDescEmpty_cfi.z2
z2
Definition: testProducerWithPsetDescEmpty_cfi.py:41
HcalParameters::layHE
std::vector< int > layHE
Definition: HcalParameters.h:52
cms::DDFilteredView::solid
dd4hep::Solid solid() const
Definition: DDFilteredView.cc:861
DDSolid::shape
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:119
photonIsolationHIProducer_cfi.hf
hf
Definition: photonIsolationHIProducer_cfi.py:9
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
cms::DDFilter
Definition: DDFilteredView.h:59
HcalParameters::dx1HE
std::vector< double > dx1HE
Definition: HcalParameters.h:30
HcalParameters::rhoxHE
std::vector< double > rhoxHE
Definition: HcalParameters.h:27
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDSolidShape::ddtubs
HcalGeomParameters::find
unsigned find(int element, std::vector< int > &array) const
Definition: HcalGeomParameters.cc:440
cms::dd::name
std::string name(Mapping a, V value)
Definition: DDSolidShapes.h:31
DDBox
Interface to a Box.
Definition: DDSolid.h:156
DDTrap::y1
double y1(void) const
Half-length along y of the face at -pDz.
Definition: DDSolid.cc:137
HcalParameters::dxHB
std::vector< double > dxHB
Definition: HcalParameters.h:26
DDFilteredView::next
bool next()
set current node to the next node in the filtered tree
Definition: DDFilteredView.cc:67
HcalParameters::dx2HE
std::vector< double > dx2HE
Definition: HcalParameters.h:31
cms::DDFilteredView::copyNos
const std::vector< int > copyNos() const
The list of the volume copy numbers.
Definition: DDFilteredView.cc:89
DDBase::name
const N & name() const
Definition: DDBase.h:59
HcalGeomParameters::getModHalfHBHE
std::vector< int > getModHalfHBHE(const int type) const
Definition: HcalGeomParameters.cc:26
tan10deg
static const double tan10deg
Definition: HcalGeomParameters.cc:18
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:268
DDSolid.h
cms::DDFilteredView::shape
const cms::DDSolidShape shape() const
Definition: DDFilteredView.cc:553
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
HcalParameters::dzHE
std::vector< double > dzHE
Definition: HcalParameters.h:20
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
DDValue.h
HcalParameters::rHB
std::vector< double > rHB
Definition: HcalParameters.h:17
DDTubs::rIn
double rIn(void) const
Definition: DDSolid.cc:452
DDTrap
Interface to a Trapezoid.
Definition: DDSolid.h:77
clear
void clear(HadCaloObj &c)
Definition: data.h:124
GeantUnits.h
cms::DDSolidShapeMap
const std::array< const cms::dd::NameValuePair< DDSolidShape >, 19 > DDSolidShapeMap
Definition: DDSolidShapes.h:97
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HcalGeomParameters::getConstRHO
void getConstRHO(std::vector< double > &) const
Definition: HcalGeomParameters.cc:20
HcalGeomParameters::k_ScaleFromDDDToG4
static constexpr double k_ScaleFromDDDToG4
Definition: HcalGeomParameters.h:30
HcalGeomParameters::k_ScaleFromDD4HepToG4
static constexpr double k_ScaleFromDD4HepToG4
Definition: HcalGeomParameters.h:34
DDTubs::rOut
double rOut(void) const
Definition: DDSolid.cc:454
HcalParameters::zxHE
std::vector< double > zxHE
Definition: HcalParameters.h:28
DDSolidShape::ddcons
HcalGeomParameters::loadfinal
void loadfinal(HcalParameters &php)
Definition: HcalGeomParameters.cc:493
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
HcalParameters::zHE
std::vector< double > zHE
Definition: HcalParameters.h:19
createfilelist.int
int
Definition: createfilelist.py:10
DDutils.h
DDFilter.h
HcalGeomParameters.h
DDBox::halfX
double halfX(void) const
Definition: DDSolid.cc:208
PVValHelper::dy
Definition: PVValidationHelpers.h:49
DDBox::halfY
double halfY(void) const
Definition: DDSolid.cc:210
HcalParameters::dyHE
std::vector< double > dyHE
Definition: HcalParameters.h:29
HcalGeomParameters::clear
void clear(HcalParameters &php)
Definition: HcalGeomParameters.cc:461
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDErrorDetection.h
HcalParameters::dyHB
std::vector< double > dyHB
Definition: HcalParameters.h:25
DDTrap::y2
double y2(void) const
Half-length along y of the face at +pDz.
Definition: DDSolid.cc:145
DDSolidShape::ddbox
PVValHelper::dz
Definition: PVValidationHelpers.h:50
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
DDFilteredView::translation
const DDTranslation & translation() const
The absolute translation of the current node.
Definition: DDFilteredView.cc:26
HcalGeomParameters::loadGeometry
void loadGeometry(const DDFilteredView &_fv, HcalParameters &php)
Definition: HcalGeomParameters.cc:38
HcalParameters::drHB
std::vector< double > drHB
Definition: HcalParameters.h:18
HcalParameters
Definition: HcalParameters.h:6
cms::DDCompactView
Definition: DDCompactView.h:31
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:121
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
Exception.h
DDTrap::x1
double x1(void) const
Half-length along x of the side at y=-pDy1 of the face at -pDz.
Definition: DDSolid.cc:139
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
DDFilteredView
Definition: DDFilteredView.h:20
DDSolidShape::ddpolycone_rrz
DDTrap::alpha1
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
Definition: DDSolid.cc:143
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DDTrap::alpha2
double alpha2(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy2 to the centre at y=+pDy2 of t...
Definition: DDSolid.cc:151
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Log
Definition: MessageLogger.h:70
DDConstant.h
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
PVValHelper::dx
Definition: PVValidationHelpers.h:48
HcalParameters::rhoxHB
std::vector< double > rhoxHB
Definition: HcalParameters.h:23
DDTrap::x3
double x3(void) const
Half-length along x of the side at y=-pDy2 of the face at +pDz.
Definition: DDSolid.cc:147
DDTubs
Definition: DDSolid.h:255