Project
Loading...
Searching...
No Matches
o2::utils Namespace Reference

Namespaces

namespace  details
 

Classes

class  BinCenterView
 Axis iterator over bin centers. More...
 
class  BinLowerView
 Axis iterator over bin lower edges. More...
 
class  BinUpperView
 Axis iterator over bin upper edges. More...
 
class  DebugStreamer
 class to enable streaming debug information to root files More...
 
class  DLLoaderBase
 
class  EnumFlags
 Classs to aggregate and manage enum-based on-off flags. More...
 
class  FIFO
 
class  FileFetcher
 
class  fitResult
 
class  IRFrameSelector
 
struct  MemFileHelper
 
struct  ParameterDebugStreamer
 struct for setting and storing the streamer level More...
 
class  RngHelper
 
class  RootChain
 
class  RootSerializableKeyValueStore
 
class  ShmAllocator
 
class  ShmManager
 
struct  ShmMetaInfo
 
struct  Str
 
class  TreeStream
 
class  TreeStreamRedirector
 
class  ValueMonitor
 

Concepts

concept  EnumFlag
 

Enumerations

enum class  FitGausError_t {
  FIT_ERROR_MAX , FIT_ERROR_MIN , FIT_ERROR_ENTRIES , FIT_ERROR_KTOL_MEAN ,
  FIT_ERROR_KTOL_SIGMA , FIT_ERROR_KTOL_RMS
}
 Error code for invalid result in the fitGaus process. More...
 
enum  StreamFlags {
  streamdEdx = 1 << 0 , streamDigitFolding = 1 << 1 , streamDigits = 1 << 2 , streamFastTransform = 1 << 3 ,
  streamITCorr = 1 << 4 , streamDistortionsSC = 1 << 5 , streamUpdateTrack = 1 << 6 , streamRejectCluster = 1 << 7 ,
  streamMergeBorderTracksBest = 1 << 8 , streamMergeBorderTracksAll = 1 << 9 , streamFlagsCount = 10
}
 struct defining the flags which can be used to check if a certain debug streamer is used More...
 
enum  SamplingTypes {
  sampleAll = 0 , sampleRandom = 1 , sampleID = 2 , sampleIDGlobal = 3 ,
  sampleWeights = 4 , sampleTsallis = 5
}
 

Functions

template<typename AxisIterator >
BinCenterView< AxisIterator > operator+ (BinCenterView< AxisIterator > lhs, int n)
 
template<typename AxisIterator >
BinUpperView< AxisIterator > operator+ (BinUpperView< AxisIterator > lhs, int n)
 
template<typename AxisIterator >
BinLowerView< AxisIterator > operator+ (BinLowerView< AxisIterator > lhs, int n)
 
std::string createErrorMessageFitGaus (o2::utils::FitGausError_t errorcode)
 Printing an error message when then fit returns an invalid result.
 
template<typename T , typename Iterator , typename BinCenterView >
std::vector< double > fitGaus (Iterator first, Iterator last, BinCenterView axisfirst, const bool ignoreUnderOverflowBin=true)
 Function to fit histogram to a gaussian using iterators.
 
template<typename valuetype , typename... axes>
std::vector< double > fitBoostHistoWithGaus (boost::histogram::histogram< axes... > &hist)
 
template<typename Hist >
Hist boosthistoFromRoot_1D (TH1D *inHist1D)
 Convert a 1D root histogram to a Boost histogram.
 
template<typename Hist >
Hist boostHistoFromRoot_2D (TH2D *inHist2D)
 Convert a 2D root histogram to a Boost histogram.
 
template<typename... axes>
double getMeanBoost1D (boost::histogram::histogram< axes... > &inHist1D, const double rangeLow=0, const double rangeHigh=0)
 Get the mean of a 1D boost histogram.
 
template<typename... axes>
double getVarianceBoost1D (boost::histogram::histogram< axes... > &inHist1D, double mean=-999999, const double rangeLow=0, const double rangeHigh=0, const double weight=1)
 Get the variance of a 1D boost histogram.
 
