rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
Rivet::BinnedHistogram< T > Class Template Reference

#include <BinnedHistogram.hh>

Public Member Functions

 BinnedHistogram ()
 Create a new empty BinnedHistogram.
 
 BinnedHistogram (const vector< T > &edges, const vector< Histo1DPtr > &histos)
 Create a new BinnedHistogram with the given bin edges and contents.
 
const BinnedHistogram< T > & add (const T &binMin, const T &binMax, Histo1DPtr histo)
 Add a histogram in the T bin between binMin and binMax. More...
 
const BinnedHistogram< T > & addHistogram (const T &binMin, const T &binMax, Histo1DPtr histo)
 
void fill (const T &binval, double val, double weight)
 Fill the histogram in the same bin as binval with value val and weight weight.
 
const Histo1DPtr histo (const T &binval) const
 Get the histogram in the same bin as binval (const) More...
 
Histo1DPtr histo (const T &binval)
 Get the histogram in the same bin as binval. More...
 
const vector< Histo1DPtr > & histos () const
 Get the contained histograms (const)
 
vector< Histo1DPtr > & histos ()
 Get the contained histograms.
 
const vector< Histo1DPtr > & getHistograms () const
 
vector< Histo1DPtr > & getHistograms ()
 
void scale (const T &scale, Analysis *ana)
 

Detailed Description

template<typename T>
class Rivet::BinnedHistogram< T >

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.

Member Function Documentation

◆ add()

template<typename T >
const BinnedHistogram< T > & Rivet::BinnedHistogram< T >::add ( const T &  binMin,
const T &  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?

Referenced by Rivet::BinnedHistogram< double >::addHistogram(), and Rivet::BinnedHistogram< double >::BinnedHistogram().

◆ addHistogram()

template<typename T>
const BinnedHistogram<T>& Rivet::BinnedHistogram< T >::addHistogram ( const T &  binMin,
const T &  binMax,
Histo1DPtr  histo 
)
inline

◆ getHistograms() [1/2]

template<typename T>
const vector<Histo1DPtr>& Rivet::BinnedHistogram< T >::getHistograms ( ) const
inline

◆ getHistograms() [2/2]

template<typename T>
vector<Histo1DPtr>& Rivet::BinnedHistogram< T >::getHistograms ( )
inline

◆ histo() [1/2]

template<typename T >
const Histo1DPtr Rivet::BinnedHistogram< T >::histo ( const T &  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

Referenced by Rivet::BinnedHistogram< double >::addHistogram(), Rivet::BinnedHistogram< double >::BinnedHistogram(), and Rivet::BinnedHistogram< double >::histo().

◆ histo() [2/2]

template<typename T >
Histo1DPtr Rivet::BinnedHistogram< T >::histo ( const T &  binval)

Get the histogram in the same bin as binval.

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

◆ scale()

template<typename T >
void Rivet::BinnedHistogram< T >::scale ( const T &  scale,
Analysis ana 
)

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

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

Referenced by Rivet::BinnedHistogram< double >::getHistograms().


The documentation for this class was generated from the following files: