CbmRoot
Loading...
Searching...
No Matches
cbm::algo::qa::H1D Class Reference

1D-histogram More...

#include <Histogram.h>

Inheritance diagram for cbm::algo::qa::H1D:
[legend]
Collaboration diagram for cbm::algo::qa::H1D:
[legend]

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.
 
H1Doperator= (const H1D &)=default
 Copy assignment operator.
 
H1Doperator= (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 HistogramMetadataGetMetadata () 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.
 

Detailed Description

1D-histogram

Member Typedef Documentation

◆ Hist_t

template<class Axes , class Storage , class TotalSums >
using cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::Hist_t = bh::histogram<Axes, Storage>
protectedinherited

Definition at line 252 of file Histogram.h.

Constructor & Destructor Documentation

◆ H1D() [1/4]

cbm::algo::qa::H1D::H1D ( const std::string & name,
const std::string & title,
uint32_t nBins,
double xMin,
double xMax )
inline

Constructor for 1D-histogram.

Parameters
nameName of histogram
titleTitle of histogram
nBinsNumber of bins
xMinLower x bound
xMaxUpper x bound

Definition at line 449 of file Histogram.h.

◆ H1D() [2/4]

cbm::algo::qa::H1D::H1D ( )
default

Default constructor.

◆ H1D() [3/4]

cbm::algo::qa::H1D::H1D ( const H1D & )
default

Copy constructor.

◆ H1D() [4/4]

cbm::algo::qa::H1D::H1D ( H1D && )
default

Move constructor.

Member Function Documentation

◆ Fill()

int cbm::algo::qa::H1D::Fill ( double x,
double w = 1. )
inline

◆ GetAxisMax()

template<class Axes , class Storage , class TotalSums >
template<EAxis A, unsigned IA = static_cast<unsigned>(A), std::enable_if_t<(IA< Rank), bool > = true>
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMax ( ) const
inlineinherited

◆ GetAxisMin()

template<class Axes , class Storage , class TotalSums >
template<EAxis A, unsigned IA = static_cast<unsigned>(A), std::enable_if_t<(IA< Rank), bool > = true>
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisMin ( ) const
inlineinherited

Gets range lower bound of the selected axis.

Template Parameters
AxisTypeAn 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().

◆ GetAxisNbins()

template<class Axes , class Storage , class TotalSums >
template<EAxis A, unsigned IA = static_cast<unsigned>(A), std::enable_if_t<(IA< Rank), bool > = true>
uint32_t cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetAxisNbins ( ) const
inlineinherited

◆ GetBinAccumulator()

auto cbm::algo::qa::H1D::GetBinAccumulator ( uint32_t iBin) const
inline

Gets underlying bin accumulator.

Parameters
iBinBin 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().

◆ GetBinBH()

template<class Axes , class Storage , class TotalSums >
static int cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetBinBH ( uint32_t iBin)
inlinestaticprotectedinherited

◆ GetBinContent()

double cbm::algo::qa::H1D::GetBinContent ( uint32_t iBin) const
inline

◆ GetBinError()

double cbm::algo::qa::H1D::GetBinError ( uint32_t iBin) const
inline

◆ GetEntries()

template<class Axes , class Storage , class TotalSums >
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetEntries ( ) const
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().

◆ GetFlag()

template<class Axes , class Storage , class TotalSums >
bool cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetFlag ( EHistFlag key) const
inlineinherited

Get flag.

Parameters
keyFlag 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().

◆ GetMaximum()

template<class Axes , class Storage , class TotalSums >
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMaximum ( ) const
inlineinherited

Gets maximum value.

Definition at line 336 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram.

◆ GetMaxX()

template<class Axes , class Storage , class TotalSums >
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMaxX ( ) const
inlineinherited

◆ GetMaxY()

template<class Axes , class Storage , class TotalSums >
template<unsigned RankCheck = Rank, std::enable_if_t<(RankCheck > 1), bool > = true>
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMaxY ( ) const
inlineinherited

◆ GetMetadata()

template<class Axes , class Storage , class TotalSums >
const HistogramMetadata & cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMetadata ( ) const
inlineinherited

Gets metadata instance.

Definition at line 300 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fMetadata.

◆ GetMetadataString()

template<class Axes , class Storage , class TotalSums >
std::string cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMetadataString ( ) const
inlineinherited

◆ GetMinimum()

template<class Axes , class Storage , class TotalSums >
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMinimum ( ) const
inlineinherited

Gets minimum value.

Definition at line 342 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram.

◆ GetMinX()

template<class Axes , class Storage , class TotalSums >
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMinX ( ) const
inlineinherited

◆ GetMinY()

template<class Axes , class Storage , class TotalSums >
template<unsigned RankCheck = Rank, std::enable_if_t<(RankCheck > 1), bool > = true>
double cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetMinY ( ) const
inlineinherited

◆ GetName()

template<class Axes , class Storage , class TotalSums >
const std::string & cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetName ( ) const
inlineinherited

◆ GetNbinsX()

◆ GetNbinsY()

template<class Axes , class Storage , class TotalSums >
template<unsigned RankCheck = Rank, std::enable_if_t<(RankCheck > 1), bool > = true>
uint32_t cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetNbinsY ( ) const
inlineinherited

◆ GetTitle()

template<class Axes , class Storage , class TotalSums >
const std::string & cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetTitle ( ) const
inlineinherited

◆ operator=() [1/2]

H1D & cbm::algo::qa::H1D::operator= ( const H1D & )
default

Copy assignment operator.

◆ operator=() [2/2]

H1D & cbm::algo::qa::H1D::operator= ( H1D && )
default

Move assignment operator.

◆ Reset()

template<class Axes , class Storage , class TotalSums >
void cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::Reset ( )
inlineinherited

◆ serialize()

template<class Archive >
void cbm::algo::qa::H1D::serialize ( Archive & ar,
const unsigned int  )
inlineprivate

Definition at line 502 of file Histogram.h.

◆ SetFlag()

template<class Axes , class Storage , class TotalSums >
void cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::SetFlag ( EHistFlag key,
bool flag = true )
inlineinherited

Get flag.

Parameters
keyFlag key from the EHistFlag enumeration
flagFlag value

Definition at line 361 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fMetadata, and cbm::algo::qa::HistogramMetadata::SetFlag().

◆ SetName()

template<class Axes , class Storage , class TotalSums >
void cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::SetName ( const std::string & name)
inlineinherited

Sets name.

Parameters
nameHistogram name

Definition at line 365 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fName.

◆ SetTitle()

template<class Axes , class Storage , class TotalSums >
void cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::SetTitle ( const std::string & title)
inlineinherited

Sets title.

Parameters
titleHistogram title
Note
ROOT axes convention is applicable: "<main title>;<x-axis title>;<y-axis title>"

Definition at line 370 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fTitle.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialization function.

Definition at line 500 of file Histogram.h.

Member Data Documentation

◆ fEntries

template<class Axes , class Storage , class TotalSums >
int cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fEntries = 0
protectedinherited

◆ fHistogram

◆ fMetadata

◆ fName

template<class Axes , class Storage , class TotalSums >
std::string cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fName = ""
protectedinherited

◆ fTitle

template<class Axes , class Storage , class TotalSums >
std::string cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fTitle = ""
protectedinherited

◆ Rank

template<class Axes , class Storage , class TotalSums >
unsigned cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::Rank = std::tuple_size_v<Axes>
staticconstexprprotectedinherited

Definition at line 253 of file Histogram.h.


The documentation for this class was generated from the following file: