Belle II Software development
TRandomWrapper Struct Reference

Wrap TRandom to be useable as a uniform random number generator with STL algorithms like std::shuffle. More...

#include <TRandomWrapper.h>

Public Types

typedef unsigned int result_type
 Define the result type to be a normal unsigned int.
 

Public Member Functions

result_type operator() ()
 Return a random value in the range [min(), max()].
 

Static Public Member Functions

static constexpr result_type min ()
 Minimum value returned by the random number generator.
 
static constexpr result_type max ()
 Maximum value returned by the random number generator.
 

Detailed Description

Wrap TRandom to be useable as a uniform random number generator with STL algorithms like std::shuffle.

Definition at line 20 of file TRandomWrapper.h.

Member Typedef Documentation

◆ result_type

typedef unsigned int result_type

Define the result type to be a normal unsigned int.

Definition at line 23 of file TRandomWrapper.h.

Member Function Documentation

◆ max()

static constexpr result_type max ( )
inlinestaticconstexpr

Maximum value returned by the random number generator.

Definition at line 29 of file TRandomWrapper.h.

29{ return std::numeric_limits<result_type>::max(); }

◆ min()

static constexpr result_type min ( )
inlinestaticconstexpr

Minimum value returned by the random number generator.

Definition at line 26 of file TRandomWrapper.h.

26{ return 0; }

◆ operator()()

result_type operator() ( )
inline

Return a random value in the range [min(), max()].

Definition at line 32 of file TRandomWrapper.h.

32{ return gRandom->Integer(max()); }
static constexpr result_type max()
Maximum value returned by the random number generator.

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