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  HGCScintillatorDetId hid(idc);
108  std::pair<int, int> typm = m_topology.dddConstants().tileType(hid.layer(), hid.ring(), 0);
109  if (typm.first >= 0) {
110  hid.setType(typm.first);
111  hid.setSiPM(typm.second);
112  idc = static_cast<DetId>(hid);
113  }
114  m_validIds.emplace_back(idc);
115 #ifdef EDM_ML_DEBUG
116  edm::LogVerbatim("HGCalGeom") << "Valid Id [0] " << HGCScintillatorDetId(idc);
117 #endif
118  } else {
119  edm::LogWarning("HGCalGeom") << "Check " << HGCScintillatorDetId(idc) << " from " << HGCScintillatorDetId(detId)
120  << " ERROR ???";
121  }
122  } else {
123 #ifdef EDM_ML_DEBUG
124  unsigned int cellAll(0), cellSelect(0);
125 #endif
126  for (int u = 0; u < 2 * cells; ++u) {
127  for (int v = 0; v < 2 * cells; ++v) {
128  if (((v - u) < cells) && (u - v) <= cells) {
129  id.iCell1 = u;
130  id.iCell2 = v;
131  DetId idc = m_topology.encode(id);
132 #ifdef EDM_ML_DEBUG
133  ++cellAll;
134 #endif
135  if (m_topology.dddConstants().cellInLayer(id.iSec1, id.iSec2, u, v, id.iLay, true)) {
136  m_validIds.emplace_back(idc);
137 #ifdef EDM_ML_DEBUG
138  ++cellSelect;
139  edm::LogVerbatim("HGCalGeom") << "Valid Id [" << u << ", " << v << "] " << HGCSiliconDetId(idc);
140 #endif
141  }
142  }
143  }
144  }
145 #ifdef EDM_ML_DEBUG
146  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry keeps " << cellSelect << " out of " << cellAll << " for wafer "
147  << id.iSec1 << ":" << id.iSec2 << " in "
148  << " layer " << id.iLay;
149 #endif
150  }
151 #ifdef EDM_ML_DEBUG
152  if (m_det == DetId::HGCalHSc) {
153  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry::newCell-> [" << cellIndex << "]"
154  << " front:" << f1.x() << '/' << f1.y() << '/' << f1.z() << " back:" << f2.x() << '/'
155  << f2.y() << '/' << f2.z() << " eta|phi " << m_cellVec2[cellIndex].etaPos() << ":"
156  << m_cellVec2[cellIndex].phiPos();
157  } else {
158  edm::LogVerbatim("HGCalGeom") << "HGCalGeometry::newCell-> [" << cellIndex << "]"
159  << " front:" << f1.x() << '/' << f1.y() << '/' << f1.z() << " back:" << f2.x() << '/'
160  << f2.y() << '/' << f2.z() << " eta|phi " << m_cellVec[cellIndex].etaPos() << ":"
161  << m_cellVec[cellIndex].phiPos();
162  }
163  unsigned int nNew = m_validIds.size();
164  if (m_topology.waferHexagon6()) {
165  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCalDetId(detId) << " with valid DetId from " << nOld << " to " << nNew;
166  } else if (m_topology.tileTrapezoid()) {
167  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCScintillatorDetId(detId) << " with valid DetId from " << nOld
168  << " to " << nNew;
169  } else if (m_topology.isHFNose()) {
170  edm::LogVerbatim("HGCalGeom") << "ID: " << HFNoseDetId(detId) << " with valid DetId from " << nOld << " to "
171  << nNew;
172  } else {
173  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCSiliconDetId(detId) << " with valid DetId from " << nOld << " to "
174  << nNew;
175  }
176  edm::LogVerbatim("HGCalGeom") << "Cell[" << cellIndex << "] " << std::hex << geomId.rawId() << ":"
177  << m_validGeomIds[cellIndex].rawId() << std::dec;
178 #endif
179 }
180 
181 std::shared_ptr<const CaloCellGeometry> HGCalGeometry::getGeometry(const DetId& detId) const {
182  if (detId == DetId())
183  return nullptr; // nothing to get
184  DetId geomId = getGeometryDetId(detId);
185  const uint32_t cellIndex(m_topology.detId2denseGeomId(geomId));
186  const GlobalPoint pos = (detId != geomId) ? getPosition(detId) : GlobalPoint();
187  return cellGeomPtr(cellIndex, pos);
188 }
189 
190 bool HGCalGeometry::present(const DetId& detId) const {
191  if (detId == DetId())
192  return false;
193  DetId geomId = getGeometryDetId(detId);
194  const uint32_t index(m_topology.detId2denseGeomId(geomId));
195  return (nullptr != getGeometryRawPtr(index));
196 }
197 
199  unsigned int cellIndex = indexFor(detid);
200  GlobalPoint glob;
201  unsigned int maxSize = (m_topology.tileTrapezoid() ? m_cellVec2.size() : m_cellVec.size());
202  if (cellIndex < maxSize) {
204  std::pair<float, float> xy;
205  if (m_topology.waferHexagon6()) {
206  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
207  const HepGeom::Point3D<float> lcoord(xy.first, xy.second, 0);
208  glob = m_cellVec[cellIndex].getPosition(lcoord);
209 #ifdef EDM_ML_DEBUG
210  edm::LogVerbatim("HGCalGeom") << "getPosition:: index " << cellIndex << " Local " << lcoord.x() << ":"
211  << lcoord.y() << " ID " << id.iCell1 << ":" << id.iSec1 << " Global " << glob;
212 #endif
213  } else if (m_topology.tileTrapezoid()) {
214  const HepGeom::Point3D<float> lcoord(0, 0, 0);
215  glob = m_cellVec2[cellIndex].getPosition(lcoord);
216 #ifdef EDM_ML_DEBUG
217  edm::LogVerbatim("HGCalGeom") << "getPositionTrap:: index " << cellIndex << " Local " << lcoord.x() << ":"
218  << lcoord.y() << " ID " << id.iLay << ":" << id.iSec1 << ":" << id.iCell1
219  << " Global " << glob;
220 #endif
221  } else {
222  xy = m_topology.dddConstants().locateCell(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false, true);
223  const HepGeom::Point3D<float> lcoord(xy.first, xy.second, 0);
224  glob = m_cellVec[cellIndex].getPosition(lcoord);
225 #ifdef EDM_ML_DEBUG
226  edm::LogVerbatim("HGCalGeom") << "getPositionWafer:: index " << cellIndex << " Local " << lcoord.x() << ":"
227  << lcoord.y() << " ID " << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":"
228  << id.iCell1 << ":" << id.iCell2 << " Global " << glob;
229 #endif
230  }
231  }
232  return glob;
233 }
234 
236  unsigned int cellIndex = indexFor(detid);
237  GlobalPoint glob;
238  unsigned int maxSize = (m_topology.tileTrapezoid() ? m_cellVec2.size() : m_cellVec.size());
239  if (cellIndex < maxSize) {
240  const HepGeom::Point3D<float> lcoord(0, 0, 0);
241  if (m_topology.tileTrapezoid()) {
242  glob = m_cellVec2[cellIndex].getPosition(lcoord);
243  } else {
244  glob = m_cellVec[cellIndex].getPosition(lcoord);
245  }
246 #ifdef EDM_ML_DEBUG
247  edm::LogVerbatim("HGCalGeom") << "getPositionTrap:: ID " << std::hex << detid.rawId() << std::dec << " index "
248  << cellIndex << " Global " << glob;
249 #endif
250  }
251  return glob;
252 }
253 
254 double HGCalGeometry::getArea(const DetId& detid) const {
255  HGCalGeometry::CornersVec corners = getNewCorners(detid);
256  double area(0);
257  if (corners.size() > 1) {
258  int n = corners.size() - 1;
259  int j = n - 1;
260  for (int i = 0; i < n; ++i) {
261  area += ((corners[j].x() + corners[i].x()) * (corners[i].y() - corners[j].y()));
262  j = i;
263  }
264  }
265  return (0.5 * area);
266 }
267 
269  unsigned int ncorner = ((m_det == DetId::HGCalHSc) ? FlatTrd::ncorner_ : FlatHexagon::ncorner_);
270  HGCalGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
271  unsigned int cellIndex = indexFor(detid);
273  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
274  GlobalPoint v = getPosition(detid);
275  std::pair<double, double> rr = m_topology.dddConstants().cellSizeTrap(id.iType, id.iSec1);
276  float dr = k_half * (rr.second - rr.first);
277  float dfi = m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
278  float dz = id.zSide * m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
279  float r = v.perp();
280  float fi = v.phi();
281  static const int signr[] = {1, 1, -1, -1, 1, 1, -1, -1};
282  static const int signf[] = {-1, 1, 1, -1, -1, 1, 1, -1};
283  static const int signz[] = {-1, -1, -1, -1, 1, 1, 1, 1};
284  for (unsigned int i = 0; i < ncorner; ++i) {
285  co[i] = GlobalPoint((r + signr[i] * dr) * cos(fi + signf[i] * dfi),
286  (r + signr[i] * dr) * sin(fi + signf[i] * dfi),
287  (v.z() + signz[i] * dz));
288  }
289  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
290  std::pair<float, float> xy;
291  if (m_topology.waferHexagon6()) {
292  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
293  float dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
294  float dy = k_half * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
295  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
296  static const int signx[] = {0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1};
297  static const int signy[] = {-2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1};
298  static const int signz[] = {-1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1};
299  for (unsigned int i = 0; i < ncorner; ++i) {
300  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dy, signz[i] * dz);
301  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
302  }
303  } else {
304  xy = m_topology.dddConstants().locateCell(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false);
305  float dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
306  float dy = k_fac1 * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
307  float dz = -id.zSide * m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
308  static const int signx[] = {1, -1, -2, -1, 1, 2, 1, -1, -2, -1, 1, 2};
309  static const int signy[] = {1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0};
310  static const int signz[] = {-1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1};
311  for (unsigned int i = 0; i < ncorner; ++i) {
312  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dy, signz[i] * dz);
313  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
314  }
315  }
316  }
317  return co;
318 }
319 
321  unsigned int ncorner = FlatTrd::ncorner_;
322  HGCalGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
323  unsigned int cellIndex = indexFor(detid);
325  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
326  GlobalPoint v = getPosition(detid);
327  std::pair<double, double> rr = m_topology.dddConstants().cellSizeTrap(id.iType, id.iSec1);
328  float dr = k_half * (rr.second - rr.first);
329  float dfi = m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
330  float dz = id.zSide * m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
331  float r = v.perp();
332  float fi = v.phi();
333  static const int signr[] = {1, 1, -1, -1, 1, 1, -1, -1};
334  static const int signf[] = {-1, 1, 1, -1, -1, 1, 1, -1};
335  static const int signz[] = {-1, -1, -1, -1, 1, 1, 1, 1};
336  for (unsigned int i = 0; i < ncorner; ++i) {
337  co[i] = GlobalPoint((r + signr[i] * dr) * cos(fi + signf[i] * dfi),
338  (r + signr[i] * dr) * sin(fi + signf[i] * dfi),
339  (v.z() + signz[i] * dz));
340  }
341  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
342  std::pair<float, float> xy;
343  float dx(0);
344  if (m_topology.waferHexagon6()) {
345  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
346  dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
347  } else {
348  xy = m_topology.dddConstants().locateCell(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false);
349  dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
350  }
351  static const int signx[] = {-1, -1, 1, 1, -1, -1, 1, 1};
352  static const int signy[] = {-1, 1, 1, -1, -1, 1, 1, -1};
353  static const int signz[] = {-1, -1, -1, -1, 1, 1, 1, 1};
354  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
355  for (unsigned int i = 0; i < ncorner; ++i) {
356  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dx, signz[i] * dz);
357  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
358  }
359  }
360  return co;
361 }
362 
364  unsigned int ncorner = (m_det == DetId::HGCalHSc) ? 5 : 7;
365  HGCalGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
366  unsigned int cellIndex = indexFor(detid);
368  if (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc) {
369  GlobalPoint v = getPosition(detid);
370  std::pair<double, double> rr = m_topology.dddConstants().cellSizeTrap(id.iType, id.iSec1);
371  float dr = k_half * (rr.second - rr.first);
372  float dfi = m_cellVec2[cellIndex].param()[FlatTrd::k_Cell];
373  float dz = -id.zSide * m_cellVec2[cellIndex].param()[FlatTrd::k_dZ];
374  float r = v.perp();
375  float fi = v.phi();
376  static const int signr[] = {1, 1, -1, -1};
377  static const int signf[] = {-1, 1, 1, -1};
378  for (unsigned int i = 0; i < ncorner - 1; ++i) {
379  co[i] = GlobalPoint(
380  (r + signr[i] * dr) * cos(fi + signf[i] * dfi), (r + signr[i] * dr) * sin(fi + signf[i] * dfi), (v.z() + dz));
381  }
382  co[ncorner - 1] = GlobalPoint(0, 0, -2 * dz);
383  } else if (cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) {
384  std::pair<float, float> xy;
385  if (m_topology.waferHexagon6()) {
386  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
387  } else {
388  xy = m_topology.dddConstants().locateCell(id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, false);
389  }
390  float dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
391  float dy = k_fac1 * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
392  float dz = -id.zSide * m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
393  static const int signx[] = {1, -1, -2, -1, 1, 2};
394  static const int signy[] = {1, 1, 0, -1, -1, 0};
395  for (unsigned int i = 0; i < ncorner - 1; ++i) {
396  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dy, dz);
397  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
398  }
399  co[ncorner - 1] = GlobalPoint(0, 0, -2 * dz);
400  }
401  return co;
402 }
403 
404 DetId HGCalGeometry::neighborZ(const DetId& idin, const GlobalVector& momentum) const {
405  DetId idnew;
407  int lay = ((momentum.z() * id.zSide > 0) ? (id.iLay + 1) : (id.iLay - 1));
408 #ifdef EDM_ML_DEBUG
409  edm::LogVerbatim("HGCalGeom") << "neighborz1:: ID " << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":"
410  << id.iCell1 << ":" << id.iCell2 << " New Layer " << lay << " Range "
411  << m_topology.dddConstants().firstLayer() << ":"
412  << m_topology.dddConstants().lastLayer(true) << " pz " << momentum.z();
413 #endif
414  if ((lay >= m_topology.dddConstants().firstLayer()) && (lay <= m_topology.dddConstants().lastLayer(true)) &&
415  (momentum.z() != 0.0)) {
416  GlobalPoint v = getPosition(idin);
417  double z = id.zSide * m_topology.dddConstants().waferZ(lay, true);
418  double grad = (z - v.z()) / momentum.z();
419  GlobalPoint p(v.x() + grad * momentum.x(), v.y() + grad * momentum.y(), z);
420  double r = p.perp();
421  auto rlimit = topology().dddConstants().rangeR(z, true);
422  if (r >= rlimit.first && r <= rlimit.second)
423  idnew = getClosestCell(p);
424 #ifdef EDM_ML_DEBUG
425  edm::LogVerbatim("HGCalGeom") << "neighborz1:: Position " << v << " New Z " << z << ":" << grad << " new position "
426  << p << " r-limit " << rlimit.first << ":" << rlimit.second;
427 #endif
428  }
429  return idnew;
430 }
431 
433  const MagneticField* bField,
434  int charge,
435  const GlobalVector& momentum) const {
436  DetId idnew;
438  int lay = ((momentum.z() * id.zSide > 0) ? (id.iLay + 1) : (id.iLay - 1));
439 #ifdef EDM_ML_DEBUG
440  edm::LogVerbatim("HGCalGeom") << "neighborz2:: ID " << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":"
441  << id.iCell1 << ":" << id.iCell2 << " New Layer " << lay << " Range "
442  << m_topology.dddConstants().firstLayer() << ":"
443  << m_topology.dddConstants().lastLayer(true) << " pz " << momentum.z();
444 #endif
445  if ((lay >= m_topology.dddConstants().firstLayer()) && (lay <= m_topology.dddConstants().lastLayer(true)) &&
446  (momentum.z() != 0.0)) {
447  GlobalPoint v = getPosition(idin);
448  double z = id.zSide * m_topology.dddConstants().waferZ(lay, true);
449  FreeTrajectoryState fts(v, momentum, charge, bField);
452  TrajectoryStateOnSurface tsos = myAP.propagate(fts, *nPlane);
453  GlobalPoint p;
454  auto rlimit = topology().dddConstants().rangeR(z, true);
455  if (tsos.isValid()) {
456  p = tsos.globalPosition();
457  double r = p.perp();
458  if (r >= rlimit.first && r <= rlimit.second)
459  idnew = getClosestCell(p);
460  }
461 #ifdef EDM_ML_DEBUG
462  edm::LogVerbatim("HGCalGeom") << "neighborz2:: Position " << v << " New Z " << z << ":" << charge << ":"
463  << tsos.isValid() << " new position " << p << " r limits " << rlimit.first << ":"
464  << rlimit.second;
465 #endif
466  }
467  return idnew;
468 }
469 
471  unsigned int cellIndex = getClosestCellIndex(r);
472  if ((cellIndex < m_cellVec.size() && m_det != DetId::HGCalHSc) ||
473  (cellIndex < m_cellVec2.size() && m_det == DetId::HGCalHSc)) {
475  if (id.det == 0)
476  id.det = static_cast<int>(m_topology.detector());
477  HepGeom::Point3D<float> local;
478  if (r.z() > 0) {
479  local = HepGeom::Point3D<float>(r.x(), r.y(), 0);
480  id.zSide = 1;
481  } else {
482  local = HepGeom::Point3D<float>(-r.x(), r.y(), 0);
483  id.zSide = -1;
484  }
485  if (m_topology.waferHexagon6()) {
486  const auto& kxy = m_topology.dddConstants().assignCell(local.x(), local.y(), id.iLay, id.iType, true);
487  id.iCell1 = kxy.second;
488  id.iSec1 = kxy.first;
489  id.iType = m_topology.dddConstants().waferTypeT(kxy.first);
490  if (id.iType != 1)
491  id.iType = -1;
492  } else if (m_topology.tileTrapezoid()) {
493  id.iLay = m_topology.dddConstants().getLayer(r.z(), true);
494  const auto& kxy = m_topology.dddConstants().assignCellTrap(r.x(), r.y(), r.z(), id.iLay, true);
495  id.iSec1 = kxy[0];
496  id.iCell1 = kxy[1];
497  id.iType = kxy[2];
498  } else {
499  id.iLay = m_topology.dddConstants().getLayer(r.z(), true);
500  const auto& kxy = m_topology.dddConstants().assignCellHex(local.x(), local.y(), id.iLay, true);
501  id.iSec1 = kxy[0];
502  id.iSec2 = kxy[1];
503  id.iType = kxy[2];
504  id.iCell1 = kxy[3];
505  id.iCell2 = kxy[4];
506  }
507 #ifdef EDM_ML_DEBUG
508  edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local << " Id " << id.det << ":" << id.zSide << ":"
509  << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":" << id.iType << ":"
510  << id.iCell1 << ":" << id.iCell2;
511 #endif
512 
513  //check if returned cell is valid
514  if (id.iCell1 >= 0)
515  return m_topology.encode(id);
516  }
517 
518  //if not valid or out of bounds return a null DetId
519  return DetId();
520 }
521 
524  return dss;
525 }
526 
528  if (m_subdet == HGCEE || m_det == DetId::HGCalEE)
529  return "HGCalEE";
530  else if (m_subdet == HGCHEF || m_det == DetId::HGCalHSi)
531  return "HGCalHEFront";
532  else if (m_subdet == HGCHEB || m_det == DetId::HGCalHSc)
533  return "HGCalHEBack";
534  else
535  return "Unknown";
536 }
537 
538 unsigned int HGCalGeometry::indexFor(const DetId& detId) const {
539  unsigned int cellIndex = ((m_det == DetId::HGCalHSc) ? m_cellVec2.size() : m_cellVec.size());
540  if (detId != DetId()) {
541  DetId geomId = getGeometryDetId(detId);
542  cellIndex = m_topology.detId2denseGeomId(geomId);
543 #ifdef EDM_ML_DEBUG
544  edm::LogVerbatim("HGCalGeom") << "indexFor " << std::hex << detId.rawId() << ":" << geomId.rawId() << std::dec
545  << " index " << cellIndex;
546 #endif
547  }
548  return cellIndex;
549 }
550 
552 
554  // Modify the RawPtr class
555  if (m_det == DetId::HGCalHSc) {
556  if (m_cellVec2.size() < index)
557  return nullptr;
558  const CaloCellGeometry* cell(&m_cellVec2[index]);
559  return (nullptr == cell->param() ? nullptr : cell);
560  } else {
561  if (m_cellVec2.size() < index)
562  return nullptr;
563  const CaloCellGeometry* cell(&m_cellVec[index]);
564  return (nullptr == cell->param() ? nullptr : cell);
565  }
566 }
567 
568 std::shared_ptr<const CaloCellGeometry> HGCalGeometry::cellGeomPtr(uint32_t index) const {
569  if ((index >= m_cellVec.size() && m_det != DetId::HGCalHSc) ||
570  (index >= m_cellVec2.size() && m_det == DetId::HGCalHSc) || (m_validGeomIds[index].rawId() == 0))
571  return nullptr;
572  static const auto do_not_delete = [](const void*) {};
573  if (m_det == DetId::HGCalHSc) {
574  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec2[index], do_not_delete);
575  if (nullptr == cell->param())
576  return nullptr;
577  return cell;
578  } else {
579  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec[index], do_not_delete);
580  if (nullptr == cell->param())
581  return nullptr;
582  return cell;
583  }
584 }
585 
586 std::shared_ptr<const CaloCellGeometry> HGCalGeometry::cellGeomPtr(uint32_t index, const GlobalPoint& pos) const {
587  if ((index >= m_cellVec.size() && m_det != DetId::HGCalHSc) ||
588  (index >= m_cellVec2.size() && m_det == DetId::HGCalHSc) || (m_validGeomIds[index].rawId() == 0))
589  return nullptr;
590  if (pos == GlobalPoint())
591  return cellGeomPtr(index);
592  if (m_det == DetId::HGCalHSc) {
593  auto cell = std::make_shared<FlatTrd>(m_cellVec2[index]);
594  cell->setPosition(pos);
595 #ifdef EDM_ML_DEBUG
596  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
597 #endif
598  if (nullptr == cell->param())
599  return nullptr;
600  return cell;
601  } else {
602  auto cell = std::make_shared<FlatHexagon>(m_cellVec[index]);
603  cell->setPosition(pos);
604 #ifdef EDM_ML_DEBUG
605  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
606 #endif
607  if (nullptr == cell->param())
608  return nullptr;
609  return cell;
610  }
611 }
612 
614  edm::LogError("HGCalGeom") << "HGCalGeometry::addValidID is not implemented";
615 }
616 
619 }
620 
621 template <class T>
622 unsigned int HGCalGeometry::getClosestCellIndex(const GlobalPoint& r, const std::vector<T>& vec) const {
623  float phip = r.phi();
624  float zp = r.z();
625  float dzmin(9999), dphimin(9999), dphi10(0.175);
626  unsigned int cellIndex = vec.size();
627  for (unsigned int k = 0; k < vec.size(); ++k) {
628  float dphi = phip - vec[k].phiPos();
629  while (dphi > M_PI)
630  dphi -= 2 * M_PI;
631  while (dphi <= -M_PI)
632  dphi += 2 * M_PI;
633  if (std::abs(dphi) < dphi10) {
634  float dz = std::abs(zp - vec[k].getPosition().z());
635  if (dz < (dzmin + 0.001)) {
636  dzmin = dz;
637  if (std::abs(dphi) < (dphimin + 0.01)) {
638  cellIndex = k;
639  dphimin = std::abs(dphi);
640  } else {
641  if (cellIndex >= vec.size())
642  cellIndex = k;
643  }
644  }
645  }
646  }
647 #ifdef EDM_ML_DEBUG
648  edm::LogVerbatim("HGCalGeom") << "getClosestCellIndex::Input " << zp << ":" << phip << " Index " << cellIndex;
649  if (cellIndex < vec.size())
650  edm::LogVerbatim("HGCalGeom") << " Cell z " << vec[cellIndex].getPosition().z() << ":" << dzmin << " phi "
651  << vec[cellIndex].phiPos() << ":" << dphimin;
652 #endif
653  return cellIndex;
654 }
655 
656 // FIXME: Change sorting algorithm if needed
657 namespace {
658  struct rawIdSort {
659  bool operator()(const DetId& a, const DetId& b) { return (a.rawId() < b.rawId()); }
660  };
661 } // namespace
662 
664  m_validIds.shrink_to_fit();
665  std::sort(m_validIds.begin(), m_validIds.end(), rawIdSort());
666 }
667 
671  CaloSubdetectorGeometry::IVec& dinsVector) const {
672  unsigned int numberOfCells = m_topology.totalGeomModules(); // total Geom Modules both sides
673  unsigned int numberOfShapes = k_NumberOfShapes;
674  unsigned int numberOfParametersPerShape = ((m_det == DetId::HGCalHSc) ? (unsigned int)(k_NumberOfParametersPerTrd)
675  : (unsigned int)(k_NumberOfParametersPerHex));
676 
677  trVector.reserve(numberOfCells * numberOfTransformParms());
678  iVector.reserve(numberOfCells);
679  dimVector.reserve(numberOfShapes * numberOfParametersPerShape);
680  dinsVector.reserve(numberOfCells);
681 
682  for (unsigned itr = 0; itr < m_topology.dddConstants().getTrFormN(); ++itr) {
684  int layer = mytr.lay;
685 
686  if (m_topology.waferHexagon6()) {
687  for (int wafer = 0; wafer < m_topology.dddConstants().sectors(); ++wafer) {
688  if (m_topology.dddConstants().waferInLayer(wafer, layer, true)) {
689  HGCalParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
691  params[FlatHexagon::k_dZ] = vol.dz;
694  dimVector.insert(dimVector.end(), params.begin(), params.end());
695  }
696  }
697  } else if (m_topology.tileTrapezoid()) {
698  int indx = m_topology.dddConstants().layerIndex(layer, true);
699  for (int md = m_topology.dddConstants().getParameter()->firstModule_[indx];
701  ++md) {
704  params[FlatTrd::k_dZ] = vol.dz;
711  dimVector.insert(dimVector.end(), params.begin(), params.end());
712  }
713  } else {
714  for (int wafer = 0; wafer < m_topology.dddConstants().sectors(); ++wafer) {
715  if (m_topology.dddConstants().waferInLayer(wafer, layer, true)) {
716  HGCalParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
718  params[FlatHexagon::k_dZ] = vol.dz;
721  dimVector.insert(dimVector.end(), params.begin(), params.end());
722  }
723  }
724  }
725  }
726 
727  for (unsigned int i(0); i < numberOfCells; ++i) {
728  DetId detId = m_validGeomIds[i];
729  int layer(0);
730  if (m_topology.waferHexagon6()) {
731  layer = HGCalDetId(detId).layer();
732  } else if (m_topology.tileTrapezoid()) {
733  layer = HGCScintillatorDetId(detId).layer();
734  } else if (m_topology.isHFNose()) {
735  layer = HFNoseDetId(detId).layer();
736  } else {
737  layer = HGCSiliconDetId(detId).layer();
738  }
739  dinsVector.emplace_back(m_topology.detId2denseGeomId(detId));
740  iVector.emplace_back(layer);
741 
742  Tr3D tr;
743  auto ptr = cellGeomPtr(i);
744  if (nullptr != ptr) {
745  ptr->getTransform(tr, (Pt3DVec*)nullptr);
746 
747  if (Tr3D() == tr) { // there is no rotation
748  const GlobalPoint& gp(ptr->getPosition());
749  tr = HepGeom::Translate3D(gp.x(), gp.y(), gp.z());
750  }
751 
752  const CLHEP::Hep3Vector tt(tr.getTranslation());
753  trVector.emplace_back(tt.x());
754  trVector.emplace_back(tt.y());
755  trVector.emplace_back(tt.z());
756  if (6 == numberOfTransformParms()) {
757  const CLHEP::HepRotation rr(tr.getRotation());
758  const ROOT::Math::Transform3D rtr(
759  rr.xx(), rr.xy(), rr.xz(), tt.x(), rr.yx(), rr.yy(), rr.yz(), tt.y(), rr.zx(), rr.zy(), rr.zz(), tt.z());
761  rtr.GetRotation(ea);
762  trVector.emplace_back(ea.Phi());
763  trVector.emplace_back(ea.Theta());
764  trVector.emplace_back(ea.Psi());
765  }
766  }
767  }
768 }
769 
771  DetId geomId;
772  if (m_topology.waferHexagon6()) {
773  geomId = static_cast<DetId>(HGCalDetId(detId).geometryCell());
774  } else if (m_topology.tileTrapezoid()) {
775  geomId = static_cast<DetId>(HGCScintillatorDetId(detId).geometryCell());
776  } else if (m_topology.isHFNose()) {
777  geomId = static_cast<DetId>(HFNoseDetId(detId).geometryCell());
778  } else {
779  geomId = static_cast<DetId>(HGCSiliconDetId(detId).geometryCell());
780  }
781  return geomId;
782 }
783 
785 
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:663
HGCalDDDConstants::cellSizeTrap
std::pair< double, double > cellSizeTrap(int type, int irad) const
Definition: HGCalDDDConstants.h:38
HGCalParameters::hgtrap::bl
float bl
Definition: HGCalParameters.h:49
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
HGCScintillatorDetId::setType
void setType(int type)
Definition: HGCScintillatorDetId.cc:72
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:613
HGCalGeometry::m_cellVec
CellVec m_cellVec
Definition: HGCalGeometry.h:138
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
HGCScintillatorDetId::ring
int ring() const
get the eta index
Definition: HGCScintillatorDetId.cc:44
HGCalDDDConstants::waferTypeT
int waferTypeT(int wafer) const
Definition: HGCalDDDConstants.h:192
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:53
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:568
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:190
FlatTrd::k_Cell
static constexpr uint32_t k_Cell
Definition: FlatTrd.h:45
HGCalParameters::hgtrap::cellSize
float cellSize
Definition: HGCalParameters.h:49
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:1390
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:254
CaloSubdetectorGeometry::TrVec
std::vector< CCGFloat > TrVec
Definition: CaloSubdetectorGeometry.h:33
cells
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ cells
Definition: CAHitNtupletGeneratorKernelsImpl.h:33
typelookup.h
HGCalTopology::decode
DecodedDetId decode(const DetId &id) const
Definition: HGCalTopology.cc:589
HGCalParameters::hgtrap::alpha
float alpha
Definition: HGCalParameters.h:49
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:235
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:522
HGCalGeometry::getSummary
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
Definition: HGCalGeometry.cc:668
ReferenceCountingPointer< Plane >
HGCalParameters::hgtrap::dz
float dz
Definition: HGCalParameters.h:49
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:404
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:527
HGCalParameters::hgtrap::tl
float tl
Definition: HGCalParameters.h:49
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
cms::cuda::co
__host__ __device__ VT * co
Definition: prefixScan.h:47
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::tileType
std::pair< int, int > tileType(int layer, int ring, int phi) const
Definition: HGCalDDDConstants.h:116
HGCalDDDConstants::waferInLayer
bool waferInLayer(int wafer, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:1186
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:128
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:770
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:949
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
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
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:166
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
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
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:553
HGCalGeometry::k_fac1
static constexpr double k_fac1
Definition: HGCalGeometry.h:134
HGCalParameters::hgtrap::h
float h
Definition: HGCalParameters.h:49
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:434
PVValHelper::dy
Definition: PVValidationHelpers.h:50
HGCalGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Definition: HGCalGeometry.cc:198
HGCalGeometry::getClosestCell
DetId getClosestCell(const GlobalPoint &r) const override
Definition: HGCalGeometry.cc:470
HGCalDDDConstants::sectors
int sectors() const
Definition: HGCalDDDConstants.h:109
AnalyticalPropagator.h
HGCalGeometry::twoBysqrt3_
const double twoBysqrt3_
Definition: HGCalGeometry.h:143
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
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:53
HGCalDDDConstants::getTrForm
HGCalParameters::hgtrform getTrForm(unsigned int k) const
Definition: HGCalDDDConstants.h:66
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:927
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:268
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:551
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:701
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:284
HGCalTopology::encode
DetId encode(const DecodedDetId &id_) const
Definition: HGCalTopology.cc:635
PVValHelper::dz
Definition: PVValidationHelpers.h:51
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
HGCalParameters::lastModule_
std::vector< int > lastModule_
Definition: HGCalParameters.h:167
HGCScintillatorDetId::setSiPM
void setSiPM(int sipm)
Definition: HGCScintillatorDetId.cc:77
Exception.h
HGCalGeometry::indexFor
unsigned int indexFor(const DetId &id) const override
Definition: HGCalGeometry.cc:538
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:52
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:464
HGCHEF
Definition: ForwardSubdetector.h:9
HGCalGeometry::getClosestCellIndex
unsigned int getClosestCellIndex(const GlobalPoint &r) const
Definition: HGCalGeometry.cc:617
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:67
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:47
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:181
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:59
PVValHelper::dx
Definition: PVValidationHelpers.h:49
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:363
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:320
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