template<class BoostHist >
TH1F TH1FFromBoost (BoostHist hist, const char *name="hist")
 Convert a 2D boost histogram to a root histogram.
 
template<class BoostHist >
TH2F TH2FFromBoost (BoostHist hist, const char *name="hist")
 Convert a 2D boost histogram to a root histogram.
 
template<typename... axes>
auto ProjectBoostHistoX (const boost::histogram::histogram< axes... > &hist2d, const int binLow, const int binHigh)
 Function to project 2d boost histogram onto x-axis.
 
template<typename... axes>
auto ProjectBoostHistoXFast (const boost::histogram::histogram< axes... > &hist2d, const int binLow, const int binHigh)
 Function to project 2d boost histogram onto x-axis.
 
template<typename... axes>
auto ReduceBoostHistoFastSlice (const boost::histogram::histogram< axes... > &hist2d, int binXLow, int binXHigh, int binYLow, int binYHigh, bool includeOverflowUnderflow)
 Function to project 2d boost histogram onto x-axis.
 
template<typename... axes>
auto ReduceBoostHistoFastSlice1D (boost::histogram::histogram< axes... > &hist1d, int binXLow, int binXHigh, bool includeOverflowUnderflow)
 
template<typename... axes>
auto ReduceBoostHistoFastSliceByValue (boost::histogram::histogram< axes... > &hist2d, double xLow, double xHigh, double yLow, double yHigh, bool includeOverflowUnderflow)
 Function to project 2d boost histogram onto x-axis.
 
template<typename... axes>
double getIntegralBoostHist (boost::histogram::histogram< axes... > &hist, double min, double max)
 Function to integrate 1d boost histogram in specified range.
 
StreamFlags operator| (StreamFlags a, StreamFlags b)
 
StreamFlags operator& (StreamFlags a, StreamFlags b)
 
StreamFlags operator~ (StreamFlags a)
 
template<EnumFlag E>
std::ostream & operator<< (std::ostream &os, const EnumFlags< E > &f)
 
std::vector< std::string > listFiles (std::string const &dir, std::string const &searchpattern)
 
std::vector< std::string > listFiles (std::string const &searchpattern)
 
void createDirectoriesIfAbsent (std::string const &path)
 
std::string expandShellVarsInFileName (std::string const &input)
 
template<typename T >
std::vector< T > * createSimVector ()
 
template<typename T >
void freeSimVector (std::vector< T > *ptr)
 
std::string createErrorMessage (o2::utils::FitGausError_t errorcode)
 Printing an error message when then fit returns an invalid result.
 

Variables

constexpr size_t SHMPOOLSIZE = 1024 * 1024 * 1024
 
const charSHMIDNAME = "ALICEO2_SIMSHM_SHMID"
 
const charSHMADDRNAME = "ALICEO2_SIMSHM_COMMONADDR"
 

Enumeration Type Documentation

◆ FitGausError_t

enum class o2::utils::FitGausError_t
strong

Error code for invalid result in the fitGaus process.

Enumerator
FIT_ERROR_MAX 

Gaus fit failed! yMax too large.

FIT_ERROR_MIN 

Gaus fit failed! yMax < 4.

FIT_ERROR_ENTRIES 

Gaus fit failed! entries < 12.

FIT_ERROR_KTOL_MEAN 

Gaus fit failed! std::abs(par[1]) < kTol.

FIT_ERROR_KTOL_SIGMA 

Gaus fit failed! std::abs(par[2]) < kTol.

FIT_ERROR_KTOL_RMS 

Gaus fit failed! RMS < kTol.

Definition at line 225 of file BoostHistogramUtils.h.

◆ SamplingTypes

Enumerator
sampleAll 

use all data (default)

sampleRandom 

sample randomly every n points

sampleID 

sample every n IDs (per example track)

sampleIDGlobal 

in case different streamers have access to the same IDs use this gloabl ID

sampleWeights 

perform sampling on weights, defined where the streamer is called

sampleTsallis 

