Skip to content

Shift integer histograms by -1/2 bin

This MR shifts all histograms which are filled with integer values by -1/2 bin.

It follows up on the discussion on Mattermost:

We've got a bunch of histograms which are filled with integer values, e.g. pixels per event, cluster size etc. But we're creating histograms like TH1F("h1","h1", 100, 0, 100).

This means that we get a binning like 0th bin --> [0-1) --> will only be filled if value=1 1st bin --> [1-2) --> will only be filled if value=0 2nd bin --> [2-3) --> etc.

Per se, that's not wrong, but the unfortunate thing here is that the mean that can be read off from the histogram does not represent the true mean of values that have been filled, same if a fit is applied.

Example: In case of the TPX3, we always have 1 pixel hit per eudaq event. Therefore, the histogram pixelsPerEvent will be filled in the 1st bin only, which extends from [1,2). When checking the mean (or stupidly applying a gaussian fit), the result will be 1.5 instead of 1.


In addition:

  • Tracking4D/TrackingSpatial: finer binning for chi2 histograms --> shows the peak position a bit nicer
  • AnalysisEfficiency: move histogram title/axis title into short-hand notation

Merge request reports