CbmRoot
Loading...
Searching...
No Matches
cbm::algo::qa::Histogram< Axes, Storage, TotalSums > Class Template Reference

Interface to a histogram/profile. More...

#include <Histogram.h>

Inheritance diagram for cbm::algo::qa::Histogram< Axes, Storage, TotalSums >:
[legend]
Collaboration diagram for cbm::algo::qa::Histogram< Axes, Storage, TotalSums >:
[legend]

Public Member Functions

 ~Histogram ()=default
 Destructor.
 
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>
 

Protected Member Functions

 Histogram ()=default
 String representation of the histogram/profile.
 
 Histogram (const Histogram< Axes, Storage, TotalSums > &h)=default
 Copy constructor.
 
 Histogram (const Hist_t &bhist, const std::string &name, const std::string title)
 Constructor.
 

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)
 Serialization rule.
 

Friends

class boost::serialization::access
 

Detailed Description

template<class Axes, class Storage, class TotalSums>
class cbm::algo::qa::Histogram< Axes, Storage, TotalSums >

Interface to a histogram/profile.

Template Parameters
AxesThe axes type
StorageStorage type for the histogram
TotalSumsClass for storing the total sums of weights for axes (essential to calculate mean and std.dev.)

Definition at line 250 of file Histogram.h.

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>
protected

Definition at line 252 of file Histogram.h.

Constructor & Destructor Documentation

◆ ~Histogram()

template<class Axes , class Storage , class TotalSums >
cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::~Histogram ( )
default

Destructor.

◆ Histogram() [1/3]

template<class Axes , class Storage , class TotalSums >
cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::Histogram ( )
protecteddefault

String representation of the histogram/profile.

Default constructor

◆ Histogram() [2/3]

template<class Axes , class Storage , class TotalSums >
cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::Histogram ( const Histogram< Axes, Storage, TotalSums > & h)
explicitprotecteddefault

Copy constructor.

◆ Histogram() [3/3]

template<class Axes , class Storage , class TotalSums >
cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::Histogram ( const Hist_t & bhist,
const std::string & name,
const std::string title )
inlineprotected

Constructor.

Parameters
bhistBoost histogram object
nameName of the histogram
titleTitle of the histogram

Definition at line 398 of file Histogram.h.

Member Function Documentation

◆ 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
inline

◆ 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
inline

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
inline

◆ GetBinBH()

◆ GetEntries()

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

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
inline

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
inline

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
inline

◆ 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
inline

◆ GetMetadata()

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

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
inline

◆ GetMinimum()

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

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
inline

◆ 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
inline

◆ GetName()

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

◆ 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
inline

◆ GetTitle()

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

◆ Reset()

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

◆ serialize()

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

◆ SetFlag()

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

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)
inline

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)
inline

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

template<class Axes , class Storage , class TotalSums >
friend class boost::serialization::access
friend

Definition at line 420 of file Histogram.h.

Member Data Documentation

◆ fEntries

◆ fHistogram

◆ fMetadata

◆ fName

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

◆ fTitle

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

◆ Rank

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

Definition at line 253 of file Histogram.h.


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