perform sampling on tsallis pdf

Definition at line 47 of file DebugStreamer.h.

◆ StreamFlags

struct defining the flags which can be used to check if a certain debug streamer is used

Enumerator
streamdEdx 

stream corrections and cluster properties used for the dE/dx

streamDigitFolding 

stream ion tail and saturatio information

streamDigits 

stream digit information

streamFastTransform 

stream tpc fast transform

streamITCorr 

stream ion tail correction information

streamDistortionsSC 

stream distortions applied in the TPC space-charge class (used for example in the tpc digitizer)

streamUpdateTrack 

stream update track informations

streamRejectCluster 

stream cluster rejection informations

streamMergeBorderTracksBest 

stream MergeBorderTracks best track

streamMergeBorderTracksAll 

stream MergeBorderTracks all tracks

streamFlagsCount 

total number of streamers

Definition at line 33 of file DebugStreamer.h.

Function Documentation

◆ boosthistoFromRoot_1D()

template<typename Hist >
Hist o2::utils::boosthistoFromRoot_1D ( TH1D *  inHist1D)

Convert a 1D root histogram to a Boost histogram.

Definition at line 405 of file BoostHistogramUtils.h.

◆ boostHistoFromRoot_2D()

template<typename Hist >
Hist o2::utils::boostHistoFromRoot_2D ( TH2D *  inHist2D)

Convert a 2D root histogram to a Boost histogram.

Definition at line 430 of file BoostHistogramUtils.h.

◆ createDirectoriesIfAbsent()

void o2::utils::createDirectoriesIfAbsent ( std::string const &  path)

Definition at line 58 of file FileSystemUtils.cxx.

◆ createErrorMessage()

std::string o2::utils::createErrorMessage ( o2::utils::FitGausError_t  errorcode)

Printing an error message when then fit returns an invalid result.

Parameters
errorcodeError of the type FitGausError_t, thrown when fit result is invalid.

Definition at line 45 of file BoostHistogramUtils.cxx.

◆ createErrorMessageFitGaus()

std::string o2::utils::createErrorMessageFitGaus ( o2::utils::FitGausError_t  errorcode)

Printing an error message when then fit returns an invalid result.

Parameters
errorcodeError of the type FitGausError_t, thrown when fit result is invalid.

Definition at line 22 of file BoostHistogramUtils.cxx.

◆ createSimVector()

template<typename T >
std::vector< T > * o2::utils::createSimVector ( )

Definition at line 109 of file ShmAllocator.h.

◆ expandShellVarsInFileName()

std::string o2::utils::expandShellVarsInFileName ( std::string const &  input)

Definition at line 69 of file FileSystemUtils.cxx.

◆ fitBoostHistoWithGaus()

template<typename valuetype , typename... axes>
std::vector< double > o2::utils::fitBoostHistoWithGaus ( boost::histogram::histogram< axes... > &  hist)

Definition at line 398 of file BoostHistogramUtils.h.

◆ fitGaus()

template<typename T , typename Iterator , typename BinCenterView >
std::vector< double > o2::utils::fitGaus ( Iterator  first,
Iterator  last,
BinCenterView  axisfirst,
const bool  ignoreUnderOverflowBin = true 
)

Function to fit histogram to a gaussian using iterators.

Parameters
firstbegin iterator of the histogram
lastend iterator of the histogram
axisFirstaxis iterator over the bin centers
ignoreUnderOverflowBinswitch to disable taking under and overflow bin into fit
Returns
result result is of the type fitResult, which contains 4 parameters (0-Constant, 1-Mean, 2-Sigma, 3-Sum)

** Temp Note: For now we forgo the templated struct in favor of a std::vector in order to have this compile while we are working out the details

Definition at line 250 of file BoostHistogramUtils.h.

◆ freeSimVector()

template<typename T >
void o2::utils::freeSimVector ( std::vector< T > *  ptr)

Definition at line 122 of file ShmAllocator.h.

◆ getIntegralBoostHist()

