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)
 
 RandomRing (TF1 &function)
 
void initialize (const RandomType randomType=RandomType::Gaus)
 
void initialize (TF1 &function)
 
void initialize (std::function< float()> function)
 
float getNextValue ()
 
template<typename VcType >
VcType getNextValueVc ()
 
unsigned int getRingPosition () const
 

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

constructor

Parameters
[in]randomTypetype of the random generator

Definition at line 126 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 136 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 79 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 95 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 111 of file RandomRing.h.

◆ initialize() [1/3]

template<size_t N>
void o2::math_utils::RandomRing< N >::initialize ( const RandomType  randomType = RandomType::Gaus)
inline

initialisation of the random ring

Parameters
[in]randomTypetype of the random generator

Definition at line 145 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 179 of file RandomRing.h.

◆ initialize() [3/3]

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

initialisation of the random ring

Parameters
[in]randomTypetype of the random generator

Definition at line 169 of file RandomRing.h.


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