This commit is contained in:
froejdh_e 2025-03-05 21:51:23 +01:00
parent 5614cb4673
commit 3a987319d4
2 changed files with 8 additions and 6 deletions

View File

@ -422,10 +422,10 @@ Eta2 calculate_eta2(Cluster3x3 &cl) {
Eta2 calculate_eta2(Cluster2x2 &cl) { Eta2 calculate_eta2(Cluster2x2 &cl) {
Eta2 eta{}; Eta2 eta{};
eta.x = static_cast<double>(cl.data[0]) / (cl.data[0] + cl.data[1]); eta.x = static_cast<double>(cl.data[1]) / (cl.data[0] + cl.data[1]);
eta.y = static_cast<double>(cl.data[0]) / (cl.data[0] + cl.data[2]); eta.y = static_cast<double>(cl.data[2]) / (cl.data[0] + cl.data[2]);
eta.sum = cl.data[0] + cl.data[1] + cl.data[2]+ cl.data[3]; eta.sum = cl.data[0] + cl.data[1] + cl.data[2]+ cl.data[3];
eta.c = cBottomLeft; //TODO! This is not correct eta.c = cBottomLeft; //TODO! This is not correct, but need to put something
return eta; return eta;
} }

View File

@ -139,12 +139,14 @@ std::vector<Photon> Interpolator::interpolate(const ClusterVector<int32_t>& clus
}; };
auto ix = find_index(m_etabinsx, eta.x)-1; auto ix = find_index(m_etabinsx, eta.x)-1;
auto iy = find_index(m_etabinsy, eta.y)-1; auto iy = find_index(m_etabinsy, eta.y)-1;
if(ix<0) ix=0;
if(iy<0) iy=0;
photon.x += (1-m_ietax(ix, iy, idx))*2; //eta goes between 0 and 1 but we could move the hit anywhere in the 2x2 photon.x += m_ietax(ix, iy, 0)*2; //eta goes between 0 and 1 but we could move the hit anywhere in the 2x2
photon.y += (1-m_ietay(ix, iy, idx))*2; photon.y += m_ietay(ix, iy, 0)*2;
// photon.x = ix; // photon.x = ix;
// photon.y = iy; // photon.y = idx;
photons.push_back(photon); photons.push_back(photon);
} }