LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Implementation of the "random" policy. More...
#include "BasePolicies.h"
Classes | |
class | RandomImpl |
Public Types | |
using | base_t = RandomSeedPolicyBase< SEED > |
using | this_t = RandomPolicy< SEED > |
using | seed_t = typename base_t::seed_t |
using | base_t = RandomSeedPolicyBase< SEED > |
using | this_t = RandomPolicy< SEED > |
using | seed_t = typename base_t::seed_t |
using | EventData_t = NuRandomServiceHelper::EventSeedInputData |
type of data used for event seeds More... | |
using | EventData_t = NuRandomServiceHelper::EventSeedInputData |
type of data used for event seeds More... | |
Public Member Functions | |
RandomPolicy (fhicl::ParameterSet const &pset) | |
virtual void | configure (fhicl::ParameterSet const &pset) override |
Configure this policy. More... | |
virtual void | print (std::ostream &out) const override |
Prints the details of the configuration of the random generator. More... | |
RandomPolicy (fhicl::ParameterSet const &pset) | |
virtual void | configure (fhicl::ParameterSet const &pset) override |
Configure this policy. More... | |
virtual void | print (std::ostream &out) const override |
Prints the details of the configuration of the random generator. More... | |
virtual seed_t | getSeed (SeedMasterHelper::EngineId const &id) |
Returns the next random number. More... | |
virtual seed_t | getSeed (SeedMasterHelper::EngineId const &id) |
Returns the next random number. More... | |
virtual seed_t | getEventSeed (SeedMasterHelper::EngineId const &id, EventData_t const &eventInfo) |
Returns a random number specific to an event. More... | |
virtual seed_t | getEventSeed (SeedMasterHelper::EngineId const &id, EventData_t const &eventInfo) |
Returns a random number specific to an event. More... | |
std::string | getName () const |
Returns the given name of the policy. More... | |
std::string | getName () const |
Returns the given name of the policy. More... | |
virtual bool | yieldsUniqueSeeds () const override |
Returns whether the returned seed should be unique. More... | |
virtual bool | yieldsUniqueSeeds () const |
Returns whether the returned seed should be unique. More... | |
Static Public Attributes | |
static constexpr seed_t | InvalidSeed = 0 |
An invalid seed. More... | |
Protected Member Functions | |
virtual seed_t | createEventSeed (SeedMasterHelper::EngineId const &, EventData_t const &) |
Extracts a seed for specified event information; returns InvalidSeed. More... | |
virtual seed_t | createEventSeed (SeedMasterHelper::EngineId const &, EventData_t const &) |
Extracts a seed for specified event information; returns InvalidSeed. More... | |
Protected Attributes | |
std::string | name |
name of the policy More... | |
Private Member Functions | |
virtual seed_t | createSeed (SeedMasterHelper::EngineId const &) override |
Extracts a random seed. More... | |
virtual seed_t | createSeed (SeedMasterHelper::EngineId const &) override |
Extracts a random seed. More... | |
Private Attributes | |
std::unique_ptr< RandomImpl > | random_seed |
Implementation of the "random" policy.
This policy extracts seeds randomly. Each seed is between 1 and the maximum seed value specified at construction, both extremes included. The sequence of these seeds is initialized by a random seed. The random generator used is potentially low quality – it does not matter for this application.
Definition at line 781 of file BasePolicies.h.
using rndm::details::RandomPolicy< SEED >::base_t = RandomSeedPolicyBase<SEED> |
Definition at line 45 of file RandomPolicy.h.
using rndm::details::RandomPolicy< SEED >::base_t = RandomSeedPolicyBase<SEED> |
Definition at line 783 of file BasePolicies.h.
|
inherited |
type of data used for event seeds
Definition at line 48 of file BasePolicies.h.
|
inherited |
type of data used for event seeds
Definition at line 93 of file RandomSeedPolicyBase.h.
using rndm::details::RandomPolicy< SEED >::seed_t = typename base_t::seed_t |
Definition at line 47 of file RandomPolicy.h.
using rndm::details::RandomPolicy< SEED >::seed_t = typename base_t::seed_t |
Definition at line 785 of file BasePolicies.h.
using rndm::details::RandomPolicy< SEED >::this_t = RandomPolicy<SEED> |
Definition at line 46 of file RandomPolicy.h.
using rndm::details::RandomPolicy< SEED >::this_t = RandomPolicy<SEED> |
Definition at line 784 of file BasePolicies.h.
|
inline |
Configures from a parameter set
Definition at line 789 of file BasePolicies.h.
References rndm::details::RandomSeedPolicyBase< SEED >::configure(), and rndm::details::RandomSeedPolicyBase< SEED >::print().
|
inline |
Configures from a parameter set
Definition at line 51 of file RandomPolicy.h.
References rndm::details::RandomPolicy< SEED >::configure(), and rndm::details::RandomPolicy< SEED >::print().
|
overridevirtual |
Configure this policy.
pset | the parameter set for the configuration |
Parameters:
Reimplemented from rndm::details::RandomSeedPolicyBase< SEED >.
|
overridevirtual |
Configure this policy.
pset | the parameter set for the configuration |
Parameters:
Reimplemented from rndm::details::RandomSeedPolicyBase< SEED >.
Definition at line 836 of file BasePolicies.h.
References fhicl::ParameterSet::get_if_present().
Referenced by rndm::details::RandomPolicy< SEED >::createSeed(), and rndm::details::RandomPolicy< SEED >::RandomPolicy().
|
inlineprotectedvirtualinherited |
Extracts a seed for specified event information; returns InvalidSeed.
Reimplemented in rndm::details::PerEventPolicy< SEED >.
Definition at line 90 of file BasePolicies.h.
Referenced by rndm::details::RandomSeedPolicyBase< seed_t >::getEventSeed().
|
inlineprotectedvirtualinherited |
Extracts a seed for specified event information; returns InvalidSeed.
Reimplemented in rndm::details::PerEventPolicy< SEED >.
Definition at line 135 of file RandomSeedPolicyBase.h.
|
inlineoverrideprivatevirtual |
Extracts a random seed.
Implements rndm::details::RandomSeedPolicyBase< SEED >.
Definition at line 91 of file RandomPolicy.h.
References rndm::details::RandomPolicy< SEED >::configure(), fhicl::ParameterSet::get_if_present(), rndm::details::RandomPolicy< SEED >::RandomImpl::master_seed(), rndm::details::RandomSeedPolicyBase< SEED >::print(), rndm::details::RandomPolicy< SEED >::print(), rndm::details::RandomPolicy< SEED >::random_seed, and rndm::details::RandomPolicy< SEED >::RandomImpl::RandomImpl().
|
inlineoverrideprivatevirtual |
Extracts a random seed.
Implements rndm::details::RandomSeedPolicyBase< SEED >.
Definition at line 829 of file BasePolicies.h.
|
inlinevirtualinherited |
Returns a random number specific to an event.
Definition at line 69 of file BasePolicies.h.
Referenced by rndm::details::RandomSeedPolicyBase< seed_t >::getSeed().
|
inlinevirtualinherited |
Returns a random number specific to an event.
Definition at line 114 of file RandomSeedPolicyBase.h.
|
inlineinherited |
Returns the given name of the policy.
Definition at line 73 of file BasePolicies.h.
Referenced by rndm::details::CheckedRangePolicy< SEED >::CheckRangeConfiguration(), rndm::details::CheckedRangePolicy< SEED >::ensureRange(), and rndm::details::RandomSeedPolicyBase< seed_t >::print().
|
inlineinherited |
Returns the given name of the policy.
Definition at line 118 of file RandomSeedPolicyBase.h.
|
inlinevirtualinherited |
Returns the next random number.
Reimplemented in rndm::details::CheckedRangePolicy< SEED >, and rndm::details::CheckedRangePolicy< SEED >.
Definition at line 64 of file BasePolicies.h.
Referenced by rndm::details::PerEventPolicy< SEED >::createSeed().
|
inlinevirtualinherited |
Returns the next random number.
Reimplemented in rndm::details::CheckedRangePolicy< SEED >, and rndm::details::CheckedRangePolicy< SEED >.
Definition at line 109 of file RandomSeedPolicyBase.h.
|
overridevirtual |
Prints the details of the configuration of the random generator.
Reimplemented from rndm::details::RandomSeedPolicyBase< SEED >.
|
overridevirtual |
Prints the details of the configuration of the random generator.
Reimplemented from rndm::details::RandomSeedPolicyBase< SEED >.
Definition at line 852 of file BasePolicies.h.
Referenced by rndm::details::RandomPolicy< SEED >::createSeed(), and rndm::details::RandomPolicy< SEED >::RandomPolicy().
|
inlineoverridevirtualinherited |
Returns whether the returned seed should be unique.
Reimplemented in rndm::details::PredefinedSeedPolicy< SEED >, rndm::details::PredefinedSeedPolicy< SEED >, and rndm::details::PerEventPolicy< SEED >.
Definition at line 80 of file BasePolicies.h.
|
inlinevirtualinherited |
Returns whether the returned seed should be unique.
Reimplemented in rndm::details::PredefinedSeedPolicy< SEED >, rndm::details::PredefinedSeedPolicy< SEED >, and rndm::details::PerEventPolicy< SEED >.
Definition at line 125 of file RandomSeedPolicyBase.h.
|
staticinherited |
An invalid seed.
Definition at line 51 of file BasePolicies.h.
Referenced by rndm::details::RandomSeedPolicyBase< seed_t >::createEventSeed(), rndm::details::PerEventPolicy< SEED >::createEventSeed(), and rndm::details::PerEventPolicy< SEED >::createSeed().
|
protectedinherited |
name of the policy
Definition at line 83 of file BasePolicies.h.
Referenced by rndm::details::RandomSeedPolicyBase< seed_t >::getName().
|
private |
Definition at line 826 of file BasePolicies.h.
Referenced by rndm::details::RandomPolicy< SEED >::createSeed(), and rndm::details::RandomPolicy< SEED >::RandomImpl::operator()().