4 #ifndef RecoLocalCalo_HGCalRecProducers_HGCalLayerTiles_h
5 #define RecoLocalCalo_HGCalRecProducers_HGCalLayerTiles_h
19 void fill(
const std::vector<float>&
x,
20 const std::vector<float>&
y,
21 const std::vector<float>&
eta,
22 const std::vector<float>&
phi,
23 const std::vector<bool>& isSi) {
24 auto cellsSize = x.size();
25 for (
unsigned int i = 0;
i < cellsSize; ++
i) {
42 constexpr
float xRange = T::maxX - T::minX;
43 static_assert(xRange >= 0.);
44 constexpr
float r = T::nColumns /
xRange;
45 int xBin = (x - T::minX) * r;
46 xBin = std::clamp(xBin, 0, T::nColumns - 1);
51 constexpr
float yRange = T::maxY - T::minY;
52 static_assert(yRange >= 0.);
53 constexpr
float r = T::nRows /
yRange;
54 int yBin = (y - T::minY) * r;
55 yBin = std::clamp(yBin, 0, T::nRows - 1);
61 static_assert(etaRange >= 0.);
62 constexpr
float r = T::nColumnsEta /
etaRange;
63 int etaBin = (eta - T::minEta) * r;
64 etaBin = std::clamp(etaBin, 0, T::nColumnsEta - 1);
70 static_assert(phiRange >= 0.);
71 constexpr
float r = T::nRowsPhi / phiRange;
73 phiBin = std::clamp(phiBin, 0, T::nRowsPhi - 1);
89 return T::nColumns * T::nRows + etaBin + phiBin * T::nColumnsEta;
97 return std::array<int, 4>({{xBinMin, xBinMax, yBinMin, yBinMax}});
105 return std::array<int, 4>({{etaBinMin, etaBinMax, phiBinMin, phiBinMax}});
116 std::array<std::vector<int>, T::nTiles>
tiles_;
std::array< int, 4 > searchBoxEtaPhi(float etaMin, float etaMax, float phiMin, float phiMax) const
int getXBin(float x) const
int getEtaBin(float eta) const
int getPhiBin(float phi) const
int getGlobalBinEtaPhi(float eta, float phi) const
int getGlobalBin(float x, float y) const
std::array< std::vector< int >, T::nTiles > tiles_
int getYBin(float y) const
void fill(const std::vector< float > &x, const std::vector< float > &y, const std::vector< float > &eta, const std::vector< float > &phi, const std::vector< bool > &isSi)
const std::vector< int > & operator[](int globalBinId) const
int getGlobalBinByBinEtaPhi(int etaBin, int phiBin) const
int getGlobalBinByBin(int xBin, int yBin) const
std::array< int, 4 > searchBox(float xMin, float xMax, float yMin, float yMax) const
int etaBin(const l1t::HGCalMulticluster *cl)