File LandauDistribution.hpp

namespace ActsFatras
class LandauDistribution
#include <ActsFatras/Utilities/LandauDistribution.hpp>

Draw random numbers from a Landau distribution.

Implements the same interface as the standard library distributions.

Public Types

using result_type = double

The type of the generated values.

Public Functions

LandauDistribution() = default
LandauDistribution(const LandauDistribution&) = default
inline LandauDistribution(const param_type &cfg)

Construct from a parameter object.

inline LandauDistribution(double location, double scale)

Construct directly from the distribution parameters.

LandauDistribution(LandauDistribution&&) = default
inline result_type max() const

The maximum value the distribution generates.

inline result_type min() const

The minimum value the distribution generates.

template<typename Generator>
inline result_type operator()(Generator &generator)

Generate a random number from the configured Landau distribution.

template<typename Generator>
inline result_type operator()(Generator &generator, const param_type &params)

Generate a random number from the given Landau distribution.

LandauDistribution &operator=(const LandauDistribution&) = default
LandauDistribution &operator=(LandauDistribution&&) = default
inline param_type param() const

Return the currently configured distribution parameters.

inline void param(const param_type &cfg)

Set the distribution parameters.

inline void reset()

Reset any possible internal state. Noop, since there is no internal state.

Private Members

param_type m_cfg

Private Static Functions

static double quantile(double z)


inline friend bool operator!=(const LandauDistribution &lhs, const LandauDistribution &rhs)
inline friend bool operator==(const LandauDistribution &lhs, const LandauDistribution &rhs)

Provide standard comparison operators.

struct param_type
#include <ActsFatras/Utilities/LandauDistribution.hpp>

Parameter struct that contains all distribution parameters.

Public Types

using distribution_type = LandauDistribution

Parameters must link back to the host distribution.

Public Functions

param_type() = default
param_type(const param_type&) = default
inline param_type(double location_, double scale_)

Construct from parameters.

param_type(param_type&&) = default
param_type &operator=(const param_type&) = default
param_type &operator=(param_type&&) = default

Public Members

double location = 0.0

Location parameter.


This is neither the mean nor the most probable value.

double scale = 1.0

Scale parameter.


inline friend bool operator!=(const param_type &lhs, const param_type &rhs)
inline friend bool operator==(const param_type &lhs, const param_type &rhs)

Parameters should be EqualityComparable.