template<typename... axes>
double o2::utils::getIntegralBoostHist ( boost::histogram::histogram< axes... > &  hist,
double  min,
double  max 
)

Function to integrate 1d boost histogram in specified range.

Parameters
hist1d boost histogram
minlower integration range
maxupper integration range
Returns
sum of bin contents in specified range

Definition at line 723 of file BoostHistogramUtils.h.

◆ getMeanBoost1D()

template<typename... axes>
double o2::utils::getMeanBoost1D ( boost::histogram::histogram< axes... > &  inHist1D,
const double  rangeLow = 0,
const double  rangeHigh = 0 
)

Get the mean of a 1D boost histogram.

Parameters
inHist1Dinput boost histogram
rangeLowminimum range considered for the mean calculation (if rangeLow == rangeHigh, no cut will be performed)
rangeHighmaximum range considered for the mean calculation (if rangeLow == rangeHigh, no cut will be performed)
Returns
mean value of boost histogram in specified range

Definition at line 468 of file BoostHistogramUtils.h.

◆ getVarianceBoost1D()

template<typename... axes>
double o2::utils::getVarianceBoost1D ( boost::histogram::histogram< axes... > &  inHist1D,
double  mean = -999999,
const double  rangeLow = 0,
const double  rangeHigh = 0,
const double  weight = 1 
)

Get the variance of a 1D boost histogram.

Parameters
inHist1Dinput boost histogram
meanmean mean of the histogram, if set to -999999, mean will be caluclated
weightweight of the entries in the histogram. Per default set to 1
rangeLowminimum range considered for the mean calculation (if rangeLow == rangeHigh, no cut will be performed)
rangeHighmaximum range considered for the mean calculation (if rangeLow == rangeHigh, no cut will be performed)
Returns
variance of the distribution with respect to the mean

Definition at line 495 of file BoostHistogramUtils.h.

◆ listFiles() [1/2]

std::vector< std::string > o2::utils::listFiles ( std::string const &  dir,
std::string const &  searchpattern 
)

Definition at line 30 of file FileSystemUtils.cxx.

◆ listFiles() [2/2]

std::vector< std::string > o2::utils::listFiles ( std::string const &  searchpattern)

Definition at line 53 of file FileSystemUtils.cxx.

◆ operator&()

StreamFlags o2::utils::operator& ( StreamFlags  a,
StreamFlags  b 
)
inline

Definition at line 62 of file DebugStreamer.h.

◆ operator+() [1/3]

template<typename AxisIterator >
BinCenterView< AxisIterator > o2::utils::operator+ ( BinCenterView< AxisIterator >  lhs,
int  n 
)

Definition at line 152 of file BoostHistogramUtils.h.

◆ operator+() [2/3]

template<typename AxisIterator >
BinLowerView< AxisIterator > o2::utils::operator+ ( BinLowerView< AxisIterator >  lhs,
int  n 
)

Definition at line 172 of file BoostHistogramUtils.h.

◆ operator+() [3/3]

template<typename AxisIterator >
BinUpperView< AxisIterator > o2::utils::operator+ ( BinUpperView< AxisIterator >  lhs,
int  n 
)

Definition at line 162 of file BoostHistogramUtils.h.

◆ operator<<()

template<EnumFlag E>
std::ostream & o2::utils::operator<< ( std::ostream &  os,
const EnumFlags< E > &  f 
)

Definition at line 691 of file EnumFlags.h.

◆ operator|()

StreamFlags o2::utils::operator| ( StreamFlags  a,
StreamFlags  b 
)
inline

Definition at line 58 of file DebugStreamer.h.

◆ operator~()

StreamFlags o2::utils::operator~ ( StreamFlags  a)
inline

Definition at line 63 of file DebugStreamer.h.

◆ ProjectBoostHistoX()

template<typename... axes>
auto o2::utils::ProjectBoostHistoX ( const boost::histogram::histogram< axes... > &  hist2d,
const int  binLow,
const int  binHigh 
)

Function to project 2d boost histogram onto x-axis.

