CMS 3D CMS Logo

HGCalTBGeometry.cc
Go to the documentation of this file.
1 /* for High Granularity Calorimeter TestBeam
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  m_cellVec = CellVec(topology_.totalGeomModules());
34 #ifdef EDM_ML_DEBUG
35  edm::LogVerbatim("HGCalGeom") << "Expected total # of Geometry Modules " << m_topology.totalGeomModules();
36 #endif
37 }
38 
40 
42 
44 
45 void HGCalTBGeometry::localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref) {
46  FlatHexagon::localCorners(lc, pv, ref);
47 }
48 
50  const GlobalPoint& f1, const GlobalPoint& f2, const GlobalPoint& f3, const CCGFloat* parm, const DetId& detId) {
51  DetId geomId = getGeometryDetId(detId);
52  int cells(0);
55 #ifdef EDM_ML_DEBUG
56  edm::LogVerbatim("HGCalGeom") << "NewCell " << HGCalDetId(detId) << " GEOM " << HGCalDetId(geomId);
57 #endif
58  const uint32_t cellIndex(m_topology.detId2denseGeomId(geomId));
59 
60  m_cellVec.at(cellIndex) = FlatHexagon(cornersMgr(), f1, f2, f3, parm);
61  m_validGeomIds.at(cellIndex) = geomId;
62 
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HGCalGeom") << "Store for DetId " << std::hex << detId.rawId() << " GeomId " << geomId.rawId()
65  << std::dec << " Index " << cellIndex << " cells " << cells;
66  unsigned int nOld = m_validIds.size();
67 #endif
68  for (int cell = 0; cell < cells; ++cell) {
69  id.iCell1 = cell;
70  DetId idc = m_topology.encode(id);
71  if (m_topology.valid(idc)) {
72  m_validIds.emplace_back(idc);
73 #ifdef EDM_ML_DEBUG
74  edm::LogVerbatim("HGCalGeom") << "Valid Id [" << cell << "] " << HGCalDetId(idc);
75 #endif
76  }
77  }
78 #ifdef EDM_ML_DEBUG
79  edm::LogVerbatim("HGCalGeom") << "HGCalTBGeometry::newCell-> [" << cellIndex << "]"
80  << " front:" << f1.x() << '/' << f1.y() << '/' << f1.z() << " back:" << f2.x() << '/'
81  << f2.y() << '/' << f2.z() << " eta|phi " << m_cellVec[cellIndex].etaPos() << ":"
82  << m_cellVec[cellIndex].phiPos();
83  unsigned int nNew = m_validIds.size();
84  edm::LogVerbatim("HGCalGeom") << "ID: " << HGCalDetId(detId) << " with valid DetId from " << nOld << " to " << nNew;
85 #endif
86 }
87 
88 std::shared_ptr<const CaloCellGeometry> HGCalTBGeometry::getGeometry(const DetId& detId) const {
89  if (detId == DetId())
90  return nullptr; // nothing to get
91  DetId geomId = getGeometryDetId(detId);
92  const uint32_t cellIndex(m_topology.detId2denseGeomId(geomId));
93  const GlobalPoint pos = (detId != geomId) ? getPosition(detId, false) : GlobalPoint();
94  return cellGeomPtr(cellIndex, pos);
95 }
96 
97 bool HGCalTBGeometry::present(const DetId& detId) const {
98  if (detId == DetId())
99  return false;
100  DetId geomId = getGeometryDetId(detId);
101  const uint32_t index(m_topology.detId2denseGeomId(geomId));
102  return (nullptr != getGeometryRawPtr(index));
103 }
104 
106  unsigned int cellIndex = indexFor(detid);
107  GlobalPoint glob;
108  unsigned int maxSize = m_cellVec.size();
109  if (cellIndex < maxSize) {
111  std::pair<float, float> xy;
112  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
113  const HepGeom::Point3D<float> lcoord(xy.first, xy.second, 0);
114  glob = m_cellVec[cellIndex].getPosition(lcoord);
115  if (debug)
116  edm::LogVerbatim("HGCalGeom") << "getPosition:: index " << cellIndex << " Local " << lcoord.x() << ":"
117  << lcoord.y() << " ID " << id.iCell1 << ":" << id.iSec1 << " Global " << glob;
118  }
119  return glob;
120 }
121 
123  unsigned int cellIndex = indexFor(detid);
124  GlobalPoint glob;
125  unsigned int maxSize = m_cellVec.size();
126  if (cellIndex < maxSize) {
127  const HepGeom::Point3D<float> lcoord(0, 0, 0);
128  glob = m_cellVec[cellIndex].getPosition(lcoord);
129 #ifdef EDM_ML_DEBUG
130  edm::LogVerbatim("HGCalGeom") << "getWaferPosition:: ID " << std::hex << detid.rawId() << std::dec << " index "
131  << cellIndex << " Global " << glob;
132 #endif
133  }
134  return glob;
135 }
136 
137 double HGCalTBGeometry::getArea(const DetId& detid) const {
139  double area(0);
140  if (corners.size() > 1) {
141  int n = corners.size() - 1;
142  int j = n - 1;
143  for (int i = 0; i < n; ++i) {
144  area += ((corners[j].x() + corners[i].x()) * (corners[i].y() - corners[j].y()));
145  j = i;
146  }
147  }
148  return std::abs(0.5 * area);
149 }
150 
152  unsigned int ncorner = ((m_det == DetId::HGCalHSc) ? FlatTrd::ncorner_ : FlatHexagon::ncorner_);
153  HGCalTBGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
154  unsigned int cellIndex = indexFor(detid);
156  if (cellIndex < m_cellVec.size()) {
157  std::pair<float, float> xy;
158  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
159  float dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
160  float dy = k_half * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
161  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
162  static const int signx[] = {0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1};
163  static const int signy[] = {-2, -1, 1, 2, 1, -1, -2, -1, 1, 2, 1, -1};
164  static const int signz[] = {-1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1};
165  for (unsigned int i = 0; i < ncorner; ++i) {
166  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dy, signz[i] * dz);
167  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
168  }
169  }
170  return co;
171 }
172 
174  unsigned int ncorner = FlatTrd::ncorner_;
175  HGCalTBGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
176  unsigned int cellIndex = indexFor(detid);
178  if (cellIndex < m_cellVec.size()) {
179  std::pair<float, float> xy;
180  float dx(0);
181  static const int signx[] = {-1, -1, 1, 1, -1, -1, 1, 1};
182  static const int signy[] = {-1, 1, 1, -1, -1, 1, 1, -1};
183  static const int signz[] = {-1, -1, -1, -1, 1, 1, 1, 1};
184  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
185  dx = m_cellVec[cellIndex].param()[FlatHexagon::k_r];
186  float dz = m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
187  for (unsigned int i = 0; i < ncorner; ++i) {
188  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dx, signz[i] * dz);
189  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
190  }
191  }
192  return co;
193 }
194 
196  unsigned int ncorner = (m_det == DetId::HGCalHSc) ? 5 : 7;
197  HGCalTBGeometry::CornersVec co(ncorner, GlobalPoint(0, 0, 0));
198  unsigned int cellIndex = indexFor(detid);
200  if (debug)
201  edm::LogVerbatim("HGCalGeom") << "NewCorners for Layer " << id.iLay << " Wafer " << id.iSec1 << ":" << id.iSec2
202  << " Cell " << id.iCell1 << ":" << id.iCell2;
203  if (cellIndex < m_cellVec.size()) {
204  std::pair<float, float> xy;
205  float dx = k_fac2 * m_cellVec[cellIndex].param()[FlatHexagon::k_r];
206  float dy = k_fac1 * m_cellVec[cellIndex].param()[FlatHexagon::k_R];
207  float dz = -id.zSide * m_cellVec[cellIndex].param()[FlatHexagon::k_dZ];
208  static const int signx[] = {1, -1, -2, -1, 1, 2};
209  static const int signy[] = {1, 1, 0, -1, -1, 0};
210 #ifdef EDM_ML_DEBUG
211  if (debug)
212  edm::LogVerbatim("HGCalGeom") << "kfac " << k_fac1 << ":" << k_fac2 << " dx:dy:dz " << dx << ":" << dy << ":"
213  << dz;
214 #endif
215  xy = m_topology.dddConstants().locateCellHex(id.iCell1, id.iSec1, true);
216  for (unsigned int i = 0; i < ncorner - 1; ++i) {
217  const HepGeom::Point3D<float> lcoord(xy.first + signx[i] * dx, xy.second + signy[i] * dy, dz);
218  co[i] = m_cellVec[cellIndex].getPosition(lcoord);
219  }
220  // Used to pass downstream the thickness of this cell
221  co[ncorner - 1] = GlobalPoint(0, 0, -2 * dz);
222  }
223  return co;
224 }
225 
226 DetId HGCalTBGeometry::neighborZ(const DetId& idin, const GlobalVector& momentum) const {
227  DetId idnew;
229  int lay = ((momentum.z() * id.zSide > 0) ? (id.iLay + 1) : (id.iLay - 1));
230 #ifdef EDM_ML_DEBUG
231  edm::LogVerbatim("HGCalGeom") << "neighborz1:: ID " << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":"
232  << id.iCell1 << ":" << id.iCell2 << " New Layer " << lay << " Range "
233  << m_topology.dddConstants().firstLayer() << ":"
234  << m_topology.dddConstants().lastLayer(true) << " pz " << momentum.z();
235 #endif
236  if ((lay >= m_topology.dddConstants().firstLayer()) && (lay <= m_topology.dddConstants().lastLayer(true)) &&
237  (momentum.z() != 0.0)) {
238  GlobalPoint v = getPosition(idin, false);
239  double z = id.zSide * m_topology.dddConstants().waferZ(lay, true);
240  double grad = (z - v.z()) / momentum.z();
241  GlobalPoint p(v.x() + grad * momentum.x(), v.y() + grad * momentum.y(), z);
242  double r = p.perp();
243  auto rlimit = topology().dddConstants().rangeR(z, true);
244  if (r >= rlimit.first && r <= rlimit.second)
245  idnew = getClosestCell(p);
246 #ifdef EDM_ML_DEBUG
247  edm::LogVerbatim("HGCalGeom") << "neighborz1:: Position " << v << " New Z " << z << ":" << grad << " new position "
248  << p << " r-limit " << rlimit.first << ":" << rlimit.second;
249 #endif
250  }
251  return idnew;
252 }
253 
255  const MagneticField* bField,
256  int charge,
257  const GlobalVector& momentum) const {
258  DetId idnew;
260  int lay = ((momentum.z() * id.zSide > 0) ? (id.iLay + 1) : (id.iLay - 1));
261 #ifdef EDM_ML_DEBUG
262  edm::LogVerbatim("HGCalGeom") << "neighborz2:: ID " << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":"
263  << id.iCell1 << ":" << id.iCell2 << " New Layer " << lay << " Range "
264  << m_topology.dddConstants().firstLayer() << ":"
265  << m_topology.dddConstants().lastLayer(true) << " pz " << momentum.z();
266 #endif
267  if ((lay >= m_topology.dddConstants().firstLayer()) && (lay <= m_topology.dddConstants().lastLayer(true)) &&
268  (momentum.z() != 0.0)) {
269  GlobalPoint v = getPosition(idin, false);
270  double z = id.zSide * m_topology.dddConstants().waferZ(lay, true);
271  FreeTrajectoryState fts(v, momentum, charge, bField);
274  TrajectoryStateOnSurface tsos = myAP.propagate(fts, *nPlane);
275  GlobalPoint p;
276  auto rlimit = topology().dddConstants().rangeR(z, true);
277  if (tsos.isValid()) {
278  p = tsos.globalPosition();
279  double r = p.perp();
280  if (r >= rlimit.first && r <= rlimit.second)
281  idnew = getClosestCell(p);
282  }
283 #ifdef EDM_ML_DEBUG
284  edm::LogVerbatim("HGCalGeom") << "neighborz2:: Position " << v << " New Z " << z << ":" << charge << ":"
285  << tsos.isValid() << " new position " << p << " r limits " << rlimit.first << ":"
286  << rlimit.second;
287 #endif
288  }
289  return idnew;
290 }
291 
293  unsigned int cellIndex = getClosestCellIndex(r);
294  if (cellIndex < m_cellVec.size()) {
296  if (id.det == 0)
297  id.det = static_cast<int>(m_topology.detector());
298  HepGeom::Point3D<float> local;
299  if (r.z() > 0) {
300  local = HepGeom::Point3D<float>(r.x(), r.y(), 0);
301  id.zSide = 1;
302  } else {
303  local = HepGeom::Point3D<float>(-r.x(), r.y(), 0);
304  id.zSide = -1;
305  }
306  const auto& kxy = m_topology.dddConstants().assignCell(local.x(), local.y(), id.iLay, id.iType, true);
307  id.iCell1 = kxy.second;
308  id.iSec1 = kxy.first;
309  id.iType = m_topology.dddConstants().waferTypeT(kxy.first);
310  if (id.iType != 1)
311  id.iType = -1;
312 #ifdef EDM_ML_DEBUG
313  edm::LogVerbatim("HGCalGeom") << "getClosestCell: local " << local << " Id " << id.det << ":" << id.zSide << ":"
314  << id.iLay << ":" << id.iSec1 << ":" << id.iSec2 << ":" << id.iType << ":"
315  << id.iCell1 << ":" << id.iCell2;
316 #endif
317  //check if returned cell is valid
318  if (id.iCell1 >= 0)
319  return m_topology.encode(id);
320  }
321 
322  //if not valid or out of bounds return a null DetId
323  return DetId();
324 }
325 
328  return dss;
329 }
330 
332  if (m_subdet == HGCEE)
333  return "HGCalEE";
334  else if (m_subdet == HGCHEF)
335  return "HGCalHEFront";
336  else
337  return "Unknown";
338 }
339 
340 unsigned int HGCalTBGeometry::indexFor(const DetId& detId) const {
341  unsigned int cellIndex = m_cellVec.size();
342  if (detId != DetId()) {
343  DetId geomId = getGeometryDetId(detId);
344  cellIndex = m_topology.detId2denseGeomId(geomId);
345 #ifdef EDM_ML_DEBUG
346  edm::LogVerbatim("HGCalGeom") << "indexFor " << std::hex << detId.rawId() << ":" << geomId.rawId() << std::dec
347  << " index " << cellIndex;
348 #endif
349  }
350  return cellIndex;
351 }
352 
354 
356  // Modify the RawPtr class
357  if (m_cellVec.size() < index)
358  return nullptr;
359  const CaloCellGeometry* cell(&m_cellVec[index]);
360  return (nullptr == cell->param() ? nullptr : cell);
361 }
362 
363 std::shared_ptr<const CaloCellGeometry> HGCalTBGeometry::cellGeomPtr(uint32_t index) const {
364  if (index >= m_cellVec.size())
365  return nullptr;
366  static const auto do_not_delete = [](const void*) {};
367  auto cell = std::shared_ptr<const CaloCellGeometry>(&m_cellVec[index], do_not_delete);
368  if (nullptr == cell->param())
369  return nullptr;
370  return cell;
371 }
372 
373 std::shared_ptr<const CaloCellGeometry> HGCalTBGeometry::cellGeomPtr(uint32_t index, const GlobalPoint& pos) const {
374  if ((index >= m_cellVec.size()) || (m_validGeomIds[index].rawId() == 0))
375  return nullptr;
376  if (pos == GlobalPoint())
377  return cellGeomPtr(index);
378  auto cell = std::make_shared<FlatHexagon>(m_cellVec[index]);
379  cell->setPosition(pos);
380 #ifdef EDM_ML_DEBUG
381  edm::LogVerbatim("HGCalGeom") << "cellGeomPtr " << index << ":" << cell;
382 #endif
383  if (nullptr == cell->param())
384  return nullptr;
385  return cell;
386 }
387 
389  edm::LogError("HGCalGeom") << "HGCalTBGeometry::addValidID is not implemented";
390 }
391 
393  return (getClosestCellIndex(r, m_cellVec));
394 }
395 
396 template <class T>
397 unsigned int HGCalTBGeometry::getClosestCellIndex(const GlobalPoint& r, const std::vector<T>& vec) const {
398  float phip = r.phi();
399  float zp = r.z();
400  float dzmin(9999), dphimin(9999), dphi10(0.175);
401  unsigned int cellIndex = vec.size();
402  for (unsigned int k = 0; k < vec.size(); ++k) {
403  float dphi = phip - vec[k].phiPos();
404  while (dphi > M_PI)
405  dphi -= 2 * M_PI;
406  while (dphi <= -M_PI)
407  dphi += 2 * M_PI;
408  if (std::abs(dphi) < dphi10) {
409  float dz = std::abs(zp - vec[k].getPosition().z());
410  if (dz < (dzmin + 0.001)) {
411  dzmin = dz;
412  if (std::abs(dphi) < (dphimin + 0.01)) {
413  cellIndex = k;
414  dphimin = std::abs(dphi);
415  } else {
416  if (cellIndex >= vec.size())
417  cellIndex = k;
418  }
419  }
420  }
421  }
422 #ifdef EDM_ML_DEBUG
423  edm::LogVerbatim("HGCalGeom") << "getClosestCellIndex::Input " << zp << ":" << phip << " Index " << cellIndex;
424  if (cellIndex < vec.size())
425  edm::LogVerbatim("HGCalGeom") << " Cell z " << vec[cellIndex].getPosition().z() << ":" << dzmin << " phi "
426  << vec[cellIndex].phiPos() << ":" << dphimin;
427 #endif
428  return cellIndex;
429 }
430 
431 // FIXME: Change sorting algorithm if needed
432 namespace {
433  struct rawIdSort {
434  bool operator()(const DetId& a, const DetId& b) { return (a.rawId() < b.rawId()); }
435  };
436 } // namespace
437 
439  m_validIds.shrink_to_fit();
440  std::sort(m_validIds.begin(), m_validIds.end(), rawIdSort());
441 }
442 
446  CaloSubdetectorGeometry::IVec& dinsVector) const {
447  unsigned int numberOfCells = m_topology.totalGeomModules(); // total Geom Modules both sides
448  unsigned int numberOfShapes = k_NumberOfShapes;
449  unsigned int numberOfParametersPerShape = ((m_det == DetId::HGCalHSc) ? (unsigned int)(k_NumberOfParametersPerTrd)
450  : (unsigned int)(k_NumberOfParametersPerHex));
451 
452  trVector.reserve(numberOfCells * numberOfTransformParms());
453  iVector.reserve(numberOfCells);
454  dimVector.reserve(numberOfShapes * numberOfParametersPerShape);
455  dinsVector.reserve(numberOfCells);
456 
457  for (unsigned itr = 0; itr < m_topology.dddConstants().getTrFormN(); ++itr) {
459  int layer = mytr.lay;
460 
461  for (int wafer = 0; wafer < m_topology.dddConstants().sectors(); ++wafer) {
462  if (m_topology.dddConstants().waferInLayer(wafer, layer, true)) {
463  HGCalTBParameters::hgtrap vol = m_topology.dddConstants().getModule(wafer, true, true);
465  params[FlatHexagon::k_dZ] = vol.dz;
468  dimVector.insert(dimVector.end(), params.begin(), params.end());
469  }
470  }
471  }
472 
473  for (unsigned int i(0); i < numberOfCells; ++i) {
475  int layer = HGCalDetId(detId).layer();
476  dinsVector.emplace_back(m_topology.detId2denseGeomId(detId));
477  iVector.emplace_back(layer);
478 
479  Tr3D tr;
480  auto ptr = cellGeomPtr(i);
481  if (nullptr != ptr) {
482  ptr->getTransform(tr, (Pt3DVec*)nullptr);
483 
484  if (Tr3D() == tr) { // there is no rotation
485  const GlobalPoint& gp(ptr->getPosition());
486  tr = HepGeom::Translate3D(gp.x(), gp.y(), gp.z());
487  }
488 
489  const CLHEP::Hep3Vector tt(tr.getTranslation());
490  trVector.emplace_back(tt.x());
491  trVector.emplace_back(tt.y());
492  trVector.emplace_back(tt.z());
493  if (6 == numberOfTransformParms()) {
494  const CLHEP::HepRotation rr(tr.getRotation());
495  const ROOT::Math::Transform3D rtr(
496  rr.xx(), rr.xy(), rr.xz(), tt.x(), rr.yx(), rr.yy(), rr.yz(), tt.y(), rr.zx(), rr.zy(), rr.zz(), tt.z());
498  rtr.GetRotation(ea);
499  trVector.emplace_back(ea.Phi());
500  trVector.emplace_back(ea.Theta());
501  trVector.emplace_back(ea.Psi());
502  }
503  }
504  }
505 }
506 
508  return static_cast<DetId>(HGCalDetId(detId).geometryCell());
509 }
510 
512 
CornersVec getNewCorners(const DetId &id, bool debug=false) const
unsigned int totalGeomModules() const
Log< level::Info, true > LogVerbatim
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
CaloCellGeometry::Pt3DVec Pt3DVec
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.
std::vector< CCGFloat > DimVec
static constexpr unsigned int k_NumberOfParametersPerHex
const CaloCellGeometry * getGeometryRawPtr(uint32_t index) const override
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
bool waferInLayer(int wafer, int lay, bool reco) const
double getArea(const DetId &detid) const
Returns area of a cell.
int lastLayer(bool reco) const
static constexpr double k_fac1
T z() const
Definition: PV3DBase.h:61
virtual unsigned int numberOfTransformParms() const
DetId encode(const DecodedDetId &id_) const
unsigned int getClosestCellIndex(const GlobalPoint &r) const
static constexpr double k_half
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< unsigned int > IVec
int numberCellsHexagon(int wafer) const
void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId) override
double waferZ(int layer, bool reco) const
std::vector< CCGFloat > TrVec
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
HepGeom::Transform3D Tr3D
virtual unsigned int numberOfShapes() const
std::vector< GlobalPoint > CornersVec
Log< level::Error, false > LogError
__host__ __device__ VT * co
Definition: prefixScan.h:47
CaloCellGeometry::CCGFloat CCGFloat
static constexpr unsigned int k_NumberOfParametersPerTrd
ForwardSubdetector m_subdet
HGCalDetId geometryCell() const
Definition: HGCalDetId.h:34
static constexpr double k_fac2
std::pair< double, double > rangeR(double z, bool reco) const
std::vector< float > ParmVec
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:154
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:81
int waferTypeT(int wafer) const
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
void addValidID(const DetId &id)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
static constexpr unsigned int ncorner_
Definition: FlatTrd.h:97
const double twoBysqrt3_
Definition: TTTypes.h:54
static constexpr uint32_t k_R
Definition: FlatHexagon.h:29
DetId getClosestCell(const GlobalPoint &r) const override
GlobalPoint globalPosition() const
static constexpr uint32_t k_r
Definition: FlatHexagon.h:28
std::set< DetId > DetIdSet
std::string cellElement() const
std::vector< float > ParmVec
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< DetId > m_validIds
A base class to handle the hexagonal shape of HGCal silicon volumes.
Definition: FlatHexagon.h:20
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId getGeometryDetId(DetId detId) const
CaloCellGeometry::Pt3D Pt3D
HGCalTBGeometry(const HGCalTBTopology &topology)
DetIdSet getCells(const GlobalPoint &r, double dR) const override
Get a list of all cells within a dR of the given cell.
#define M_PI
std::shared_ptr< const CaloCellGeometry > cellGeomPtr(uint32_t index) const override
Definition: DetId.h:17
DecodedDetId decode(const DetId &id) const
AlgebraicVector EulerAngles
Definition: Definitions.h:34
unsigned int getTrFormN() const
const HGCalTBDDDConstants & dddConstants() const
#define debug
Definition: HDRShower.cc:19
HGCalTBParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const
std::vector< FlatHexagon > CellVec
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:27
virtual void fillNamedParams(DDFilteredView fv)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CornersVec get8Corners(const DetId &id) const
CaloCellGeometry::CornersMgr * cornersMgr()
const HGCalTBTopology & topology() const
bool valid(const DetId &id) const override
Is this a valid cell id.
int layer() const
get the layer #
Definition: HGCalDetId.h:46
double b
Definition: hdecay.h:120
virtual uint32_t detId2denseGeomId(const DetId &id) const
~HGCalTBGeometry() override
const HGCalTBTopology & m_topology
unsigned int totalModules() const
GlobalPoint getPosition(const DetId &id, bool debug=false) const
CaloCellGeometry::Tr3D Tr3D
CaloCellGeometry::Tr3D Tr3D
CornersVec getCorners(const DetId &id) const
Returns the corner points of this cell&#39;s volume.
std::vector< DetId > m_validGeomIds
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
unsigned int indexFor(const DetId &id) const override
double a
Definition: hdecay.h:121
GlobalPoint getWaferPosition(const DetId &id) const
void initializeParms() override
DetId neighborZ(const DetId &idin, const GlobalVector &p) const
DetId::Detector m_det
static constexpr unsigned int k_NumberOfShapes
bool present(const DetId &id) const override
is this detid present in the geometry?
unsigned int sizeForDenseIndex() const
HGCalTBParameters::hgtrform getTrForm(unsigned int k) const
const CCGFloat * param() const
void getSummary(CaloSubdetectorGeometry::TrVec &trVector, CaloSubdetectorGeometry::IVec &iVector, CaloSubdetectorGeometry::DimVec &dimVector, CaloSubdetectorGeometry::IVec &dinsVector) const override
void localCorners(Pt3DVec &lc, const CCGFloat *pv, unsigned int i, Pt3D &ref)
DetId::Detector detector() const
virtual unsigned int numberOfParametersPerShape() const