CMS 3D CMS Logo

HGCalGeometry.cc
Go to the documentation of this file.
1 /* for High Granularity Calorimeter
2  * This geometry is essentially driven by topology,
3  * which is thus encapsulated in this class.
4  * This makes this geometry not suitable to be loaded
5  * by regular CaloGeometryLoader<T>
6  */
15 
16 #include <cmath>
17 
18 #include <Math/Transform3D.h>
19 #include <Math/EulerAngles.h>
20 
22 typedef std::vector<float> ParmVec;
23 
24 //#define EDM_ML_DEBUG
25 
27  : m_topology(topology_),
28  m_validGeomIds(topology_.totalGeomModules()),
29  m_det(topology_.detector()),
30  m_subdet(topology_.subDetector()),
31  twoBysqrt3_(2.0 / std::sqrt(3.0)) {
32  if (m_det == DetId::HGCalHSc) {
33  m_cellVec2 = CellVec2(topology_.totalGeomModules());
34  } else {
35  m_cellVec = CellVec(topology_.totalGeomModules());
36  }
38 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("HGCalGeom") << "Expected total # of Geometry Modules " << m_topology.totalGeomModules();
40 #endif
41 }
42 
44 
46 
48 
49 void HGCalGeometry::localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref) {
50  if (m_det == DetId::HGCalHSc) {
51  FlatTrd::localCorners(lc, pv, ref);
52  } else {
53  FlatHexagon::localCorners(lc, pv, ref);
54  }
55 }
56 
58  const GlobalPoint& f1, const GlobalPoint& f2, const GlobalPoint& f3, const CCGFloat* parm, const DetId& detId) {
59  DetId geomId = getGeometryDetId(detId);
60  int cells(0);
62  if (m_topology.waferHexagon6()) {
64 #ifdef EDM_ML_DEBUG
65  edm::LogVerbatim("HGCalGeom") << "NewCell " << HGCalDetId(detId) << " GEOM " << HGCalDetId(geomId);
66 #endif
67  } else if (m_topology.tileTrapezoid()) {
68  cells = 1;
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("HGCalGeom") << "NewCell " << HGCScintillatorDetId(detId) << " GEOM "
71  << HGCScintillatorDetId(geomId);
72 #endif
73  } else {
74  cells = m_topology.dddConstants().numberCellsHexagon(id.iLay, id.iSec1, id.iSec2, false);
75 #ifdef EDM_ML_DEBUG
76  edm::LogVerbatim("HGCalGeom") << "NewCell " << HGCSiliconDetId(detId) << " GEOM " << HGCSiliconDetId(geomId);
77 #endif
78  }
79  const uint32_t cellIndex(m_topology.detId2denseGeomId(geomId));
80 
81  if (m_det == DetId::HGCalHSc) {
82  m_cellVec2.at(cellIndex) = FlatTrd(cornersMgr(), f1, f2, f3, parm);
83  } else {
84  m_cellVec.at(cellIndex) = FlatHexagon(cornersMgr(), f1, f2, f3, parm);
85  }
86  m_validGeomIds.at(cellIndex) = geomId;
87 
88 #ifdef EDM_ML_DEBUG
89  edm::LogVerbatim("HGCalGeom") << "Store for DetId " << std::hex << detId.rawId() << " GeomId " << geomId.rawId()
90  << std::dec << " Index " << cellIndex << " cells " << cells;
91  unsigned int nOld = m_validIds.size();
92 #endif
93  if (m_topology.waferHexagon6()) {
94  for (int cell = 0; cell < cells; ++cell) {
95  id.iCell1 = cell;
96  DetId idc = m_topology.encode(id);
97  if (m_topology.valid(idc)) {
98  m_validIds.emplace_back(idc);
99 #ifdef EDM_ML_DEBUG
100  edm::LogVerbatim("HGCalGeom") << "Valid Id [" << cell << "] " << HGCalDetId(idc);
101 #endif
102  }
103  }
104  } else if (m_topology.tileTrapezoid()) {
105  DetId idc = m_topology.encode(id);
106  if (m_topology.valid(idc)) {
107  m_validIds.emplace_back(idc);
108 #ifdef EDM_ML_DEBUG
109  edm::LogVerbatim("HGCalGeom") << "Valid Id [0] " << HGCScintillatorDetId(idc);
110 #endif
111  } else {
112  edm::LogWarning("HGCalGeom") << "Check " << HGCScintillatorDetId(idc) << " from " << HGCScintillatorDetId(detId)
113  << " ERROR ???";
114  }
115  } else {
116 #ifdef EDM_ML_DEBUG
117  unsigned int cellAll(0), cellSelect(0);
118 #endif
119  for (int u = 0; u < 2 * cells; ++u) {
120  for (int v = 0; v < 2 * cells; ++v) {
121  if (((v - u) < cells) && (u - v) <= cells) {
122  id.iCell1 = u;
123  id.iCell2 = v;
124  DetId idc = m_topology.encode(id);
125 #ifdef EDM_ML_DEBUG
126  ++cellAll;
127 #endif
128  if (m_topology.dddConstants().cellInLayer(id.iSec1, id.iSec2, u, v, id.iLay, true)) {
129  m_validIds.emplace_back(idc);
130 #ifdef EDM_ML_DEBUG
131  ++cellSelect;
132  edm::LogVerbatim("HGCalGeom") << "Valid Id [" << u << ", " << v << "] " << HGCSiliconDetId(idc);
133 #endif
134  }
135  }
136  }
137  }
138 #ifdef EDM_ML_DEBUG
139  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry keeps " << cellSelect << " out of " << cellAll << " for wafer "
140  << id.iSec1 << ":" << id.iSec2 << " in "
141  << " layer " << id.iLay;
142 #endif
143  }
144 #ifdef EDM_ML_DEBUG
145  if (m_det == DetId::HGCalHSc) {
146  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry::newCell-> [" << cellIndex << "]"
147  << " front:" << f1.x() << '/' << f1.y() << '/' << f1.z() << " back:" << f2.x() << '/'
148  << f2.y() << '/' << f2.z() << " eta|phi " << m_cellVec2[cellIndex].etaPos() << ":"
149  << m_cellVec2[cellIndex].phiPos();
150  } else {
151  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry::newCell-> [" << cellIndex << "]"
152  << " front:" << f1.x() << '/' << f1.y() << '/' << f1.z() << " back:" << f2.x() << '/'
153  << f2.y() << '/' << f2.z() << " eta|phi " << m_cellVec[cellIndex].etaPos() << ":"
154  << m_cellVec[cellIndex].phiPos();
155  }
156  unsigned int nNew = m_validIds.size();
157  if (m_topology.waferHexagon6()) {
158  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCalDetId(detId) << " with valid DetId from " << nOld << " to " << nNew;
159  } else if (m_topology.tileTrapezoid()) {
160  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCScintillatorDetId(detId) << " with valid DetId from " << nOld
161  << " to " << nNew;
162  } else if (m_topology.isHFNose()) {
163  edm::LogVerbatim("HGCalGeom") << "ID: " << HFNoseDetId(detId) << " with valid DetId from " << nOld << " to "
164  << nNew;
165  } else {
166  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCSiliconDetId(detId) << " with valid DetId from " << nOld << " to "
167  << nNew;
168  }
169  edm::LogVerbatim("HGCalGeom") << "Cell[" << cellIndex << "] " << std::hex << geomId.rawId() << ":"
170  << m_validGeomIds[cellIndex].rawId() << std::dec;
171 #endif
172 }
173 
174 std::shared_ptr<const CaloCellGeometry> HGCalGeometry::getGeometry(const DetId& detId) const {
175  if (detId == DetId())
176  return nullptr; // nothing to get
177  DetId geomId = getGeometryDetId(detId);
178  const uint32_t cellIndex(m_topology.detId2denseGeomId(geomId));
179  const GlobalPoint pos = (detId != geomId) ? getPosition(detId) : GlobalPoint();
180  return cellGeomPtr(cellIndex, pos);
181 }
182 
183 bool HGCalGeometry::present(const DetId& detId) const {
184  if (detId == DetId())
185  return false;
186  DetId geomId = getGeometryDetId(detId);
187  const uint32_t index(m_topology.detId2denseGeomId(geomId));
188  return (nullptr != getGeometryRawPtr(index));
189 }
190 
192  unsigned int cellIndex = indexFor(detid);
193  GlobalPoint glob;
194  unsigned int maxSize = (m_topology.tileTrapezoid() ? m_cellVec2.size() : m_cellVec.size());
195  if (cellIndex < maxSize) {
197  std::pair<float, float> xy;
198  if (m_topology.waferHexagon6()) {
199  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
200  const HepGeom::Point3D<float> lcoord(xy.first, xy.second, 0);
201  glob = m_cellVec[cellIndex].getPosition(lcoord);
202 #ifdef EDM_ML_DEBUG
203  edm::LogVerbatim("HGCalGeom") << "getPosition:: index " << cellIndex << " Local " << lcoord.x() << ":"
204  << lcoord.y() << " ID " << id.iCell1 << ":" << id.iSec1 << " Global " << glob;
205 #endif
206  } else if (m_topology.tileTrapezoid()) {
207  const HepGeom::Point3D<float> lcoord(0, 0, 0);
208  glob = m_cellVec2[cellIndex].getPosition(lcoord);
209 #ifdef EDM_ML_DEBUG
210  edm::LogVerbatim("HGCalGeom") << "getPositionTrap:: index " << cellIndex << " Local " << lcoord.x() << ":"
211  << lcoord.y() << " ID " << id.iLay << ":" << id.iSec1 << ":" << id.iCell1
212  << " Global " << glob;
213 #endif
214  } else {
215  xy = m_topology.dddConstants().locateCell(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false, true);
216  const HepGeom::Point3D<float> lcoord(xy.first, xy.second, 0);
217  glob = m_cellVec[cellIndex].getPosition(lcoord);
218 #ifdef EDM_ML_DEBUG
219  edm::LogVerbatim("HGCalGeom") << "getPositionWafer:: index " << cellIndex << " Local " << lcoord.x() << ":"
220  << lcoord.y() << " ID " << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":"
221  << id.iCell1 << ":" << id.iCell2 << " Global " << glob;
222 #endif
223  }
224  }
225  return glob;
226 }
227 
229  unsigned int cellIndex = indexFor(detid);
230  GlobalPoint glob;
231  unsigned int maxSize = (m_topology.tileTrapezoid() ? m_cellVec2.size() : m_cellVec.size());
232  if (cellIndex < maxSize) {
233  const HepGeom::Point3D<float> lcoord(0, 0, 0);
234  if (m_topology.tileTrapezoid()) {
235  glob = m_cellVec2[cellIndex].getPosition(lcoord);
236  } else {
237  glob = m_cellVec[cellIndex].getPosition(lcoord);
238  }
239 #ifdef EDM_ML_DEBUG
240  edm::LogVerbatim("HGCalGeom") << "getPositionTrap:: ID " << std::hex << detid.rawId() << std::dec << " index "
241  << cellIndex << " Global " << glob;
242 #endif
243  }
244  return glob;
245 }
246 
247 double HGCalGeometry::getArea(const DetId& detid) const {
248  HGCalGeometry::CornersVec corners = getNewCorners(detid);
249  double area(0);
250  if (corners.size() > 1) {
251  int n = corners.size() - 1;
252  int j = n - 1;
253  for (int i = 0; i < n; ++i) {
254  area += ((corners[j].x() + corners[i].x()) * (corners[i].y() - corners[j].y()));
255  j = i;
256  }
257  }
258  return (0.5 * area);
259 }
260 
262  unsigned int ncorner = ((m_det == DetId::HGCalHSc) ? FlatTrd::ncorner_ : FlatHexagon::ncorner_);
263  HGCalGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
264  unsigned int cellIndex = indexFor(detid);
266  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
267  GlobalPoint v = getPosition(detid);
268  std::pair<double, double> rr = m_topology.dddConstants().cellSizeTrap(id.iType, id.iSec1);
269  float dr = k_half * (rr.second - rr.first);
270  float dfi = m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
271  float dz = id.zSide * m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
272  float r = v.perp();
273  float fi = v.phi();
274  static const int signr[] = {1, 1, -1, -1, 1, 1, -1, -1};
275  static const int signf[] = {-1, 1, 1, -1, -1, 1, 1, -1};
276  static const int signz[] = {-1, -1, -1, -1, 1, 1, 1, 1};
277  for (unsigned int i = 0; i < ncorner; ++i) {
278  co[i] = GlobalPoint((r + signr[i] * dr) * cos(fi + signf[i] * dfi),
279  (r + signr[i] * dr) * sin(fi + signf[i] * dfi),
280  (v.z() + signz[i] * dz));
281  }
282  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
283  std::pair<float, float> xy;
284  if (m_topology.waferHexagon6()) {
285  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
286  float dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
287  float dy = k_half * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
288  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
289  static const int signx[] = {0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1};
290  static const int signy[] = {-2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1};
291  static const int signz[] = {-1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1};
292  for (unsigned int i = 0; i < ncorner; ++i) {
293  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dy, signz[i] * dz);
294  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
295  }
296  } else {
297  xy = m_topology.dddConstants().locateCell(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false);
298  float dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
299  float dy = k_fac1 * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
300  float dz = -id.zSide * m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
301  static const int signx[] = {1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2};
302  static const int signy[] = {1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0};
303  static const int signz[] = {-1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1};
304  for (unsigned int i = 0; i < ncorner; ++i) {
305  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dy, signz[i] * dz);
306  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
307  }
308  }
309  }
310  return co;
311 }
312 
314  unsigned int ncorner = FlatTrd::ncorner_;
315  HGCalGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
316  unsigned int cellIndex = indexFor(detid);
318  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
319  GlobalPoint v = getPosition(detid);
320  std::pair<double, double> rr = m_topology.dddConstants().cellSizeTrap(id.iType, id.iSec1);
321  float dr = k_half * (rr.second - rr.first);
322  float dfi = m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
323  float dz = id.zSide * m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
324  float r = v.perp();
325  float fi = v.phi();
326  static const int signr[] = {1, 1, -1, -1, 1, 1, -1, -1};
327  static const int signf[] = {-1, 1, 1, -1, -1, 1, 1, -1};
328  static const int signz[] = {-1, -1, -1, -1, 1, 1, 1, 1};
329  for (unsigned int i = 0; i < ncorner; ++i) {
330  co[i] = GlobalPoint((r + signr[i] * dr) * cos(fi + signf[i] * dfi),
331  (r + signr[i] * dr) * sin(fi + signf[i] * dfi),
332  (v.z() + signz[i] * dz));
333  }
334  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
335  std::pair<float, float> xy;
336  float dx(0);
337  if (m_topology.waferHexagon6()) {
338  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
339  dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
340  } else {
341  xy = m_topology.dddConstants().locateCell(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false);
342  dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
343  }
344  static const int signx[] = {-1, -1, 1, 1, -1, -1, 1, 1};
345  static const int signy[] = {-1, 1, 1, -1, -1, 1, 1, -1};
346  static const int signz[] = {-1, -1, -1, -1, 1, 1, 1, 1};
347  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
348  for (unsigned int i = 0; i < ncorner; ++i) {
349  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dx, signz[i] * dz);
350  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
351  }
352  }
353  return co;
354 }
355 
357  unsigned int ncorner = (m_det == DetId::HGCalHSc) ? 5 : 7;
358  HGCalGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
359  unsigned int cellIndex = indexFor(detid);
361  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
362  GlobalPoint v = getPosition(detid);
363  std::pair<double, double> rr = m_topology.dddConstants().cellSizeTrap(id.iType, id.iSec1);
364  float dr = k_half * (rr.second - rr.first);
365  float dfi = m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
366  float dz = -id.zSide * m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
367  float r = v.perp();
368  float fi = v.phi();
369  static const int signr[] = {1, 1, -1, -1};
370  static const int signf[] = {-1, 1, 1, -1};
371  for (unsigned int i = 0; i < ncorner - 1; ++i) {
372  co[i] = GlobalPoint(
373  (r + signr[i] * dr) * cos(fi + signf[i] * dfi), (r + signr[i] * dr) * sin(fi + signf[i] * dfi), (v.z() + dz));
374  }
375  co[ncorner - 1] = GlobalPoint(0, 0, -2 * dz);
376  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
377  std::pair<float, float> xy;
378  if (m_topology.waferHexagon6()) {
379  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
380  } else {
381  xy = m_topology.dddConstants().locateCell(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false);
382  }
383  float dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
384  float dy = k_fac1 * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
385  float dz = -id.zSide * m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
386  static const int signx[] = {1, -1, -2, -1, 1, 2};
387  static const int signy[] = {1, 1, 0, -1, -1, 0};
388  for (unsigned int i = 0; i < ncorner - 1; ++i) {
389  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dy, dz);
390  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
391  }
392  co[ncorner - 1] = GlobalPoint(0, 0, -2 * dz);
393  }
394  return co;
395 }
396 
397 DetId HGCalGeometry::neighborZ(const DetId& idin, const GlobalVector& momentum) const {
398  DetId idnew;
400  int lay = ((momentum.z() * id.zSide > 0) ? (id.iLay + 1) : (id.iLay - 1));
401 #ifdef EDM_ML_DEBUG
402  edm::LogVerbatim("HGCalGeom") << "neighborz1:: ID " << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":"
403  << id.iCell1 << ":" << id.iCell2 << " New Layer " << lay << " Range "
404  << m_topology.dddConstants().firstLayer() << ":"
405  << m_topology.dddConstants().lastLayer(true) << " pz " << momentum.z();
406 #endif
407  if ((lay >= m_topology.dddConstants().firstLayer()) && (lay <= m_topology.dddConstants().lastLayer(true)) &&
408  (momentum.z() != 0.0)) {
409  GlobalPoint v = getPosition(idin);
410  double z = id.zSide * m_topology.dddConstants().waferZ(lay, true);
411  double grad = (z - v.z()) / momentum.z();
412  GlobalPoint p(v.x() + grad * momentum.x(), v.y() + grad * momentum.y(), z);
413  double r = p.perp();
414  auto rlimit = topology().dddConstants().rangeR(z, true);
415  if (r >= rlimit.first && r <= rlimit.second)
416  idnew = getClosestCell(p);
417 #ifdef EDM_ML_DEBUG
418  edm::LogVerbatim("HGCalGeom") << "neighborz1:: Position " << v << " New Z " << z << ":" << grad << " new position "
419  << p << " r-limit " << rlimit.first << ":" << rlimit.second;
420 #endif
421  }
422  return idnew;
423 }
424 
426  const MagneticField* bField,
427  int charge,
428  const GlobalVector& momentum) const {
429  DetId idnew;
431  int lay = ((momentum.z() * id.zSide > 0) ? (id.iLay + 1) : (id.iLay - 1));
432 #ifdef EDM_ML_DEBUG
433  edm::LogVerbatim("HGCalGeom") << "neighborz2:: ID " << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":"
434  << id.iCell1 << ":" << id.iCell2 << " New Layer " << lay << " Range "
435  << m_topology.dddConstants().firstLayer() << ":"
436  << m_topology.dddConstants().lastLayer(true) << " pz " << momentum.z();
437 #endif
438  if ((lay >= m_topology.dddConstants().firstLayer()) && (lay <= m_topology.dddConstants().lastLayer(true)) &&
439  (momentum.z() != 0.0)) {
440  GlobalPoint v = getPosition(idin);
441  double z = id.zSide * m_topology.dddConstants().waferZ(lay, true);
442  FreeTrajectoryState fts(v, momentum, charge, bField);
445  TrajectoryStateOnSurface tsos = myAP.propagate(fts, *nPlane);
446  GlobalPoint p;
447  auto rlimit = topology().dddConstants().rangeR(z, true);
448  if (tsos.isValid()) {
449  p = tsos.globalPosition();
450  double r = p.perp();
451  if (r >= rlimit.first && r <= rlimit.second)
452  idnew = getClosestCell(p);
453  }
454 #ifdef EDM_ML_DEBUG
455  edm::LogVerbatim("HGCalGeom") << "neighborz2:: Position " << v << " New Z " << z << ":" << charge << ":"
456  << tsos.isValid() << " new position " << p << " r limits " << rlimit.first << ":"
457  << rlimit.second;
458 #endif
459  }
460  return idnew;
461 }
462 
464  unsigned int cellIndex = getClosestCellIndex(r);
465  if ((cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) ||
466  (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc)) {
468  if (id.det == 0)
469  id.det = static_cast<int>(m_topology.detector());
470  HepGeom::Point3D<float> local;
471  if (r.z() > 0) {
472  local = HepGeom::Point3D<float>(r.x(), r.y(), 0);
473  id.zSide = 1;
474  } else {
475  local = HepGeom::Point3D<float>(-r.x(), r.y(), 0);
476  id.zSide = -1;
477  }
478  if (m_topology.waferHexagon6()) {
479  const auto& kxy = m_topology.dddConstants().assignCell(local.x(), local.y(), id.iLay, id.iType, true);
480  id.iCell1 = kxy.second;
481  id.iSec1 = kxy.first;
482  id.iType = m_topology.dddConstants().waferTypeT(kxy.first);
483  if (id.iType != 1)
484  id.iType = -1;
485  } else if (m_topology.tileTrapezoid()) {
486  id.iLay = m_topology.dddConstants().getLayer(r.z(), true);
487  const auto& kxy = m_topology.dddConstants().assignCellTrap(r.x(), r.y(), r.z(), id.iLay, true);
488  id.iSec1 = kxy[0];
489  id.iCell1 = kxy[1];
490  id.iType = kxy[2];
491  } else {
492  id.iLay = m_topology.dddConstants().getLayer(r.z(), true);
493  const auto& kxy = m_topology.dddConstants().assignCellHex(local.x(), local.y(), id.iLay, true);
494  id.iSec1 = kxy[0];
495  id.iSec2 = kxy[1];
496  id.iType = kxy[2];
497  id.iCell1 = kxy[3];
498  id.iCell2 = kxy[4];
499  }
500 #ifdef EDM_ML_DEBUG
501  edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local << " Id " << id.det << ":" << id.zSide << ":"
502  << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":" << id.iType << ":"
503  << id.iCell1 << ":" << id.iCell2;
504 #endif
505 
506  //check if returned cell is valid
507  if (id.iCell1 >= 0)
508  return m_topology.encode(id);
509  }
510 
511  //if not valid or out of bounds return a null DetId
512  return DetId();
513 }
514 
517  return dss;
518 }
519 
521  if (m_subdet == HGCEE || m_det == DetId::HGCalEE)
522  return "HGCalEE";
523  else if (m_subdet == HGCHEF || m_det == DetId::HGCalHSi)
524  return "HGCalHEFront";
525  else if (m_subdet == HGCHEB || m_det == DetId::HGCalHSc)
526  return "HGCalHEBack";
527  else
528  return "Unknown";
529 }
530 
531 unsigned int HGCalGeometry::indexFor(const DetId& detId) const {
532  unsigned int cellIndex = ((m_det == DetId::HGCalHSc) ? m_cellVec2.size() : m_cellVec.size());
533  if (detId != DetId()) {
534  DetId geomId = getGeometryDetId(detId);
535  cellIndex = m_topology.detId2denseGeomId(geomId);
536 #ifdef EDM_ML_DEBUG
537  edm::LogVerbatim("HGCalGeom") << "indexFor " << std::hex << detId.rawId() << ":" << geomId.rawId() << std::dec
538  << " index " << cellIndex;
539 #endif
540  }
541  return cellIndex;
542 }
543 
545 
547  // Modify the RawPtr class
548  if (m_det == DetId::HGCalHSc) {
549  if (m_cellVec2.size() < index)
550  return nullptr;
551  const CaloCellGeometry* cell(&m_cellVec2[index]);
552  return (nullptr == cell->param() ? nullptr : cell);
553  } else {
554  if (m_cellVec2.size() < index)
555  return nullptr;
556  const CaloCellGeometry* cell(&m_cellVec[index]);
557  return (nullptr == cell->param() ? nullptr : cell);
558  }
559 }
560 
561 std::shared_ptr<const CaloCellGeometry> HGCalGeometry::cellGeomPtr(uint32_t index) const {
562  if ((index >= m_cellVec.size() && m_det != DetId::HGCalHSc) ||
563  (index >= m_cellVec2.size() && m_det == DetId::HGCalHSc) || (m_validGeomIds[index].rawId() == 0))
564  return nullptr;
565  static const auto do_not_delete = [](const void*) {};
566  if (m_det == DetId::HGCalHSc) {
567  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec2[index], do_not_delete);
568  if (nullptr == cell->param())
569  return nullptr;
570  return cell;
571  } else {
572  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec[index], do_not_delete);
573  if (nullptr == cell->param())
574  return nullptr;
575  return cell;
576  }
577 }
578 
579 std::shared_ptr<const CaloCellGeometry> HGCalGeometry::cellGeomPtr(uint32_t index, const GlobalPoint& pos) const {
580  if ((index >= m_cellVec.size() && m_det != DetId::HGCalHSc) ||
581  (index >= m_cellVec2.size() && m_det == DetId::HGCalHSc) || (m_validGeomIds[index].rawId() == 0))
582  return nullptr;
583  if (pos == GlobalPoint())
584  return cellGeomPtr(index);
585  if (m_det == DetId::HGCalHSc) {
586  auto cell = std::make_shared<FlatTrd>(m_cellVec2[index]);
587  cell->setPosition(pos);
588 #ifdef EDM_ML_DEBUG
589  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
590 #endif
591  if (nullptr == cell->param())
592  return nullptr;
593  return cell;
594  } else {
595  auto cell = std::make_shared<FlatHexagon>(m_cellVec[index]);
596  cell->setPosition(pos);
597 #ifdef EDM_ML_DEBUG
598  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
599 #endif
600  if (nullptr == cell->param())
601  return nullptr;
602  return cell;
603  }
604 }
605 
607  edm::LogError("HGCalGeom") << "HGCalGeometry::addValidID is not implemented";
608 }
609 
612 }
613 
614 template <class T>
615 unsigned int HGCalGeometry::getClosestCellIndex(const GlobalPoint& r, const std::vector<T>& vec) const {
616  float phip = r.phi();
617  float zp = r.z();
618  float dzmin(9999), dphimin(9999), dphi10(0.175);
619  unsigned int cellIndex = vec.size();
620  for (unsigned int k = 0; k < vec.size(); ++k) {
621  float dphi = phip - vec[k].phiPos();
622  while (dphi > M_PI)
623  dphi -= 2 * M_PI;
624  while (dphi <= -M_PI)
625  dphi += 2 * M_PI;
626  if (std::abs(dphi) < dphi10) {
627  float dz = std::abs(zp - vec[k].getPosition().z());
628  if (dz < (dzmin + 0.001)) {
629  dzmin = dz;
630  if (std::abs(dphi) < (dphimin + 0.01)) {
631  cellIndex = k;
632  dphimin = std::abs(dphi);
633  } else {
634  if (cellIndex >= vec.size())
635  cellIndex = k;
636  }
637  }
638  }
639  }
640 #ifdef EDM_ML_DEBUG
641  edm::LogVerbatim("HGCalGeom") << "getClosestCellIndex::Input " << zp << ":" << phip << " Index " << cellIndex;
642  if (cellIndex < vec.size())
643  edm::LogVerbatim("HGCalGeom") << " Cell z " << vec[cellIndex].getPosition().z() << ":" << dzmin << " phi "
644  << vec[cellIndex].phiPos() << ":" << dphimin;
645 #endif
646  return cellIndex;
647 }
648 
649 // FIXME: Change sorting algorithm if needed
650 namespace {
651  struct rawIdSort {
652  bool operator()(const DetId& a, const DetId& b) { return (a.rawId() < b.rawId()); }
653  };
654 } // namespace
655 
657  m_validIds.shrink_to_fit();
658  std::sort(m_validIds.begin(), m_validIds.end(), rawIdSort());
659 }
660 
664  CaloSubdetectorGeometry::IVec& dinsVector) const {
665  unsigned int numberOfCells = m_topology.totalGeomModules(); // total Geom Modules both sides
666  unsigned int numberOfShapes = k_NumberOfShapes;
667  unsigned int numberOfParametersPerShape = ((m_det == DetId::HGCalHSc) ? (unsigned int)(k_NumberOfParametersPerTrd)
668  : (unsigned int)(k_NumberOfParametersPerHex));
669 
670  trVector.reserve(numberOfCells * numberOfTransformParms());
671  iVector.reserve(numberOfCells);
672  dimVector.reserve(numberOfShapes * numberOfParametersPerShape);
673  dinsVector.reserve(numberOfCells);
674 
675  for (unsigned itr = 0; itr < m_topology.dddConstants().getTrFormN(); ++itr) {
677  int layer = mytr.lay;
678 
679  if (m_topology.waferHexagon6()) {
680  for (int wafer = 0; wafer < m_topology.dddConstants().sectors(); ++wafer) {
681  if (m_topology.dddConstants().waferInLayer(wafer, layer, true)) {
682  HGCalParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
684  params[FlatHexagon::k_dZ] = vol.dz;
687  dimVector.insert(dimVector.end(), params.begin(), params.end());
688  }
689  }
690  } else if (m_topology.tileTrapezoid()) {
691  int indx = m_topology.dddConstants().layerIndex(layer, true);
692  for (int md = m_topology.dddConstants().getParameter()->firstModule_[indx];
694  ++md) {
697  params[FlatTrd::k_dZ] = vol.dz;
704  dimVector.insert(dimVector.end(), params.begin(), params.end());
705  }
706  } else {
707  for (int wafer = 0; wafer < m_topology.dddConstants().sectors(); ++wafer) {
708  if (m_topology.dddConstants().waferInLayer(wafer, layer, true)) {
709  HGCalParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
711  params[FlatHexagon::k_dZ] = vol.dz;
714  dimVector.insert(dimVector.end(), params.begin(), params.end());
715  }
716  }
717  }
718  }
719 
720  for (unsigned int i(0); i < numberOfCells; ++i) {
721  DetId detId = m_validGeomIds[i];
722  int layer(0);
723  if (m_topology.waferHexagon6()) {
724  layer = HGCalDetId(detId).layer();
725  } else if (m_topology.tileTrapezoid()) {
726  layer = HGCScintillatorDetId(detId).layer();
727  } else if (m_topology.isHFNose()) {
728  layer = HFNoseDetId(detId).layer();
729  } else {
730  layer = HGCSiliconDetId(detId).layer();
731  }
732  dinsVector.emplace_back(m_topology.detId2denseGeomId(detId));
733  iVector.emplace_back(layer);
734 
735  Tr3D tr;
736  auto ptr = cellGeomPtr(i);
737  if (nullptr != ptr) {
738  ptr->getTransform(tr, (Pt3DVec*)nullptr);
739 
740  if (Tr3D() == tr) { // there is no rotation
741  const GlobalPoint& gp(ptr->getPosition());
742  tr = HepGeom::Translate3D(gp.x(), gp.y(), gp.z());
743  }
744 
745  const CLHEP::Hep3Vector tt(tr.getTranslation());
746  trVector.emplace_back(tt.x());
747  trVector.emplace_back(tt.y());
748  trVector.emplace_back(tt.z());
749  if (6 == numberOfTransformParms()) {
750  const CLHEP::HepRotation rr(tr.getRotation());
751  const ROOT::Math::Transform3D rtr(
752  rr.xx(), rr.xy(), rr.xz(), tt.x(), rr.yx(), rr.yy(), rr.yz(), tt.y(), rr.zx(), rr.zy(), rr.zz(), tt.z());
754  rtr.GetRotation(ea);
755  trVector.emplace_back(ea.Phi());
756  trVector.emplace_back(ea.Theta());
757  trVector.emplace_back(ea.Psi());
758  }
759  }
760  }
761 }
762 
764  DetId geomId;
765  if (m_topology.waferHexagon6()) {
766  geomId = static_cast<DetId>(HGCalDetId(detId).geometryCell());
767  } else if (m_topology.tileTrapezoid()) {
768  geomId = static_cast<DetId>(HGCScintillatorDetId(detId).geometryCell());
769  } else if (m_topology.isHFNose()) {
770  geomId = static_cast<DetId>(HFNoseDetId(detId).geometryCell());
771  } else {
772  geomId = static_cast<DetId>(HGCSiliconDetId(detId).geometryCell());
773  }
774  return geomId;
775 }
776 
778 
CaloCellGeometry::Tr3D
HepGeom::Transform3D Tr3D
Definition: CaloCellGeometry.h:53
Vector3DBase
Definition: Vector3DBase.h:8
TkRotation< float >
CaloGenericDetId.h
HGCalGeometry::sortDetIds
void sortDetIds()
Definition: HGCalGeometry.cc:656
HGCalDDDConstants::cellSizeTrap
std::pair< double, double > cellSizeTrap(int type, int irad) const
Definition: HGCalDDDConstants.h:37
HGCalParameters::hgtrap::bl
float bl
Definition: HGCalParameters.h:43
DDAxes::y
TrajectoryStateOnSurface.h
HGCalGeometry::localCorners
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
Definition: HGCalGeometry.cc:49
CaloSubdetectorGeometry::numberOfParametersPerShape
virtual unsigned int numberOfParametersPerShape() const
Definition: CaloSubdetectorGeometry.h:93
HGCalGeometry::m_det
DetId::Detector m_det
Definition: HGCalGeometry.h:141
mps_fire.i
i
Definition: mps_fire.py:428
HGCalTopology::dddConstants
const HGCalDDDConstants & dddConstants() const
Definition: HGCalTopology.h:98
HGCalGeometry::addValidID
void addValidID(const DetId &id)
Definition: HGCalGeometry.cc:606
HGCalGeometry::m_cellVec
CellVec m_cellVec
Definition: HGCalGeometry.h:138
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
HGCalDDDConstants::waferTypeT
int waferTypeT(int wafer) const
Definition: HGCalDDDConstants.h:179
FlatTrd::localCorners
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatTrd.cc:153
HGCalGeometry::~HGCalGeometry
~HGCalGeometry() override
Definition: HGCalGeometry.cc:43
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
HGCalDDDConstants::firstLayer
int firstLayer() const
Definition: HGCalDDDConstants.h:52
HGCalGeometry::CellVec2
std::vector< FlatTrd > CellVec2
Definition: HGCalGeometry.h:32
HGCalGeometry::cellGeomPtr
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
Definition: HGCalGeometry.cc:561
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
CaloSubdetectorGeometry::DimVec
std::vector< CCGFloat > DimVec
Definition: CaloSubdetectorGeometry.h:35
FlatTrd
A base class to handle the particular shape of HGCal volumes.
Definition: FlatTrd.h:19
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
HGCalGeometry::present
bool present(const DetId &id) const override
is this detid present in the geometry?
Definition: HGCalGeometry.cc:183
FlatTrd::k_Cell
static constexpr uint32_t k_Cell
Definition: FlatTrd.h:45
HGCalParameters::hgtrap::cellSize
float cellSize
Definition: HGCalParameters.h:43
HFNoseDetId::layer
int layer() const
get the layer #
Definition: HFNoseDetId.h:56
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HGCalGeometry::k_half
static constexpr double k_half
Definition: HGCalGeometry.h:133
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
FlatHexagon::localCorners
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:154
pos
Definition: PixelAliasList.h:18
HGCalDDDConstants::waferZ
double waferZ(int layer, bool reco) const
Definition: HGCalDDDConstants.cc:1388
HGCalTopology::detector
DetId::Detector detector() const
Definition: HGCalTopology.h:117
FlatTrd::k_Phi
static constexpr uint32_t k_Phi
Definition: FlatTrd.h:29
HGCalGeometry::getArea
double getArea(const DetId &detid) const
Returns area of a cell.
Definition: HGCalGeometry.cc:247
CaloSubdetectorGeometry::TrVec
std::vector< CCGFloat > TrVec
Definition: CaloSubdetectorGeometry.h:33
typelookup.h
HGCalTopology::decode
DecodedDetId decode(const DetId &id) const
Definition: HGCalTopology.cc:588
HGCalParameters::hgtrap::alpha
float alpha
Definition: HGCalParameters.h:43
HGCalGeometry::m_cellVec2
CellVec2 m_cellVec2
Definition: HGCalGeometry.h:139
CaloSubdetectorGeometry::numberOfTransformParms
virtual unsigned int numberOfTransformParms() const
Definition: CaloSubdetectorGeometry.h:94
HGCalGeometry::k_NumberOfShapes
static constexpr unsigned int k_NumberOfShapes
Definition: HGCalGeometry.h:46
HGCalGeometry::getWaferPosition
GlobalPoint getWaferPosition(const DetId &id) const
Definition: HGCalGeometry.cc:228
HGCalTopology::DecodedDetId
Definition: HGCalTopology.h:108
HGCalGeometry::getCells
DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
Definition: HGCalGeometry.cc:515
HGCalGeometry::getSummary
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
Definition: HGCalGeometry.cc:661
ReferenceCountingPointer< Plane >
HGCalParameters::hgtrap::dz
float dz
Definition: HGCalParameters.h:43
HGCalDDDConstants::assignCellHex
std::array< int, 5 > assignCellHex(float x, float y, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:159
HGCalGeometry::Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: HGCalGeometry.h:34
HGCalGeometry::m_subdet
ForwardSubdetector m_subdet
Definition: HGCalGeometry.h:142
HGCalTopology::totalGeomModules
unsigned int totalGeomModules() const
Definition: HGCalTopology.h:93
findQualityFiles.v
v
Definition: findQualityFiles.py:179
HGCalGeometry::k_NumberOfParametersPerTrd
static constexpr unsigned int k_NumberOfParametersPerTrd
Definition: HGCalGeometry.h:43
CaloSubdetectorGeometry::IVec
std::vector< unsigned int > IVec
Definition: CaloSubdetectorGeometry.h:34
HGCalTopology::tileTrapezoid
bool tileTrapezoid() const
Definition: HGCalTopology.h:124
HFNoseDetId
Definition: HFNoseDetId.h:22
FlatTrd::k_Theta
static constexpr uint32_t k_Theta
Definition: FlatTrd.h:27
HGCalDetId::layer
int layer() const
get the layer #
Definition: HGCalDetId.h:46
HGCalDDDConstants::lastLayer
int lastLayer(bool reco) const
Definition: HGCalDDDConstants.cc:559
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
FlatHexagon::k_r
static constexpr uint32_t k_r
Definition: FlatHexagon.h:28
ParmVec
std::vector< float > ParmVec
Definition: FastTimeGeometry.cc:13
HGCalGeometry::neighborZ
DetId neighborZ(const DetId &idin, const GlobalVector &p) const
Definition: HGCalGeometry.cc:397
CaloSubdetectorGeometry::numberOfShapes
virtual unsigned int numberOfShapes() const
Definition: CaloSubdetectorGeometry.h:92
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
HGCScintillatorDetId::layer
int layer() const
get the layer #
Definition: HGCScintillatorDetId.h:50
DetId
Definition: DetId.h:17
Plane.h
FlatTrd::k_dX1
static constexpr uint32_t k_dX1
Definition: FlatTrd.h:32
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
CaloSubdetectorGeometry::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloSubdetectorGeometry.h:25
HGCalGeometry::cellElement
std::string cellElement() const
Definition: HGCalGeometry.cc:520
HGCalParameters::hgtrap::tl
float tl
Definition: HGCalParameters.h:43
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
FlatTrd::k_Alp1
static constexpr uint32_t k_Alp1
Definition: FlatTrd.h:36
FlatHexagon::ncorner_
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:81
FlatTrd::k_dY2
static constexpr uint32_t k_dY2
Definition: FlatTrd.h:38
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HGCalDDDConstants::waferInLayer
bool waferInLayer(int wafer, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:1184
CaloSubdetectorGeometry::m_validIds
std::vector< DetId > m_validIds
Definition: CaloSubdetectorGeometry.h:115
DDAxes::z
FlatTrd::k_dX4
static constexpr uint32_t k_dX4
Definition: FlatTrd.h:41
HGCalDDDConstants::layerIndex
int layerIndex(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:563
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloCellGeometry.cc:7
HGCalGeometry::k_NumberOfParametersPerHex
static constexpr unsigned int k_NumberOfParametersPerHex
Definition: HGCalGeometry.h:44
HGCalTopology::waferHexagon6
bool waferHexagon6() const
Definition: HGCalTopology.h:127
FlatHexagon
A base class to handle the hexagonal shape of HGCal silicon volumes.
Definition: FlatHexagon.h:20
HGCalGeometry::getGeometryDetId
DetId getGeometryDetId(DetId detId) const
Definition: HGCalGeometry.cc:763
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
FlatHexagon::k_R
static constexpr uint32_t k_R
Definition: FlatHexagon.h:29
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: HGCalGeometry.cc:21
HGCalGeometry
Definition: HGCalGeometry.h:29
b
double b
Definition: hdecay.h:118
HGCalGeometry::topology
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:111
HGCalDDDConstants::rangeR
std::pair< double, double > rangeR(double z, bool reco) const
Definition: HGCalDDDConstants.cc:947
HGCalDDDConstants::assignCell
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
Definition: HGCalDDDConstants.cc:120
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCEE
Definition: ForwardSubdetector.h:8
Plane::build
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
HGCalDDDConstants::cellInLayer
bool cellInLayer(int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:203
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
HGCalParameters::firstModule_
std::vector< int > firstModule_
Definition: HGCalParameters.h:160
HGCalTopology::totalModules
unsigned int totalModules() const
Definition: HGCalTopology.h:92
HGCalGeometry.h
a
double a
Definition: hdecay.h:119
FlatTrd::k_dX3
static constexpr uint32_t k_dX3
Definition: FlatTrd.h:39
HGCalGeometry::CellVec
std::vector< FlatHexagon > CellVec
Definition: HGCalGeometry.h:31
CaloCellGeometry
Definition: CaloCellGeometry.h:50
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
HGCalGeometry::m_validGeomIds
std::vector< DetId > m_validGeomIds
Definition: HGCalGeometry.h:140
CaloCellGeometry::param
const CCGFloat * param() const
Definition: CaloCellGeometry.h:99
HGCalGeometry::HGCalGeometry
HGCalGeometry(const HGCalTopology &topology)
Definition: HGCalGeometry.cc:26
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
HGCalGeometry::getGeometryRawPtr
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
Definition: HGCalGeometry.cc:546
HGCalGeometry::k_fac1
static constexpr double k_fac1
Definition: HGCalGeometry.h:134
HGCalParameters::hgtrap::h
float h
Definition: HGCalParameters.h:43
ParmVec
std::vector< float > ParmVec
Definition: HGCalGeometry.cc:22
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
FlatTrd::k_dX2
static constexpr uint32_t k_dX2
Definition: FlatTrd.h:34
HGCalTopology::detId2denseGeomId
virtual uint32_t detId2denseGeomId(const DetId &id) const
Definition: HGCalTopology.cc:433
PVValHelper::dy
Definition: PVValidationHelpers.h:49
HGCalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HGCalGeometry.cc:191
HGCalGeometry::getClosestCell
DetId getClosestCell(const GlobalPoint &r) const override
Definition: HGCalGeometry.cc:463
HGCalDDDConstants::sectors
int sectors() const
Definition: HGCalDDDConstants.h:108
AnalyticalPropagator.h
HGCalGeometry::twoBysqrt3_
const double twoBysqrt3_
Definition: HGCalGeometry.h:143
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
HGCalTopology::DecodedDetId::det
int det
Definition: HGCalTopology.h:110
align::EulerAngles
AlgebraicVector EulerAngles
Definition: Definitions.h:34
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
HGCalParameters::hgtrform::lay
int lay
Definition: HGCalParameters.h:47
HGCalDDDConstants::getTrForm
HGCalParameters::hgtrform getTrForm(unsigned int k) const
Definition: HGCalDDDConstants.h:65
HGCalTopology
Definition: HGCalTopology.h:12
HGCalGeometry::DetIdSet
std::set< DetId > DetIdSet
Definition: HGCalGeometry.h:37
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HGCalDDDConstants::numberCellsHexagon
int numberCellsHexagon(int wafer) const
Definition: HGCalDDDConstants.cc:925
HGCalGeometry::k_fac2
static constexpr double k_fac2
Definition: HGCalGeometry.h:135
HGCalDDDConstants::assignCellTrap
std::array< int, 3 > assignCellTrap(float x, float y, float z, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:170
AnalyticalPropagator
Definition: AnalyticalPropagator.h:22
reco_skim_cfg_mod.maxSize
maxSize
Definition: reco_skim_cfg_mod.py:154
HGCalGeometry::getCorners
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell's volume.
Definition: HGCalGeometry.cc:261
HGCalDetId
Definition: HGCalDetId.h:8
CaloCellGeometry.h
FlatHexagon::k_dZ
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:27
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HGCalGeometry::initializeParms
void initializeParms() override
Definition: HGCalGeometry.cc:47
HGCalGeometry::sizeForDenseIndex
unsigned int sizeForDenseIndex() const
Definition: HGCalGeometry.cc:544
CaloSubdetectorGeometry::cornersMgr
CaloCellGeometry::CornersMgr * cornersMgr()
Definition: CaloSubdetectorGeometry.h:82
HGCalDDDConstants::locateCellHex
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
Definition: HGCalDDDConstants.cc:700
HGCalGeometry::Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: HGCalGeometry.h:35
HGCalGeometry::fillNamedParams
virtual void fillNamedParams(DDFilteredView fv)
Definition: HGCalGeometry.cc:45
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:292
HGCalTopology::encode
DetId encode(const DecodedDetId &id_) const
Definition: HGCalTopology.cc:634
PVValHelper::dz
Definition: PVValidationHelpers.h:50
HGCScintillatorDetId
Definition: HGCScintillatorDetId.h:23
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DetId::HGCalHSc
Definition: DetId.h:34
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
HGCalParameters::lastModule_
std::vector< int > lastModule_
Definition: HGCalParameters.h:161
Exception.h
HGCalGeometry::indexFor
unsigned int indexFor(const DetId &id) const override
Definition: HGCalGeometry.cc:531
HGCalDDDConstants::getLayer
int getLayer(double z, bool reco) const
Definition: HGCalDDDConstants.cc:355
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HGCalGeometry::newCell
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
Definition: HGCalGeometry.cc:57
HGCalParameters::hgtrform
Definition: HGCalParameters.h:46
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
FlatTrd::k_Alp2
static constexpr uint32_t k_Alp2
Definition: FlatTrd.h:43
DDFilteredView
Definition: DDFilteredView.h:20
HGCalTopology::valid
bool valid(const DetId &id) const override
Is this a valid cell id.
Definition: HGCalTopology.cc:463
cms::cuda::co
VT * co
Definition: prefixScan.h:46
HGCHEF
Definition: ForwardSubdetector.h:9
HGCalGeometry::getClosestCellIndex
unsigned int getClosestCellIndex(const GlobalPoint &r) const
Definition: HGCalGeometry.cc:610
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
HGCalDDDConstants::getTrFormN
unsigned int getTrFormN() const
Definition: HGCalDDDConstants.h:66
HGCalDDDConstants::locateCell
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
Definition: HGCalDDDConstants.cc:580
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
FlatTrd::ncorner_
static constexpr unsigned int ncorner_
Definition: FlatTrd.h:97
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
HGCalTopology::isHFNose
bool isHFNose() const
Definition: HGCalTopology.h:120
HGCalParameters::hgtrap
Definition: HGCalParameters.h:41
MagneticField
Definition: MagneticField.h:19
HGCalGeometry::getGeometry
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const override
Get the cell geometry of a given detector id. Should return false if not found.
Definition: HGCalGeometry.cc:174
edm::Log
Definition: MessageLogger.h:70
custom_jme_cff.area
area
Definition: custom_jme_cff.py:140
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
HGCalDDDConstants::getParameter
const HGCalParameters * getParameter() const
Definition: HGCalDDDConstants.h:58
PVValHelper::dx
Definition: PVValidationHelpers.h:48
FlatTrd::k_dY1
static constexpr uint32_t k_dY1
Definition: FlatTrd.h:31
alongMomentum
Definition: PropagationDirection.h:4
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
HGCalGeometry::CornersVec
std::vector< GlobalPoint > CornersVec
Definition: HGCalGeometry.h:38
FlatTrd::k_dZ
static constexpr uint32_t k_dZ
Definition: FlatTrd.h:26
AnalyticalPropagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
HGCalGeometry::getNewCorners
CornersVec getNewCorners(const DetId &id) const
Definition: HGCalGeometry.cc:356
HGCalGeometry::m_topology
const HGCalTopology & m_topology
Definition: HGCalGeometry.h:137
HGCHEB
Definition: ForwardSubdetector.h:10
HGCalGeometry::get8Corners
CornersVec get8Corners(const DetId &id) const
Definition: HGCalGeometry.cc:313
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:375