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

#include <Histogram.h>

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

Public Member Functions

 Prof1D (const std::string &name, const std::string &title, uint32_t nBinsX, double xMin, double xMax, double yMin=0., double yMax=0.)
 Constructor for 2D-histogram.
 
 Prof1D ()=default
 Default constructor.
 
 Prof1D (const Prof1D &)=default
 Copy constructor.
 
 Prof1D (Prof1D &&)=default
 Move constructor.
 
Prof1Doperator= (const Prof1D &)=default
 Copy assignment operator.
 
Prof1Doperator= (Prof1D &&)=default
 Move assignment operator.
 
int Fill (double x, double y, 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 GetBinCount (uint32_t iBin) const
 Gets bin entries.
 
double GetBinError (uint32_t iBin) const
 Gets bin error.
 
double GetMinY () const
 Gets y-axis lower bound.
 
double GetMaxY () const
 Gets y-axis lower bound.
 
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.
 
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)
 

Private Attributes

double fYmin = 0.
 Lower bound of the profile y-axis.
 
double fYmax = 0.
 Upper bound of the profile y-axis.
 

Friends

class boost::serialization::access
 Serialization rule.
 

Detailed Description

Definition at line 603 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>
protectedinherited

Definition at line 252 of file Histogram.h.

Constructor & Destructor Documentation

◆ Prof1D() [1/4]

cbm::algo::qa::Prof1D::Prof1D ( const std::string & name,
const std::string & title,
uint32_t nBinsX,
double xMin,
double xMax,
double yMin = 0.,
double yMax = 0. )
inline

Constructor for 2D-histogram.

Parameters
nameName of histogram
titleTitle of histogram
nBinsXNumber of x bins
xMinLower x bound
xMaxUpper x bound
yMinLower y bound (optional)
yMaxUpper y bound (optional)
Note
If the yMin and yMax are defined (yMin != yMax), all the passed values outside the [yMin, yMax] range will be ignored.

Definition at line 616 of file Histogram.h.

◆ Prof1D() [2/4]

cbm::algo::qa::Prof1D::Prof1D ( )
default

Default constructor.

◆ Prof1D() [3/4]

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

Copy constructor.

◆ Prof1D() [4/4]

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

Move constructor.

Member Function Documentation

◆ Fill()

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

Fills histogram.

Parameters
xValue along x-axis
yValue along y-axis
wWeight
Returns
Bin number TODO: implement

Skip measurement, if it goes beyond the defined [fYmin, fYmax] range

Definition at line 644 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fEntries, cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, fYmax, fYmin, cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetNbinsX(), x, and y.

◆ 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::Prof1D::GetBinAccumulator ( uint32_t iBin) const
inline

Gets underlying bin accumulator.

Parameters
iBinBin index along x-axis

Definition at line 664 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::Prof1D::GetBinContent ( uint32_t iBin) const
inline

◆ GetBinCount()

double cbm::algo::qa::Prof1D::GetBinCount ( uint32_t iBin) const
inline

◆ GetBinError()

double cbm::algo::qa::Prof1D::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()

double cbm::algo::qa::Prof1D::GetMaxY ( ) const
inline

Gets y-axis lower bound.

Definition at line 682 of file Histogram.h.

References fYmax.

Referenced by cbm::qa::OnlineInterface::ROOTHistogram().

◆ 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()

double cbm::algo::qa::Prof1D::GetMinY ( ) const
inline

Gets y-axis lower bound.

Definition at line 679 of file Histogram.h.

References fYmin.

Referenced by cbm::qa::OnlineInterface::ROOTHistogram().

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

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

Copy assignment operator.

◆ operator=() [2/2]

Prof1D & cbm::algo::qa::Prof1D::operator= ( Prof1D && )
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::Prof1D::serialize ( Archive & ar,
const unsigned int  )
inlineprivate

Definition at line 688 of file Histogram.h.

References fYmax, and fYmin.

◆ 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 rule.

Definition at line 686 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

◆ fYmax

double cbm::algo::qa::Prof1D::fYmax = 0.
private

Upper bound of the profile y-axis.

Definition at line 696 of file Histogram.h.

Referenced by Fill(), GetMaxY(), and serialize().

◆ fYmin

double cbm::algo::qa::Prof1D::fYmin = 0.
private

Lower bound of the profile y-axis.

Definition at line 695 of file Histogram.h.

Referenced by Fill(), GetMinY(), and serialize().

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