CepGen 1.2.5
Central exclusive processes event generator
|
2D histogram container More...
#include <CepGen/Utils/Histogram.h>
Classes | |
struct | contents_t |
Public Types | |
enum | BinMode { low = 0 , high , both } |
typedef std::map< coord_t, Value > | axis_t |
Metadata for an axis (coordinates and bins value) | |
typedef std::map< coord_t, axis_t > | dualaxis_t |
Metadata for a two-dimensional axis definition (coordinates and bins values) | |
Public Member Functions | |
Hist2D (const ParametersList &) | |
Build a histogram from user-steeed parameters. | |
Hist2D (size_t num_bins_x, const Limits &xlim, size_t num_bins_y, const Limits &ylim, const std::string &name="", const std::string &title="") | |
Build a histogram from uniform-width bins. | |
Hist2D (const std::vector< double > &xbins, const std::vector< double > &ybins, const std::string &name="", const std::string &title="") | |
Build a histogram from variable-width bins. | |
Hist2D (const Hist2D &) | |
Copy constructor. | |
void | clear () override |
Reset the histogram. | |
void | fill (double x, double y, double weight=1.) |
Fill the histogram with one value. | |
void | fill (const std::pair< double, double > &xy, double weight=1.) |
Fill the histogram with one value. | |
void | add (Hist2D, double scaling=1.) |
Bin-by-bin addition of another histogram to this one. | |
void | scale (double) override |
Rescale all histogram bins by a constant factor. | |
std::pair< double, double > | sample (RandomGenerator &) const |
Sample individual "events" from a distribution. | |
Value | value (size_t bin_x, size_t bin_y) const |
Retrieve the value + uncertainty for one bin. | |
void | setValue (size_t bin_x, size_t bin_y, Value value) |
Set the value + uncertainty for one bin. | |
size_t | nbinsX () const |
Number of x-axis bins. | |
Limits | rangeX () const |
x-axis range | |
Limits | binRangeX (size_t bin) const |
Range for a single x-axis bin. | |
std::vector< double > | binsX (BinMode) const |
List of x-bins limits (nbinsX + 1 values if min-max, nbins values otherwise) | |
size_t | nbinsY () const |
Number of y-axis bins. | |
Limits | rangeY () const |
y-axis range | |
Limits | binRangeY (size_t bin) const |
Range for a single y-axis bin. | |
std::vector< double > | binsY (BinMode) const |
List of y-bins limits (nbinsY + 1 values if min-max, nbins values otherwise) | |
std::pair< size_t, size_t > | bin (double x, double y) const |
Retrieve the bin indices for a (x, y) value. | |
double | meanX () const |
Compute the mean histogram value over full x-axis range. | |
double | rmsX () const |
Compute the root-mean-square value over full x-axis range. | |
double | meanY () const |
Compute the mean histogram value over full y-axis range. | |
double | rmsY () const |
Compute the root-mean-square value over full y-axis range. | |
double | minimum () const override |
Retrieve the maximum bin value. | |
double | maximum () const override |
Retrieve the minimum bin value. | |
double | integral (bool=false) const override |
Compute the histogram integral. | |
const contents_t & | outOfRange () const |
bool | isHist2D () const override final |
Is this drawable a two-dimensional histogram? | |
void | normalise (double integ=1.) |
Normalise the histogram to a given constant. | |
const std::string & | name () const |
Drawable name. | |
void | setName (const std::string &name) |
Set the drawable name. | |
const std::string & | title () const |
Drawable name. | |
void | setTitle (const std::string &title) |
Set the drawable title. | |
AxisInfo & | xAxis () |
const AxisInfo & | xAxis () const |
AxisInfo & | yAxis () |
const AxisInfo & | yAxis () const |
AxisInfo & | zAxis () |
const AxisInfo & | zAxis () const |
virtual bool | isHist1D () const |
Is this drawable a one-dimensional histogram? | |
virtual bool | isGraph1D () const |
Is this drawable a one-dimensional graph? | |
virtual bool | isGraph2D () const |
Is this drawable a two-dimensional graph? | |
Protected Member Functions | |
std::set< double > | extractBins (BinMode mode, size_t num_bins, const std::function< Limits(size_t)> &bins_extractor) const |
Extract the list of bin limits. | |
Protected Attributes | |
std::string | name_ |
Computer-readable name. | |
std::string | title_ |
Human-readable title. | |
AxisInfo | xaxis_ |
x-axis metadata | |
AxisInfo | yaxis_ |
y-axis metadata | |
AxisInfo | zaxis_ |
z-axis metadata | |
Definition at line 146 of file Histogram.h.
Definition at line 95 of file Drawable.h.
|
inherited |
Definition at line 103 of file Drawable.h.
|
inherited |
Enumerator | |
---|---|
low | |
high | |
both |
Definition at line 46 of file Histogram.h.
|
explicit |
Definition at line 31 of file Hist2D.cpp.
|
explicit |
Definition at line 44 of file Hist2D.cpp.
|
explicit |
Definition at line 56 of file Hist2D.cpp.
Definition at line 66 of file Hist2D.cpp.
void add | ( | Hist2D | oth, |
double | scaling = 1. |
||
) |
Definition at line 148 of file Hist2D.cpp.
std::pair< size_t, size_t > bin | ( | double | x, |
double | y | ||
) | const |
Definition at line 219 of file Hist2D.cpp.
Limits binRangeX | ( | size_t | bin | ) | const |
Definition at line 183 of file Hist2D.cpp.
Limits binRangeY | ( | size_t | bin | ) | const |
Definition at line 206 of file Hist2D.cpp.
std::vector< double > binsX | ( | BinMode | mode | ) | const |
Definition at line 191 of file Hist2D.cpp.
std::vector< double > binsY | ( | BinMode | mode | ) | const |
Definition at line 214 of file Hist2D.cpp.
|
overridevirtual |
Implements Histogram.
Definition at line 106 of file Hist2D.cpp.
|
protectedinherited |
[in] | mode | type of extraction (low/high/low-high) |
[in] | num_bins | total number of bins |
[in] | bins_extractor | method used to extract range of one single bin |
Definition at line 26 of file Histogram.cpp.
void fill | ( | const std::pair< double, double > & | xy, |
double | weight = 1. |
||
) |
Definition at line 168 of file Histogram.h.
void fill | ( | double | x, |
double | y, | ||
double | weight = 1. |
||
) |
Definition at line 113 of file Hist2D.cpp.
|
overridevirtual |
Implements Histogram.
Definition at line 273 of file Hist2D.cpp.
|
virtualinherited |
Reimplemented in Graph1D.
Definition at line 107 of file Drawable.h.
|
virtualinherited |
Reimplemented in Graph2D.
Definition at line 108 of file Drawable.h.
|
virtualinherited |
Reimplemented in Hist1D.
Definition at line 105 of file Drawable.h.
|
finaloverridevirtual |
Reimplemented from Drawable.
Definition at line 231 of file Histogram.h.
|
overridevirtual |
Implements Histogram.
Definition at line 268 of file Hist2D.cpp.
double meanX | ( | ) | const |
Definition at line 243 of file Hist2D.cpp.
double meanY | ( | ) | const |
Definition at line 253 of file Hist2D.cpp.
|
overridevirtual |
Implements Histogram.
Definition at line 263 of file Hist2D.cpp.
|
inherited |
Definition at line 37 of file Drawable.h.
size_t nbinsX | ( | ) | const |
Definition at line 173 of file Hist2D.cpp.
size_t nbinsY | ( | ) | const |
Definition at line 196 of file Hist2D.cpp.
|
inherited |
Definition at line 24 of file Histogram.cpp.
const contents_t & outOfRange | ( | ) | const |
Definition at line 229 of file Histogram.h.
Limits rangeX | ( | ) | const |
Definition at line 178 of file Hist2D.cpp.
Limits rangeY | ( | ) | const |
Definition at line 201 of file Hist2D.cpp.
double rmsX | ( | ) | const |
Definition at line 248 of file Hist2D.cpp.
double rmsY | ( | ) | const |
Definition at line 258 of file Hist2D.cpp.
std::pair< double, double > sample | ( | RandomGenerator & | rng | ) | const |
Definition at line 311 of file Hist2D.cpp.
|
overridevirtual |
Implements Histogram.
Definition at line 166 of file Hist2D.cpp.
|
inherited |
Definition at line 39 of file Drawable.h.
|
inherited |
Definition at line 44 of file Drawable.h.
void setValue | ( | size_t | bin_x, |
size_t | bin_y, | ||
Value | value | ||
) |
Definition at line 233 of file Hist2D.cpp.
|
inherited |
Definition at line 42 of file Drawable.h.
Value value | ( | size_t | bin_x, |
size_t | bin_y | ||
) | const |
Definition at line 227 of file Hist2D.cpp.
|
inherited |
Definition at line 79 of file Drawable.h.
|
inherited |
Definition at line 80 of file Drawable.h.
|
inherited |
Definition at line 81 of file Drawable.h.
|
inherited |
Definition at line 82 of file Drawable.h.
|
inherited |
Definition at line 83 of file Drawable.h.
|
inherited |
Definition at line 84 of file Drawable.h.
|
protectedinherited |
Definition at line 111 of file Drawable.h.
|
protectedinherited |
Definition at line 112 of file Drawable.h.
|
protectedinherited |
Definition at line 113 of file Drawable.h.
|
protectedinherited |
Definition at line 114 of file Drawable.h.
|
protectedinherited |
Definition at line 115 of file Drawable.h.