28 throw cms::Exception(
"TotemT2Segmentation") <<
"Failed to retrieve list of bins for TotemT2DetId " << detid <<
".";
29 if (static_cast<size_t>(
hist->GetXaxis()->GetNbins()) !=
nbinsx_ ||
30 static_cast<size_t>(
hist->GetYaxis()->GetNbins()) !=
nbinsy_)
32 <<
"Trying to fill a summary plot with invalid number of bins. " 33 <<
"Should be of dimension (" <<
nbinsx_ <<
", " <<
nbinsy_ <<
"), but has dimension (" 34 <<
hist->GetXaxis()->GetNbins() <<
", " <<
hist->GetYaxis()->GetNbins() <<
").";
40 std::vector<std::pair<short, short> >
bins;
46 const float max_half_angle_rad = 0.3;
49 const auto tile_angle_rad = std::atan2(tile_centre.y(), tile_centre.x());
52 for (
size_t ix = 0; ix <
nbinsx_; ++ix)
53 for (
size_t iy = 0; iy <
nbinsy_; ++iy) {
54 const auto ell_rad_norm =
std::pow((ix - ox) / ax, 2) +
std::pow((iy - oy) / by, 2);
55 if (ell_rad_norm < 1. && ell_rad_norm >= 0.1 &&
56 fabs(std::atan2(iy - oy, ix - ox) - tile_angle_rad) < max_half_angle_rad)
57 bins.emplace_back(ix, iy);
constexpr int32_t ceil(float num)
Detector ID class for Totem T2 detectors. Bits [19:31] : Base CTPPSDetId class attributes Bits [16:18...
const TotemGeometry geom_
void fill(TH2D *, const TotemT2DetId &, double value=1.)
static constexpr uint32_t maxChannel
TotemT2Segmentation(const TotemGeometry &, size_t, size_t)
const GlobalPoint & centre() const
static constexpr uint32_t maxPlane
static const uint32_t maxArm
const TotemT2Tile & tile(const TotemT2DetId &) const
std::unordered_map< TotemT2DetId, std::vector< std::pair< short, short > > > bins_map_
std::vector< std::pair< short, short > > computeBins(const TotemT2DetId &detid) const
Power< A, B >::type pow(const A &a, const B &b)