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!";
213 if (thickness > 99. && thickness < 121.)
215 else if (thickness > 199. && thickness < 201.)
217 else if (thickness > 299. && thickness < 301.)
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();
453 float phi = atan2(position.
y(), position.
x());
459 float phi = atan2(position.
y(), position.
x());
465 float pt = hitEnergy / cosh(eta);
472 float pt = hitEnergy / cosh(eta);
bool isHalfCell(int waferType, int cell) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
int zside() const
get the z-side of the cell (1/-1)
constexpr int zside() const
get the z-side of the cell (1/-1)
int type() const
get the type
double cellSizeHex(int type) const
int cellU() const
get the cell #'s in u,v or in x,y
double cellThickness(int layer, int waferU, int waferV) const
int32_t waferU(const int32_t index)
Global3DPoint GlobalPoint
GlobalPoint getPosition(const DetId &id) const
int zside() const
get the z-side of the cell (1/-1)
Log< level::Error, false > LogError
int cellU() const
get the cell #'s in u,v or in x,y
constexpr std::array< uint8_t, layerIndexSize > layer
int zside() const
get the z-side of the cell (1/-1)
int layer() const
get the layer #
int type() const
get the type
int layer() const
get the layer #
const HGCalTopology & topology() const
Abs< T >::type abs(const T &t)
int wafer() const
get the wafer #
double waferZ(int layer, bool reco) const
int cell() const
get the absolute value of the cell #'s in x and y
const HGCalDDDConstants & dddConstants() 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.
bool maskCell(const DetId &id, int corners) const
int layer() const
get the layer #
int zside() const
get the z-side of the cell (1/-1)
static int position[264][3]
int32_t waferV(const int32_t index)
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
int waferType() const
get the wafer type
constexpr int depth() const
get the tower depth
int waferTypeT(int wafer) const
tuple size
Write out results.
int layer() const
get the layer #