Parameters
hist2d2d boost histogram
binLowlower bin in y for projection
binHighlower bin in y for projection
Returns
result 1d boost histogram from projection of the input 2d boost histogram

Definition at line 567 of file BoostHistogramUtils.h.

◆ ProjectBoostHistoXFast()

template<typename... axes>
auto o2::utils::ProjectBoostHistoXFast ( const boost::histogram::histogram< axes... > &  hist2d,
const int  binLow,
const int  binHigh 
)

Function to project 2d boost histogram onto x-axis.

Parameters
hist2d2d boost histogram
binLowlower bin in y for projection
binHighlower bin in y for projection
Returns
result 1d boost histogram from projection of the input 2d boost histogram

Definition at line 593 of file BoostHistogramUtils.h.

◆ ReduceBoostHistoFastSlice()

template<typename... axes>
auto o2::utils::ReduceBoostHistoFastSlice ( const boost::histogram::histogram< axes... > &  hist2d,
int  binXLow,
int  binXHigh,
int  binYLow,
int  binYHigh,
bool  includeOverflowUnderflow 
)

Function to project 2d boost histogram onto x-axis.

Parameters
hist2d2d boost histogram
binXLowlower bin in x for the reduction
binXHighlower bin in x for the reduction
binYLowlower bin in y for the reduction
binYHighlower bin in y for the reduction
includeOverflowUnderflowoption to include overflow and underflow bins
Returns
result 1d boost histogram from projection of the input 2d boost histogram

Definition at line 621 of file BoostHistogramUtils.h.

◆ ReduceBoostHistoFastSlice1D()

template<typename... axes>
auto o2::utils::ReduceBoostHistoFastSlice1D ( boost::histogram::histogram< axes... > &  hist1d,
int  binXLow,
int  binXHigh,
bool  includeOverflowUnderflow 
)
Parameters
hist1d2d boost histogram
binXLowlower bin in x for the reduction
binXHighlower bin in x for the reduction
includeOverflowUnderflowoption to include overflow and underflow bins
Returns
result 1d boost histogram from projection of the input 2d boost histogram

Definition at line 665 of file BoostHistogramUtils.h.

◆ ReduceBoostHistoFastSliceByValue()

template<typename... axes>
auto o2::utils::ReduceBoostHistoFastSliceByValue ( boost::histogram::histogram< axes... > &  hist2d,
double  xLow,
double  xHigh,
double  yLow,
double  yHigh,
bool  includeOverflowUnderflow 
)

Function to project 2d boost histogram onto x-axis.

Parameters
hist2d2d boost histogram
xLowlower value in x for the reduction
xHighlower value in x for the reduction
yLowlower value in y for the reduction
yHighlower value in y for the reduction
includeOverflowUnderflowoption to include overflow and underflow bins
Returns
result 1d boost histogram from projection of the input 2d boost histogram

Definition at line 706 of file BoostHistogramUtils.h.

◆ TH1FFromBoost()

template<class BoostHist >
TH1F o2::utils::TH1FFromBoost ( BoostHist  hist,
const char name = "hist" 
)

Convert a 2D boost histogram to a root histogram.

Definition at line 524 of file BoostHistogramUtils.h.

◆ TH2FFromBoost()

template<class BoostHist >
TH2F o2::utils::TH2FFromBoost ( BoostHist  hist,
const char name = "hist" 
)

Convert a 2D boost histogram to a root histogram.

Definition at line 541 of file BoostHistogramUtils.h.

Variable Documentation

◆ SHMADDRNAME

const char* o2::utils::SHMADDRNAME = "ALICEO2_SIMSHM_COMMONADDR"

Definition at line 42 of file ShmManager.cxx.

◆ SHMIDNAME

const char* o2::utils::SHMIDNAME = "ALICEO2_SIMSHM_SHMID"

Definition at line 40 of file ShmManager.cxx.

◆ SHMPOOLSIZE

constexpr size_t o2::utils::SHMPOOLSIZE = 1024 * 1024 * 1024
constexpr

Definition at line 42 of file ShmManager.h.