CMS 3D CMS Logo

HcalHardcodeGeometryLoader.cc
Go to the documentation of this file.
7 
8 #include <vector>
9 #include <algorithm>
10 
12 //#define DebugLog
13 // ==============> Loader Itself <==========================
14 
16  MAX_HCAL_PHI = 72;
17  DEGREE2RAD = M_PI / 180.;
18 #ifdef DebugLog
19  std::cout << "Instantiate HcalHardCodeGeometryLoader" << std::endl;
20 #endif
21 }
22 
24  int maxEta = fTopology.lastHERing();
25  m_segmentation.resize(maxEta);
26  for (int i = 0; i < maxEta; i++) {
27  fTopology.getDepthSegmentation(i + 1, m_segmentation[i]);
28 #ifdef DebugLog
29  std::cout << "Eta" << i + 1;
30  for (unsigned int k = 0; k < m_segmentation[i].size(); ++k) {
31  std::cout << " [" << k << "] " << m_segmentation[i][k];
32  }
33  std::cout << std::endl;
34 #endif
35  }
36  HcalGeometry* hcalGeometry = new HcalGeometry(fTopology);
37  if (nullptr == hcalGeometry->cornersMgr())
38  hcalGeometry->allocateCorners(fTopology.ncells() + fTopology.getHFSize());
39  if (nullptr == hcalGeometry->parMgr())
41  if (fTopology.mode() == HcalTopologyMode::H2) { // TB geometry
42  fillHBHO(hcalGeometry, makeHBCells(fTopology), true);
43  fillHBHO(hcalGeometry, makeHOCells(), false);
44  fillHE(hcalGeometry, makeHECells_H2());
45  } else { // regular geometry
46  fillHBHO(hcalGeometry, makeHBCells(fTopology), true);
47  fillHBHO(hcalGeometry, makeHOCells(), false);
48  fillHF(hcalGeometry, makeHFCells());
49  fillHE(hcalGeometry, makeHECells(fTopology));
50  }
51  //fast insertion of valid ids requires sort at end
52  hcalGeometry->sortValidIds();
53  return hcalGeometry;
54 }
55 
56 // ----------> HB <-----------
57 std::vector<HcalHardcodeGeometryLoader::HBHOCellParameters> HcalHardcodeGeometryLoader::makeHBCells(
58  const HcalTopology& topology) {
59  const float HBRMIN = 181.1;
60  const float HBRMAX = 288.8;
61 
62  float normalDepths[2] = {HBRMIN, HBRMAX};
63  float ring15Depths[3] = {HBRMIN, 258.4, HBRMAX};
64  float ring16Depths[3] = {HBRMIN, 190.4, 232.6};
65  float layerDepths[18] = {HBRMIN,
66  188.7,
67  194.7,
68  200.7,
69  206.7,
70  212.7,
71  218.7,
72  224.7,
73  230.7,
74  236.7,
75  242.7,
76  249.3,
77  255.9,
78  262.5,
79  269.1,
80  275.7,
81  282.3,
82  HBRMAX};
83  float slhcDepths[4] = {HBRMIN, 214., 239., HBRMAX};
84 #ifdef DebugLog
85  std::cout << "FlexiGeometryLoader called for " << topology.mode() << ":" << HcalTopologyMode::SLHC << std::endl;
86 #endif
87  std::vector<HcalHardcodeGeometryLoader::HBHOCellParameters> result;
88  for (int iring = 1; iring <= 16; ++iring) {
89  std::vector<float> depths;
90  if (topology.mode() != HcalTopologyMode::SLHC) {
91  if (iring == 15) {
92  for (float ring15Depth : ring15Depths)
93  depths.emplace_back(ring15Depth);
94  } else if (iring == 16) {
95  for (float ring16Depth : ring16Depths)
96  depths.emplace_back(ring16Depth);
97  } else {
98  for (float normalDepth : normalDepths)
99  depths.emplace_back(normalDepth);
100  }
101  } else {
102  if (m_segmentation.size() >= (unsigned int)(iring)) {
103  int depth = m_segmentation[iring - 1][0];
104  depths.emplace_back(layerDepths[depth]);
105  int layer = 1;
106  for (unsigned int i = 1; i < m_segmentation[iring - 1].size(); ++i) {
107  if (depth != m_segmentation[iring - 1][i]) {
108  depth = m_segmentation[iring - 1][i];
109  layer = i;
110  if (iring != 16 || depth < 3)
111  depths.emplace_back(layerDepths[depth]);
112  }
113  if (i >= 17)
114  break;
115  }
116  if (layer <= 17)
117  depths.emplace_back(HBRMAX);
118  } else {
119  for (int i = 0; i < 4; ++i) {
120  if (iring != 16 || i < 3) {
121  depths.emplace_back(slhcDepths[i]);
122  }
123  }
124  }
125  }
126  unsigned int ndepth = depths.size() - 1;
127  unsigned int startingDepth = 1;
128  float etaMin = (iring - 1) * 0.087;
129  float etaMax = iring * 0.087;
130  // topology.depthBinInformation(HcalBarrel, iring, ndepth, startingDepth);
131 #ifdef DebugLog
132  std::cout << "HBRing " << iring << " eta " << etaMin << ":" << etaMax << " depths " << ndepth << ":"
133  << startingDepth;
134  for (unsigned int i = 0; i < depths.size(); ++i)
135  std::cout << ":" << depths[i];
136  std::cout << "\n";
137 #endif
138  for (unsigned int idepth = startingDepth; idepth <= ndepth; ++idepth) {
139  float rmin = depths[idepth - 1];
140  float rmax = depths[idepth];
141 #ifdef DebugLog
142  std::cout << "HB " << idepth << " R " << rmin << ":" << rmax << "\n";
143 #endif
144  result.emplace_back(
145  HcalHardcodeGeometryLoader::HBHOCellParameters(iring, (int)idepth, 1, 1, 5, rmin, rmax, etaMin, etaMax));
146  }
147  }
148  return result;
149 }
150 
151 // ----------> HO <-----------
152 std::vector<HcalHardcodeGeometryLoader::HBHOCellParameters> HcalHardcodeGeometryLoader::makeHOCells() {
153  const float HORMIN0 = 390.0;
154  const float HORMIN1 = 412.6;
155  const float HORMAX = 413.6;
156 
158  // eta, depth, firstPhi, stepPhi, deltaPhi, rMin, rMax, etaMin, etaMax
159  HcalHardcodeGeometryLoader::HBHOCellParameters(1, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087 * 0, 0.087 * 1),
160  HcalHardcodeGeometryLoader::HBHOCellParameters(2, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087 * 1, 0.087 * 2),
161  HcalHardcodeGeometryLoader::HBHOCellParameters(3, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087 * 2, 0.087 * 3),
162  HcalHardcodeGeometryLoader::HBHOCellParameters(4, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087 * 3, 0.3075),
163  HcalHardcodeGeometryLoader::HBHOCellParameters(5, 4, 1, 1, 5, HORMIN1, HORMAX, 0.3395, 0.087 * 5),
164  HcalHardcodeGeometryLoader::HBHOCellParameters(6, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 5, 0.087 * 6),
165  HcalHardcodeGeometryLoader::HBHOCellParameters(7, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 6, 0.087 * 7),
166  HcalHardcodeGeometryLoader::HBHOCellParameters(8, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 7, 0.087 * 8),
167  HcalHardcodeGeometryLoader::HBHOCellParameters(9, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 8, 0.087 * 9),
168  HcalHardcodeGeometryLoader::HBHOCellParameters(10, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 9, 0.8494),
169  HcalHardcodeGeometryLoader::HBHOCellParameters(11, 4, 1, 1, 5, HORMIN1, HORMAX, 0.873, 0.087 * 11),
170  HcalHardcodeGeometryLoader::HBHOCellParameters(12, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 11, 0.087 * 12),
171  HcalHardcodeGeometryLoader::HBHOCellParameters(13, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 12, 0.087 * 13),
172  HcalHardcodeGeometryLoader::HBHOCellParameters(14, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 13, 0.087 * 14),
173  HcalHardcodeGeometryLoader::HBHOCellParameters(15, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087 * 14, 0.087 * 15)};
175  std::vector<HcalHardcodeGeometryLoader::HBHOCellParameters> result;
176  result.reserve(nCells);
177  for (int i = 0; i < nCells; ++i)
178  result.emplace_back(cells[i]);
179  return result;
180 }
181 
182 //
183 // Convert constants to appropriate cells
184 //
186  const std::vector<HcalHardcodeGeometryLoader::HBHOCellParameters>& fCells,
187  bool fHB) {
188  fGeometry->increaseReserve(fCells.size());
189  for (const auto& param : fCells) {
190  for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) {
191  for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical
192  HcalDetId hid(fHB ? HcalBarrel : HcalOuter, param.eta * iside, iPhi, param.depth);
193  float phiCenter = ((iPhi - 1) * 360. / MAX_HCAL_PHI + 0.5 * param.dphi) * DEGREE2RAD; // middle of the cell
194  float etaCenter = 0.5 * (param.etaMin + param.etaMax);
195  float x = param.rMin * cos(phiCenter);
196  float y = param.rMin * sin(phiCenter);
197  float z = iside * param.rMin * sinh(etaCenter);
198  // make cell geometry
199  GlobalPoint refPoint(x, y, z); // center of the cell's face
200  std::vector<CCGFloat> cellParams;
201  cellParams.reserve(5);
202  cellParams.emplace_back(0.5 * (param.etaMax - param.etaMin)); // deta_half
203  cellParams.emplace_back(0.5 * param.dphi * DEGREE2RAD); // dphi_half
204  cellParams.emplace_back(0.5 * (param.rMax - param.rMin) * cosh(etaCenter)); // dr_half
205  cellParams.emplace_back(fabs(refPoint.eta()));
206  cellParams.emplace_back(fabs(refPoint.z()));
207 #ifdef DebugLog
208  std::cout << "HcalHardcodeGeometryLoader::fillHBHO-> " << hid << hid.ieta() << '/' << hid.iphi() << '/'
209  << hid.depth() << refPoint << '/' << cellParams[0] << '/' << cellParams[1] << '/' << cellParams[2]
210  << std::endl;
211 #endif
212  fGeometry->newCellFast(refPoint,
213  refPoint,
214  refPoint,
215  CaloCellGeometry::getParmPtr(cellParams, fGeometry->parMgr(), fGeometry->parVecVec()),
216  hid);
217  }
218  }
219  }
220 }
221 
222 // ----------> HE <-----------
223 std::vector<HcalHardcodeGeometryLoader::HECellParameters> HcalHardcodeGeometryLoader::makeHECells(
224  const HcalTopology& topology) {
225  std::vector<HcalHardcodeGeometryLoader::HECellParameters> result;
226  const float HEZMIN = 400.458;
227  const float HEZMID = 436.168;
228  const float HEZMAX = 549.268;
229  float normalDepths[3] = {HEZMIN, HEZMID, HEZMAX};
230  float tripleDepths[4] = {HEZMIN, 418.768, HEZMID, HEZMAX};
231  float slhcDepths[5] = {HEZMIN, 418.768, HEZMID, 493., HEZMAX};
232  float ring16Depths[2] = {418.768, 470.968};
233  float ring16slhcDepths[3] = {418.768, 450., 470.968};
234  float ring17Depths[2] = {409.698, 514.468};
235  float ring17slhcDepths[5] = {409.698, 435., 460., 495., 514.468};
236  float ring18Depths[3] = {391.883, 427.468, 540.568};
237  float ring18slhcDepths[5] = {391.883, 439., 467., 504., 540.568};
238  float etaBounds[] = {0.087 * 15,
239  0.087 * 16,
240  0.087 * 17,
241  0.087 * 18,
242  0.087 * 19,
243  1.74,
244  1.83,
245  1.93,
246  2.043,
247  2.172,
248  2.322,
249  2.500,
250  2.650,
251  2.868,
252  3.000};
253  float layerDepths[19] = {HEZMIN,
254  408.718,
255  416.978,
256  425.248,
257  433.508,
258  441.768,
259  450.038,
260  458.298,
261  466.558,
262  474.828,
263  483.088,
264  491.348,
265  499.618,
266  507.878,
267  516.138,
268  524.398,
269  532.668,
270  540.928,
271  HEZMAX};
272 
273  // count by ring - 16
274  for (int iringm16 = 0; iringm16 <= 13; ++iringm16) {
275  int iring = iringm16 + 16;
276  std::vector<float> depths;
277  unsigned int startingDepth = 1;
278  if (topology.mode() != HcalTopologyMode::SLHC) {
279  if (iring == 16) {
280  for (float ring16Depth : ring16Depths)
281  depths.emplace_back(ring16Depth);
282  startingDepth = 3;
283  } else if (iring == 17)
284  for (float ring17Depth : ring17Depths)
285  depths.emplace_back(ring17Depth);
286  else if (iring == 18)
287  for (float ring18Depth : ring18Depths)
288  depths.emplace_back(ring18Depth);
289  else if (iring == topology.lastHERing())
290  for (int i = 0; i < 3; ++i)
291  depths.emplace_back(tripleDepths[i]);
292  else if (iring >= topology.firstHETripleDepthRing())
293  for (float tripleDepth : tripleDepths)
294  depths.emplace_back(tripleDepth);
295  else
296  for (float normalDepth : normalDepths)
297  depths.emplace_back(normalDepth);
298  } else {
299  if (m_segmentation.size() >= (unsigned int)(iring)) {
300  int depth = m_segmentation[iring - 1][0];
301  if (iring == 16)
302  depths.emplace_back(ring16Depths[0]);
303  else if (iring == 17)
304  depths.emplace_back(ring17Depths[0]);
305  else if (iring == 18)
306  depths.emplace_back(ring18Depths[0]);
307  else
308  depths.emplace_back(layerDepths[depth]);
309  int layer = 1;
310  float lastDepth = depths[0];
311  for (unsigned int i = 1; i < m_segmentation[iring - 1].size(); ++i) {
312  if (depth != m_segmentation[iring - 1][i]) {
313  depth = m_segmentation[iring - 1][i];
314  layer = i;
315  if (layerDepths[depth] > lastDepth && (iring != 16 || depth > 3)) {
316  depths.emplace_back(layerDepths[depth]);
317  lastDepth = layerDepths[depth];
318  }
319  }
320  }
321  if (layer <= 17)
322  depths.emplace_back(HEZMAX);
323  if (iring == 16)
324  startingDepth = 3;
325  } else {
326  if (iring == 16) {
327  for (float ring16slhcDepth : ring16slhcDepths)
328  depths.emplace_back(ring16slhcDepth);
329  startingDepth = 3;
330  } else if (iring == 17)
331  for (float ring17slhcDepth : ring17slhcDepths)
332  depths.emplace_back(ring17slhcDepth);
333  else if (iring == 18)
334  for (float ring18slhcDepth : ring18slhcDepths)
335  depths.emplace_back(ring18slhcDepth);
336  else
337  for (float slhcDepth : slhcDepths)
338  depths.emplace_back(slhcDepth);
339  }
340  }
341  float etamin = etaBounds[iringm16];
342  float etamax = etaBounds[iringm16 + 1];
343  unsigned int ndepth = depths.size() - 1;
344  // topology.depthBinInformation(HcalEndcap, iring, ndepth, startingDepth);
345 #ifdef DebugLog
346  std::cout << "HERing " << iring << " eta " << etamin << ":" << etamax << " depths " << ndepth << ":"
347  << startingDepth;
348  for (unsigned int i = 0; i < depths.size(); ++i)
349  std::cout << ":" << depths[i];
350  std::cout << "\n";
351 #endif
352  for (unsigned int idepth = 0; idepth < ndepth; ++idepth) {
353  int depthIndex = (int)(idepth + startingDepth);
354  float zmin = depths[idepth];
355  float zmax = depths[idepth + 1];
356  if (depthIndex <= 7) {
357 #ifdef DebugLog
358  std::cout << "HE Depth " << idepth << ":" << depthIndex << " Z " << zmin << ":" << zmax << "\n";
359 #endif
360  int stepPhi = (iring >= topology.firstHEDoublePhiRing() ? 2 : 1);
361  int deltaPhi = (iring >= topology.firstHEDoublePhiRing() ? 10 : 5);
362  if (topology.mode() != HcalTopologyMode::SLHC && iring == topology.lastHERing() - 1 && idepth == ndepth - 1) {
363 #ifdef DebugLog
364  std::cout << "HE iEta " << iring << " Depth " << depthIndex << " Eta " << etamin << ":"
365  << etaBounds[iringm16 + 2] << std::endl;
366 #endif
368  iring, depthIndex, 1, stepPhi, deltaPhi, zmin, zmax, etamin, etaBounds[iringm16 + 2]));
369  } else {
370 #ifdef DebugLog
371  std::cout << "HE iEta " << iring << " Depth " << depthIndex << " Eta " << etamin << ":" << etamax
372  << std::endl;
373 #endif
375  iring, depthIndex, 1, stepPhi, deltaPhi, zmin, zmax, etamin, etamax));
376  }
377  }
378  }
379  }
380 
381  return result;
382 }
383 
384 // ----------> HE @ H2 <-----------
385 std::vector<HcalHardcodeGeometryLoader::HECellParameters> HcalHardcodeGeometryLoader::makeHECells_H2() {
386  const float HEZMIN_H2 = 400.715;
387  const float HEZMID_H2 = 436.285;
388  const float HEZMAX_H2 = 541.885;
389 
391  // eta, depth, firstPhi, stepPhi, deltaPhi, zMin, zMax, etaMin, etaMax
392  HcalHardcodeGeometryLoader::HECellParameters(16, 3, 1, 1, 5, 409.885, 462.685, 1.305, 1.373),
393  HcalHardcodeGeometryLoader::HECellParameters(17, 1, 1, 1, 5, HEZMIN_H2, 427.485, 1.373, 1.444),
394  HcalHardcodeGeometryLoader::HECellParameters(17, 2, 1, 1, 5, 427.485, 506.685, 1.373, 1.444),
395  HcalHardcodeGeometryLoader::HECellParameters(18, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.444, 1.521),
396  HcalHardcodeGeometryLoader::HECellParameters(18, 2, 1, 1, 5, HEZMID_H2, 524.285, 1.444, 1.521),
397  HcalHardcodeGeometryLoader::HECellParameters(19, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.521, 1.603),
398  HcalHardcodeGeometryLoader::HECellParameters(19, 2, 1, 1, 5, HEZMID_H2, HEZMAX_H2, 1.521, 1.603),
399  HcalHardcodeGeometryLoader::HECellParameters(20, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.603, 1.693),
400  HcalHardcodeGeometryLoader::HECellParameters(20, 2, 1, 1, 5, HEZMID_H2, HEZMAX_H2, 1.603, 1.693),
401  HcalHardcodeGeometryLoader::HECellParameters(21, 1, 1, 2, 5, HEZMIN_H2, HEZMID_H2, 1.693, 1.79),
402  HcalHardcodeGeometryLoader::HECellParameters(21, 2, 1, 2, 5, HEZMID_H2, HEZMAX_H2, 1.693, 1.79),
403  HcalHardcodeGeometryLoader::HECellParameters(22, 1, 1, 2, 10, HEZMIN_H2, HEZMID_H2, 1.79, 1.88),
404  HcalHardcodeGeometryLoader::HECellParameters(22, 2, 1, 2, 10, HEZMID_H2, HEZMAX_H2, 1.79, 1.88),
405  HcalHardcodeGeometryLoader::HECellParameters(23, 1, 1, 2, 10, HEZMIN_H2, HEZMID_H2, 1.88, 1.98),
406  HcalHardcodeGeometryLoader::HECellParameters(23, 2, 1, 2, 10, HEZMID_H2, HEZMAX_H2, 1.88, 1.98),
407  HcalHardcodeGeometryLoader::HECellParameters(24, 1, 1, 2, 10, HEZMIN_H2, 418.685, 1.98, 2.09),
408  HcalHardcodeGeometryLoader::HECellParameters(24, 2, 1, 2, 10, 418.685, HEZMID_H2, 1.98, 2.09),
409  HcalHardcodeGeometryLoader::HECellParameters(24, 3, 1, 2, 10, HEZMID_H2, HEZMAX_H2, 1.98, 2.09),
410  HcalHardcodeGeometryLoader::HECellParameters(25, 1, 1, 2, 10, HEZMIN_H2, 418.685, 2.09, 2.21),
411  HcalHardcodeGeometryLoader::HECellParameters(25, 2, 1, 2, 10, 418.685, HEZMID_H2, 2.09, 2.21),
412  HcalHardcodeGeometryLoader::HECellParameters(25, 3, 1, 2, 10, HEZMID_H2, HEZMAX_H2, 2.09, 2.21)};
414  std::vector<HcalHardcodeGeometryLoader::HECellParameters> result;
415  result.reserve(nCells);
416  for (int i = 0; i < nCells; ++i)
417  result.emplace_back(cells[i]);
418  return result;
419 }
420 
421 // ----------> HF <-----------
422 std::vector<HcalHardcodeGeometryLoader::HFCellParameters> HcalHardcodeGeometryLoader::makeHFCells() {
423  const float HFZMIN1 = 1115.;
424  const float HFZMIN2 = 1137.;
425  const float HFZMAX = 1280.1;
426 
428  // eta, depth, firstPhi, stepPhi, deltaPhi, zMin, zMax, rMin, rMax
429  HcalHardcodeGeometryLoader::HFCellParameters(29, 1, 1, 2, 10, HFZMIN1, HFZMAX, 116.2, 130.0),
430  HcalHardcodeGeometryLoader::HFCellParameters(29, 2, 1, 2, 10, HFZMIN2, HFZMAX, 116.2, 130.0),
431  HcalHardcodeGeometryLoader::HFCellParameters(30, 1, 1, 2, 10, HFZMIN1, HFZMAX, 97.5, 116.2),
432  HcalHardcodeGeometryLoader::HFCellParameters(30, 2, 1, 2, 10, HFZMIN2, HFZMAX, 97.5, 116.2),
433  HcalHardcodeGeometryLoader::HFCellParameters(31, 1, 1, 2, 10, HFZMIN1, HFZMAX, 81.8, 97.5),
434  HcalHardcodeGeometryLoader::HFCellParameters(31, 2, 1, 2, 10, HFZMIN2, HFZMAX, 81.8, 97.5),
435  HcalHardcodeGeometryLoader::HFCellParameters(32, 1, 1, 2, 10, HFZMIN1, HFZMAX, 68.6, 81.8),
436  HcalHardcodeGeometryLoader::HFCellParameters(32, 2, 1, 2, 10, HFZMIN2, HFZMAX, 68.6, 81.8),
437  HcalHardcodeGeometryLoader::HFCellParameters(33, 1, 1, 2, 10, HFZMIN1, HFZMAX, 57.6, 68.6),
438  HcalHardcodeGeometryLoader::HFCellParameters(33, 2, 1, 2, 10, HFZMIN2, HFZMAX, 57.6, 68.6),
439  HcalHardcodeGeometryLoader::HFCellParameters(34, 1, 1, 2, 10, HFZMIN1, HFZMAX, 48.3, 57.6),
440  HcalHardcodeGeometryLoader::HFCellParameters(34, 2, 1, 2, 10, HFZMIN2, HFZMAX, 48.3, 57.6),
441  HcalHardcodeGeometryLoader::HFCellParameters(35, 1, 1, 2, 10, HFZMIN1, HFZMAX, 40.6, 48.3),
442  HcalHardcodeGeometryLoader::HFCellParameters(35, 2, 1, 2, 10, HFZMIN2, HFZMAX, 40.6, 48.3),
443  HcalHardcodeGeometryLoader::HFCellParameters(36, 1, 1, 2, 10, HFZMIN1, HFZMAX, 34.0, 40.6),
444  HcalHardcodeGeometryLoader::HFCellParameters(36, 2, 1, 2, 10, HFZMIN2, HFZMAX, 34.0, 40.6),
445  HcalHardcodeGeometryLoader::HFCellParameters(37, 1, 1, 2, 10, HFZMIN1, HFZMAX, 28.6, 34.0),
446  HcalHardcodeGeometryLoader::HFCellParameters(37, 2, 1, 2, 10, HFZMIN2, HFZMAX, 28.6, 34.0),
447  HcalHardcodeGeometryLoader::HFCellParameters(38, 1, 1, 2, 10, HFZMIN1, HFZMAX, 24.0, 28.6),
448  HcalHardcodeGeometryLoader::HFCellParameters(38, 2, 1, 2, 10, HFZMIN2, HFZMAX, 24.0, 28.6),
449  HcalHardcodeGeometryLoader::HFCellParameters(39, 1, 1, 2, 10, HFZMIN1, HFZMAX, 20.1, 24.0),
450  HcalHardcodeGeometryLoader::HFCellParameters(39, 2, 1, 2, 10, HFZMIN2, HFZMAX, 20.1, 24.0),
451  HcalHardcodeGeometryLoader::HFCellParameters(40, 1, 3, 4, 20, HFZMIN1, HFZMAX, 16.9, 20.1),
452  HcalHardcodeGeometryLoader::HFCellParameters(40, 2, 3, 4, 20, HFZMIN2, HFZMAX, 16.9, 20.1),
453  HcalHardcodeGeometryLoader::HFCellParameters(41, 1, 3, 4, 20, HFZMIN1, HFZMAX, 12.5, 16.9),
454  HcalHardcodeGeometryLoader::HFCellParameters(41, 2, 3, 4, 20, HFZMIN2, HFZMAX, 12.5, 16.9)};
456  std::vector<HcalHardcodeGeometryLoader::HFCellParameters> result;
457  result.reserve(nCells);
458  for (int i = 0; i < nCells; ++i)
459  result.emplace_back(cells[i]);
460  return result;
461 }
462 
464  const std::vector<HcalHardcodeGeometryLoader::HECellParameters>& fCells) {
465  fGeometry->increaseReserve(fCells.size());
466  for (const auto& param : fCells) {
467  for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) {
468  for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical
469  HcalDetId hid(HcalEndcap, param.eta * iside, iPhi, param.depth);
470  float phiCenter = ((iPhi - 1) * 360. / MAX_HCAL_PHI + 0.5 * param.dphi) * DEGREE2RAD; // middle of the cell
471  float etaCenter = 0.5 * (param.etaMin + param.etaMax);
472 
473  float perp = param.zMin / sinh(etaCenter);
474  float x = perp * cos(phiCenter);
475  float y = perp * sin(phiCenter);
476  float z = iside * param.zMin;
477  // make cell geometry
478  GlobalPoint refPoint(x, y, z); // center of the cell's face
479  std::vector<CCGFloat> cellParams;
480  cellParams.reserve(5);
481  cellParams.emplace_back(0.5 * (param.etaMax - param.etaMin)); //deta_half
482  cellParams.emplace_back(0.5 * param.dphi * DEGREE2RAD); // dphi_half
483  cellParams.emplace_back(-0.5 * (param.zMax - param.zMin) / tanh(etaCenter)); // dz_half, "-" means edges in Z
484  cellParams.emplace_back(fabs(refPoint.eta()));
485  cellParams.emplace_back(fabs(refPoint.z()));
486 #ifdef DebugLog
487  std::cout << "HcalHardcodeGeometryLoader::fillHE-> " << hid << refPoint << '/' << cellParams[0] << '/'
488  << cellParams[1] << '/' << cellParams[2] << std::endl;
489 #endif
490  fGeometry->newCellFast(refPoint,
491  refPoint,
492  refPoint,
493  CaloCellGeometry::getParmPtr(cellParams, fGeometry->parMgr(), fGeometry->parVecVec()),
494  hid);
495  }
496  }
497  }
498 }
499 
501  const std::vector<HcalHardcodeGeometryLoader::HFCellParameters>& fCells) {
502  fGeometry->increaseReserve(fCells.size());
503  for (const auto& param : fCells) {
504  for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) {
505  for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical
506  HcalDetId hid(HcalForward, param.eta * iside, iPhi, param.depth);
507  float phiCenter = ((iPhi - 1) * 360. / MAX_HCAL_PHI + 0.5 * param.dphi) * DEGREE2RAD; // middle of the cell
508  GlobalPoint inner(param.rMin, 0, param.zMin);
509  GlobalPoint outer(param.rMax, 0, param.zMin);
510  float iEta = inner.eta();
511  float oEta = outer.eta();
512  float etaCenter = 0.5 * (iEta + oEta);
513 
514  float perp = param.zMin / sinh(etaCenter);
515  float x = perp * cos(phiCenter);
516  float y = perp * sin(phiCenter);
517  float z = iside * param.zMin;
518  // make cell geometry
519  GlobalPoint refPoint(x, y, z); // center of the cell's face
520  std::vector<CCGFloat> cellParams;
521  cellParams.reserve(5);
522  cellParams.emplace_back(0.5 * (iEta - oEta)); // deta_half
523  cellParams.emplace_back(0.5 * param.dphi * DEGREE2RAD); // dphi_half
524  cellParams.emplace_back(0.5 * (param.zMax - param.zMin)); // dz_half
525  cellParams.emplace_back(fabs(refPoint.eta()));
526  cellParams.emplace_back(fabs(refPoint.z()));
527 #ifdef DebugLog
528  std::cout << "HcalHardcodeGeometryLoader::fillHF-> " << hid << refPoint << '/' << cellParams[0] << '/'
529  << cellParams[1] << '/' << cellParams[2] << std::endl;
530 #endif
531  fGeometry->newCellFast(refPoint,
532  refPoint,
533  refPoint,
534  CaloCellGeometry::getParmPtr(cellParams, fGeometry->parMgr(), fGeometry->parVecVec()),
535  hid);
536  }
537  }
538  }
539 }
IdealObliquePrism.h
HcalHardcodeGeometryLoader::fillHE
void fillHE(HcalGeometry *fGeometry, const std::vector< HECellParameters > &fCells)
Definition: HcalHardcodeGeometryLoader.cc:463
HcalGeometry::increaseReserve
void increaseReserve(unsigned int extra)
Definition: HcalGeometry.cc:589
DDAxes::y
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
mps_fire.i
i
Definition: mps_fire.py:428
HcalHardcodeGeometryLoader::HBHOCellParameters
Definition: HcalHardcodeGeometryLoader.h:24
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
MessageLogger.h
HcalGeometry::k_NumberOfParametersPerShape
Definition: HcalGeometry.h:38
HcalDetId::iphi
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
HcalHardcodeGeometryLoader::makeHECells
std::vector< HECellParameters > makeHECells(const HcalTopology &topology)
Definition: HcalHardcodeGeometryLoader.cc:223
HcalHardcodeGeometryLoader::HECellParameters
Definition: HcalHardcodeGeometryLoader.h:55
HcalHardcodeGeometryLoader::HFCellParameters
Definition: HcalHardcodeGeometryLoader.h:86
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
HcalTopology
Definition: HcalTopology.h:26
cells
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ cells
Definition: CAHitNtupletGeneratorKernelsImpl.h:43
HcalDetId::depth
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
HcalGeometry::newCellFast
void newCellFast(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
Definition: HcalGeometry.cc:485
DDAxes::x
HcalBarrel
Definition: HcalAssistant.h:33
CaloSubdetectorGeometry::allocatePar
void allocatePar(ParVec::size_type n, unsigned int m)
Definition: CaloSubdetectorGeometry.cc:113
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
nCells
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ const uint32_t *__restrict__ nCells
Definition: CAHitNtupletGeneratorKernelsImpl.h:43
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
HcalGeometry.h
muonTiming_cfi.etamin
etamin
Definition: muonTiming_cfi.py:30
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
HcalGeometry::sortValidIds
void sortValidIds()
Definition: HcalGeometry.cc:591
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
HcalTopology::firstHEDoublePhiRing
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:101
HcalHardcodeGeometryLoader::makeHECells_H2
std::vector< HECellParameters > makeHECells_H2()
Definition: HcalHardcodeGeometryLoader.cc:385
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HcalHardcodeGeometryLoader::fillHBHO
void fillHBHO(HcalGeometry *fGeometry, const std::vector< HBHOCellParameters > &fCells, bool fHB)
Definition: HcalHardcodeGeometryLoader.cc:185
HcalHardcodeGeometryLoader::HcalHardcodeGeometryLoader
HcalHardcodeGeometryLoader()
Definition: HcalHardcodeGeometryLoader.cc:15
HcalHardcodeGeometryLoader::DEGREE2RAD
double DEGREE2RAD
Definition: HcalHardcodeGeometryLoader.h:128
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
SurfaceOrientation::inner
Definition: Surface.h:19
IdealZPrism.h
DDAxes::z
maxEta
double maxEta
Definition: PFJetBenchmarkAnalyzer.cc:76
HcalOuter
Definition: HcalAssistant.h:35
HcalHardcodeGeometryLoader::m_segmentation
std::vector< std::vector< int > > m_segmentation
Definition: HcalHardcodeGeometryLoader.h:130
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HcalTopologyMode::SLHC
Definition: HcalTopologyMode.h:26
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
HcalTopology::mode
HcalTopologyMode::Mode mode() const
Definition: HcalTopology.h:34
HcalTopologyMode::H2
Definition: HcalTopologyMode.h:26
HcalTopology::getHFSize
unsigned int getHFSize() const
Definition: HcalTopology.h:135
HcalDetId::ieta
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
ndepth
const int ndepth
Definition: CMTRawAnalyzer.h:422
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
HcalDetId
Definition: HcalDetId.h:12
createfilelist.int
int
Definition: createfilelist.py:10
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
HcalHardcodeGeometryLoader::MAX_HCAL_PHI
int MAX_HCAL_PHI
Definition: HcalHardcodeGeometryLoader.h:127
HcalTopology::lastHERing
int lastHERing() const
Definition: HcalTopology.h:94
HLT_FULL_cff.depths
depths
Definition: HLT_FULL_cff.py:13426
HcalHardcodeGeometryLoader::fillHF
void fillHF(HcalGeometry *fGeometry, const std::vector< HFCellParameters > &fCells)
Definition: HcalHardcodeGeometryLoader.cc:500
HcalForward
Definition: HcalAssistant.h:36
HcalHardcodeGeometryLoader::load
CaloSubdetectorGeometry * load(const HcalTopology &fTopology)
Definition: HcalHardcodeGeometryLoader.cc:23
HcalHardcodeGeometryLoader.h
CaloCellGeometry.h
CaloSubdetectorGeometry::cornersMgr
CaloCellGeometry::CornersMgr * cornersMgr()
Definition: CaloSubdetectorGeometry.h:82
HcalTopology::getDepthSegmentation
void getDepthSegmentation(const unsigned ring, std::vector< int > &readoutDepths, const bool flag=false) const
Definition: HcalTopology.cc:1065
HcalEndcap
Definition: HcalAssistant.h:34
HcalHardcodeGeometryLoader::makeHOCells
std::vector< HBHOCellParameters > makeHOCells()
Definition: HcalHardcodeGeometryLoader.cc:152
HcalTopology::firstHETripleDepthRing
int firstHETripleDepthRing() const
Definition: HcalTopology.h:104
muonTiming_cfi.etamax
etamax
Definition: muonTiming_cfi.py:23
HcalTopology::ncells
unsigned int ncells() const override
return a count of valid cells (for dense indexing use)
Definition: HcalTopology.cc:1687
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
CaloCellGeometry::getParmPtr
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:117
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
CaloSubdetectorGeometry::parMgr
ParMgr * parMgr()
Definition: CaloSubdetectorGeometry.h:86
HcalHardcodeGeometryLoader::makeHFCells
std::vector< HFCellParameters > makeHFCells()
Definition: HcalHardcodeGeometryLoader.cc:422
L1TowerCalibrationProducer_cfi.iEta
iEta
Definition: L1TowerCalibrationProducer_cfi.py:60
HcalHardcodeGeometryLoader::makeHBCells
std::vector< HBHOCellParameters > makeHBCells(const HcalTopology &topology)
Definition: HcalHardcodeGeometryLoader.cc:57
mps_fire.result
result
Definition: mps_fire.py:311
CaloSubdetectorGeometry::allocateCorners
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
Definition: CaloSubdetectorGeometry.cc:106
SurfaceOrientation::outer
Definition: Surface.h:19
CaloSubdetectorGeometry::parVecVec
ParVecVec & parVecVec()
Definition: CaloSubdetectorGeometry.h:89
HcalGeometry
Definition: HcalGeometry.h:17
HcalGeometry::numberOfShapes
unsigned int numberOfShapes() const override
Definition: HcalGeometry.h:42