Skip to content

Commit 58d88f4

Browse files
Change tofmin to be at the lowest event's tof
Since histogramming is inclusive on the lower bound, there is need to shift the lower boundary to the left. The effect of the current implementation is that when the smallest TOF is <1, the workspace histogram started at negative values which makes a mess for log (re)binning.
1 parent bdd4ebb commit 58d88f4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Framework/DataHandling/src/LoadEventNexus.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,8 +1271,8 @@ void LoadEventNexus::loadEvents(API::Progress *const prog, const bool monitors)
12711271
if (eventsLoaded > 0) {
12721272
int nBins = getProperty("NumberOfBins");
12731273
auto binEdgesVec = std::vector<double>(nBins + 1);
1274-
binEdgesVec[0] = shortest_tof - 1;
1275-
binEdgesVec[nBins] = longest_tof + 1;
1274+
binEdgesVec[0] = shortest_tof; // left edge is inclusive
1275+
binEdgesVec[nBins] = longest_tof + 1; // right edge is exclusive
12761276
double binStep = (binEdgesVec[nBins] - binEdgesVec[0]) / nBins;
12771277
for (int binIndex = 1; binIndex < nBins; binIndex++) {
12781278
binEdgesVec[binIndex] = binEdgesVec[0] + (binStep * binIndex);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Modify :ref:`LoadEventNexus <algm-LoadEventNexus>` so the minimum histogram bin edge is equal to the lowest time-of-flight event rather than one less. The effect is that there is no longer negative bin edges unless there is actually a negative time-of-flight in the data.

0 commit comments

Comments
 (0)