29#ifndef ALICEO2_MATHUTILS_RANDOMRING_H_
30#define ALICEO2_MATHUTILS_RANDOMRING_H_
44template <
size_t N = 4 * 100000>
81 const float value = mRandomNumbers[mRingPosition];
83 if (mRingPosition >= mRandomNumbers.size()) {
94 template <
typename VcType>
101 const VcType
value = VcType(&mRandomNumbers[mRingPosition]);
102 mRingPosition += VcType::size();
103 if (mRingPosition >= mRandomNumbers.size()) {
119 std::array<float, N> mRandomNumbers;
120 size_t mRingPosition = 0;
127 : mRandomType(randomType),
148 for (
auto&
v : mRandomNumbers) {
150 switch (randomType) {
151 case RandomType::Gaus: {
152 v = gRandom->Gaus(0, 1);
155 case RandomType::Flat: {
171 mRandomType = RandomType::CustomTF1;
172 for (
auto&
v : mRandomNumbers) {
173 v = function.GetRandom();
181 mRandomType = RandomType::CustomLambda;
182 for (
auto&
v : mRandomNumbers) {
@ Gaus
Gaussian distribution.
@ CustomLambda
Initialized through external lambda.
@ CustomTF1
Custom TF1 function to be used.
void initialize(const RandomType randomType=RandomType::Gaus)
void initialize(std::function< float()> function)
RandomRing(const RandomType randomType=RandomType::Gaus)
RandomRing(TF1 &function)
unsigned int getRingPosition() const
void initialize(TF1 &function)
GLsizei const GLfloat * value
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...