![]() |
The Gaudi Framework
master (d98a2936)
|
generic class implementing an array of histograms The only addition to a raw array is the constructor that allows to build names and titles for the histograms automatically from the index of the histogram in the array There are 2 possibilities : More...
#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators/HistogramArray.h>
generic class implementing an array of histograms The only addition to a raw array is the constructor that allows to build names and titles for the histograms automatically from the index of the histogram in the array There are 2 possibilities :
Typical usage : // Array of 5 1D histograms with simple names and titles // Names will be GaudiH1D-0, GaudiH1D-1, ... and similarly for titles Gaudi::Accumulators::HistogramArray<Gaudi::Accumulators::Histogram<1>, 5> histo1d{ &algo, "GaudiH1D-{}", "A Gaudi 1D histogram - number {}", { 21, -10.5, 10.5, "X" } }; ++histo1d[3][-10.0]; // Array of 5 2D weighted histograms with simple names and titles // Names will be Name0, Name1, ... and similarly for titles Gaudi::Accumulators::HistogramArray<Gaudi::Accumulators::WeightedHistogram<2>, 7> histo2dw{ &algo, "Name{}", "Title {}", { 21, -10.5, 10.5, "X" }, { 21, -10.5, 10.5, "Y" } }; histo2dw[1][{ -10.0, -10.0 }] += 0.25; // Array of histograms with custom name and titles // Names will be GaudiH1D-0-0, GaudiH1D-1-1, GaudiH1D-2-4, ... // Titles will be "Title 1 of 5", "Title 2 of 5", "Title 3 of 5", ... Gaudi::Accumulators::HistogramArray<Gaudi::Accumulators::Histogram<1>, 5> histoCustom{ &algo, []( int n ) { return fmt::format( "GaudiH1D-{}-{}", n, n*n ); }, [nb = 5]( int n ) { return fmt::format( "Title {} of {}", n+1, nb ); }, { 21, -10.5, 10.5, "X" } }; ++histoCustom[2][-10.0];
Definition at line 98 of file HistogramArray.h.