herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
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.


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