18 using namespace hgcal;
21 template <
typename DDD>
22 inline void check_ddd(
const DDD* ddd) {
24 throw cms::Exception(
"hgcal::RecHitTools") <<
"DDDConstants not accessibl to hgcal::RecHitTools!";
28 template <
typename GEOM>
29 inline void check_geom(
const GEOM*
geom) {
30 if (
nullptr ==
geom) {
31 throw cms::Exception(
"hgcal::RecHitTools") <<
"Geometry not provided yet to hgcal::RecHitTools!";
81 unsigned int wmaxEE(0), wmaxFH(0);
87 eeOffset_ = (geomEE->topology().dddConstants()).getLayerOffset();
88 wmaxEE = (geomEE->topology().dddConstants()).waferCount(0);
91 fhOffset_ = (geomFH->topology().dddConstants()).getLayerOffset();
92 wmaxFH = (geomFH->topology().dddConstants()).waferCount(0);
96 bhOffset_ = (geomBH->topology().dddConstants()).getLayerOffset();
99 bhMaxIphi_ = geomBH->topology().dddConstants().maxCells(
true);
104 eeOffset_ = (geomEE->topology().dddConstants()).getLayerOffset();
105 wmaxEE = 1 + (geomEE->topology().dddConstants()).waferMax();
108 fhOffset_ = (geomFH->topology().dddConstants()).getLayerOffset();
112 wmaxFH = 1 + (geomFH->topology().dddConstants()).waferMax();
161 z = (layer > 0) ? ddd->
waferZ(lay,
true) : -ddd->
waferZ(lay,
true);
169 z = (layer > 0) ? ddd->
waferZ(lay,
true) : -ddd->
waferZ(lay,
true);
192 std::float_t thick(0.37);
195 auto ddd = get_ddd(
geom, hid);
199 auto ddd = get_ddd(
geom, hid);
203 auto ddd = get_ddd(
geom, hid);
206 LogDebug(
"getSiThickness::InvalidSiliconDetid")
207 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
231 assert(thickIndex > 0 &&
"ERROR - silicon thickness has a nonsensical value");
238 LogDebug(
"getScintDEtaDPhi::InvalidScintDetid")
239 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal scintillator!";
243 return {cellGeom->etaSpan(), cellGeom->phiSpan()};
251 auto ddd = get_ddd(
geom, hid);
255 auto ddd = get_ddd(
geom, hid);
259 auto ddd = get_ddd(
geom, hid);
263 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
274 layer = (geomEE->topology().dddConstants()).
layers(
true);
280 layer = (geomFH->topology().dddConstants()).
layers(
true);
286 layer = (geomBH->topology().dddConstants())->getMaxDepth(1);
292 layer = (geomEE->topology().dddConstants()).
layers(
true);
295 layer += (geomFH->topology().dddConstants()).
layers(
true);
299 layer += (geomBH->topology().dddConstants())->getMaxDepth(1);
303 layer += (geomBH2->topology().dddConstants()).
layers(
true);
309 layer = (geomHFN->topology().dddConstants()).
layers(
true);
315 return (
unsigned int)(layer);
324 layer = (geomEE->topology().dddConstants()).
layers(
true);
330 layer = (geomFH->topology().dddConstants()).
layers(
true);
336 layer = (geomBH->topology().dddConstants()).
layers(
true);
343 layer = (geomHFN->topology().dddConstants()).
layers(
true);
347 layer = (geomEE->topology().dddConstants()).
layers(
true);
350 layer += (geomFH->topology().dddConstants()).
layers(
true);
357 return (
unsigned int)(layer);
408 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
426 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
428 return std::pair<int, int>(cellU, cellV);
436 auto ddd = get_ddd(
geom, hid);
449 auto isNose = geomNose ?
true :
false;
450 auto isEELayer = (layer_number <=
lastLayerEE(isNose));
455 layerType = CE_H_SCINT;
459 layerType = CE_E_120;
461 layerType = CE_E_200;
463 layerType = CE_E_300;
467 layerType = CE_H_120;
469 layerType = CE_H_200;
471 layerType = CE_H_300;
488 return isonlysilicon;
493 return corrected_position.
eta();
515 float pt = hitEnergy / cosh(
eta);
522 float pt = hitEnergy / cosh(
eta);
bool maskCell(const DetId &id, int corners) const
double waferZ(int layer, bool reco) const
int wafer() const
get the wafer #
int waferType() const
get the wafer type
int layer() const
get the layer #
constexpr int zside() const
get the z-side of the cell (1/-1)
int32_t waferU(const int32_t index)
Global3DPoint GlobalPoint
int waferTypeT(int wafer) const
constexpr int zside() const
get the z-side of the cell (1/-1)
Log< level::Error, false > LogError
constexpr int32_t waferV() const
GlobalPoint getPosition(const DetId &id, bool cog, bool debug) const
bool isHalfCell(int waferType, int cell) const
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
Abs< T >::type abs(const T &t)
int zside() const
get the z-side of the cell (1/-1)
int cellU() const
get the cell #'s in u,v or in x,y
constexpr int32_t cellU() const
get the cell #'s in u,v or in x,y
int type() const
get the type
const HGCalTopology & topology() const
int cell() const
get the absolute value of the cell #'s in x and y
double cellSizeHex(int type) const
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
double cellThickness(int layer, int waferU, int waferV) const
int layer() const
get the layer #
constexpr int32_t layer() const
get the layer #
constexpr int32_t cellV() const
constexpr int layer() const
get the layer #
static int position[264][3]
int32_t waferV(const int32_t index)
constexpr int32_t waferU() const
constexpr int32_t type() const
get the type
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
const HGCalDDDConstants & dddConstants() const
int zside() const
get the z-side of the cell (1/-1)
constexpr int depth() const
get the tower depth