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!";
60 const HGCalGeometry* hg = static_cast<const HGCalGeometry*>(
geom->getSubdetectorGeometry(det, subdet));
70 unsigned int wmaxEE(0), wmaxFH(0);
71 auto geomEE = static_cast<const HGCalGeometry*>(
77 wmaxEE = (geomEE->topology().dddConstants()).waferCount(0);
78 auto geomFH = static_cast<const HGCalGeometry*>(
80 wmaxFH = (geomFH->topology().dddConstants()).waferCount(0);
82 auto geomBH = static_cast<const HGCalGeometry*>(
85 fhOffset_ + (geomBH->topology().dddConstants()).firstLayer() - (geomEE->topology().dddConstants()).firstLayer();
87 bhMaxIphi_ = geomBH->topology().dddConstants().maxCells(
true);
93 wmaxEE = 1 + (geomEE->topology().dddConstants()).waferMax();
97 wmaxFH = 1 + (geomFH->topology().dddConstants()).waferMax();
132 auto hg = static_cast<const HGCalGeometry*>(
geom);
178 std::float_t thick(0.37);
181 auto ddd = get_ddd(
geom, hid);
185 auto ddd = get_ddd(
geom, hid);
189 auto ddd = get_ddd(
geom, hid);
190 thick = ddd->cellThickness(hid.
layer(), hid.
wafer(), 0);
192 LogDebug(
"getSiThickness::InvalidSiliconDetid")
193 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
217 assert(thickIndex > 0 &&
"ERROR - silicon thickness has a nonsensical value");
227 auto ddd = get_ddd(
geom, hid);
228 size = ddd->cellSizeHex(hid.
type());
231 auto ddd = get_ddd(
geom, hid);
232 size = ddd->cellSizeHex(hid.
type());
235 auto ddd = get_ddd(
geom, hid);
239 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
250 layer = (geomEE->topology().dddConstants()).
layers(
true);
256 layer = (geomFH->topology().dddConstants()).
layers(
true);
262 layer = (geomBH->topology().dddConstants())->getMaxDepth(1);
268 layer = (geomEE->topology().dddConstants()).
layers(
true);
271 layer += (geomFH->topology().dddConstants()).
layers(
true);
275 layer += (geomBH->topology().dddConstants())->getMaxDepth(1);
279 layer += (geomBH2->topology().dddConstants()).
layers(
true);
285 layer = (geomHFN->topology().dddConstants()).
layers(
true);
291 return (
unsigned int)(
layer);
300 layer = (geomEE->topology().dddConstants()).
layers(
true);
306 layer = (geomFH->topology().dddConstants()).
layers(
true);
312 layer = (geomBH->topology().dddConstants()).
layers(
true);
317 auto geomHFN = static_cast<const HGCalGeometry*>(
319 layer = (geomHFN->topology().dddConstants()).
layers(
true);
321 auto geomEE = static_cast<const HGCalGeometry*>(
323 layer = (geomEE->topology().dddConstants()).
layers(
true);
324 auto geomFH = static_cast<const HGCalGeometry*>(
326 layer += (geomFH->topology().dddConstants()).
layers(
true);
333 return (
unsigned int)(
layer);
379 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
397 <<
"det id: " << std::hex <<
id.rawId() <<
std::dec <<
":" <<
id.det() <<
" is not HGCal silicon!";
399 return std::pair<int, int>(cellU, cellV);
407 auto ddd = get_ddd(
geom, hid);
408 const int waferType = ddd->waferTypeT(hid.
waferType());
409 return ddd->isHalfCell(waferType, hid.
cell());
423 return isonlysilicon;
428 return corrected_position.
eta();
450 float pt = hitEnergy / cosh(
eta);
457 float pt = hitEnergy / cosh(
eta);