Skip to content

Correct conversion to Root histograms in RootHistogramSink

Johannes Heuel requested to merge jheuel/Gaudi:jheuel_RootHistogramSink into master

The histogram implementation Gaudi::Accumulators::Histogram and Root's histogram types (TH1, TH2, TH3) use a different layout of bins. The Gaudi::Accumulators::Histogram implementation uses this layout (row first) while Root uses this layout (column first).

The indices are calculated as

index = ((x * b_y + y) * b_z) + z

and

root_index = x + (b_x * (y + (b_y * z))

with bins x, y, and z with bin numbers b_x, b_y, and b_z which includes overflow bins.

This does not make a difference in 1D, but for 2D and 3D one has to translate indices when converting from one implementation to the other, which is added in this merge request.

Closes #212 (closed)

Edited by Marco Clemencic

Merge request reports

Loading