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

#include <Histogram.h>

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

Public Member Functions

 Prof2D (const std::string &name, const std::string &title, uint32_t nBinsX, double xMin, double xMax, uint32_t nBinsY, double yMin, double yMax, double zMin=0., double zMax=0.)
 Constructor for 2D-histogram.
 
 Prof2D ()=default
 Default constructor.
 
 Prof2D (const Prof2D &)=default
 Copy constructor.
 
 Prof2D (Prof2D &&)=default
 Move constructor.
 
Prof2Doperator= (const Prof2D &)=default
 Copy assignment operator.
 
Prof2Doperator= (Prof2D &&)=default
 Move assignment operator.
 
int Fill (double x, double y, double z, double w=1.)
 Fills histogram.
 
auto GetBinAccumulator (uint32_t iBinX, uint32_t iBinY) const
 Gets underlying bin accumulator.
 
double GetBinContent (uint32_t iBinX, uint32_t iBinY) const
 Gets bin content.
 
double GetBinCount (uint32_t iBinX, uint32_t iBinY) const
 Gets bin entries.
 
double GetBinError (uint32_t iBinX, uint32_t iBinY) const
 Gets bin error.
 
double GetMinZ () const
 Gets z-axis lower bound.
 
double GetMaxZ () const
 Gets z-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.
 
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)
 

Private Attributes

double fZmin = 0.
 Lower bound of the profile z-axis.
 
double fZmax = 0.
 Upper bound of the profile z-axis.
 

Friends

class boost::serialization::access
 Serialization rule.
 

Detailed Description

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

◆ Prof2D() [1/4]

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

Constructor for 2D-histogram.

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

Definition at line 715 of file Histogram.h.

◆ Prof2D() [2/4]

cbm::algo::qa::Prof2D::Prof2D ( )
default

Default constructor.

◆ Prof2D() [3/4]

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

Copy constructor.

◆ Prof2D() [4/4]

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

Move constructor.

Member Function Documentation

◆ Fill()

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

Fills histogram.

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

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

Definition at line 745 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fEntries, cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, fZmax, fZmin, cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetNbinsX(), cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetNbinsY(), 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::Prof2D::GetBinAccumulator ( uint32_t iBinX,
uint32_t iBinY ) const
inline

Gets underlying bin accumulator.

Parameters
iBinXBin index along x-axis
iBinYBin index along y-axis

Definition at line 772 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::Prof2D::GetBinContent ( uint32_t iBinX,
uint32_t iBinY ) const
inline

Gets bin content.

Parameters
iBinXBin index along x-axis
iBinYBin index along y-axis

Definition at line 780 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetBinBH().

◆ GetBinCount()

double cbm::algo::qa::Prof2D::GetBinCount ( uint32_t iBinX,
uint32_t iBinY ) const
inline

Gets bin entries.

Parameters
iBinXBin index along x-axis
iBinYBin index along y-axis

Definition at line 788 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetBinBH().

◆ GetBinError()

double cbm::algo::qa::Prof2D::GetBinError ( uint32_t iBinX,
uint32_t iBinY ) const
inline

Gets bin error.

Parameters
iBinXBin index along x-axis
iBinYBin index along y-axis

Definition at line 796 of file Histogram.h.

References cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::fHistogram, and cbm::algo::qa::Histogram< Axes, Storage, TotalSums >::GetBinBH().

◆ 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

◆ GetMaxZ()

double cbm::algo::qa::Prof2D::GetMaxZ ( ) const
inline

Gets z-axis lower bound.

Definition at line 805 of file Histogram.h.

References fZmax.

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

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

◆ GetMinZ()

double cbm::algo::qa::Prof2D::GetMinZ ( ) const
inline

Gets z-axis lower bound.

Definition at line 802 of file Histogram.h.

References fZmin.

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]

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

Copy assignment operator.

◆ operator=() [2/2]

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

Definition at line 811 of file Histogram.h.

References fZmax, and fZmin.

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

◆ fZmax

double cbm::algo::qa::Prof2D::fZmax = 0.
private

Upper bound of the profile z-axis.

Definition at line 819 of file Histogram.h.

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

◆ fZmin

double cbm::algo::qa::Prof2D::fZmin = 0.
private

Lower bound of the profile z-axis.

Definition at line 818 of file Histogram.h.

Referenced by Fill(), GetMinZ(), 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: