27 throw cms::Exception(
"TotemT2Segmentation") <<
"Failed to retrieve list of bins for TotemT2DetId " << detid <<
".";
28 if (static_cast<size_t>(
hist->GetXaxis()->GetNbins()) !=
nbinsx_ ||
29 static_cast<size_t>(
hist->GetYaxis()->GetNbins()) !=
nbinsy_)
31 <<
"Trying to fill a summary plot with invalid number of bins. " 32 <<
"Should be of dimension (" <<
nbinsx_ <<
", " <<
nbinsy_ <<
"), but has dimension (" 33 <<
hist->GetXaxis()->GetNbins() <<
", " <<
hist->GetYaxis()->GetNbins() <<
").";
39 std::vector<std::pair<short, short> >
bins;
45 const float max_half_angle_rad = 0.3;
52 const float tile_angle_rad = (180 - 45. / 2 - (detid.
plane() % 2 ? 45 : 0) - (detid.
channel() * 90)) *
M_PI / 180.;
55 for (
size_t ix = 0; ix <
nbinsx_; ++ix)
56 for (
size_t iy = 0; iy <
nbinsy_; ++iy) {
57 const auto ell_rad_norm =
std::pow((ix - ox) / ax, 2) +
std::pow((iy - oy) / by, 2);
58 if (ell_rad_norm < 1. && ell_rad_norm >= 0.1 &&
59 fabs(std::atan2(iy - oy, ix - ox) - tile_angle_rad) < max_half_angle_rad)
60 bins.emplace_back(ix, iy);
constexpr int32_t ceil(float num)
TotemT2Segmentation(size_t, size_t)
Detector ID class for Totem T2 detectors. Bits [19:31] : Base CTPPSDetId class attributes Bits [16:18...
void fill(TH2D *, const TotemT2DetId &, double value=1.)
static constexpr uint32_t maxChannel
static constexpr uint32_t maxPlane
static const uint32_t maxArm
std::unordered_map< TotemT2DetId, std::vector< std::pair< short, short > > > bins_map_
std::vector< std::pair< short, short > > computeBins(const TotemT2DetId &detid) const