Project
Loading...
Searching...
No Matches
o2::math_utils::RandomRing< N > Class Template Reference

#include <RandomRing.h>

Public Types

enum class  RandomType : char { Gaus , Flat , CustomTF1 , CustomLambda }
 

Public Member Functions

 RandomRing (const RandomType randomType=RandomType::Gaus, TRandom *rng=nullptr)
 
 RandomRing (TF1 &function)
 
void initialize (const RandomType randomType=RandomType::Gaus, TRandom *rng=nullptr)
 
void initialize (TF1 &function, TRandom *rng=nullptr)
 
void initialize (std::function< float()> function)
 
float getNextValue ()
 
template<typename VcType >
VcType getNextValueVc ()
 
unsigned int getRingPosition () const
 
void setRandomPosition (TRandom &rng)
 

Detailed Description

template<size_t N = 4 * 100000>
class o2::math_utils::RandomRing< N >

Definition at line 45 of file RandomRing.h.

Member Enumeration Documentation

◆ RandomType

template<size_t N = 4 * 100000>
enum class o2::math_utils::RandomRing::RandomType : char
strong
Enumerator
Gaus 

Gaussian distribution.

Flat 

Flat distribution.

CustomTF1 

Custom TF1 function to be used.

CustomLambda 

Initialized through external lambda.

Definition at line 48 of file RandomRing.h.

Constructor & Destructor Documentation

◆ RandomRing() [1/2]

template<size_t N>
o2::math_utils::RandomRing< N >::RandomRing ( const RandomType  randomType = RandomType::Gaus,
TRandom *  rng = nullptr 
)
inline

constructor

Parameters
[in]randomTypetype of the random generator
[in]rngrandom generator to draw from, gRandom if null

Definition at line 137 of file RandomRing.h.

◆ RandomRing() [2/2]

template<size_t N>
o2::math_utils::RandomRing< N >::RandomRing ( TF1 &  function)
inline

constructor accepting TF1

Parameters
[in]functionTF1 function

Definition at line 147 of file RandomRing.h.

Member Function Documentation

◆ getNextValue()

template<size_t N = 4 * 100000>
float o2::math_utils::RandomRing< N >::getNextValue ( )
inline

next random value from the ring buffer This function return a value from the ring buffer and increases the buffer position

Returns
next random value

Definition at line 82 of file RandomRing.h.

◆ getNextValueVc()

template<size_t N = 4 * 100000>
template<typename VcType >
VcType o2::math_utils::RandomRing< N >::getNextValueVc ( )
inline

next vector with random values This function retuns a Vc vector with random numbers to be used for vectorised programming and increases the buffer position by the size of the vector

Returns
vector with random values

Definition at line 98 of file RandomRing.h.

◆ getRingPosition()

template<size_t N = 4 * 100000>
unsigned int o2::math_utils::RandomRing< N >::getRingPosition ( ) const
inline

position in the ring buffer

Returns
position in the ring buffer

Definition at line 118 of file RandomRing.h.

◆ initialize() [1/3]

template<size_t N>
void o2::math_utils::RandomRing< N >::initialize ( const RandomType  randomType = RandomType::Gaus,
TRandom *  rng = nullptr 
)
inline

initialisation of the random ring

Parameters
[in]randomTypetype of the random generator
[in]rngrandom generator to draw from, gRandom if null

Definition at line 156 of file RandomRing.h.

◆ initialize() [2/3]

template<size_t N>
void o2::math_utils::RandomRing< N >::initialize ( std::function< float()>  function)
inline

initialisation of the random ring

Parameters
[in]randomTypetype of the random generator

Definition at line 190 of file RandomRing.h.

◆ initialize() [3/3]

template<size_t N>
void o2::math_utils::RandomRing< N >::initialize ( TF1 &  function,
TRandom *  rng = nullptr 
)
inline

initialisation of the random ring

Parameters
[in]functionTF1 function
[in]rngrandom generator to draw from, gRandom if null

Definition at line 180 of file RandomRing.h.

◆ setRandomPosition()

template<size_t N = 4 * 100000>
void o2::math_utils::RandomRing< N >::setRandomPosition ( TRandom &  rng)
inline

move to a random position in the ring buffer

Parameters
[in]rngrandom generator to draw the position from

Definition at line 122 of file RandomRing.h.


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