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!";
70 unsigned int wmaxEE(0), wmaxFH(0);
76 eeOffset_ = (geomEE->topology().dddConstants()).getLayerOffset();
77 wmaxEE = (geomEE->topology().dddConstants()).waferCount(0);
80 fhOffset_ = (geomFH->topology().dddConstants()).getLayerOffset();
81 wmaxFH = (geomFH->topology().dddConstants()).waferCount(0);
85 bhOffset_ = (geomBH->topology().dddConstants()).getLayerOffset();
88 bhMaxIphi_ = geomBH->topology().dddConstants().maxCells(
true);
93 eeOffset_ = (geomEE->topology().dddConstants()).getLayerOffset();
94 wmaxEE = 1 + (geomEE->topology().dddConstants()).waferMax();
97 fhOffset_ = (geomFH->topology().dddConstants()).getLayerOffset();
101 wmaxFH = 1 + (geomFH->topology().dddConstants()).waferMax();
150 z = (layer > 0) ? ddd->
waferZ(lay,
true) : -ddd->
waferZ(lay,
true);
158 z = (layer > 0) ? ddd->
waferZ(lay,
true) : -ddd->
waferZ(lay,
true);
181 std::float_t thick(0.37);
184 auto ddd = get_ddd(
geom, hid);
188 auto ddd = get_ddd(
geom, hid);
192 auto ddd = get_ddd(
geom, hid);
195 LogDebug(
"getSiThickness::InvalidSiliconDetid")
196 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
220 assert(thickIndex > 0 &&
"ERROR - silicon thickness has a nonsensical value");
227 LogDebug(
"getScintDEtaDPhi::InvalidScintDetid")
228 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal scintillator!";
232 return {cellGeom->etaSpan(), cellGeom->phiSpan()};
240 auto ddd = get_ddd(
geom, hid);
244 auto ddd = get_ddd(
geom, hid);
248 auto ddd = get_ddd(
geom, hid);
252 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
263 layer = (geomEE->topology().dddConstants()).
layers(
true);
269 layer = (geomFH->topology().dddConstants()).
layers(
true);
275 layer = (geomBH->topology().dddConstants())->getMaxDepth(1);
281 layer = (geomEE->topology().dddConstants()).
layers(
true);
284 layer += (geomFH->topology().dddConstants()).
layers(
true);
288 layer += (geomBH->topology().dddConstants())->getMaxDepth(1);
292 layer += (geomBH2->topology().dddConstants()).
layers(
true);
298 layer = (geomHFN->topology().dddConstants()).
layers(
true);
304 return (
unsigned int)(layer);
313 layer = (geomEE->topology().dddConstants()).
layers(
true);
319 layer = (geomFH->topology().dddConstants()).
layers(
true);
325 layer = (geomBH->topology().dddConstants()).
layers(
true);
332 layer = (geomHFN->topology().dddConstants()).
layers(
true);
336 layer = (geomEE->topology().dddConstants()).
layers(
true);
339 layer += (geomFH->topology().dddConstants()).
layers(
true);
346 return (
unsigned int)(layer);
392 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
410 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
412 return std::pair<int, int>(cellU, cellV);
420 auto ddd = get_ddd(
geom, hid);
438 return isonlysilicon;
443 return corrected_position.
eta();
465 float pt = hitEnergy / cosh(
eta);
472 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)
int cellU() const
get the cell #'s in u,v or in x,y
Global3DPoint GlobalPoint
int waferTypeT(int wafer) const
Log< level::Error, false > LogError
int layer() const
get the layer #
bool isHalfCell(int waferType, int cell) const
int layer() const
get the layer #
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
int zside() const
get the z-side of the cell (1/-1)
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.
int zside() const
get the z-side of the cell (1/-1)
double cellThickness(int layer, int waferU, int waferV) const
int layer() const
get the layer #
GlobalPoint getPosition(const DetId &id, bool debug=false) const
static int position[264][3]
int32_t waferV(const int32_t index)
int 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