CMS 3D CMS Logo

HGCalDDDConstants.cc
Go to the documentation of this file.
2 
15 
16 #include <algorithm>
17 #include <functional>
18 #include <numeric>
19 
20 //#define EDM_ML_DEBUG
21 using namespace geant_units::operators;
22 
24  : hgpar_(hp), sqrt3_(std::sqrt(3.0)) {
25  mode_ = hgpar_->mode_;
26 #ifdef EDM_ML_DEBUG
27  edm::LogVerbatim("HGCalGeom") << "Mode " << mode_;
28 #endif
32  hexside_ = 2.0 * rmax_ * tan30deg_;
33 #ifdef EDM_ML_DEBUG
34  edm::LogVerbatim("HGCalGeom") << "rmax_ " << rmax_ << ":" << hexside_ << " CellSize "
37 #endif
38  }
39  // init maps and constants
40  modHalf_ = 0;
42  for (int simreco = 0; simreco < 2; ++simreco) {
43  tot_layers_[simreco] = layersInit((bool)simreco);
44  max_modules_layer_[simreco].resize(tot_layers_[simreco] + 1);
45  for (unsigned int layer = 1; layer <= tot_layers_[simreco]; ++layer) {
46  max_modules_layer_[simreco][layer] = modulesInit(layer, (bool)simreco);
47  if (simreco == 1) {
48  modHalf_ += max_modules_layer_[simreco][layer];
50 #ifdef EDM_ML_DEBUG
51  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with " << max_modules_layer_[simreco][layer] << ":"
52  << modHalf_ << " modules in RECO";
53  } else {
54  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with " << max_modules_layer_[simreco][layer]
55  << " modules in SIM";
56 #endif
57  }
58  }
59 #ifdef EDM_ML_DEBUG
60  edm::LogVerbatim("HGCalGeom") << "SimReco " << simreco << " with " << tot_layers_[simreco] << " Layers";
61 #endif
62  }
63  tot_wafers_ = wafers();
64 
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants initialized for " << name << " with " << layers(false) << ":"
67  << layers(true) << " layers, " << wafers() << ":" << 2 * modHalf_
68  << " wafers with maximum " << maxWafersPerLayer_ << " per layer and "
69  << "maximum of " << maxCells(false) << ":" << maxCells(true) << " cells";
70 #endif
73  int wminT(9999999), wmaxT(-9999999), kount1(0), kount2(0);
74  for (unsigned int i = 0; i < getTrFormN(); ++i) {
75  int lay0 = getTrForm(i).lay;
76  int wmin(9999999), wmax(-9999999), kount(0);
77  for (int wafer = 0; wafer < sectors(); ++wafer) {
78  bool waferIn = waferInLayer(wafer, lay0, true);
80  int kndx = HGCalWaferIndex::waferIndex(lay0,
83  waferIn_[kndx] = waferIn;
84  }
85  if (waferIn) {
87  ? wafer
89  if (waferU < wmin)
90  wmin = waferU;
91  if (waferU > wmax)
92  wmax = waferU;
93  ++kount;
94  }
95  }
96  if (wminT > wmin)
97  wminT = wmin;
98  if (wmaxT < wmax)
99  wmaxT = wmax;
100  if (kount1 < kount)
101  kount1 = kount;
102  kount2 += kount;
103 #ifdef EDM_ML_DEBUG
104  int lay1 = getIndex(lay0, true).first;
105  edm::LogVerbatim("HGCalGeom") << "Index " << i << " Layer " << lay0 << ":" << lay1 << " Wafer " << wmin << ":"
106  << wmax << ":" << kount;
107 #endif
108  HGCWaferParam a1{{wmin, wmax, kount}};
109  waferLayer_[lay0] = a1;
110  }
111  waferMax_ = std::array<int, 4>{{wminT, wmaxT, kount1, kount2}};
112 #ifdef EDM_ML_DEBUG
113  edm::LogVerbatim("HGCalGeom") << "Overall wafer statistics: " << wminT << ":" << wmaxT << ":" << kount1 << ":"
114  << kount2;
115 #endif
116  }
117 }
118 
120 
121 std::pair<int, int> HGCalDDDConstants::assignCell(float x, float y, int lay, int subSec, bool reco) const {
122  const auto& index = getIndex(lay, reco);
123  if (index.first < 0)
124  return std::make_pair(-1, -1);
126  float xx = (reco) ? x : HGCalParameters::k_ScaleFromDDD * x;
127  float yy = (reco) ? y : HGCalParameters::k_ScaleFromDDD * y;
128 
129  // First the wafer
130  int wafer = cellHex(xx, yy, rmax_, hgpar_->waferPosX_, hgpar_->waferPosY_);
131  if (wafer < 0 || wafer >= (int)(hgpar_->waferTypeT_.size())) {
132  edm::LogWarning("HGCalGeom") << "Wafer no. out of bound for " << wafer << ":" << (hgpar_->waferTypeT_).size()
133  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
134  << " ***** ERROR *****";
135  return std::make_pair(-1, -1);
136  } else {
137  // Now the cell
138  xx -= hgpar_->waferPosX_[wafer];
139  yy -= hgpar_->waferPosY_[wafer];
140  if (hgpar_->waferTypeT_[wafer] == 1)
141  return std::make_pair(wafer,
142  cellHex(xx,
143  yy,
146  hgpar_->cellFineY_));
147  else
148  return std::make_pair(wafer,
149  cellHex(xx,
150  yy,
153  hgpar_->cellCoarseY_));
154  }
155  } else {
156  return std::make_pair(-1, -1);
157  }
158 }
159 
160 std::array<int, 5> HGCalDDDConstants::assignCellHex(float x, float y, int lay, bool reco) const {
161  int waferU(0), waferV(0), waferType(-1), cellU(0), cellV(0);
163  double xx = (reco) ? HGCalParameters::k_ScaleToDDD * x : x;
164  double yy = (reco) ? HGCalParameters::k_ScaleToDDD * y : y;
165  double wt(1.0);
166  waferFromPosition(xx, yy, lay, waferU, waferV, cellU, cellV, waferType, wt);
167  }
168  return std::array<int, 5>{{waferU, waferV, waferType, cellU, cellV}};
169 }
170 
171 std::array<int, 3> HGCalDDDConstants::assignCellTrap(float x, float y, float z, int layer, bool reco) const {
172  int irad(-1), iphi(-1), type(-1);
173  const auto& indx = getIndex(layer, reco);
174  if (indx.first < 0)
175  return std::array<int, 3>{{irad, iphi, type}};
176  double xx = (z > 0) ? x : -x;
177  double r = (reco ? std::sqrt(x * x + y * y) : HGCalParameters::k_ScaleFromDDD * std::sqrt(x * x + y * y));
178  double phi = (r == 0. ? 0. : std::atan2(y, xx));
179  if (phi < 0)
180  phi += (2.0 * M_PI);
181  type = hgpar_->scintType(layer);
182  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(), hgpar_->radiusLayer_[type].end(), r);
183  irad = (int)(ir - hgpar_->radiusLayer_[type].begin());
184  irad = std::clamp(irad, hgpar_->iradMinBH_[indx.first], hgpar_->iradMaxBH_[indx.first]);
185  iphi = 1 + (int)(phi / indx.second);
186 #ifdef EDM_ML_DEBUG
187  edm::LogVerbatim("HGCalGeom") << "assignCellTrap Input " << x << ":" << y << ":" << z << ":" << layer << ":" << reco
188  << " x|r " << xx << ":" << r << " phi " << phi << " o/p " << irad << ":" << iphi << ":"
189  << type;
190 #endif
191  return std::array<int, 3>{{irad, iphi, type}};
192 }
193 
194 std::pair<double, double> HGCalDDDConstants::cellEtaPhiTrap(int type, int irad) const {
195  double dr(0), df(0);
197  double r = 0.5 * ((hgpar_->radiusLayer_[type][irad - 1] + hgpar_->radiusLayer_[type][irad]));
198  dr = (hgpar_->radiusLayer_[type][irad] - hgpar_->radiusLayer_[type][irad - 1]);
199  df = r * hgpar_->cellSize_[type];
200  }
201  return std::make_pair(dr, df);
202 }
203 
204 bool HGCalDDDConstants::cellInLayer(int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const {
205  const auto& indx = getIndex(lay, true);
206  if (indx.first >= 0) {
210  ? locateCell(lay, waferU, waferV, cellU, cellV, reco, true, false)
211  : locateCell(cellU, lay, waferU, reco));
212  double rpos = sqrt(xy.first * xy.first + xy.second * xy.second);
213  return ((rpos >= hgpar_->rMinLayHex_[indx.first]) && (rpos <= hgpar_->rMaxLayHex_[indx.first]));
214  } else {
215  return true;
216  }
217  } else {
218  return false;
219  }
220 }
221 
222 double HGCalDDDConstants::cellThickness(int layer, int waferU, int waferV) const {
223  double thick(-1);
224  int type = waferType(layer, waferU, waferV, false);
225  if (type >= 0) {
227  thick = 10000.0 * hgpar_->cellThickness_[type]; // cm to micron
229  thick = 100.0 * (type + 1); // type = 1,2,3 for 100,200,300 micron
230  }
231  }
232  return thick;
233 }
234 
236  int indx =
238  : ((type == 1) ? 1 : 0));
239  double cell =
242  return cell;
243 }
244 
245 HGCalTypes::CellType HGCalDDDConstants::cellType(int type, int cellU, int cellV) const {
246  // type=0: in the middle; 1..6: the edges clocwise from bottom left;
247  // =11..16: the corners clockwise from bottom
248  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
249  if (cellU == 0) {
250  if (cellV == 0)
252  else if (cellV - cellU == N - 1)
254  else
256  } else if (cellV == 0) {
257  if (cellU - cellV == N)
259  else
261  } else if (cellU - cellV == N) {
262  if (cellU == 2 * N - 1)
264  else
266  } else if (cellU == 2 * N - 1) {
267  if (cellV == 2 * N - 1)
269  else
271  } else if (cellV == 2 * N - 1) {
272  if (cellV - cellU == N - 1)
274  else
276  } else if (cellV - cellU == N - 1) {
278  } else if ((cellU > 2 * N - 1) || (cellV > 2 * N - 1) || (cellV >= (cellU + N)) || (cellU > (cellV + N))) {
280  } else {
282  }
283 }
284 
285 double HGCalDDDConstants::distFromEdgeHex(double x, double y, double z) const {
286  // Assming the point is within a hexagonal plane of the wafer, calculate
287  // the shortest distance from the edge
288  if (z < 0)
289  x = -x;
290  double dist(0);
291  // Input x, y in Geant4 unit and transformed to CMSSW standard
295  int ll = layerIndex(getLayer(z, false), false);
296  xx -= hgpar_->xLayerHex_[ll];
297  yy -= hgpar_->yLayerHex_[ll];
298  }
299  int sizew = (int)(hgpar_->waferPosX_.size());
300  int wafer = sizew;
301  // Transform to the local coordinate frame of the wafer first
302  for (int k = 0; k < sizew; ++k) {
303  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
304  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
305  if ((dx <= rmax_) && (dy <= hexside_) && ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy)))) {
306  wafer = k;
307  xx -= hgpar_->waferPosX_[k];
308  yy -= hgpar_->waferPosY_[k];
309  break;
310  }
311  }
312  // Look at only one quarter (both x,y are positive)
313  if (wafer < sizew) {
314  if (std::abs(yy) < 0.5 * hexside_) {
315  dist = rmax_ - std::abs(xx);
316  } else {
317  dist = 0.5 * ((rmax_ - std::abs(xx)) - sqrt3_ * (std::abs(yy) - 0.5 * hexside_));
318  }
319  } else {
320  dist = 0;
321  }
323 #ifdef EDM_ML_DEBUG
324  edm::LogVerbatim("HGCalGeom") << "DistFromEdgeHex: Local " << xx << ":" << yy << " wafer " << wafer << " flag "
325  << (wafer < sizew) << " Distance " << rmax_ << ":" << (rmax_ - std::abs(xx)) << ":"
326  << (std::abs(yy) - 0.5 * hexside_) << ":" << 0.5 * hexside_ << ":" << dist;
327 #endif
328  return dist;
329 }
330 
331 double HGCalDDDConstants::distFromEdgeTrap(double x, double y, double z) const {
332  // Assming the point is within the eta-phi plane of the scintillator tile,
333  // calculate the shortest distance from the edge
334  int lay = getLayer(z, false);
335  double xx = (z < 0) ? -x : x;
336  int indx = layerIndex(lay, false);
337  double r = HGCalParameters::k_ScaleFromDDD * std::sqrt(x * x + y * y);
338  double phi = (r == 0. ? 0. : std::atan2(y, xx));
339  if (phi < 0)
340  phi += (2.0 * M_PI);
341  int type = hgpar_->scintType(lay);
342  double cell = hgpar_->scintCellSize(lay);
343  // Compare with the center of the tile find distances along R and also phi
344  // Take the smaller value
345  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(), hgpar_->radiusLayer_[type].end(), r);
346  int irad = (int)(ir - hgpar_->radiusLayer_[type].begin());
347  irad = std::clamp(irad, hgpar_->iradMinBH_[indx], hgpar_->iradMaxBH_[indx]);
348  int iphi = 1 + (int)(phi / cell);
349  double dphi = std::max(0.0, (0.5 * cell - std::abs(phi - (iphi - 0.5) * cell)));
350  double dist = std::min((r - hgpar_->radiusLayer_[type][irad - 1]), (hgpar_->radiusLayer_[type][irad] - r));
351 #ifdef EDM_ML_DEBUG
352  edm::LogVerbatim("HGCalGeom") << "DistFromEdgeTrap: Global " << x << ":" << y << ":" << z << " Layer " << lay
353  << " Index " << indx << ":" << type << " xx " << xx << " R " << r << ":" << irad << ":"
354  << hgpar_->radiusLayer_[type][irad - 1] << ":" << hgpar_->radiusLayer_[type][irad]
355  << " Phi " << phi << ":" << iphi << ":" << (iphi - 0.5) * cell << " cell " << cell
356  << " Dphi " << dphi << " Dist " << dist << ":" << r * dphi;
357 #endif
358  return HGCalParameters::k_ScaleToDDD * std::min(r * dphi, dist);
359 }
360 
361 int HGCalDDDConstants::getLayer(double z, bool reco) const {
362  // Get the layer # from the gloabl z coordinate
363  unsigned int k = 0;
365  const auto& zLayerHex = hgpar_->zLayerHex_;
366  auto itr = std::find_if(zLayerHex.begin() + 1, zLayerHex.end(), [&k, &zz, &zLayerHex](double zLayer) {
367  ++k;
368  return zz < 0.5 * (zLayerHex[k - 1] + zLayerHex[k]);
369  });
370  int lay = (itr == zLayerHex.end()) ? static_cast<int>(zLayerHex.size()) : k;
372  int indx = layerIndex(lay, false);
373  if (indx >= 0)
374  lay = hgpar_->layerGroupO_[indx];
375  } else {
376  lay += (hgpar_->firstLayer_ - 1);
377  }
378  return lay;
379 }
380 
381 HGCalParameters::hgtrap HGCalDDDConstants::getModule(unsigned int indx, bool hexType, bool reco) const {
383  if (hexType) {
384  if (indx >= hgpar_->waferTypeL_.size())
385  edm::LogWarning("HGCalGeom") << "Wafer no. out bound for index " << indx << ":" << (hgpar_->waferTypeL_).size()
386  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
387  << " ***** ERROR *****";
388  unsigned int type =
389  ((indx < hgpar_->waferTypeL_.size()) ? hgpar_->waferTypeL_[indx] - 1 : HGCSiliconDetId::HGCalCoarseThick);
390  mytr = hgpar_->getModule(type, reco);
391  } else {
392  mytr = hgpar_->getModule(indx, reco);
393  }
394  return mytr;
395 }
396 
397 std::vector<HGCalParameters::hgtrap> HGCalDDDConstants::getModules() const {
398  std::vector<HGCalParameters::hgtrap> mytrs;
399  for (unsigned int k = 0; k < hgpar_->moduleLayR_.size(); ++k)
400  mytrs.emplace_back(hgpar_->getModule(k, true));
401  return mytrs;
402 }
403 
404 int HGCalDDDConstants::getPhiBins(int lay) const {
405  return ((mode_ == HGCalGeometryMode::Trapezoid) ? hgpar_->scintCells(lay) : 0);
406 }
407 
408 std::pair<int, int> HGCalDDDConstants::getREtaRange(int lay) const {
409  int irmin(0), irmax(0);
411  int indx = layerIndex(lay, false);
412  if ((indx >= 0) && (indx < static_cast<int>(hgpar_->iradMinBH_.size()))) {
413  irmin = hgpar_->iradMinBH_[indx];
414  irmax = hgpar_->iradMaxBH_[indx];
415  }
416  }
417  return std::make_pair(irmin, irmax);
418 }
419 
420 std::vector<HGCalParameters::hgtrform> HGCalDDDConstants::getTrForms() const {
421  std::vector<HGCalParameters::hgtrform> mytrs;
422  for (unsigned int k = 0; k < hgpar_->trformIndex_.size(); ++k)
423  mytrs.emplace_back(hgpar_->getTrForm(k));
424  return mytrs;
425 }
426 
427 int HGCalDDDConstants::getTypeTrap(int layer) const {
428  // Get the module type for scinitllator
430  return hgpar_->scintType(layer);
431  } else {
432  return -1;
433  }
434 }
435 
436 int HGCalDDDConstants::getTypeHex(int layer, int waferU, int waferV) const {
437  // Get the module type for a silicon wafer
439  auto itr = hgpar_->typesInLayers_.find(HGCalWaferIndex::waferIndex(layer, waferU, waferV));
440  return ((itr == hgpar_->typesInLayers_.end() ? 2 : hgpar_->waferTypeL_[itr->second]));
441  } else {
442  return -1;
443  }
444 }
445 
446 bool HGCalDDDConstants::isHalfCell(int waferType, int cell) const {
447  if (waferType < 1 || cell < 0)
448  return false;
449  return waferType == 2 ? hgpar_->cellCoarseHalf_[cell] : hgpar_->cellFineHalf_[cell];
450 }
451 
452 bool HGCalDDDConstants::isValidHex(int lay, int mod, int cell, bool reco) const {
453  // Check validity for a layer|wafer|cell of pre-TDR version
454  bool result(false), resultMod(false);
455  int cellmax(0);
457  int32_t copyNumber = hgpar_->waferCopy_[mod];
458  result = ((lay > 0 && lay <= (int)(layers(reco))));
459  if (result) {
460  const int32_t lay_idx = reco ? (lay - 1) * 3 + 1 : lay;
461  const auto& the_modules = hgpar_->copiesInLayers_[lay_idx];
462  auto moditr = the_modules.find(copyNumber);
463  result = resultMod = (moditr != the_modules.end());
464 #ifdef EDM_ML_DEBUG
465  if (!result)
466  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":" << lay_idx << " Copy " << copyNumber
467  << ":" << mod << " Flag " << result;
468 #endif
469  if (result) {
470  if (moditr->second >= 0) {
471  if (mod >= (int)(hgpar_->waferTypeT_.size()))
472  edm::LogWarning("HGCalGeom") << "Module no. out of bound for " << mod << " to be compared with "
473  << (hgpar_->waferTypeT_).size() << " ***** ERROR *****";
474  cellmax = ((hgpar_->waferTypeT_[mod] - 1 == HGCSiliconDetId::HGCalFine) ? (int)(hgpar_->cellFineX_.size())
475  : (int)(hgpar_->cellCoarseX_.size()));
476  result = (cell >= 0 && cell <= cellmax);
477  } else {
478  result = isValidCell(lay_idx, mod, cell);
479  }
480  }
481  }
482  }
483 
484 #ifdef EDM_ML_DEBUG
485  if (!result)
486  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":"
487  << (lay > 0 && (lay <= (int)(layers(reco)))) << " Module " << mod << ":" << resultMod
488  << " Cell " << cell << ":" << cellmax << ":" << (cell >= 0 && cell <= cellmax) << ":"
489  << maxCells(reco);
490 #endif
491  return result;
492 }
493 
494 bool HGCalDDDConstants::isValidHex8(int layer, int modU, int modV, bool fullAndPart) const {
495  // Check validity for a layer|wafer|cell of post-TDR version
496  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
497  auto itr = hgpar_->typesInLayers_.find(indx);
498 #ifdef EDM_ML_DEBUG
499  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferType " << layer << ":" << modU << ":" << modV
500  << ":" << indx << " Test " << (itr != hgpar_->typesInLayers_.end());
501 #endif
502  if (itr == hgpar_->typesInLayers_.end())
503  return false;
504  auto jtr = waferIn_.find(indx);
505 #ifdef EDM_ML_DEBUG
506  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferIn " << jtr->first << ":" << jtr->second;
507 #endif
508  if (!(jtr->second))
509  return false;
510 
511  if (fullAndPart) {
512  auto ktr = hgpar_->waferTypes_.find(indx);
513  if (ktr != hgpar_->waferTypes_.end()) {
514  if (hgpar_->waferMaskMode_ > 0) {
515  if (ktr->second.first == HGCalTypes::WaferOut)
516  return false;
517  } else {
518  if (ktr->second.first < HGCalTypes::WaferCornerMin)
519  return false;
520  }
521  }
522  }
523  return true;
524 }
525 
526 bool HGCalDDDConstants::isValidHex8(int layer, int modU, int modV, int cellU, int cellV, bool fullAndPart) const {
527  // First check validity for a layer|wafer| of post TDR version
528  if (!isValidHex8(layer, modU, modV, fullAndPart))
529  return false;
530  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
531  auto itr = hgpar_->typesInLayers_.find(indx);
532  int type = hgpar_->waferTypeL_[itr->second];
533  int N = ((hgpar_->waferTypeL_[itr->second] == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_);
534 #ifdef EDM_ML_DEBUG
535  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:Cell " << cellU << ":" << cellV << ":" << N
536  << " Tests " << (cellU >= 0) << ":" << (cellU < 2 * N) << ":" << (cellV >= 0) << ":"
537  << (cellV < 2 * N) << ":" << ((cellV - cellU) < N) << ":" << ((cellU - cellV) <= N);
538 #endif
539  if ((cellU < 0) || (cellU >= 2 * N) || (cellV < 0) || (cellV >= 2 * N))
540  return false;
541  if (((cellV - cellU) >= N) || ((cellU - cellV) > N))
542  return false;
543 
544  return isValidCell8(layer, modU, modV, cellU, cellV, type);
545 }
546 
547 bool HGCalDDDConstants::isValidTrap(int layer, int irad, int iphi) const {
548  // Check validity for a layer|eta|phi of scintillator
549  const auto& indx = getIndex(layer, true);
550  if (indx.first < 0)
551  return false;
552  return ((irad >= hgpar_->iradMinBH_[indx.first]) && (irad <= hgpar_->iradMaxBH_[indx.first]) && (iphi > 0) &&
553  (iphi <= hgpar_->scintCells(layer)));
554 }
555 
556 int HGCalDDDConstants::lastLayer(bool reco) const { return (hgpar_->firstLayer_ + tot_layers_[(int)reco] - 1); }
557 
558 unsigned int HGCalDDDConstants::layers(bool reco) const { return tot_layers_[(int)reco]; }
559 
560 int HGCalDDDConstants::layerIndex(int lay, bool reco) const {
561  int ll = lay - hgpar_->firstLayer_;
562  if (ll < 0 || ll >= (int)(hgpar_->layerIndex_.size()))
563  return -1;
565  if (reco && ll >= (int)(hgpar_->depthIndex_.size()))
566  return -1;
567  return (reco ? hgpar_->depthLayerF_[ll] : hgpar_->layerIndex_[ll]);
568  } else {
569  return (hgpar_->layerIndex_[ll]);
570  }
571 }
572 
573 unsigned int HGCalDDDConstants::layersInit(bool reco) const {
574  return (reco ? hgpar_->depthIndex_.size() : hgpar_->layerIndex_.size());
575 }
576 
577 std::pair<float, float> HGCalDDDConstants::locateCell(int cell, int lay, int type, bool reco) const {
578  // type refers to wafer # for hexagon cell
579  float x(999999.), y(999999.);
580  const auto& index = getIndex(lay, reco);
581  int i = index.first;
582  if (i < 0)
583  return std::make_pair(x, y);
585  x = hgpar_->waferPosX_[type];
586  y = hgpar_->waferPosY_[type];
587 #ifdef EDM_ML_DEBUG
588  float x0(x), y0(y);
589 #endif
591  x += hgpar_->cellFineX_[cell];
592  y += hgpar_->cellFineY_[cell];
593  } else {
594  x += hgpar_->cellCoarseX_[cell];
595  y += hgpar_->cellCoarseY_[cell];
596  }
597 #ifdef EDM_ML_DEBUG
598  edm::LogVerbatim("HGCalGeom") << "LocateCell (Wafer) " << x0 << ":" << y0 << " Final " << x << ":" << y;
599 #endif
600  if (!reco) {
603  }
604  }
605  return std::make_pair(x, y);
606 }
607 
608 std::pair<float, float> HGCalDDDConstants::locateCell(
609  int lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool debug) const {
610  float x(0), y(0);
611  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
612  auto itr = hgpar_->typesInLayers_.find(indx);
613  int type = ((itr == hgpar_->typesInLayers_.end()) ? 2 : hgpar_->waferTypeL_[itr->second]);
614 #ifdef EDM_ML_DEBUG
615  if (debug)
616  edm::LogVerbatim("HGCalGeom") << "LocateCell " << lay << ":" << waferU << ":" << waferV << ":" << indx << ":"
617  << (itr == hgpar_->typesInLayers_.end()) << ":" << type;
618 #endif
619  int kndx = cellV * 100 + cellU;
620  if (type == 0) {
621  auto ktr = hgpar_->cellFineIndex_.find(kndx);
622  if (ktr != hgpar_->cellFineIndex_.end()) {
623  x = hgpar_->cellFineX_[ktr->second];
624  y = hgpar_->cellFineY_[ktr->second];
625  }
626 #ifdef EDM_ML_DEBUG
627  if (debug)
628  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
629  << (ktr != hgpar_->cellFineIndex_.end());
630 #endif
631  } else {
632  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
633  if (ktr != hgpar_->cellCoarseIndex_.end()) {
634  x = hgpar_->cellCoarseX_[ktr->second];
635  y = hgpar_->cellCoarseY_[ktr->second];
636  }
637 #ifdef EDM_ML_DEBUG
638  if (debug)
639  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
640  << (ktr != hgpar_->cellCoarseIndex_.end());
641 #endif
642  }
643  if (!reco) {
646  }
647  if (all) {
648  const auto& xy = waferPosition(lay, waferU, waferV, reco, debug);
649  x += xy.first;
650  y += xy.second;
651 #ifdef EDM_ML_DEBUG
652  if (debug)
653  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
654 #endif
655  }
656  return std::make_pair(x, y);
657 }
658 
659 std::pair<float, float> HGCalDDDConstants::locateCell(const HGCSiliconDetId& id, bool debug) const {
660  int lay(id.layer());
661  double r = 0.5 * (hgpar_->waferSize_ + hgpar_->sensorSeparation_);
662  double R = 2.0 * r / sqrt3_;
663  int ncells = (id.type() == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
664  int n2 = ncells / 2;
665  auto xyoff = geomTools_.shiftXY(hgpar_->layerCenter_[lay - 1], (2.0 * r));
666  double xpos = xyoff.first + ((-2 * id.waferU() + id.waferV()) * r);
667  double ypos = xyoff.second + (1.5 * id.waferV() * R);
668 #ifdef EDM_ML_DEBUG
669  if (debug)
670  edm::LogVerbatim("HGCalGeom") << "LocateCell " << id << " Lay " << lay << " r:R " << r << ":" << R << " N "
671  << ncells << ":" << n2 << " Off " << xyoff.first << ":" << xyoff.second << " Pos "
672  << xpos << ":" << ypos;
673 #endif
674  double R1 = hgpar_->waferSize_ / (3.0 * ncells);
675  double r1 = 0.5 * R1 * sqrt3_;
676  xpos += ((1.5 * (id.cellV() - ncells) + 1.0) * R1);
677  ypos += ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1);
678 #ifdef EDM_ML_DEBUG
679  if (debug)
680  edm::LogVerbatim("HGCalGeom") << "LocateCell r1:R1 " << r1 << ":" << R1 << " dx:dy "
681  << ((1.5 * (id.cellV() - ncells) + 1.0) * R1) << ":"
682  << ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1) << " Pos " << xpos << ":" << ypos;
683 #endif
684  return std::make_pair(xpos * id.zside(), ypos);
685 }
686 
687 std::pair<float, float> HGCalDDDConstants::locateCellHex(int cell, int wafer, bool reco) const {
688  float x(0), y(0);
689  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine) {
690  x = hgpar_->cellFineX_[cell];
691  y = hgpar_->cellFineY_[cell];
692  } else {
693  x = hgpar_->cellCoarseX_[cell];
694  y = hgpar_->cellCoarseY_[cell];
695  }
696  if (!reco) {
699  }
700  return std::make_pair(x, y);
701 }
702 
703 std::pair<float, float> HGCalDDDConstants::locateCellTrap(int lay, int irad, int iphi, bool reco) const {
704  float x(0), y(0);
705  const auto& indx = getIndex(lay, reco);
706  if (indx.first >= 0) {
707  int ir = std::abs(irad);
708  int type = hgpar_->scintType(lay);
709  double phi = (iphi - 0.5) * indx.second;
710  double z = hgpar_->zLayerHex_[indx.first];
711  double r = 0.5 * (hgpar_->radiusLayer_[type][ir - 1] + hgpar_->radiusLayer_[type][ir]);
712  std::pair<double, double> range = rangeR(z, true);
713 #ifdef EDM_ML_DEBUG
714  edm::LogVerbatim("HGCalGeom") << "locateCellTrap:: Input " << lay << ":" << irad << ":" << iphi << ":" << reco
715  << " IR " << ir << ":" << hgpar_->iradMinBH_[indx.first] << ":"
716  << hgpar_->iradMaxBH_[indx.first] << " Type " << type << " Z " << indx.first << ":"
717  << z << " phi " << phi << " R " << r << ":" << range.first << ":" << range.second;
718 #endif
719  r = std::max(range.first, std::min(r, range.second));
720  x = r * std::cos(phi);
721  y = r * std::sin(phi);
722  if (irad < 0)
723  x = -x;
724  }
725  if (!reco) {
728  }
729  return std::make_pair(x, y);
730 }
731 
732 bool HGCalDDDConstants::maskCell(const DetId& detId, int corners) const {
733  bool mask(false);
734  if (corners > 2 && corners <= (int)(HGCalParameters::k_CornerSize)) {
736  int N(0), layer(0), waferU(0), waferV(0), u(0), v(0);
737  if (detId.det() == DetId::Forward) {
738  HFNoseDetId id(detId);
739  N = getUVMax(id.type());
740  layer = id.layer();
741  waferU = id.waferU();
742  waferV = id.waferV();
743  u = id.cellU();
744  v = id.cellV();
745  } else {
746  HGCSiliconDetId id(detId);
747  N = getUVMax(id.type());
748  layer = id.layer();
749  waferU = id.waferU();
750  waferV = id.waferV();
751  u = id.cellU();
752  v = id.cellV();
753  }
754  int wl = HGCalWaferIndex::waferIndex(layer, waferU, waferV);
755  auto itr = hgpar_->waferTypes_.find(wl);
756 #ifdef EDM_ML_DEBUG
757  edm::LogVerbatim("HGCalGeom") << "MaskCell: Layer " << layer << " Wafer " << waferU << ":" << waferV << " Index "
758  << wl << ":" << (itr != hgpar_->waferTypes_.end());
759 #endif
760  if (itr != hgpar_->waferTypes_.end()) {
761  if ((itr->second).second <= HGCalWaferMask::k_OffsetRotation)
762  mask = HGCalWaferMask::maskCell(u, v, N, (itr->second).first, (itr->second).second, corners);
763  else
764  mask = !(HGCalWaferMask::goodCell(
765  u, v, N, (itr->second).first, ((itr->second).second - HGCalWaferMask::k_OffsetRotation)));
766  }
767  }
768  }
769  return mask;
770 }
771 
773  int cells(0);
774  for (unsigned int i = 0; i < layers(reco); ++i) {
775  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
776  if (cells < maxCells(lay, reco))
777  cells = maxCells(lay, reco);
778  }
779  return cells;
780 }
781 
782 int HGCalDDDConstants::maxCells(int lay, bool reco) const {
783  const auto& index = getIndex(lay, reco);
784  if (index.first < 0)
785  return 0;
787  unsigned int cells(0);
788  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
789  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
790  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine) ? (hgpar_->cellFineX_.size())
791  : (hgpar_->cellCoarseX_.size());
792  if (cell > cells)
793  cells = cell;
794  }
795  }
796  return (int)(cells);
798  int cells(0);
799  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
800  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
804  : hgpar_->waferTypeL_[itr->second]);
806  cells = std::max(cells, 3 * N * N);
807  }
808  }
809  return cells;
810  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
811  return hgpar_->scintCells(index.first + hgpar_->firstLayer_);
812  } else {
813  return 0;
814  }
815 }
816 
817 int HGCalDDDConstants::maxRows(int lay, bool reco) const {
818  int kymax(0);
819  const auto& index = getIndex(lay, reco);
820  int i = index.first;
821  if (i < 0)
822  return kymax;
824  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
826  int ky = ((hgpar_->waferCopy_[k]) / 100) % 100;
827  if (ky > kymax)
828  kymax = ky;
829  }
830  }
832  kymax = 1 + 2 * hgpar_->waferUVMaxLayer_[index.first];
833  }
834  return kymax;
835 }
836 
837 int HGCalDDDConstants::modifyUV(int uv, int type1, int type2) const {
838  // Modify u/v for transition of type1 to type2
839  return (((type1 == type2) || (type1 * type2 != 0)) ? uv : ((type1 == 0) ? (2 * uv + 1) / 3 : (3 * uv) / 2));
840 }
841 
842 int HGCalDDDConstants::modules(int lay, bool reco) const {
843  if (getIndex(lay, reco).first < 0)
844  return 0;
845  else
846  return max_modules_layer_[(int)reco][lay];
847 }
848 
849 int HGCalDDDConstants::modulesInit(int lay, bool reco) const {
850  int nmod(0);
851  const auto& index = getIndex(lay, reco);
852  if (index.first < 0)
853  return nmod;
855  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
856  if (waferInLayerTest(k, index.first, hgpar_->defineFull_))
857  ++nmod;
858  }
859  } else {
860  nmod = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
861  }
862  return nmod;
863 }
864 
865 double HGCalDDDConstants::mouseBite(bool reco) const {
867 }
868 
870  int cells(0);
871  unsigned int nlayer = (reco) ? hgpar_->depth_.size() : hgpar_->layer_.size();
872  for (unsigned k = 0; k < nlayer; ++k) {
873  std::vector<int> ncells = numberCells(((reco) ? hgpar_->depth_[k] : hgpar_->layer_[k]), reco);
874  cells = std::accumulate(ncells.begin(), ncells.end(), cells);
875  }
876  return cells;
877 }
878 
879 std::vector<int> HGCalDDDConstants::numberCells(int lay, bool reco) const {
880  const auto& index = getIndex(lay, reco);
881  int i = index.first;
882  std::vector<int> ncell;
883  if (i >= 0) {
885  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
887  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine)
888  ? (hgpar_->cellFineX_.size())
889  : (hgpar_->cellCoarseX_.size());
890  ncell.emplace_back((int)(cell));
891  }
892  }
893  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
894  int nphi = hgpar_->scintCells(lay);
895  for (int k = hgpar_->firstModule_[i]; k <= hgpar_->lastModule_[i]; ++k)
896  ncell.emplace_back(nphi);
897  } else {
898  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
899  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
900  int cell = numberCellsHexagon(lay,
903  true);
904  ncell.emplace_back(cell);
905  }
906  }
907  }
908  }
909  return ncell;
910 }
911 
913  if (wafer >= 0 && wafer < (int)(hgpar_->waferTypeT_.size())) {
914  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine)
915  return (int)(hgpar_->cellFineX_.size());
916  else
917  return (int)(hgpar_->cellCoarseX_.size());
918  } else {
919  return 0;
920  }
921 }
922 
923 int HGCalDDDConstants::numberCellsHexagon(int lay, int waferU, int waferV, bool flag) const {
924  auto itr = hgpar_->typesInLayers_.find(HGCalWaferIndex::waferIndex(lay, waferU, waferV));
925  int type =
927  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
928  if (flag)
929  return (3 * N * N);
930  else
931  return N;
932 }
933 
934 std::pair<double, double> HGCalDDDConstants::rangeR(double z, bool reco) const {
935  double rmin(0), rmax(0), zz(0);
936  if (hgpar_->detectorType_ > 0) {
938  if (hgpar_->detectorType_ <= 2) {
940  } else {
941  rmin = HGCalGeomTools::radius(
943  }
944  if ((hgpar_->detectorType_ == 2) && (zz >= hgpar_->zLayerHex_[hgpar_->firstMixedLayer_ - 1])) {
945  rmax = HGCalGeomTools::radius(
947  } else {
949  }
950  }
951  if (!reco) {
954  }
955 #ifdef EDM_ML_DEBUG
956  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << z << ":" << zz << " R " << rmin << ":" << rmax;
957 #endif
958  return std::make_pair(rmin, rmax);
959 }
960 
961 std::pair<double, double> HGCalDDDConstants::rangeRLayer(int lay, bool reco) const {
962  double rmin(0), rmax(0);
963  const auto& index = getIndex(lay, reco);
964  if (index.first >= 0 && index.first < static_cast<int>(hgpar_->rMinLayHex_.size())) {
965  rmin = hgpar_->rMinLayHex_[index.first];
966  rmax = hgpar_->rMaxLayHex_[index.first];
967  }
968  if (!reco) {
971  }
972 #ifdef EDM_ML_DEBUG
973  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << lay << ":" << index.first << " R " << rmin << ":"
974  << rmax;
975 #endif
976  return std::make_pair(rmin, rmax);
977 }
978 
979 std::pair<double, double> HGCalDDDConstants::rangeZ(bool reco) const {
980  double zmin = (hgpar_->zLayerHex_[0] - hgpar_->waferThick_);
981  double zmax = (hgpar_->zLayerHex_[hgpar_->zLayerHex_.size() - 1] + hgpar_->waferThick_);
982 #ifdef EDM_ML_DEBUG
983  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeZ: " << zmin << ":" << zmax << ":" << hgpar_->waferThick_;
984 #endif
985  if (!reco) {
988  }
989  return std::make_pair(zmin, zmax);
990 }
991 
992 std::pair<int, int> HGCalDDDConstants::rowColumnWafer(int wafer) const {
993  int row(0), col(0);
994  if (wafer < (int)(hgpar_->waferCopy_.size())) {
995  int copy = hgpar_->waferCopy_[wafer];
996  col = copy % 100;
997  if ((copy / 10000) % 10 != 0)
998  col = -col;
999  row = (copy / 100) % 100;
1000  if ((copy / 100000) % 10 != 0)
1001  row = -row;
1002  }
1003  return std::make_pair(row, col);
1004 }
1005 
1006 std::pair<int, int> HGCalDDDConstants::simToReco(int cell, int lay, int mod, bool half) const {
1008  return std::make_pair(cell, lay);
1009  } else {
1010  const auto& index = getIndex(lay, false);
1011  int i = index.first;
1012  if (i < 0) {
1013  edm::LogWarning("HGCalGeom") << "Wrong Layer # " << lay << " not in the list ***** ERROR *****";
1014  return std::make_pair(-1, -1);
1015  }
1016  if (mod >= (int)(hgpar_->waferTypeL_).size()) {
1017  edm::LogWarning("HGCalGeom") << "Invalid Wafer # " << mod << "should be < " << (hgpar_->waferTypeL_).size()
1018  << " ***** ERROR *****";
1019  return std::make_pair(-1, -1);
1020  }
1021  int depth(-1);
1022  int kx = cell;
1023  int type = hgpar_->waferTypeL_[mod];
1024  if (type == 1) {
1025  depth = hgpar_->layerGroup_[i];
1026  } else if (type == 2) {
1027  depth = hgpar_->layerGroupM_[i];
1028  } else {
1029  depth = hgpar_->layerGroupO_[i];
1030  }
1031  return std::make_pair(kx, depth);
1032  }
1033 }
1034 
1036  const int ncopies = hgpar_->waferCopy_.size();
1037  int wafer(ncopies);
1038  bool result(false);
1039  for (int k = 0; k < ncopies; ++k) {
1040  if (copy == hgpar_->waferCopy_[k]) {
1041  wafer = k;
1042  result = true;
1043  break;
1044  }
1045  }
1046  if (!result) {
1047  wafer = -1;
1048 #ifdef EDM_ML_DEBUG
1049  edm::LogVerbatim("HGCalGeom") << "Cannot find " << copy << " in a list of " << ncopies << " members";
1050  for (int k = 0; k < ncopies; ++k)
1051  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << hgpar_->waferCopy_[k];
1052 #endif
1053  }
1054 #ifdef EDM_ML_DEBUG
1055  edm::LogVerbatim("HGCalGeom") << "WaferFromCopy " << copy << ":" << wafer << ":" << result;
1056 #endif
1057  return wafer;
1058 }
1059 
1060 void HGCalDDDConstants::waferFromPosition(const double x, const double y, int& wafer, int& icell, int& celltyp) const {
1061  // Input x, y in Geant4 unit and transformed to CMSSW standard
1064  int size_ = (int)(hgpar_->waferCopy_.size());
1065  wafer = size_;
1066  for (int k = 0; k < size_; ++k) {
1067  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1068  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1069  if (dx <= rmax_ && dy <= hexside_) {
1070  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1071  wafer = k;
1072  celltyp = hgpar_->waferTypeT_[k];
1073  xx -= hgpar_->waferPosX_[k];
1074  yy -= hgpar_->waferPosY_[k];
1075  break;
1076  }
1077  }
1078  }
1079  if (wafer < size_) {
1080  if (celltyp - 1 == HGCSiliconDetId::HGCalFine)
1081  icell = cellHex(
1083  else
1084  icell = cellHex(xx,
1085  yy,
1088  hgpar_->cellCoarseY_);
1089  } else {
1090  wafer = -1;
1091 #ifdef EDM_ML_DEBUG
1092  edm::LogWarning("HGCalGeom") << "Cannot get wafer type corresponding to " << x << ":" << y << " " << xx << ":"
1093  << yy;
1094 #endif
1095  }
1096 #ifdef EDM_ML_DEBUG
1097  edm::LogVerbatim("HGCalGeom") << "Position " << x << ":" << y << " Wafer " << wafer << ":" << size_ << " XX " << xx
1098  << ":" << yy << " Cell " << icell << " Type " << celltyp;
1099 #endif
1100 }
1101 
1103  const double y,
1104  const int layer,
1105  int& waferU,
1106  int& waferV,
1107  int& cellU,
1108  int& cellV,
1109  int& celltype,
1110  double& wt,
1111  bool debug) const {
1112  int ll = layer - hgpar_->firstLayer_;
1115  waferU = waferV = 1 + hgpar_->waferUVMax_;
1116  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1117  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1118  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1119  if (dx <= rmax_ && dy <= hexside_) {
1120  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1123  auto itr = hgpar_->typesInLayers_.find(HGCalWaferIndex::waferIndex(layer, waferU, waferV));
1125  : hgpar_->waferTypeL_[itr->second]);
1126 #ifdef EDM_ML_DEBUG
1127  if (debug)
1128  edm::LogVerbatim("HGCalGeom") << "WaferFromPosition:: Input " << layer << ":" << ll << ":"
1129  << hgpar_->firstLayer_ << ":" << x << ":" << y << ":" << hgpar_->xLayerHex_[ll]
1130  << ":" << hgpar_->yLayerHex_[ll] << ":" << xx << ":" << yy << " compared with "
1131  << hgpar_->waferPosX_[k] << ":" << hgpar_->waferPosY_[k] << " difference " << dx
1132  << ":" << dy << ":" << dx * tan30deg_ << ":" << (hexside_ - dy)
1133  << " comparator " << rmax_ << ":" << hexside_ << " wafer " << waferU << ":"
1134  << waferV << ":" << celltype;
1135 #endif
1136  xx -= hgpar_->waferPosX_[k];
1137  yy -= hgpar_->waferPosY_[k];
1138  break;
1139  }
1140  }
1141  }
1142  if (std::abs(waferU) <= hgpar_->waferUVMax_) {
1143  cellHex(xx, yy, celltype, cellU, cellV, debug);
1144  wt = ((celltype < 2) ? (hgpar_->cellThickness_[celltype] / hgpar_->waferThick_) : 1.0);
1145  } else {
1146  cellU = cellV = 2 * hgpar_->nCellsFine_;
1147  wt = 1.0;
1148  celltype = -1;
1149  }
1150 #ifdef EDM_ML_DEBUG
1151  if (celltype < 0) {
1154  edm::LogVerbatim("HGCalGeom") << "waferFromPosition: Bad type for X " << x << ":" << x1 << ":" << xx << " Y " << y
1155  << ":" << y1 << ":" << yy << " Wafer " << waferU << ":" << waferV << " Cell " << cellU
1156  << ":" << cellV;
1157  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1158  double dx = std::abs(x1 - hgpar_->waferPosX_[k]);
1159  double dy = std::abs(y1 - hgpar_->waferPosY_[k]);
1160  edm::LogVerbatim("HGCalGeom") << "Wafer [" << k << "] Position (" << hgpar_->waferPosX_[k] << ", "
1161  << hgpar_->waferPosY_[k] << ") difference " << dx << ":" << dy << ":"
1162  << dx * tan30deg_ << ":" << hexside_ - dy << " Paramerers " << rmax_ << ":"
1163  << hexside_;
1164  }
1165  }
1166 #endif
1167 }
1168 
1169 bool HGCalDDDConstants::waferInLayer(int wafer, int lay, bool reco) const {
1170  const auto& indx = getIndex(lay, reco);
1171  if (indx.first < 0)
1172  return false;
1173  return waferInLayerTest(wafer, indx.first, hgpar_->defineFull_);
1174 }
1175 
1176 bool HGCalDDDConstants::waferFullInLayer(int wafer, int lay, bool reco) const {
1177  const auto& indx = getIndex(lay, reco);
1178  if (indx.first < 0)
1179  return false;
1180  return waferInLayerTest(wafer, indx.first, false);
1181 }
1182 
1183 std::pair<double, double> HGCalDDDConstants::waferParameters(bool reco) const {
1184  if (reco)
1185  return std::make_pair(rmax_, hexside_);
1186  else
1188 }
1189 
1190 std::pair<double, double> HGCalDDDConstants::waferPosition(int wafer, bool reco) const {
1191  double xx(0), yy(0);
1192  if (wafer >= 0 && wafer < (int)(hgpar_->waferPosX_.size())) {
1193  xx = hgpar_->waferPosX_[wafer];
1194  yy = hgpar_->waferPosY_[wafer];
1195  }
1196  if (!reco) {
1199  }
1200  return std::make_pair(xx, yy);
1201 }
1202 
1203 std::pair<double, double> HGCalDDDConstants::waferPosition(
1204  int lay, int waferU, int waferV, bool reco, bool debug) const {
1205  int ll = lay - hgpar_->firstLayer_;
1206  double x = hgpar_->xLayerHex_[ll];
1207  double y = hgpar_->yLayerHex_[ll];
1208 #ifdef EDM_ML_DEBUG
1209  if (debug)
1210  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Shift " << hgpar_->xLayerHex_[ll] << ":"
1211  << hgpar_->yLayerHex_[ll];
1212 #endif
1213  if (!reco) {
1216  }
1217 
1218  const auto& xy = waferPosition(waferU, waferV, reco);
1219  x += xy.first;
1220  y += xy.second;
1221 #ifdef EDM_ML_DEBUG
1222  if (debug)
1223  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
1224 #endif
1225  return std::make_pair(x, y);
1226 }
1227 
1228 int HGCalDDDConstants::waferType(DetId const& id, bool fromFile) const {
1229  int type(1);
1231  if (fromFile && (waferFileSize() > 0)) {
1232  int layer(0), waferU(0), waferV(0);
1233  if (id.det() != DetId::Forward) {
1234  HGCSiliconDetId hid(id);
1235  layer = hid.layer();
1236  waferU = hid.waferU();
1237  waferV = hid.waferV();
1238  } else {
1239  HFNoseDetId hid(id);
1240  layer = hid.layer();
1241  waferU = hid.waferU();
1242  waferV = hid.waferV();
1243  }
1244  auto itr = hgpar_->waferInfoMap_.find(HGCalWaferIndex::waferIndex(layer, waferU, waferV));
1245  if (itr != hgpar_->waferInfoMap_.end())
1246  type = (itr->second).type;
1247  } else {
1248  type = ((id.det() != DetId::Forward) ? HGCSiliconDetId(id).type() : HFNoseDetId(id).type());
1249  }
1251  type = waferTypeL(HGCalDetId(id).wafer()) - 1;
1252  }
1253  return type;
1254 }
1255 
1256 int HGCalDDDConstants::waferType(int layer, int waferU, int waferV, bool fromFile) const {
1259  if (fromFile && (waferFileSize() > 0)) {
1260  auto itr = hgpar_->waferInfoMap_.find(HGCalWaferIndex::waferIndex(layer, waferU, waferV));
1261  if (itr != hgpar_->waferInfoMap_.end())
1262  type = (itr->second).type;
1263  } else {
1264  auto itr = hgpar_->typesInLayers_.find(HGCalWaferIndex::waferIndex(layer, waferU, waferV));
1265  if (itr != hgpar_->typesInLayers_.end())
1266  type = hgpar_->waferTypeL_[itr->second];
1267  }
1269  if ((waferU >= 0) && (waferU < (int)(hgpar_->waferTypeL_.size())))
1270  type = (hgpar_->waferTypeL_[waferU] - 1);
1271  }
1272  return type;
1273 }
1274 
1275 std::tuple<int, int, int> HGCalDDDConstants::waferType(HGCSiliconDetId const& id, bool fromFile) const {
1276  const auto& index = HGCalWaferIndex::waferIndex(id.layer(), id.waferU(), id.waferV());
1277  int type(-1), part(-1), orient(-1);
1278  if (fromFile && (waferFileSize() > 0)) {
1279  auto itr = hgpar_->waferInfoMap_.find(index);
1280  if (itr != hgpar_->waferInfoMap_.end()) {
1281  type = (itr->second).type;
1282  part = (itr->second).part;
1283  orient = (itr->second).orient;
1284  }
1285  } else {
1286  auto ktr = hgpar_->typesInLayers_.find(index);
1287  if (ktr != hgpar_->typesInLayers_.end())
1288  type = hgpar_->waferTypeL_[ktr->second];
1289  auto itr = hgpar_->waferTypes_.find(index);
1290  if (itr != hgpar_->waferTypes_.end()) {
1291  if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
1292  orient = (itr->second).second;
1293  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1295  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1297  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1299  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1301  }
1302  } else {
1303  part = (itr->second).first;
1304  orient = ((itr->second).second - HGCalWaferMask::k_OffsetRotation);
1305  }
1306  } else {
1308  orient = 0;
1309  }
1310  }
1311  return std::make_tuple(type, part, orient);
1312 }
1313 
1315  int layer, int waferU, int waferV, bool fromFile, bool debug) const {
1316  int type(HGCalTypes::WaferOut), rotn(0);
1317  int wl = HGCalWaferIndex::waferIndex(layer, waferU, waferV);
1318  if (fromFile && (waferFileSize() > 0)) {
1319  auto itr = hgpar_->waferInfoMap_.find(wl);
1320  if (itr != hgpar_->waferInfoMap_.end()) {
1321  type = (itr->second).part;
1322  rotn = (itr->second).orient;
1323  }
1324  } else {
1325  auto itr = hgpar_->waferTypes_.find(wl);
1327  if (itr != hgpar_->waferTypes_.end()) {
1328  if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
1329  rotn = (itr->second).second;
1330  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1332  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1334  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1336  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1338  }
1339  } else {
1340  type = (itr->second).first;
1341  rotn = ((itr->second).second - HGCalWaferMask::k_OffsetRotation);
1342  }
1343  }
1344  }
1345  }
1346 #ifdef EDM_ML_DEBUG
1347  if (debug)
1348  edm::LogVerbatim("HGCalGeom") << "waferTypeRotation: Layer " << layer << " Wafer " << waferU << ":" << waferV
1349  << " Index " << std::hex << wl << std::dec << ":"
1350  << (itr != hgpar_->waferTypes_.end()) << " Type " << type << " Rotation " << rotn;
1351 #endif
1352  return std::make_pair(type, rotn);
1353 }
1354 
1355 bool HGCalDDDConstants::waferVirtual(int layer, int waferU, int waferV) const {
1356  bool type(false);
1358  int wl = HGCalWaferIndex::waferIndex(layer, waferU, waferV, false);
1359  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1361  int wl = HGCalWaferIndex::waferIndex(layer, waferU, 0, true);
1362  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1363  }
1364  return type;
1365 }
1366 
1367 double HGCalDDDConstants::waferZ(int lay, bool reco) const {
1368  const auto& index = getIndex(lay, reco);
1369  if (index.first < 0)
1370  return 0;
1371  else
1373 }
1374 
1376  int wafer(0);
1378  for (unsigned int i = 0; i < layers(true); ++i) {
1379  int lay = hgpar_->depth_[i];
1380  wafer += modules(lay, true);
1381  }
1382  } else {
1383  wafer = (int)(hgpar_->moduleLayR_.size());
1384  }
1385  return wafer;
1386 }
1387 
1388 int HGCalDDDConstants::wafers(int layer, int type) const {
1389  int wafer(0);
1391  auto itr = waferLayer_.find(layer);
1392  if (itr != waferLayer_.end()) {
1393  unsigned ity = (type > 0 && type <= 2) ? type : 0;
1394  wafer = (itr->second)[ity];
1395  }
1396  } else {
1397  const auto& index = getIndex(layer, true);
1398  wafer = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
1399  }
1400  return wafer;
1401 }
1402 
1404  double xx, double yy, const double& cellR, const std::vector<double>& posX, const std::vector<double>& posY) const {
1405  int num(0);
1406  const double tol(0.00001);
1407  double cellY = 2.0 * cellR * tan30deg_;
1408  for (unsigned int k = 0; k < posX.size(); ++k) {
1409  double dx = std::abs(xx - posX[k]);
1410  double dy = std::abs(yy - posY[k]);
1411  if (dx <= (cellR + tol) && dy <= (cellY + tol)) {
1412  double xmax = (dy <= 0.5 * cellY) ? cellR : (cellR - (dy - 0.5 * cellY) / tan30deg_);
1413  if (dx <= (xmax + tol)) {
1414  num = k;
1415  break;
1416  }
1417  }
1418  }
1419  return num;
1420 }
1421 
1422 void HGCalDDDConstants::cellHex(double xloc, double yloc, int cellType, int& cellU, int& cellV, bool debug) const {
1423  int N = (cellType == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1424  double Rc = 2 * rmax_ / (3 * N);
1425  double rc = 0.5 * Rc * sqrt3_;
1426  double v0 = ((xloc / Rc - 1.0) / 1.5);
1427  int cv0 = (v0 > 0) ? (N + (int)(v0 + 0.5)) : (N - (int)(-v0 + 0.5));
1428  double u0 = (0.5 * yloc / rc + 0.5 * cv0);
1429  int cu0 = (u0 > 0) ? (N / 2 + (int)(u0 + 0.5)) : (N / 2 - (int)(-u0 + 0.5));
1430  cu0 = std::max(0, std::min(cu0, 2 * N - 1));
1431  cv0 = std::max(0, std::min(cv0, 2 * N - 1));
1432  if (cv0 - cu0 >= N)
1433  cv0 = cu0 + N - 1;
1434 #ifdef EDM_ML_DEBUG
1435  if (debug)
1436  edm::LogVerbatim("HGCalGeom") << "cellHex: input " << xloc << ":" << yloc << ":" << cellType << " parameter " << rc
1437  << ":" << Rc << " u0 " << u0 << ":" << cu0 << " v0 " << v0 << ":" << cv0;
1438 #endif
1439  bool found(false);
1440  static const int shift[3] = {0, 1, -1};
1441  for (int i1 = 0; i1 < 3; ++i1) {
1442  cellU = cu0 + shift[i1];
1443  for (int i2 = 0; i2 < 3; ++i2) {
1444  cellV = cv0 + shift[i2];
1445  if (((cellV - cellU) < N) && ((cellU - cellV) <= N) && (cellU >= 0) && (cellV >= 0) && (cellU < 2 * N) &&
1446  (cellV < 2 * N)) {
1447  double xc = (1.5 * (cellV - N) + 1.0) * Rc;
1448  double yc = (2 * cellU - cellV - N) * rc;
1449  if ((std::abs(yloc - yc) <= rc) && (std::abs(xloc - xc) <= Rc) &&
1450  ((std::abs(xloc - xc) <= 0.5 * Rc) || (std::abs(yloc - yc) <= sqrt3_ * (Rc - std::abs(xloc - xc))))) {
1451 #ifdef EDM_ML_DEBUG
1452  if (debug)
1453  edm::LogVerbatim("HGCalGeom")
1454  << "cellHex: local " << xc << ":" << yc << " difference " << std::abs(xloc - xc) << ":"
1455  << std::abs(yloc - yc) << ":" << sqrt3_ * (Rc - std::abs(yloc - yc)) << " comparator " << rc << ":"
1456  << Rc << " (u,v) = (" << cellU << "," << cellV << ")";
1457 #endif
1458  found = true;
1459  break;
1460  }
1461  }
1462  }
1463  if (found)
1464  break;
1465  }
1466  if (!found) {
1467  cellU = cu0;
1468  cellV = cv0;
1469  }
1470 }
1471 
1472 std::pair<int, float> HGCalDDDConstants::getIndex(int lay, bool reco) const {
1473  int indx = layerIndex(lay, reco);
1474  if (indx < 0)
1475  return std::make_pair(-1, 0);
1476  float cell(0);
1478  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1479  } else {
1481  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1482  } else {
1483  cell = hgpar_->scintCellSize(lay);
1484  }
1485  }
1486  return std::make_pair(indx, cell);
1487 }
1488 
1489 bool HGCalDDDConstants::isValidCell(int lay, int wafer, int cell) const {
1490  // Calculate the position of the cell
1491  // Works for options HGCalHexagon/HGCalHexagonFull
1492  double x = hgpar_->waferPosX_[wafer];
1493  double y = hgpar_->waferPosY_[wafer];
1494  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine) {
1495  x += hgpar_->cellFineX_[cell];
1496  y += hgpar_->cellFineY_[cell];
1497  } else {
1498  x += hgpar_->cellCoarseX_[cell];
1499  y += hgpar_->cellCoarseY_[cell];
1500  }
1501  double rr = sqrt(x * x + y * y);
1502  bool result = ((rr >= hgpar_->rMinLayHex_[lay - 1]) && (rr <= hgpar_->rMaxLayHex_[lay - 1]) &&
1503  (wafer < (int)(hgpar_->waferPosX_.size())));
1504 #ifdef EDM_ML_DEBUG
1505  if (!result)
1506  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << wafer << ":" << cell << " Position " << x << ":" << y
1507  << ":" << rr << " Compare Limits " << hgpar_->rMinLayHex_[lay - 1] << ":"
1508  << hgpar_->rMaxLayHex_[lay - 1] << " Flag " << result;
1509 #endif
1510  return result;
1511 }
1512 
1513 bool HGCalDDDConstants::isValidCell8(int lay, int waferU, int waferV, int cellU, int cellV, int type) const {
1514  float x(0), y(0);
1515  int kndx = cellV * 100 + cellU;
1516  if (type == 0) {
1517  auto ktr = hgpar_->cellFineIndex_.find(kndx);
1518  if (ktr != hgpar_->cellFineIndex_.end()) {
1519  x = hgpar_->cellFineX_[ktr->second];
1520  y = hgpar_->cellFineY_[ktr->second];
1521  }
1522 #ifdef EDM_ML_DEBUG
1523  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1524  << (ktr != hgpar_->cellFineIndex_.end());
1525 #endif
1526  } else {
1527  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
1528  if (ktr != hgpar_->cellCoarseIndex_.end()) {
1529  x = hgpar_->cellCoarseX_[ktr->second];
1530  y = hgpar_->cellCoarseY_[ktr->second];
1531  }
1532 #ifdef EDM_ML_DEBUG
1533  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1534  << (ktr != hgpar_->cellCoarseIndex_.end());
1535 #endif
1536  }
1537  const auto& xy = waferPosition(lay, waferU, waferV, true, false);
1538  x += xy.first;
1539  y += xy.second;
1540 #ifdef EDM_ML_DEBUG
1541  edm::LogVerbatim("HGCalGeom") << "With wafer (" << waferU << "," << waferV << ") " << x << ":" << y;
1542 #endif
1543  double rr = sqrt(x * x + y * y);
1544  int ll = lay - hgpar_->firstLayer_;
1545  bool result = ((rr >= hgpar_->rMinLayHex_[ll]) && (rr <= hgpar_->rMaxLayHex_[ll]));
1546 #ifdef EDM_ML_DEBUG
1547  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << ll << ":" << waferU << ":" << waferV << ":" << cellU << ":"
1548  << cellV << " Position " << x << ":" << y << ":" << rr << " Compare Limits "
1549  << hgpar_->rMinLayHex_[ll] << ":" << hgpar_->rMaxLayHex_[ll] << " Flag " << result;
1550 #endif
1551  return result;
1552 }
1553 
1554 bool HGCalDDDConstants::waferInLayerTest(int wafer, int lay, bool full) const {
1555  bool flag = ((mode_ == HGCalGeometryMode::Hexagon) || (mode_ == HGCalGeometryMode::HexagonFull)) ? true : false;
1556  std::pair<int, int> corner = HGCalGeomTools::waferCorner(hgpar_->waferPosX_[wafer],
1557  hgpar_->waferPosY_[wafer],
1558  rmax_,
1559  hexside_,
1560  hgpar_->rMinLayHex_[lay],
1561  hgpar_->rMaxLayHex_[lay],
1562  flag);
1563  bool in = (full ? (corner.first > 0) : (corner.first == (int)(HGCalParameters::k_CornerSize)));
1564 #ifdef EDM_ML_DEBUG
1565  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " R-limits "
1566  << hgpar_->rMinLayHex_[lay] << ":" << hgpar_->rMaxLayHex_[lay] << " Corners "
1567  << corner.first << ":" << corner.second << " In " << in;
1568 #endif
1569  return in;
1570 }
1571 
1572 std::pair<double, double> HGCalDDDConstants::waferPosition(int waferU, int waferV, bool reco) const {
1573  double xx(0), yy(0);
1574  int indx = HGCalWaferIndex::waferIndex(0, waferU, waferV);
1575  auto itr = hgpar_->wafersInLayers_.find(indx);
1576  if (itr != hgpar_->wafersInLayers_.end()) {
1577  xx = hgpar_->waferPosX_[itr->second];
1578  yy = hgpar_->waferPosY_[itr->second];
1579  }
1580  if (!reco) {
1583  }
1584  return std::make_pair(xx, yy);
1585 }
1586 
1588 
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DDAxes::y
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
HGCalWaferIndex::waferV
static int32_t waferV(const int32_t index)
Definition: HGCalWaferIndex.cc:42
HGCalDDDConstants::tot_wafers_
int32_t tot_wafers_
Definition: HGCalDDDConstants.h:208
HGCalParameters::cellCoarseHalf_
std::vector< bool > cellCoarseHalf_
Definition: HGCalParameters.h:121
HGCalGeomTools::waferCorner
static std::pair< int32_t, int32_t > waferCorner(double xpos, double ypos, double r, double R, double rMin, double rMax, bool oldBug=false)
Definition: HGCalGeomTools.cc:219
V0Monitor_cff.v0
v0
Definition: V0Monitor_cff.py:7
mps_fire.i
i
Definition: mps_fire.py:355
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
HGCalDDDConstants::tan30deg_
constexpr static double tan30deg_
Definition: HGCalDDDConstants.h:204
HGCalParameters::moduleCellS_
std::vector< double > moduleCellS_
Definition: HGCalParameters.h:76
HGCalParameters::firstLayer_
int firstLayer_
Definition: HGCalParameters.h:166
MessageLogger.h
HGCScintillatorDetId.h
HGCalDDDConstants::waferFromPosition
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
Definition: HGCalDDDConstants.cc:1060
HGCalDDDConstants::maxWafersPerLayer_
int32_t maxWafersPerLayer_
Definition: HGCalDDDConstants.h:211
HGCalWaferMask::goodCell
static bool goodCell(int u, int v, int N, int type, int rotn)
Definition: HGCalWaferMask.cc:107
HGCalDDDConstants::cellHex
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
Definition: HGCalDDDConstants.cc:1403
HGCalDDDConstants::rangeZ
std::pair< double, double > rangeZ(bool reco) const
Definition: HGCalDDDConstants.cc:979
HGCalDDDConstants::sqrt3_
const double sqrt3_
Definition: HGCalDDDConstants.h:205
HGCalDDDConstants::modulesInit
int modulesInit(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:849
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
HGCalParameters::zLayerHex_
std::vector< double > zLayerHex_
Definition: HGCalParameters.h:106
HGCalDDDConstants::waferIn_
std::unordered_map< int32_t, bool > waferIn_
Definition: HGCalDDDConstants.h:214
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
HGCalDDDConstants::isValidCell
bool isValidCell(int layindex, int wafer, int cell) const
Definition: HGCalDDDConstants.cc:1489
LaserClient_cfi.wl
wl
Definition: LaserClient_cfi.py:46
HGCalParameters::moduleCellR_
std::vector< double > moduleCellR_
Definition: HGCalParameters.h:83
HGCalParameters::zFrontMin_
std::vector< double > zFrontMin_
Definition: HGCalParameters.h:133
HGCalDDDConstants::locateCellTrap
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco) const
Definition: HGCalDDDConstants.cc:703
HGCalParameters::getModule
hgtrap getModule(unsigned int k, bool reco) const
Definition: HGCalParameters.cc:35
min
T min(T a, T b)
Definition: MathUtil.h:58
HGCalDDDConstants::isValidHex
bool isValidHex(int lay, int mod, int cell, bool reco) const
Definition: HGCalDDDConstants.cc:452
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
HGCalWaferMask.h
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
HGCalParameters::rMaxLayHex_
std::vector< double > rMaxLayHex_
Definition: HGCalParameters.h:108
HGCalParameters::cellFineY_
std::vector< double > cellFineY_
Definition: HGCalParameters.h:115
HFNoseDetId::layer
int layer() const
get the layer #
Definition: HFNoseDetId.h:56
HGCalGeometryMode.h
HGCalDDDConstants::cellEtaPhiTrap
std::pair< double, double > cellEtaPhiTrap(int type, int irad) const
Definition: HGCalDDDConstants.cc:194
HGCalTypes::WaferThree
Definition: HGCalTypes.h:57
HGCalTypes::WaferFull
Definition: HGCalTypes.h:50
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
cuy.col
col
Definition: cuy.py:1010
HGCalDDDConstants::rangeRLayer
std::pair< double, double > rangeRLayer(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:961
HGCalDDDConstants::waferZ
double waferZ(int layer, bool reco) const
Definition: HGCalDDDConstants.cc:1367
HGCalDDDConstants::getREtaRange
std::pair< int, int > getREtaRange(int lay) const
Definition: HGCalDDDConstants.cc:408
HGCalParameters::k_CornerSize
static constexpr uint32_t k_CornerSize
Definition: HGCalParameters.h:38
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
HGCSiliconDetId.h
distTCMET_cfi.corner
corner
Definition: distTCMET_cfi.py:38
HGCalParameters::slopeTop_
std::vector< double > slopeTop_
Definition: HGCalParameters.h:162
HGCalDDDConstants::waferFullInLayer
bool waferFullInLayer(int wafer, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:1176
HGCalParameters::layerIndex_
std::vector< int > layerIndex_
Definition: HGCalParameters.h:98
HGCalDDDConstants::distFromEdgeTrap
double distFromEdgeTrap(double x, double y, double z) const
Definition: HGCalDDDConstants.cc:331
typelookup.h
HGCalParameters::yLayerHex_
std::vector< double > yLayerHex_
Definition: HGCalParameters.h:105
HGCalParameters::scintCellSize
double scintCellSize(const int layer) const
Definition: HGCalParameters.h:61
HGCalTypes::CellType::TopLeftEdge
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
HGCalParameters::nCellsCoarse_
int nCellsCoarse_
Definition: HGCalParameters.h:137
HGCalParameters::wafersInLayers_
wafer_map wafersInLayers_
Definition: HGCalParameters.h:170
HGCalParameters::waferSize_
double waferSize_
Definition: HGCalParameters.h:138
HGCalTypes::WaferOut
Definition: HGCalTypes.h:58
HGCalTypes::WaferCornerMin
static constexpr int32_t WaferCornerMin
Definition: HGCalTypes.h:61
HGCalGeomTools::shiftXY
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
Definition: HGCalGeomTools.cc:166
full
Definition: GenABIO.cc:168
DDAxes::x
HFNoseDetId.h
HGCalDDDConstants::assignCellHex
std::array< int, 5 > assignCellHex(float x, float y, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:160
HGCalDDDConstants::getPhiBins
int getPhiBins(int lay) const
Definition: HGCalDDDConstants.cc:404
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
geant_units::operators
Definition: GeantUnits.h:18
findQualityFiles.v
v
Definition: findQualityFiles.py:179
HGCalParameters::moduleLayR_
std::vector< int > moduleLayR_
Definition: HGCalParameters.h:77
HGCalDDDConstants::getTypeHex
int getTypeHex(int layer, int waferU, int waferV) const
Definition: HGCalDDDConstants.cc:436
HGCalDDDConstants::isHalfCell
bool isHalfCell(int waferType, int cell) const
Definition: HGCalDDDConstants.cc:446
HGCalParameters::waferUVMaxLayer_
std::vector< int > waferUVMaxLayer_
Definition: HGCalParameters.h:143
HGCalTypes::WaferFive
Definition: HGCalTypes.h:51
HFNoseDetId
Definition: HFNoseDetId.h:22
HGCalParameters::iradMaxBH_
std::vector< int > iradMaxBH_
Definition: HGCalParameters.h:158
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
HGCalDDDConstants::waferParameters
std::pair< double, double > waferParameters(bool reco) const
Definition: HGCalDDDConstants.cc:1183
HGCalTypes::CellType::TopRightEdge
HGCalDDDConstants::lastLayer
int lastLayer(bool reco) const
Definition: HGCalDDDConstants.cc:556
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
HGCalTypes::CellType::UndefinedType
dqmdumpme.first
first
Definition: dqmdumpme.py:55
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
HGCalDDDConstants::max_modules_layer_
Simrecovecs max_modules_layer_
Definition: HGCalDDDConstants.h:210
HGCSiliconDetId::HGCalCoarseThick
Definition: HGCSiliconDetId.h:24
HGCalDDDConstants::geomTools_
HGCalGeomTools geomTools_
Definition: HGCalDDDConstants.h:198
HGCalDDDConstants
Definition: HGCalDDDConstants.h:25
HGCalParameters::waferPosY_
std::vector< double > waferPosY_
Definition: HGCalParameters.h:113
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HGCalParameters::sensorSeparation_
double sensorSeparation_
Definition: HGCalParameters.h:140
HFNoseDetId::waferU
int waferU() const
Definition: HFNoseDetId.h:75
DetId
Definition: DetId.h:17
HGCalDDDConstants::waferTypeRotation
std::pair< int, int > waferTypeRotation(int layer, int waferU, int waferV, bool fromFile=false, bool debug=false) const
Definition: HGCalDDDConstants.cc:1314
HGCalDDDConstants::isValidHex8
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart=false) const
Definition: HGCalDDDConstants.cc:494
nphi
const int nphi
Definition: CMTRawAnalyzer.h:424
HGCalTypes::CellType::BottomCorner
HGCalGeomTools::k_fiveCorners
static const int k_fiveCorners
Definition: HGCalGeomTools.h:14
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
HGCalDDDConstants::waferType
int waferType(DetId const &id, bool fromFile=false) const
Definition: HGCalDDDConstants.cc:1228
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
debug
#define debug
Definition: HDRShower.cc:19
part
part
Definition: HCALResponse.h:20
HGCalGeometryMode::Trapezoid
Definition: HGCalGeometryMode.h:25
HGCalParameters::trformIndex_
std::vector< uint32_t > trformIndex_
Definition: HGCalParameters.h:84
HGCalDDDConstants::simToReco
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
Definition: HGCalDDDConstants.cc:1006
HGCalDDDConstants::isValidCell8
bool isValidCell8(int lay, int waferU, int waferV, int cellU, int cellV, int type) const
Definition: HGCalDDDConstants.cc:1513
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HGCalDDDConstants::mode_
HGCalGeometryMode::GeometryMode mode_
Definition: HGCalDDDConstants.h:207
HGCalWaferIndex.h
trackingPlots.hp
hp
Definition: trackingPlots.py:1246
HGCalParameters::radiusLayer_
std::vector< double > radiusLayer_[2]
Definition: HGCalParameters.h:156
HGCalParameters::cellFineHalf_
std::vector< bool > cellFineHalf_
Definition: HGCalParameters.h:117
HGCalDDDConstants::maxCells
int maxCells(bool reco) const
Definition: HGCalDDDConstants.cc:772
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
HGCalParameters::layerGroup_
std::vector< int > layerGroup_
Definition: HGCalParameters.h:99
HGCalParameters::radiusMixBoundary_
std::vector< double > radiusMixBoundary_
Definition: HGCalParameters.h:152
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HGCalParameters::waferPosX_
std::vector< double > waferPosX_
Definition: HGCalParameters.h:112
HGCalDDDConstants::waferInLayer
bool waferInLayer(int wafer, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:1169
vertices_cff.x
x
Definition: vertices_cff.py:29
HGCalParameters::waferUVMax_
int waferUVMax_
Definition: HGCalParameters.h:142
DDAxes::z
HGCalDDDConstants::HGCalDDDConstants
HGCalDDDConstants(const HGCalParameters *hp, const std::string &name)
Definition: HGCalDDDConstants.cc:23
HGCalWaferType.h
HGCalDDDConstants::layerIndex
int layerIndex(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:560
HGCalGeomTools::k_allCorners
static const int k_allCorners
Definition: HGCalGeomTools.h:13
N
#define N
Definition: blowfish.cc:9
HGCalParameters::rMinLayHex_
std::vector< double > rMinLayHex_
Definition: HGCalParameters.h:107
RecoTauValidation_cfi.posX
posX
Definition: RecoTauValidation_cfi.py:288
HGCalDDDConstants::waferFileSize
unsigned int waferFileSize() const
Definition: HGCalDDDConstants.h:131
HGCalDDDConstants::wafers
int wafers() const
Definition: HGCalDDDConstants.cc:1375
HGCalTypes::CellType
CellType
Definition: HGCalTypes.h:12
HGCalParameters::typesInLayers_
wafer_map typesInLayers_
Definition: HGCalParameters.h:171
HGCalParameters::getTrForm
hgtrform getTrForm(unsigned int k) const
Definition: HGCalParameters.cc:108
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HGCalParameters::waferCopy_
std::vector< int > waferCopy_
Definition: HGCalParameters.h:109
HGCalDDDConstants::rangeR
std::pair< double, double > rangeR(double z, bool reco) const
Definition: HGCalDDDConstants.cc:934
cuda_std::lower_bound
__host__ constexpr __device__ RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Definition: cudastdAlgorithm.h:27
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
HGCalParameters::iradMinBH_
std::vector< int > iradMinBH_
Definition: HGCalParameters.h:157
HGCalWaferIndex::waferU
static int32_t waferU(const int32_t index)
Definition: HGCalWaferIndex.cc:37
HGCalDDDConstants::assignCell
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
Definition: HGCalDDDConstants.cc:121
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
HGCSiliconDetId::HGCalFine
Definition: HGCSiliconDetId.h:24
HGCalDDDConstants::mouseBite
double mouseBite(bool reco) const
Definition: HGCalDDDConstants.cc:865
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalParameters::cellSize_
std::vector< double > cellSize_
Definition: HGCalParameters.h:69
edm::LogWarning
Definition: MessageLogger.h:141
HGCalParameters::mouseBite_
double mouseBite_
Definition: HGCalParameters.h:141
HGCalDDDConstants::cellInLayer
bool cellInLayer(int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:204
cms::cuda::wmin
V wmin
Definition: HistoContainer.h:136
HGCalParameters::nCellsFine_
int nCellsFine_
Definition: HGCalParameters.h:136
HGCalParameters::firstModule_
std::vector< int > firstModule_
Definition: HGCalParameters.h:160
HGCalDDDConstants::hexside_
double hexside_
Definition: HGCalDDDConstants.h:206
HFNoseDetId::type
int type() const
get the type
Definition: HFNoseDetId.h:50
HGCalDDDConstants::waferLayer_
std::map< int, HGCWaferParam > waferLayer_
Definition: HGCalDDDConstants.h:212
HGCalDDDConstants::modHalf_
int32_t modHalf_
Definition: HGCalDDDConstants.h:208
HGCalDDDConstants::numberCells
int numberCells(bool reco) const
Definition: HGCalDDDConstants.cc:869
HGCalParameters::depth_
std::vector< int > depth_
Definition: HGCalParameters.h:101
HGCalParameters::rMaxFront_
std::vector< double > rMaxFront_
Definition: HGCalParameters.h:164
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HGCalParameters::cellFineIndex_
wafer_map cellFineIndex_
Definition: HGCalParameters.h:116
HGCalDDDConstants::getIndex
std::pair< int, float > getIndex(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:1472
HGCalParameters::mode_
HGCalGeometryMode::GeometryMode mode_
Definition: HGCalParameters.h:131
GeantUnits.h
HGCalParameters::cellCoarseY_
std::vector< double > cellCoarseY_
Definition: HGCalParameters.h:119
cms::cuda::wmax
V V wmax
Definition: HistoContainer.h:136
HGCalGeometryMode::Hexagon8Full
Definition: HGCalGeometryMode.h:25
recoMuon::in
Definition: RecoMuonEnumerators.h:6
HGCalDDDConstants::layers
unsigned int layers(bool reco) const
Definition: HGCalDDDConstants.cc:558
HGCalParameters::scintType
int scintType(const int layer) const
Definition: HGCalParameters.h:62
createfilelist.int
int
Definition: createfilelist.py:10
HGCalParameters::scintCells
int scintCells(const int layer) const
Definition: HGCalParameters.h:60
HGCalParameters::layerGroupO_
std::vector< int > layerGroupO_
Definition: HGCalParameters.h:123
HGCalDDDConstants::getTrForms
std::vector< HGCalParameters::hgtrform > getTrForms() const
Definition: HGCalDDDConstants.cc:420
HGCalDDDConstants::getTypeTrap
int getTypeTrap(int layer) const
Definition: HGCalDDDConstants.cc:427
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
edm::LogVerbatim
Definition: MessageLogger.h:297
HGCalTypes::CellType::TopLeftCorner
HGCalDDDConstants::cellSizeHex
double cellSizeHex(int type) const
Definition: HGCalDDDConstants.cc:235
HGCalTypes::CellType::LeftEdge
PVValHelper::dy
Definition: PVValidationHelpers.h:49
HGCalParameters::layerGroupM_
std::vector< int > layerGroupM_
Definition: HGCalParameters.h:122
HGCalDDDConstants::cellThickness
double cellThickness(int layer, int waferU, int waferV) const
Definition: HGCalDDDConstants.cc:222
HGCalDDDConstants::sectors
int sectors() const
Definition: HGCalDDDConstants.h:108
HGCalParameters::waferR_
double waferR_
Definition: HGCalParameters.h:128
HGCalDDDConstants::isValidTrap
bool isValidTrap(int lay, int ieta, int iphi) const
Definition: HGCalDDDConstants.cc:547
HGCalDDDConstants::getUVMax
int getUVMax(int type) const
Definition: HGCalDDDConstants.h:69
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
HGCalParameters::waferThick_
double waferThick_
Definition: HGCalParameters.h:139
HGCalDDDConstants::rmax_
double rmax_
Definition: HGCalDDDConstants.h:206
HGCalParameters::hgtrform::lay
int lay
Definition: HGCalParameters.h:47
HGCalTypes::CellType::TopCorner
HGCalDDDConstants::rowColumnWafer
std::pair< int, int > rowColumnWafer(const int wafer) const
Definition: HGCalDDDConstants.cc:992
HGCalDDDConstants::waferVirtual
bool waferVirtual(int layer, int waferU, int waferV) const
Definition: HGCalDDDConstants.cc:1355
HGCalDDDConstants::getTrForm
HGCalParameters::hgtrform getTrForm(unsigned int k) const
Definition: HGCalDDDConstants.h:64
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
HGCalDDDConstants::getModules
std::vector< HGCalParameters::hgtrap > getModules() const
Definition: HGCalDDDConstants.cc:397
HGCalGeometryMode::Hexagon
Definition: HGCalGeometryMode.h:25
HGCalParameters::k_ScaleFromDDD
static constexpr double k_ScaleFromDDD
Definition: HGCalParameters.h:30
HGCalParameters::waferTypeT_
std::vector< int > waferTypeT_
Definition: HGCalParameters.h:111
HGCalDDDConstants::waferMax_
std::array< int, 4 > waferMax_
Definition: HGCalDDDConstants.h:213
HGCalTypes::CellType::BottomRightCorner
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HGCalDDDConstants::tot_layers_
std::array< uint32_t, 2 > tot_layers_
Definition: HGCalDDDConstants.h:209
HGCalDDDConstants::numberCellsHexagon
int numberCellsHexagon(int wafer) const
Definition: HGCalDDDConstants.cc:912
HGCalParameters
Definition: HGCalParameters.h:13
HGCalDDDConstants::assignCellTrap
std::array< int, 3 > assignCellTrap(float x, float y, float z, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:171
HGCalWaferMask::k_OffsetRotation
static const int k_OffsetRotation
Definition: HGCalWaferMask.h:31
HGCalParameters::k_ScaleToDDD
static constexpr double k_ScaleToDDD
Definition: HGCalParameters.h:31
DDAxes::phi
HGCalDetId
Definition: HGCalDetId.h:8
HGCalGeomTools.h
HGCalGeomTools::radius
static void radius(double zf, double zb, std::vector< double > const &zFront1, std::vector< double > const &rFront1, std::vector< double > const &slope1, std::vector< double > const &zFront2, std::vector< double > const &rFront2, std::vector< double > const &slope2, int flag, std::vector< double > &zz, std::vector< double > &rin, std::vector< double > &rout)
Definition: HGCalGeomTools.cc:11
HGCalGeometryMode::HexagonFull
Definition: HGCalGeometryMode.h:25
type
type
Definition: HCALResponse.h:21
HGCalParameters::detectorType_
int detectorType_
Definition: HGCalParameters.h:66
HGCalDetId.h
HGCalDDDConstants::cellType
HGCalTypes::CellType cellType(int type, int waferU, int waferV) const
Definition: HGCalDDDConstants.cc:245
std
Definition: JetResolutionObject.h:76
HGCalParameters::waferMaskMode_
int waferMaskMode_
Definition: HGCalParameters.h:173
HGCalDDDConstants::locateCellHex
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
Definition: HGCalDDDConstants.cc:687
HGCalTypes::CellType::BottomLeftCorner
HGCalParameters::waferInfoMap_
waferInfo_map waferInfoMap_
Definition: HGCalParameters.h:174
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
HGCalParameters::slopeMin_
std::vector< double > slopeMin_
Definition: HGCalParameters.h:132
HGCalParameters::depthIndex_
std::vector< int > depthIndex_
Definition: HGCalParameters.h:102
HGCalParameters::defineFull_
bool defineFull_
Definition: HGCalParameters.h:144
HGCalParameters::xLayerHex_
std::vector< double > xLayerHex_
Definition: HGCalParameters.h:104
HGCalTypes::CellType::RightEdge
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
HGCalGeomTools::k_threeCorners
static const int k_threeCorners
Definition: HGCalGeomTools.h:16
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
HGCalParameters::waferTypes_
waferT_map waferTypes_
Definition: HGCalParameters.h:172
HGCalTypes::CellType::BottomRightEdge
HGCalDDDConstants::waferPosition
std::pair< double, double > waferPosition(int wafer, bool reco) const
Definition: HGCalDDDConstants.cc:1190
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
HGCalTypes::WaferHalf
Definition: HGCalTypes.h:54
dt_dqm_sourceclient_common_cff.reco
reco
Definition: dt_dqm_sourceclient_common_cff.py:110
HGCalGeomTools::k_fourCorners
static const int k_fourCorners
Definition: HGCalGeomTools.h:15
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
HGCalParameters::layerCenter_
std::vector< int > layerCenter_
Definition: HGCalParameters.h:169
HGCalParameters::rMinFront_
std::vector< double > rMinFront_
Definition: HGCalParameters.h:134
HGCalDDDConstants::maxRows
int maxRows(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:817
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
HGCalParameters::lastModule_
std::vector< int > lastModule_
Definition: HGCalParameters.h:161
HGCalDDDConstants::modules
int modules(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:842
HGCSiliconDetId::type
int type() const
get the type
Definition: HGCSiliconDetId.h:51
HGCalParameters::cellFineX_
std::vector< double > cellFineX_
Definition: HGCalParameters.h:114
HGCSiliconDetId::waferU
int waferU() const
Definition: HGCSiliconDetId.h:76
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HGCalDDDConstants::distFromEdgeHex
double distFromEdgeHex(double x, double y, double z) const
Definition: HGCalDDDConstants.cc:285
HGCalWaferIndex::waferIndex
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
Definition: HGCalWaferIndex.cc:17
Exception.h
HGCalParameters::cellThickness_
std::vector< double > cellThickness_
Definition: HGCalParameters.h:145
HGCalParameters::firstMixedLayer_
int firstMixedLayer_
Definition: HGCalParameters.h:167
HGCalDDDConstants::getLayer
int getLayer(double z, bool reco) const
Definition: HGCalDDDConstants.cc:361
HGCalTypes::CellType::CentralType
HGCalGeometryMode::Hexagon8
Definition: HGCalGeometryMode.h:25
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HGCalDDDConstants::waferTypeL
int waferTypeL(int wafer) const
Definition: HGCalDDDConstants.h:173
HGCalParameters::waferTypeL_
std::vector< int > waferTypeL_
Definition: HGCalParameters.h:110
HGCalParameters::cellCoarseX_
std::vector< double > cellCoarseX_
Definition: HGCalParameters.h:118
HGCalDDDConstants::~HGCalDDDConstants
~HGCalDDDConstants()
Definition: HGCalDDDConstants.cc:119
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCalDDDConstants.h
HGCalParameters::layer_
std::vector< int > layer_
Definition: HGCalParameters.h:97
HGCalDDDConstants::getTrFormN
unsigned int getTrFormN() const
Definition: HGCalDDDConstants.h:65
HFNoseDetId::waferV
int waferV() const
Definition: HFNoseDetId.h:78
HGCalDDDConstants::layersInit
unsigned int layersInit(bool reco) const
Definition: HGCalDDDConstants.cc:573
HGCalDDDConstants::locateCell
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
Definition: HGCalDDDConstants.cc:577
HGCalParameters::cellCoarseIndex_
wafer_map cellCoarseIndex_
Definition: HGCalParameters.h:120
DetId::Forward
Definition: DetId.h:30
HGCalParameters::depthLayerF_
std::vector< int > depthLayerF_
Definition: HGCalParameters.h:103
HGCalParameters::zFrontTop_
std::vector< double > zFrontTop_
Definition: HGCalParameters.h:163
HGCalParameters::hgtrap
Definition: HGCalParameters.h:41
HGCalDDDConstants::modifyUV
int modifyUV(int uv, int type1, int type2) const
Definition: HGCalDDDConstants.cc:837
dttmaxenums::R
Definition: DTTMax.h:29
HGCalDDDConstants::waferFromCopy
int waferFromCopy(int copy) const
Definition: HGCalDDDConstants.cc:1035
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
PVValHelper::dx
Definition: PVValidationHelpers.h:48
HGCalDDDConstants::hgpar_
const HGCalParameters * hgpar_
Definition: HGCalDDDConstants.h:203
HGCalDDDConstants::maskCell
bool maskCell(const DetId &id, int corners) const
Definition: HGCalDDDConstants.cc:732
HGCalWaferMask::maskCell
static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)
Definition: HGCalWaferMask.cc:10
HGCalTypes::CellType::BottomLeftEdge
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
RecoTauValidation_cfi.posY
posY
Definition: RecoTauValidation_cfi.py:289
HGCalDDDConstants::HGCWaferParam
std::array< int, 3 > HGCWaferParam
Definition: HGCalDDDConstants.h:202
HGCSiliconDetId::waferV
int waferV() const
Definition: HGCSiliconDetId.h:77
HGCalDDDConstants::waferInLayerTest
bool waferInLayerTest(int wafer, int lay, bool full) const
Definition: HGCalDDDConstants.cc:1554
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
HGCalTypes::CellType::TopRightCorner
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HGCSiliconDetId::layer
int layer() const
get the layer #
Definition: HGCSiliconDetId.h:57
HGCalDDDConstants::getModule
HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const
Definition: HGCalDDDConstants.cc:381
HGCalParameters::copiesInLayers_
layer_map copiesInLayers_
Definition: HGCalParameters.h:135