CbmRoot
|
1D-histogram More...
#include <Histogram.h>
Public Member Functions | |
H1D (const std::string &name, const std::string &title, uint32_t nBins, double xMin, double xMax) | |
Constructor for 1D-histogram. | |
H1D ()=default | |
Default constructor. | |
H1D (const H1D &)=default | |
Copy constructor. | |
H1D (H1D &&)=default | |
Move constructor. | |
H1D & | operator= (const H1D &)=default |
Copy assignment operator. | |
H1D & | operator= (H1D &&)=default |
Move assignment operator. | |
int | Fill (double x, double w=1.) |
Fills histogram. | |
auto | GetBinAccumulator (uint32_t iBin) const |
Gets underlying bin accumulator. | |
double | GetBinContent (uint32_t iBin) const |
Gets bin content. | |
double | GetBinError (uint32_t iBin) const |
Gets bin error. | |
template<EAxis A, unsigned IA = static_cast<unsigned>(A), std::enable_if_t<(IA< Rank), bool > = true> | |
double | GetAxisMin () const |
Gets range lower bound of the selected axis. | |
template<EAxis A, unsigned IA = static_cast<unsigned>(A), std::enable_if_t<(IA< Rank), bool > = true> | |
double | GetAxisMax () const |
Gets range upper bound of the selected axis. | |
template<EAxis A, unsigned IA = static_cast<unsigned>(A), std::enable_if_t<(IA< Rank), bool > = true> | |
uint32_t | GetAxisNbins () const |
Gets number of bins in axis. | |
double | GetEntries () const |
Gets number of entries. | |
bool | GetFlag (EHistFlag key) const |
Get flag. | |
const std::string & | GetName () const |
Gets name. | |
const HistogramMetadata & | GetMetadata () const |
Gets metadata instance. | |
std::string | GetMetadataString () const |
Gets metadata string. | |
uint32_t | GetNbinsX () const |
Gets number of bins for x axis. | |
double | GetMinX () const |
Gets x-axis lower bound. | |
double | GetMaxX () const |
Gets x-axis lower bound. | |
template<unsigned RankCheck = Rank, std::enable_if_t<(RankCheck > 1), bool > = true> | |
uint32_t | GetNbinsY () const |
Gets number of bins for y axis. | |
template<unsigned RankCheck = Rank, std::enable_if_t<(RankCheck > 1), bool > = true> | |
double | GetMinY () const |
Gets y-axis lower bound. | |
template<unsigned RankCheck = Rank, std::enable_if_t<(RankCheck > 1), bool > = true> | |
double | GetMaxY () const |
Gets y-axis lower bound. | |
double | GetMaximum () const |
Gets maximum value. | |
double | GetMinimum () const |
Gets minimum value. | |
const std::string & | GetTitle () const |
Gets title. | |
void | Reset () |
Resets the histogram. | |
void | SetFlag (EHistFlag key, bool flag=true) |
Get flag. | |
void | SetName (const std::string &name) |
Sets name. | |
void | SetTitle (const std::string &title) |
Sets title. | |
Protected Types | |
using | Hist_t = bh::histogram<Axes, Storage> |
Static Protected Member Functions | |
static int | GetBinBH (uint32_t iBin) |
Gets bin index in underlying boost histogram. | |
Protected Attributes | |
Hist_t | fHistogram |
Underlying boost histogram. | |
std::string | fName = "" |
Name of the histogram. | |
std::string | fTitle = "" |
Title of the histogram. | |
int | fEntries = 0 |
Number of histogram entries. | |
HistogramMetadata | fMetadata |
Meta-data for histogram. | |
Static Protected Attributes | |
static constexpr unsigned | Rank = std::tuple_size_v<Axes> |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Friends | |
class | boost::serialization::access |
Serialization function. | |
1D-histogram
|
protectedinherited |
Definition at line 252 of file Histogram.h.
|
inline |
Constructor for 1D-histogram.
name | Name of histogram |
title | Title of histogram |
nBins | Number of bins |
xMin | Lower x bound |
xMax | Upper x bound |
Definition at line 449 of file Histogram.h.
|
default |
Default constructor.
|
default |
Copy constructor.
|
default |
Move constructor.
|
inline |
Fills histogram.
x | Value |
w | Weight |
Definition at line 473 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fEntries, cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetNbinsX(), and x.
Referenced by cbm::algo::ca::Qa::Exec(), cbm::algo::evbuild::DigiEventQa::FillDeltaT(), and cbm::algo::qa::RecoGeneralQa::operator()().
|
inlineinherited |
Gets range upper bound of the selected axis.
AxisType | An axis |
Definition at line 270 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisNbins().
Referenced by cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMaxX(), and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMaxY().
|
inlineinherited |
Gets range lower bound of the selected axis.
AxisType | An axis |
Definition at line 262 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram.
Referenced by cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMinX(), and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMinY().
|
inlineinherited |
Gets number of bins in axis.
AxisT | An axis |
D |
Definition at line 279 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram.
Referenced by cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMax(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetNbinsX(), and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetNbinsY().
|
inline |
Gets underlying bin accumulator.
iBin | Bin index |
Definition at line 488 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetBinBH().
|
inlinestaticprotectedinherited |
Gets bin index in underlying boost histogram.
iBin | Bin in histogram |
Definition at line 410 of file Histogram.h.
Referenced by GetBinAccumulator(), cbm::algo::qa::H2D::GetBinAccumulator(), cbm::algo::qa::Prof1D::GetBinAccumulator(), cbm::algo::qa::Prof2D::GetBinAccumulator(), GetBinContent(), cbm::algo::qa::H2D::GetBinContent(), cbm::algo::qa::Prof1D::GetBinContent(), cbm::algo::qa::Prof2D::GetBinContent(), cbm::algo::qa::Prof1D::GetBinCount(), cbm::algo::qa::Prof2D::GetBinCount(), GetBinError(), cbm::algo::qa::H2D::GetBinError(), cbm::algo::qa::Prof1D::GetBinError(), and cbm::algo::qa::Prof2D::GetBinError().
|
inline |
Gets bin content.
iBin | Bin index |
Definition at line 492 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetBinBH().
Referenced by CbmTaskDigiEventQa::ToTH1D().
|
inline |
Gets bin error.
iBin | Bin index |
Definition at line 496 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetBinBH().
|
inlineinherited |
Gets number of entries.
Definition at line 286 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fEntries.
Referenced by CbmTaskDigiEventQa::ToTH1D().
|
inlineinherited |
Get flag.
key | Flag key from the EHistFlag enumeration |
Definition at line 294 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fMetadata, and cbm::algo::qa::HistogramMetadata::GetFlag().
|
inlineinherited |
Gets maximum value.
Definition at line 336 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram.
|
inlineinherited |
Gets x-axis lower bound.
Definition at line 312 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMax().
Referenced by cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), and CbmTaskDigiEventQa::ToTH1D().
|
inlineinherited |
Gets y-axis lower bound.
Definition at line 330 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMax().
Referenced by cbm::qa::OnlineInterface::ROOTHistogram(), and cbm::qa::OnlineInterface::ROOTHistogram().
|
inlineinherited |
Gets metadata instance.
Definition at line 300 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fMetadata.
|
inlineinherited |
Gets metadata string.
Definition at line 303 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fMetadata, and cbm::algo::qa::HistogramMetadata::ToString().
|
inlineinherited |
Gets minimum value.
Definition at line 342 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram.
|
inlineinherited |
Gets x-axis lower bound.
Definition at line 309 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMin().
Referenced by cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), and CbmTaskDigiEventQa::ToTH1D().
|
inlineinherited |
Gets y-axis lower bound.
Definition at line 323 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMin().
Referenced by cbm::qa::OnlineInterface::ROOTHistogram(), and cbm::qa::OnlineInterface::ROOTHistogram().
|
inlineinherited |
Gets name.
Definition at line 297 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fName.
Referenced by cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), and CbmTaskDigiEventQa::ToTH1D().
|
inlineinherited |
Gets number of bins for x axis.
Definition at line 306 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisNbins().
Referenced by Fill(), cbm::algo::qa::H2D::Fill(), cbm::algo::qa::Prof1D::Fill(), cbm::algo::qa::Prof2D::Fill(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), and CbmTaskDigiEventQa::ToTH1D().
|
inlineinherited |
Gets number of bins for y axis.
Definition at line 316 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisNbins().
Referenced by cbm::algo::qa::H2D::Fill(), cbm::algo::qa::Prof2D::Fill(), cbm::qa::OnlineInterface::ROOTHistogram(), and cbm::qa::OnlineInterface::ROOTHistogram().
|
inlineinherited |
Gets title.
Definition at line 348 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fTitle.
Referenced by cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), cbm::qa::OnlineInterface::ROOTHistogram(), and cbm::qa::OnlineInterface::ROOTHistogram().
|
inlineinherited |
Resets the histogram.
Definition at line 351 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fEntries, and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram.
|
inlineprivate |
Definition at line 502 of file Histogram.h.
|
inlineinherited |
Get flag.
key | Flag key from the EHistFlag enumeration |
flag | Flag value |
Definition at line 361 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fMetadata, and cbm::algo::qa::HistogramMetadata::SetFlag().
|
inlineinherited |
Sets name.
name | Histogram name |
Definition at line 365 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fName.
|
inlineinherited |
Sets title.
title | Histogram title |
Definition at line 370 of file Histogram.h.
References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fTitle.
|
friend |
Serialization function.
Definition at line 500 of file Histogram.h.
|
protectedinherited |
Number of histogram entries.
Definition at line 415 of file Histogram.h.
Referenced by Fill(), cbm::algo::qa::H2D::Fill(), cbm::algo::qa::Prof1D::Fill(), cbm::algo::qa::Prof2D::Fill(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetEntries(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::Reset(), and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::serialize().
|
protectedinherited |
Underlying boost histogram.
Definition at line 412 of file Histogram.h.
Referenced by Fill(), cbm::algo::qa::H2D::Fill(), cbm::algo::qa::Prof1D::Fill(), cbm::algo::qa::Prof2D::Fill(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMax(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMin(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisNbins(), GetBinAccumulator(), cbm::algo::qa::H2D::GetBinAccumulator(), cbm::algo::qa::Prof1D::GetBinAccumulator(), cbm::algo::qa::Prof2D::GetBinAccumulator(), GetBinContent(), cbm::algo::qa::H2D::GetBinContent(), cbm::algo::qa::Prof1D::GetBinContent(), cbm::algo::qa::Prof2D::GetBinContent(), cbm::algo::qa::Prof1D::GetBinCount(), cbm::algo::qa::Prof2D::GetBinCount(), GetBinError(), cbm::algo::qa::H2D::GetBinError(), cbm::algo::qa::Prof1D::GetBinError(), cbm::algo::qa::Prof2D::GetBinError(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMaximum(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMinimum(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::Reset(), and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::serialize().
|
protectedinherited |
Meta-data for histogram.
Definition at line 416 of file Histogram.h.
Referenced by cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetFlag(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMetadata(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMetadataString(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::serialize(), and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::SetFlag().
|
protectedinherited |
Name of the histogram.
Definition at line 413 of file Histogram.h.
Referenced by cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetName(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::serialize(), and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::SetName().
|
protectedinherited |
Title of the histogram.
Definition at line 414 of file Histogram.h.
Referenced by cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetTitle(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::serialize(), and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::SetTitle().
|
staticconstexprprotectedinherited |
Definition at line 253 of file Histogram.h.