allpix::RNGWrapper

This class is a wrapper that allows to pass the per-thread random number engine from Geant4 to CRY. The Geant4 engine is seeded by the Allpix Squared framework for every event, and separately per thread, so using this engine in CRY ensures a reproducible and thread-safe simulation. More…

#include <RNGWrapper.hpp>

Public Functions

Name
void set(T * object, double(T::*)() func)
Setter function for the static thread-local object.
double rng()
Wrapped call to the configured method of the stored object.

Detailed Description

template <class T >
class allpix::RNGWrapper;

This class is a wrapper that allows to pass the per-thread random number engine from Geant4 to CRY. The Geant4 engine is seeded by the Allpix Squared framework for every event, and separately per thread, so using this engine in CRY ensures a reproducible and thread-safe simulation.

Public Functions Documentation

function set

static void set(
    T * object,
    double(T::*)() func
)

Setter function for the static thread-local object.

Parameters:

  • object Pointer to the random number engine
  • func Pointer to the method to be called on the object to obtain a random number

function rng

static double rng()

Wrapped call to the configured method of the stored object.

Return: Pseudo-random number


Updated on 2024-12-13 at 08:31:36 +0000