4 #ifndef RecoLocalCalo_HGCalRecProducers_HGCalLayerTiles_h 5 #define RecoLocalCalo_HGCalRecProducers_HGCalLayerTiles_h 21 void fill(
const std::vector<float>&
x,
22 const std::vector<float>&
y,
23 const std::vector<float>&
eta,
24 const std::vector<float>&
phi,
25 const std::vector<bool>& isSi) {
26 auto cellsSize =
x.size();
27 for (
unsigned int i = 0;
i < cellsSize; ++
i) {
37 static_assert(
xRange >= 0.);
38 constexpr
float r = T::nColumns /
xRange;
40 xBin = std::clamp(
xBin, 0, T::nColumns - 1);
46 static_assert(
yRange >= 0.);
47 constexpr
float r = T::nRows /
yRange;
49 yBin = std::clamp(
yBin, 0, T::nRows - 1);
56 constexpr
float r = T::nColumnsEta /
etaRange;
64 constexpr
float r = T::nRowsPhi * M_1_PI * 0.5f;
81 return T::nColumns * T::nRows +
etaBin +
phiBin * T::nColumnsEta;
89 return std::array<int, 4>({{xBinMin, xBinMax, yBinMin, yBinMax}});
94 return std::array<int, 4>({{0, 0, 0, 0}});
105 if (phiBinMax < phiBinMin) {
106 phiBinMax += T::nRowsPhi;
109 return std::array<int, 4>({{etaBinMin, etaBinMax, phiBinMin, phiBinMax}});
120 std::array<std::vector<int>, T::nTiles>
tiles_;
int getGlobalBinByBin(int xBin, int yBin) const
int getGlobalBinByBinEtaPhi(int etaBin, int phiBin) const
constexpr T normalizedPhi(T phi)
const std::vector< int > & operator[](int globalBinId) const
int getXBin(float x) const
int getEtaBin(float eta) const
int getYBin(float y) const
std::array< std::vector< int >, T::nTiles > tiles_
std::array< int, 4 > searchBox(float xMin, float xMax, float yMin, float yMax) 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)
int getGlobalBin(float x, float y) const
int getPhiBin(float phi) const
int getGlobalBinEtaPhi(float eta, float phi) const
std::array< int, 4 > searchBoxEtaPhi(float etaMin, float etaMax, float phiMin, float phiMax) const