18 template <
typename DDD>
19 inline void check_ddd(
const DDD* ddd) {
21 throw cms::Exception(
"hgcal::HGCalTriggerTools") <<
"DDDConstants not accessible to hgcal::HGCalTriggerTools!";
25 template <
typename GEOM>
26 inline void check_geom(
const GEOM*
geom) {
27 if (
nullptr == geom) {
28 throw cms::Exception(
"hgcal::HGCalTriggerTools") <<
"Geometry not provided yet to hgcal::HGCalTriggerTools!";
51 throw cms::Exception(
"hgcal::HGCalTriggerTools") <<
"method getTCPosition called for DetId not belonging to a TC";
119 unsigned int l =
layer(
id);
134 em = (
id.subdetId() ==
HGCEE);
144 bool silicon =
false;
146 silicon = (
id.subdetId() !=
HGCHEB);
175 unsigned det =
id.det();
185 std::array<unsigned, 3>
occurences = {{0, 0, 0}};
188 int c_thickness = -1;
195 if (c_thickness < 0 ||
unsigned(c_thickness) >= occurences.size()) {
196 throw cms::Exception(
"OutOfBound") <<
"Found thickness index = " << c_thickness;
198 occurences[c_thickness]++;
200 thickness = std::max_element(occurences.begin(), occurences.end()) - occurences.begin();
214 return corrected_position.
eta();
219 return getEta(position, vertex_z);
223 float phi = atan2(position.
y(), position.
x());
234 float pt = hitEnergy / cosh(eta);
240 return getPt(position, hitEnergy, vertex_z);
253 return getLayerZ(subdet, layerWithOffset - offset);
257 float layerGlobalZ = 0.;
285 int layer = 0, cell = 0,
sec = 0, subsec = 0, zp = 0;
289 auto recoLayerCell = dddConst.simToReco(cell, layer,
sec, topo.
detectorType());
290 cell = recoLayerCell.first;
291 layer = recoLayerCell.second;
292 if (layer >= 0 && cell >= 0) {
310 switch (
id.subdetId()) {
const HcalDDDRecConstants * dddConstants() const
virtual geom_set getCellsFromTriggerCell(const unsigned cell_det_id) const =0
HGCalTriggerSubdetector subdet() const
get the subdetector
int zside() const
get the z-side of the cell (1/-1)
const HGCalTopology & eeTopology() const
Global3DPoint GlobalPoint
int zside() const
get the z-side of the cell (1/-1)
bool detectorType() const
int zside() const
get the z-side of the cell (1/-1)
int type() const
get the type
int layer() const
get the layer #
int depth() const
get the tower depth
unsigned int layers(bool reco) const
int zside() const
get the z-side of the cell (1/-1)
const HcalTopology & bhTopology() const
int type() const
get the type
int layer() const
get the layer #
double getRZ(const int &subdet, const int &ieta, const int &depth) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
int waferTypeL(int wafer) const
double waferZ(int layer, bool reco) const
const HGCalDDDConstants & dddConstants() const
const HGCalTopology & hscTopology() const
int getMaxDepth(const int &type) const
bool isV9Geometry() const
int layer() const
get the layer #
int zside() const
get the z-side of the cell (1/-1)
static int position[264][3]
DetId relabel(const uint32_t testId) const
std::pair< int, int > getEtaRange(const int &i) const
T const * product() const
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
const HGCalTopology & fhTopology() const
int layer() const
get the layer #
virtual GlobalPoint getTriggerCellPosition(const unsigned trigger_cell_det_id) const =0
constexpr Detector det() const
get the detector field from this detid