The Histogram class is a simple histogram for the Analysis handlers. More...
#include <Histogram.h>
Classes | |
struct | Bin |
One bin of the histogram. More... | |
Public Member Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
unsigned int | visibleEntries () const |
get the number of visible entries (all entries without those in the under- and overflow bins) in the histogram. More... | |
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. | |
vector< Bin > | bins () const |
The vector of bins. | |
Standard constructors and destructors. | |
Histogram (double lower=0., double upper=0., unsigned int nbin=0) | |
The default constructor. More... | |
Histogram (vector< double > limits) | |
Constructor for variable width bins. More... | |
Histogram (vector< double > limits, vector< double > data, vector< double > dataerror) | |
Constructor with data included. More... | |
Public Member Functions inherited from ThePEG::Interfaced | |
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 |
void | persistentOutput (PersistentOStream &os) const |
void | persistentInput (PersistentIStream &is, int version) |
Public Member Functions inherited from ThePEG::InterfacedBase | |
string | fullName () const |
string | name () const |
string | path () const |
string | comment () const |
void | setup (istream &is) |
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 |
void | persistentOutput (PersistentOStream &os) const |
void | persistentInput (PersistentIStream &is, int version) |
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 |
void | persistentOutput (PersistentOStream &os) const |
void | persistentInput (PersistentIStream &is, int version) |
Public Member Functions inherited from ThePEG::Base | |
void | debug () const |
Public Member Functions inherited from ThePEG::Pointer::ReferenceCounted | |
CounterType | referenceCount () const |
Public Member Functions inherited from ThePEG::Named | |
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 Public Member Functions | |
static vector< double > | LogBins (double xmin, unsigned nbins, double base=10.0) |
Returns limits for bins with exponentially increasing widths. More... | |
static void | Init () |
The standard Init function used to initialize the interfaces. More... | |
Static Public Member Functions inherited from ThePEG::Interfaced | |
static void | Init () |
Static Public Member Functions inherited from ThePEG::InterfacedBase | |
static void | Init () |
Static Public Member Functions inherited from ThePEG::Base | |
static void | Init () |
Protected Member Functions | |
Clone Methods. | |
virtual IBPtr | clone () const |
Make a simple clone of this object. More... | |
virtual IBPtr | fullclone () const |
Make a clone of this object, possibly modifying the cloned object to make it sane. More... | |
Protected Member Functions inherited from ThePEG::Interfaced | |
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) |
Protected Member Functions inherited from ThePEG::InterfacedBase | |
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 &) |
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 &) |
Protected Member Functions inherited from ThePEG::Pointer::ReferenceCounted | |
ReferenceCounted (const ReferenceCounted &) | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
ReferenceCounted (const ReferenceCounted &) | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
Protected Member Functions inherited from ThePEG::Named | |
const Named & | operator= (const Named &other) |
const string & | name (const string &newName) |
Private Member Functions | |
Histogram & | operator= (const Histogram &)=delete |
The assignment operator is private and must never be called. More... | |
Private Attributes | |
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. More... | |
double | _prefactor |
Prefactors to multiply the output by. | |
double | _total |
Total entry. | |
Additional Inherited Members | |
Public Types inherited from ThePEG::InterfacedBase | |
enum | InitState |
Public Types inherited from ThePEG::Pointer::ReferenceCounted | |
typedef unsigned int | CounterType |
Public Attributes inherited from ThePEG::InterfacedBase | |
initializing | |
uninitialized | |
initialized | |
runready | |
Public Attributes inherited from ThePEG::Pointer::ReferenceCounted | |
const unsigned long | uniqueId |
Static Protected Member Functions inherited from ThePEG::Interfaced | |
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.
|
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.
|
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.
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.
|
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 |
The assignment operator is private and must never be called.
In fact, it should not even be implemented.
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.