A profile histogram, computing statistical quantities of an additional variable per bin.
Calling Fill requires an additional value:
The class is not templated, the bin content is always of type RProfileBin.
An object can have arbitrary dimensionality determined at run-time. The axis configuration is passed as a vector of RAxisVariant:
Definition at line 58 of file RProfile.hxx.
Classes | |
| struct | RProfileBin |
| The bin content type of a profile histogram. More... | |
| struct | RValueWeightWrapper |
| struct | RValueWrapper |
Public Member Functions | |
| template<typename... Axes> | |
| RProfile (const RAxisVariant &axis1, const Axes &...axes) | |
| Construct a profile histogram. | |
| RProfile (const RProfile &)=delete | |
| The copy constructor is deleted. | |
| RProfile (RProfile &&)=default | |
| Efficiently move construct a profile histogram. | |
| RProfile (std::initializer_list< RAxisVariant > axes) | |
| Construct a profile histogram. | |
| RProfile (std::uint64_t nNormalBins, std::pair< double, double > interval) | |
| Construct a one-dimensional profile histogram with a regular axis. | |
| RProfile (std::vector< RAxisVariant > axes) | |
| Construct a profile histogram. | |
| ~RProfile ()=default | |
| RProfile & | operator= (const RProfile &)=delete |
| The copy assignment operator is deleted. | |
| RProfile & | operator= (RProfile &&)=default |
| Efficiently move a profile histogram. | |
| void | Streamer (TBuffer &) |
| ROOT Streamer function to throw when trying to store an object of this class. | |
Accessors | |
| const RHistEngine< RProfileBin > & | GetEngine () const |
| const RHistStats & | GetStats () const |
| const std::vector< RAxisVariant > & | GetAxes () const |
| std::size_t | GetNDimensions () const |
| std::uint64_t | GetTotalNBins () const |
| std::uint64_t | GetNEntries () const |
| template<std::size_t N> | |
| const RProfileBin & | GetBinContent (const std::array< RBinIndex, N > &indices) const |
| Get the content of a single bin. | |
| const RProfileBin & | GetBinContent (const std::vector< RBinIndex > &indices) const |
| Get the content of a single bin. | |
| template<typename... A> | |
| const RProfileBin & | GetBinContent (const A &...args) const |
| Get the content of a single bin. | |
| RBinIndexMultiDimRange | GetFullMultiDimRange () const |
| Get the multidimensional range of all bins. | |
| template<std::size_t N, typename V > | |
| void | SetBinContent (const std::array< RBinIndex, N > &indices, const V &value) |
| Set the content of a single bin. | |
| template<typename... A> | |
| void | SetBinContent (const A &...args) |
| Set the content of a single bin. | |
Computations | |
| double | ComputeNEffectiveEntries () const |
| Compute the number of effective entries. | |
| double | ComputeMean (std::size_t dim=0) const |
| Compute the arithmetic mean of unbinned values. | |
| double | ComputeStdDev (std::size_t dim=0) const |
| Compute the standard deviation of unbinned values. | |
Filling | |
| template<typename... A, typename V > | |
| void | Fill (const std::tuple< A... > &args, const V &value) |
| Fill an entry into the profile histogram. | |
| template<typename... A, typename V > | |
| void | Fill (const std::tuple< A... > &args, const V &value, RWeight weight) |
| Fill an entry into the profile histogram with a weight. | |
| template<typename... A> | |
| void | Fill (const A &...args) |
| Fill an entry into the profile histogram. | |
Operations | |
| void | Add (const RProfile &other) |
| Add all bin contents and statistics of another profile histogram. | |
| void | AddAtomic (const RProfile &other) |
| Add all bin contents and statistics of another profile histogram using atomic instructions. | |
| void | Clear () |
| Clear all bin contents and statistics. | |
| RProfile | Clone () const |
| Clone this profile histogram. | |
| void | Scale (double factor) |
| Scale all bin contents and statistics. | |
Private Member Functions | |
| RProfile (RHistEngine< RProfileBin > engine) | |
| Private constructor based off an engine. | |
Private Attributes | |
| RHistEngine< RProfileBin > | fEngine |
| The histogram engine including the bin contents. | |
| RHistStats | fStats |
| The global histogram statistics. | |
#include <ROOT/RProfile.hxx>
|
inlineprivate |
Private constructor based off an engine.
Definition at line 135 of file RProfile.hxx.
|
inlineexplicit |
Construct a profile histogram.
| [in] | axes | the axis objects, must have size > 0 |
Definition at line 141 of file RProfile.hxx.
|
inlineexplicit |
Construct a profile histogram.
Note that there is no perfect forwarding of the axis objects. If that is needed, use the overload accepting a std::vector.
| [in] | axes | the axis objects, must have size > 0 |
Definition at line 158 of file RProfile.hxx.
|
inlineexplicit |
Construct a profile histogram.
Note that there is no perfect forwarding of the axis objects. If that is needed, use the overload accepting a std::vector.
| [in] | axis1 | the first axis object |
| [in] | axes | the remaining axis objects |
Definition at line 168 of file RProfile.hxx.
|
inline |
Construct a one-dimensional profile histogram with a regular axis.
| [in] | nNormalBins | the number of normal bins, must be > 0 |
| [in] | interval | the axis interval (lower end inclusive, upper end exclusive) |
Definition at line 180 of file RProfile.hxx.
The copy constructor is deleted.
Copying all bin contents can be an expensive operation, depending on the number of bins. If required, users can explicitly call Clone().
|
default |
Efficiently move construct a profile histogram.
After this operation, the moved-from object is invalid.
|
default |
Add all bin contents and statistics of another profile histogram.
Throws an exception if the axes configurations are not identical.
| [in] | other | another profile histogram |
Definition at line 483 of file RProfile.hxx.
Add all bin contents and statistics of another profile histogram using atomic instructions.
Throws an exception if the axes configurations are not identical.
| [in] | other | another profile histogram that must not be modified during the operation |
Definition at line 494 of file RProfile.hxx.
|
inline |
Clear all bin contents and statistics.
Definition at line 501 of file RProfile.hxx.
|
inline |
Clone this profile histogram.
Copying all bin contents can be an expensive operation, depending on the number of bins.
Definition at line 512 of file RProfile.hxx.
|
inline |
Compute the arithmetic mean of unbinned values.
\[ \mu = \frac{\sum w_i \cdot x_i}{\sum w_i} \]
| [in] | dim | the dimension index, starting at 0 |
Definition at line 226 of file RProfile.hxx.
|
inline |
Compute the number of effective entries.
\[ \frac{(\sum w_i)^2}{\sum w_i^2} \]
Definition at line 224 of file RProfile.hxx.
|
inline |
Compute the standard deviation of unbinned values.
This function computes the uncorrected sample standard deviation:
\[ \sigma = \sqrt{\frac{1}{\sum w_i} \sum(w_i \cdot x_i - \mu)^2} \]
With some rewriting, this is equivalent to:
\[ \sigma = \sqrt{\frac{\sum w_i \cdot x_i^2}{\sum w_i} - \frac{(\sum w_i \cdot x_i)^2}{(\sum w_i)^2}} \]
This function does not include Bessel's correction needed for an unbiased estimator of population variance. In other words, the return value is a biased estimation lower than the actual population standard deviation.
| [in] | dim | the dimension index, starting at 0 |
Definition at line 228 of file RProfile.hxx.
|
inline |
Fill an entry into the profile histogram.
For weighted filling, pass an RWeight as the last argument:
If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently discarded.
Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be converted for the axis type at run-time.
| [in] | args | the arguments for each axis |
std::tuple for unweighted filling and for weighted filling Definition at line 449 of file RProfile.hxx.
|
inline |
Fill an entry into the profile histogram.
If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently discarded.
Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be converted for the axis type at run-time.
| [in] | args | the arguments for each axis |
| [in] | v | the additional argument |
Definition at line 388 of file RProfile.hxx.
|
inline |
Fill an entry into the profile histogram with a weight.
If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently discarded.
Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be converted for the axis type at run-time.
| [in] | args | the arguments for each axis |
| [in] | v | the additional argument |
| [in] | weight | the weight for this entry |
Definition at line 417 of file RProfile.hxx.
|
inline |
Definition at line 213 of file RProfile.hxx.
|
inline |
Get the content of a single bin.
Throws an exception if the number of arguments does not match the axis configuration or the bin is not found.
| [in] | args | the arguments for each axis |
Definition at line 299 of file RProfile.hxx.
|
inline |
Get the content of a single bin.
Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
| [in] | indices | the array of indices for each axis |
Definition at line 253 of file RProfile.hxx.
|
inline |
Get the content of a single bin.
Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
| [in] | indices | the array of indices for each axis |
Definition at line 276 of file RProfile.hxx.
|
inline |
Definition at line 210 of file RProfile.hxx.
|
inline |
Get the multidimensional range of all bins.
Definition at line 307 of file RProfile.hxx.
|
inline |
Definition at line 214 of file RProfile.hxx.
|
inline |
Definition at line 217 of file RProfile.hxx.
|
inline |
Definition at line 211 of file RProfile.hxx.
|
inline |
Definition at line 215 of file RProfile.hxx.
The copy assignment operator is deleted.
Copying all bin contents can be an expensive operation, depending on the number of bins. If required, users can explicitly call Clone().
Efficiently move a profile histogram.
After this operation, the moved-from object is invalid.
|
inline |
Scale all bin contents and statistics.
| [in] | factor | the scale factor |
Definition at line 522 of file RProfile.hxx.
|
inline |
Set the content of a single bin.
Throws an exception if the number of arguments does not match the axis configuration or the bin is not found.
| [in] | args | the arguments for each axis and the new value of the bin content |
std::array Definition at line 358 of file RProfile.hxx.
|
inline |
Set the content of a single bin.
Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
| [in] | indices | the array of indices for each axis |
| [in] | value | the new value of the bin content |
Definition at line 331 of file RProfile.hxx.
|
inline |
ROOT Streamer function to throw when trying to store an object of this class.
Definition at line 531 of file RProfile.hxx.
|
private |
The histogram engine including the bin contents.
Definition at line 130 of file RProfile.hxx.
|
private |
The global histogram statistics.
Definition at line 132 of file RProfile.hxx.