The Histogram class is a simple histogram for the Analysis handlers. More...
#include <Histogram.h>
Classes | |
struct | Bin |
One bin of the histogram. More... | |
Clone Methods. | |
Statistic | _globalStats |
Global statistics of all data that went into the histogram. | |
bool | _havedata |
Set to true if there is experimental data available. | |
vector< Bin > | _bins |
The histogram bins. | |
double | _prefactor |
Prefactors to multiply the output by. | |
double | _total |
Total entry. | |
vector< Bin > | bins () const |
The vector of bins. | |
virtual IBPtr | clone () const |
Make a simple clone of this object. | |
virtual IBPtr | fullclone () const |
Make a clone of this object, possibly modifying the cloned object to make it sane. | |
Histogram & | operator= (const Histogram &)=delete |
The assignment operator is private and must never be called. | |
Standard constructors and destructors. | |
Histogram (double lower=0., double upper=0., unsigned int nbin=0) | |
The default constructor. | |
Histogram (vector< double > limits) | |
Constructor for variable width bins. | |
Histogram (vector< double > limits, vector< double > data, vector< double > dataerror) | |
Constructor with data included. | |
void | operator+= (double input) |
Operator to add a point to the histogrma with unit weight. | |
void | addWeighted (double input, double weight) |
Function to add a weighted point to the histogram. | |
unsigned int | numberOfBins () const |
Number of bins (not counting the overflow) | |
double | prefactor () const |
Get the prefactor. | |
void | prefactor (double in) |
Set the prefactor. | |
const Statistic & | globalStatistics () const |
Access to the statistics on the total entry of the histogram. | |
void | normaliseToData () |
Normalise the distributions to the data. | |
void | normaliseToCrossSection () |
Normalise the distributions to the total cross section. | |
void | chiSquared (double &chisq, unsigned int &ndegrees, double minfrac=0.) const |
Return the chi squared. | |
void | rivetOutput (ostream &out, string histogramname=string("default"), string analysisname=string("default"), string title=string(), string xlabel=string(), string ylabel=string(), bool rawcount=false, double multiplicator=1.0) const |
Output as file ready for usage with flat2aida and other Rivet tools. | |
void | topdrawOutput (ostream &out, unsigned int flags=0, string colour=string("BLACK"), string title=string(), string titlecase=string(), string left=string(), string leftcase=string(), string bottom=string(), string bottomcase=string()) const |
Output as a topdrawer file. | |
void | topdrawMCatNLO (ostream &out, unsigned int flags=0, string colour=string("BLACK"), string title=string()) const |
void | topdrawOutputAverage (ostream &out, bool frame, bool errorbars, bool xlog, bool ylog, string colour=string("BLACK"), string title=string(), string titlecase=string(), string left=string(), string leftcase=string(), string bottom=string(), string bottomcase=string()) const |
Output as a topdrawer file. | |
unsigned int | visibleEntries () const |
get the number of visible entries (all entries without those in the under- and overflow bins) in the histogram. | |
double | dataNorm () const |
Compute the normalisation of the data. | |
void | simpleOutput (ostream &out, bool errorbars, bool normdata=false) |
Output into a simple ascii file, easily readable by gnuplot. | |
vector< double > | dumpBins () const |
Dump bin data into a vector. | |
Histogram | ratioWith (const Histogram &h2) const |
Returns a new histogram containing bin-by-bin ratios of two histograms. | |
static vector< double > | LogBins (double xmin, unsigned nbins, double base=10.0) |
Returns limits for bins with exponentially increasing widths. | |
static void | Init () |
The standard Init function used to initialize the interfaces. | |
Additional Inherited Members | |
![]() | |
enum | InitState |
![]() | |
typedef unsigned int | CounterType |
![]() | |
virtual bool | defaultInit () |
PPtr | getParticle (PID) const |
PDPtr | getParticleData (PID) const |
bool | used () const |
void | useMe () const |
tEGPtr | generator () const |
void | persistentOutput (PersistentOStream &os) const |
void | persistentInput (PersistentIStream &is, int version) |
PPtr | getParticle (PID) const |
PDPtr | getParticleData (PID) const |
bool | used () const |
void | useMe () const |
tEGPtr | generator () const |
![]() | |
string | fullName () const |
string | name () const |
string | path () const |
string | comment () const |
void | setup (istream &is) |
void | update () |
void | init () |
virtual bool | preInitialize () const |
void | initrun () |
void | finish () |
void | touch () |
void | reset () |
void | clear () |
InitState | state () const |
bool | locked () const |
bool | touched () const |
virtual IBPtr | fullclone () const |
void | persistentOutput (PersistentOStream &os) const |
void | persistentInput (PersistentIStream &is, int version) |
virtual void | debugme () const |
void | update () |
void | init () |
virtual bool | preInitialize () const |
void | initrun () |
void | finish () |
void | touch () |
void | reset () |
void | clear () |
InitState | state () const |
bool | locked () const |
bool | touched () const |
virtual IBPtr | fullclone () const |
![]() | |
void | debug () const |
virtual void | debugme () const |
![]() | |
CounterType | referenceCount () const |
![]() | |
Named (const string &newName=string()) | |
Named (const Named &)=default | |
const string & | name () const |
bool | operator== (const Named &other) const |
bool | operator< (const Named &other) const |
![]() | |
static void | Init () |
![]() | |
static void | Init () |
![]() | |
static void | Init () |
![]() | |
initializing | |
uninitialized | |
initialized | |
runready | |
![]() | |
const unsigned long | uniqueId |
![]() | |
void | reporeg (IBPtr object, string name) const |
bool | setDefaultReference (PtrT &ptr, string classname, string objectname) |
Interfaced (const string &newName) | |
Interfaced (const Interfaced &i) | |
void | setGenerator (tEGPtr generator) |
![]() | |
virtual void | readSetup (istream &is) |
virtual void | doupdate () |
virtual void | doinit () |
virtual void | doinitrun () |
virtual void | dofinish () |
virtual IVector | getReferences () |
virtual void | rebind (const TranslationMap &) |
virtual IBPtr | clone () const=0 |
InterfacedBase (string newName) | |
InterfacedBase (const InterfacedBase &i) | |
virtual void | readSetup (istream &is) |
virtual void | doupdate () |
virtual void | doinit () |
virtual void | doinitrun () |
virtual void | dofinish () |
virtual IVector | getReferences () |
virtual void | rebind (const TranslationMap &) |
![]() | |
ReferenceCounted (const ReferenceCounted &) | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
![]() | |
const Named & | operator= (const Named &other) |
const string & | name (const string &newName) |
![]() | |
static void | registerRepository (IBPtr) |
static void | registerRepository (IBPtr, string newName) |
The Histogram class is a simple histogram for the Analysis handlers.
Definition at line 43 of file Histogram.h.
|
inline |
The default constructor.
lower | The lower limit of the histogram |
upper | The upper limit of the histogram |
nbin | Number of bins |
Definition at line 55 of file Histogram.h.
References _bins.
|
inline |
Constructor for variable width bins.
limits | The lower limits for the bins followed by the upper limit of the last bin |
Definition at line 72 of file Histogram.h.
References _bins.
|
inline |
Constructor with data included.
limits | The lower limits for the bins followed by the upper limit of the last bin |
data | The data |
dataerror | The errors on the data |
Definition at line 85 of file Histogram.h.
References _bins.
|
inline |
Function to add a weighted point to the histogram.
Definition at line 113 of file Histogram.h.
References _bins, _globalStats, _total, and ThePEG::sqr().
Referenced by operator+=().
|
inline |
void Herwig::Histogram::chiSquared | ( | double & | chisq, |
unsigned int & | ndegrees, | ||
double | minfrac = 0. |
||
) | const |
Return the chi squared.
chisq | The chi squared |
ndegrees | The number of points |
minfrac | The minimum fractional error on the data point |
|
protectedvirtual |
Make a simple clone of this object.
Implements ThePEG::InterfacedBase.
|
protectedvirtual |
Make a clone of this object, possibly modifying the cloned object to make it sane.
Reimplemented from ThePEG::InterfacedBase.
|
inline |
Access to the statistics on the total entry of the histogram.
Definition at line 151 of file Histogram.h.
References _globalStats.
|
static |
The standard Init function used to initialize the interfaces.
Called exactly once for each class by the class description system before the main function starts or when this class is dynamically loaded.
|
static |
Returns limits for bins with exponentially increasing widths.
For usage with the variable-bin-width Histogram constructor.
xmin | Lower limit of the first bin, needs to be > 0 |
nbins | Number of bins |
base | The base, needs to be > 1 |
|
inline |
Number of bins (not counting the overflow)
Definition at line 129 of file Histogram.h.
References _bins.
|
inline |
Operator to add a point to the histogrma with unit weight.
Definition at line 106 of file Histogram.h.
References addWeighted().
The assignment operator is private and must never be called.
In fact, it should not even be implemented.
|
inline |
|
inline |
void Herwig::Histogram::rivetOutput | ( | ostream & | out, |
string | histogramname = string("default") , |
||
string | analysisname = string("default") , |
||
string | title = string() , |
||
string | xlabel = string() , |
||
string | ylabel = string() , |
||
bool | rawcount = false , |
||
double | multiplicator = 1.0 |
||
) | const |
Output as file ready for usage with flat2aida and other Rivet tools.
out | The output stream |
histogramname | The histogram name identifying the histogram. Required for comparisons (e.g. with rivet-mkhtml or with compare-histos) |
analysisname | The analysis name |
title | The title for the top of the plot in LaTeX format |
xlabel | The x label in LaTeX format |
ylabel | The y label in LaTeX format |
rawcount | Don't normalise to unit area. |
multiplicator | Factor the histogram is multiplied with. N.B. Experimental data is not output. |
void Herwig::Histogram::topdrawOutput | ( | ostream & | out, |
unsigned int | flags = 0 , |
||
string | colour = string("BLACK") , |
||
string | title = string() , |
||
string | titlecase = string() , |
||
string | left = string() , |
||
string | leftcase = string() , |
||
string | bottom = string() , |
||
string | bottomcase = string() |
||
) | const |
Output as a topdrawer file.
The histogram is normalised to unit area
out | The output stream |
flags | A bitmask of flags from HistogramOptions, e.g. Frame|Ylog |
colour | The colour for the line |
title | The title for the top of the plot |
titlecase | topdraw format for the title |
left | Left axis lable |
leftcase | topdraw format for left axis label |
bottom | Bottom axis lable |
bottomcase | Bottom axis lable ofr topdraw N.B. in td smoothing only works for histograms with uniform binning. |
void Herwig::Histogram::topdrawOutputAverage | ( | ostream & | out, |
bool | frame, | ||
bool | errorbars, | ||
bool | xlog, | ||
bool | ylog, | ||
string | colour = string("BLACK") , |
||
string | title = string() , |
||
string | titlecase = string() , |
||
string | left = string() , |
||
string | leftcase = string() , |
||
string | bottom = string() , |
||
string | bottomcase = string() |
||
) | const |
Output as a topdrawer file.
A bin by bin average is taken.
out | The output stream |
frame | output on a new graph |
errorbars | output data points with error bars |
xlog | log scale on x axis |
ylog | log scale on y axis |
colour | The colour for the line |
title | The title for the top of the plot |
titlecase | topdraw format for the title |
left | Left axis lable |
leftcase | topdraw format for left axis label |
bottom | Bottom axis lable |
bottomcase | Bottom axis lable ofr topdraw |
unsigned int Herwig::Histogram::visibleEntries | ( | ) | const |
get the number of visible entries (all entries without those in the under- and overflow bins) in the histogram.
This assumes integer entries, ie it gives wrong results for weighted histograms.
|
private |
The histogram bins.
_bins[0] is the underflow, _bins.back() the overflow
Definition at line 383 of file Histogram.h.
Referenced by addWeighted(), bins(), Histogram(), and numberOfBins().
|
private |
Global statistics of all data that went into the histogram.
Definition at line 333 of file Histogram.h.
Referenced by addWeighted(), and globalStatistics().
|
private |
Set to true if there is experimental data available.
Definition at line 338 of file Histogram.h.
|
private |
Prefactors to multiply the output by.
Definition at line 388 of file Histogram.h.
Referenced by prefactor().
|
private |