class Rivet::BinnedHistogram

Rivet::BinnedHistogram

A set of booked Histo1DPtr, each in a bin of a second variable. More…

#include <BinnedHistogram.hh>

Public Functions

Name
BinnedHistogram() =default
Create a new empty BinnedHistogram.
BinnedHistogram(const vector< double > & edges, const vector< Histo1DPtr > & histos)
Create a new BinnedHistogram with the given bin edges and contents.
const BinnedHistogram &add(double binMin, double binMax, Histo1DPtr histo)
Add a histogram in the T bin between binMin and binMax.
voidfill(double binval, double val, double weight =1.0)
Fill the histogram in the same bin as binval with value val and weight weight.
const Histo1DPtrhisto(double binval) const
Get the histogram in the same bin as binval (const)
Histo1DPtrhisto(double binval)
Get the histogram in the same bin as binval.
const vector< Histo1DPtr > &histos() const
Get the contained histograms (const)
vector< Histo1DPtr > &histos()
Get the contained histograms.
voidscale(double scale, Analysis * ana)

Detailed Description

class Rivet::BinnedHistogram;

A set of booked Histo1DPtr, each in a bin of a second variable.

BinnedHistogram contains a series of histograms of the same quantity each in a different region of a second quantity. For example, a BinnedHistogram may contain histograms of the cross-section differential in ( p_T ) in different ( \eta ) regions.

Public Functions Documentation

function BinnedHistogram

BinnedHistogram() =default

Create a new empty BinnedHistogram.

function BinnedHistogram

inline BinnedHistogram(
    const vector< double > & edges,
    const vector< Histo1DPtr > & histos
)

Create a new BinnedHistogram with the given bin edges and contents.

function add

const BinnedHistogram & add(
    double binMin,
    double binMax,
    Histo1DPtr histo
)

Add a histogram in the T bin between binMin and binMax.

Todo: Can we have an “emplace constructor”, passing tuples of bookHisto1D args?

function fill

void fill(
    double binval,
    double val,
    double weight =1.0
)

Fill the histogram in the same bin as binval with value val and weight weight.

function histo

const Histo1DPtr histo(
    double binval
) const

Get the histogram in the same bin as binval (const)

Note: Throws a RangeError if binval doesn’t fall in a declared bin

function histo

Histo1DPtr histo(
    double binval
)

Get the histogram in the same bin as binval.

Note: Throws a RangeError if binval doesn’t fall in a declared bin

function histos

inline const vector< Histo1DPtr > & histos() const

Get the contained histograms (const)

function histos

inline vector< Histo1DPtr > & histos()

Get the contained histograms.

function scale

void scale(
    double scale,
    Analysis * ana
)

Note: The Analysis pointer is passed in order to call the analysis’ scale(h) method: can we avoid that?

Scale histograms taking into account its “external” binwidth, i.e. by scale/binWidth


Updated on 2022-08-07 at 20:17:16 +0100