herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Statistics::Histogram Class Reference

A (one dimensional) histogram. More...

#include <Histogram.h>

Public Member Functions

 Histogram ()
 Default constructor.
 
virtual ~Histogram ()
 Destructor.
 
 Histogram (const std::string &newName, const std::vector< double > &newBoundaries, bool newNoUnderflow=false, bool newNoOverflow=false)
 Constructor giving a name and bin boundaries; bin boundaries are subsequent boundaries.
 
 Histogram (const std::string &newName, const std::vector< double > &newBoundaries, const std::pair< double, double > &newPeriodicity)
 Constructor giving a name, bin boundaries and periodicity interval; bin boundaries are subsequent boundaries.
 
void initialize ()
 Initialize this histogram.
 
void reset ()
 Reset this histogram.
 
void finalize ()
 Finalize this histogram.
 
bool count (EventContribution event, size_t id)
 Book a contribution to the current event.
 
bool isCompatible (const Histogram &other) const
 Return true, if this histogram is compatible with another one.
 
Histogramoperator+= (const Histogram &other)
 Add a histogram to this histogram.
 
Histogramoperator-= (const Histogram &other)
 Subtract a histogram from this histogram.
 
const std::string & name () const
 Return the id of the histogram.
 
const Binunderflow () const
 Return the underflow bin.
 
const std::vector< Bin > & bins () const
 Return the bins.
 
const Binoverflow () const
 Return the overflow bin.
 
bool noUnderflow () const
 True, if there is no underflow.
 
bool noOverflow () const
 True, if there is no overflow.
 
bool isPeriodic () const
 Return true, if the quantity considered is periodic.
 
const std::pair< double, double > & periodicity () const
 Return the periodicity interval, if appropriate.
 
void fromXML (const XML::Element &)
 Fill histogram data from an XML element.
 
XML::Element toXML () const
 Return an XML element for the data of this histogram.
 

Static Public Member Functions

static std::vector< double > regularBinEdges (double lower, double upper, size_t nBins)
 Create equally spaced bin edges.
 
static std::vector< double > logBinEdges (double lower, double upper, size_t nBins)
 Create logarithmicaly spaced bin edges.
 

Private Member Functions

void fillBinMap ()
 Fill the bin map.
 
BinbinByIndex (int)
 Return a bin by index.
 

Private Attributes

std::string theName
 The id of the histogram.
 
Bin theUnderflow
 The underflow bin.
 
std::vector< BintheBins
 The bins.
 
Bin theOverflow
 The overflow bin.
 
bool theNoUnderflow
 True, if there is no underflow.
 
bool theNoOverflow
 True, if there is no overflow.
 
bool theIsPeriodic
 True, if the quantity considered is periodic.
 
std::pair< double, double > thePeriodicity
 The periodicity of the quantity considered.
 
std::map< double, int > binMap
 Map bin upper boundaries to bins.
 

Detailed Description

A (one dimensional) histogram.

Author
Simon Platzer

Definition at line 25 of file Statistics/Histogram.h.

Member Function Documentation

◆ bins()

◆ isPeriodic()

bool Statistics::Histogram::isPeriodic ( ) const
inline

Return true, if the quantity considered is periodic.

Definition at line 143 of file Statistics/Histogram.h.

References theIsPeriodic.

◆ name()

const std::string & Statistics::Histogram::name ( ) const
inline

Return the id of the histogram.

Definition at line 112 of file Statistics/Histogram.h.

References theName.

◆ noOverflow()

bool Statistics::Histogram::noOverflow ( ) const
inline

True, if there is no overflow.

Definition at line 137 of file Statistics/Histogram.h.

References theNoOverflow.

◆ noUnderflow()

bool Statistics::Histogram::noUnderflow ( ) const
inline

True, if there is no underflow.

Definition at line 132 of file Statistics/Histogram.h.

References theNoUnderflow.

◆ overflow()

const Bin & Statistics::Histogram::overflow ( ) const
inline

Return the overflow bin.

Definition at line 127 of file Statistics/Histogram.h.

References theOverflow.

◆ periodicity()

const std::pair< double, double > & Statistics::Histogram::periodicity ( ) const
inline

Return the periodicity interval, if appropriate.

Definition at line 148 of file Statistics/Histogram.h.

References thePeriodicity.

◆ underflow()

const Bin & Statistics::Histogram::underflow ( ) const
inline

Return the underflow bin.

Definition at line 117 of file Statistics/Histogram.h.

References theUnderflow.

Member Data Documentation

◆ binMap

std::map<double,int> Statistics::Histogram::binMap
private

Map bin upper boundaries to bins.

Definition at line 217 of file Statistics/Histogram.h.

◆ theBins

std::vector<Bin> Statistics::Histogram::theBins
private

The bins.

Definition at line 177 of file Statistics/Histogram.h.

Referenced by bins().

◆ theIsPeriodic

bool Statistics::Histogram::theIsPeriodic
private

True, if the quantity considered is periodic.

Definition at line 197 of file Statistics/Histogram.h.

Referenced by isPeriodic().

◆ theName

std::string Statistics::Histogram::theName
private

The id of the histogram.

Definition at line 167 of file Statistics/Histogram.h.

Referenced by name().

◆ theNoOverflow

bool Statistics::Histogram::theNoOverflow
private

True, if there is no overflow.

Definition at line 192 of file Statistics/Histogram.h.

Referenced by noOverflow().

◆ theNoUnderflow

bool Statistics::Histogram::theNoUnderflow
private

True, if there is no underflow.

Definition at line 187 of file Statistics/Histogram.h.

Referenced by noUnderflow().

◆ theOverflow

Bin Statistics::Histogram::theOverflow
private

The overflow bin.

Definition at line 182 of file Statistics/Histogram.h.

Referenced by overflow().

◆ thePeriodicity

std::pair<double,double> Statistics::Histogram::thePeriodicity
private

The periodicity of the quantity considered.

Definition at line 202 of file Statistics/Histogram.h.

Referenced by periodicity().

◆ theUnderflow

Bin Statistics::Histogram::theUnderflow
private

The underflow bin.

Definition at line 172 of file Statistics/Histogram.h.

Referenced by underflow().


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