1 parent d2ede72 commit 73230e7Copy full SHA for 73230e7
1 file changed
ALICE3/Core/FlatLutEntry.cxx
@@ -64,20 +64,18 @@ void lutEntry_t::print() const
64
65
float map_t::fracPositionWithinBin(float val) const
66
{
67
- float width = (max - min) / nbins;
68
- int bin = 0;
+ const float width = (max - min) / nbins;
+ const int bin = find(val);
69
if (log) {
70
- bin = static_cast<int>((std::log10(val) - min) / width);
71
return ((std::log10(val) - min) / width) - bin;
72
} else {
73
- bin = static_cast<int>((val - min) / width);
74
return val / width - bin;
75
}
76
77
78
int map_t::find(float val) const
79
80
81
int bin = 0;
82
83
bin = static_cast<int>((std::log10(val) - min) / width);
0 commit comments