LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
rndm::details::RandomSeedPolicyBase< SEED > Class Template Referenceabstract

Interface for a policy implementation. More...

#include "BasePolicies.h"

Inheritance diagram for rndm::details::RandomSeedPolicyBase< SEED >:
rndm::details::CheckedRangePolicy< SEED > rndm::details::CheckedRangePolicy< SEED > rndm::details::PerEventPolicy< SEED > rndm::details::RandomPolicy< SEED > rndm::details::RandomPolicy< SEED > rndm::details::AutoIncrementPolicy< SEED > rndm::details::AutoIncrementPolicy< SEED > rndm::details::LinearMappingPolicy< SEED > rndm::details::LinearMappingPolicy< SEED > rndm::details::PerInstancePolicy< SEED > rndm::details::PerInstancePolicy< SEED > rndm::details::AutoIncrementPolicy< SEED > rndm::details::AutoIncrementPolicy< SEED > rndm::details::LinearMappingPolicy< SEED > rndm::details::LinearMappingPolicy< SEED > rndm::details::PerInstancePolicy< SEED > rndm::details::PerInstancePolicy< SEED >

Public Types

using seed_t = SEED
 type of the random seed More...
 
using EventData_t = NuRandomServiceHelper::EventSeedInputData
 type of data used for event seeds More...
 
using seed_t = SEED
 type of the random seed More...
 
using EventData_t = NuRandomServiceHelper::EventSeedInputData
 type of data used for event seeds More...
 

Public Member Functions

 RandomSeedPolicyBase (std::string policy_name)
 Constructor; requires the policy name. More...
 
virtual ~RandomSeedPolicyBase ()
 
virtual void configure (fhicl::ParameterSet const &)
 Configure this policy. 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...
 
std::string getName () const
 Returns the given name of the policy. More...
 
virtual void print (std::ostream &out) const
 Prints information on the configuration of this policy. More...
 
virtual bool yieldsUniqueSeeds () const override
 Returns whether the returned seed should be unique. More...
 
 RandomSeedPolicyBase (std::string policy_name)
 Constructor; requires the policy name. More...
 
virtual ~RandomSeedPolicyBase ()
 
virtual void configure (fhicl::ParameterSet const &)
 Configure this policy. 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...
 
std::string getName () const
 Returns the given name of the policy. More...
 
virtual void print (std::ostream &out) const
 Prints information on the configuration of this policy. 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 createSeed (SeedMasterHelper::EngineId const &)=0
 Extracts the next random number seed. More...
 
virtual seed_t createEventSeed (SeedMasterHelper::EngineId const &, EventData_t const &)
 Extracts a seed for specified event information; returns InvalidSeed. More...
 
virtual seed_t createSeed (SeedMasterHelper::EngineId const &)=0
 Extracts the next random number seed. 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...
 

Detailed Description

template<typename SEED>
class rndm::details::RandomSeedPolicyBase< SEED >

Interface for a policy implementation.

Definition at line 43 of file BasePolicies.h.

Member Typedef Documentation

type of data used for event seeds

Definition at line 48 of file BasePolicies.h.

type of data used for event seeds

Definition at line 93 of file RandomSeedPolicyBase.h.

template<typename SEED>
using rndm::details::RandomSeedPolicyBase< SEED >::seed_t = SEED

type of the random seed

Definition at line 45 of file BasePolicies.h.

template<typename SEED>
using rndm::details::RandomSeedPolicyBase< SEED >::seed_t = SEED

type of the random seed

Definition at line 90 of file RandomSeedPolicyBase.h.

Constructor & Destructor Documentation

template<typename SEED>
rndm::details::RandomSeedPolicyBase< SEED >::RandomSeedPolicyBase ( std::string  policy_name)
inline

Constructor; requires the policy name.

Definition at line 54 of file BasePolicies.h.

54  :
55  name(policy_name) {}
std::string name
name of the policy
Definition: BasePolicies.h:83
template<typename SEED>
virtual rndm::details::RandomSeedPolicyBase< SEED >::~RandomSeedPolicyBase ( )
inlinevirtual

Definition at line 58 of file BasePolicies.h.

58 {}
template<typename SEED>
rndm::details::RandomSeedPolicyBase< SEED >::RandomSeedPolicyBase ( std::string  policy_name)
inline

Constructor; requires the policy name.

Definition at line 99 of file RandomSeedPolicyBase.h.

99  :
100  name(policy_name) {}
std::string name
name of the policy
Definition: BasePolicies.h:83
template<typename SEED>
virtual rndm::details::RandomSeedPolicyBase< SEED >::~RandomSeedPolicyBase ( )
inlinevirtual

Definition at line 103 of file RandomSeedPolicyBase.h.

103 {}

Member Function Documentation

template<typename SEED>
virtual seed_t rndm::details::RandomSeedPolicyBase< SEED >::createEventSeed ( SeedMasterHelper::EngineId const &  ,
EventData_t const &   
)
inlineprotectedvirtual

Extracts a seed for specified event information; returns InvalidSeed.

Reimplemented in rndm::details::PerEventPolicy< SEED >.

Definition at line 90 of file BasePolicies.h.

References rndm::details::RandomSeedPolicyBase< SEED >::InvalidSeed.

Referenced by rndm::details::RandomSeedPolicyBase< SEED >::getEventSeed().

91  { return InvalidSeed; }
static constexpr seed_t InvalidSeed
An invalid seed.
Definition: BasePolicies.h:51
template<typename SEED>
virtual seed_t rndm::details::RandomSeedPolicyBase< SEED >::createEventSeed ( SeedMasterHelper::EngineId const &  ,
EventData_t const &   
)
inlineprotectedvirtual

Extracts a seed for specified event information; returns InvalidSeed.

Reimplemented in rndm::details::PerEventPolicy< SEED >.

Definition at line 135 of file RandomSeedPolicyBase.h.

136  { return InvalidSeed; }
static constexpr seed_t InvalidSeed
An invalid seed.
Definition: BasePolicies.h:51
template<typename SEED>
virtual seed_t rndm::details::RandomSeedPolicyBase< SEED >::getEventSeed ( SeedMasterHelper::EngineId const &  id,
EventData_t const &  eventInfo 
)
inlinevirtual

Returns a random number specific to an event.

Definition at line 69 of file BasePolicies.h.

References rndm::details::RandomSeedPolicyBase< SEED >::createEventSeed().

Referenced by rndm::details::RandomSeedPolicyBase< SEED >::getSeed().

70  { return createEventSeed(id, eventInfo); }
virtual seed_t createEventSeed(SeedMasterHelper::EngineId const &, EventData_t const &)
Extracts a seed for specified event information; returns InvalidSeed.
Definition: BasePolicies.h:90
template<typename SEED>
virtual seed_t rndm::details::RandomSeedPolicyBase< SEED >::getEventSeed ( SeedMasterHelper::EngineId const &  id,
EventData_t const &  eventInfo 
)
inlinevirtual

Returns a random number specific to an event.

Definition at line 114 of file RandomSeedPolicyBase.h.

115  { return createEventSeed(id, eventInfo); }
virtual seed_t createEventSeed(SeedMasterHelper::EngineId const &, EventData_t const &)
Extracts a seed for specified event information; returns InvalidSeed.
Definition: BasePolicies.h:90
template<typename SEED>
std::string rndm::details::RandomSeedPolicyBase< SEED >::getName ( ) const
inline
template<typename SEED>
std::string rndm::details::RandomSeedPolicyBase< SEED >::getName ( ) const
inline

Returns the given name of the policy.

Definition at line 118 of file RandomSeedPolicyBase.h.

118 { return name; }
std::string name
name of the policy
Definition: BasePolicies.h:83
template<typename SEED>
virtual seed_t rndm::details::RandomSeedPolicyBase< SEED >::getSeed ( SeedMasterHelper::EngineId const &  id)
inlinevirtual

Returns the next random number.

Reimplemented in rndm::details::CheckedRangePolicy< SEED >, and rndm::details::CheckedRangePolicy< SEED >.

Definition at line 64 of file BasePolicies.h.

References rndm::details::RandomSeedPolicyBase< SEED >::createSeed(), and rndm::details::RandomSeedPolicyBase< SEED >::getEventSeed().

65  { return createSeed(id); }
virtual seed_t createSeed(SeedMasterHelper::EngineId const &)=0
Extracts the next random number seed.
template<typename SEED>
virtual seed_t rndm::details::RandomSeedPolicyBase< SEED >::getSeed ( SeedMasterHelper::EngineId const &  id)
inlinevirtual

Returns the next random number.

Reimplemented in rndm::details::CheckedRangePolicy< SEED >, and rndm::details::CheckedRangePolicy< SEED >.

Definition at line 109 of file RandomSeedPolicyBase.h.

110  { return createSeed(id); }
virtual seed_t createSeed(SeedMasterHelper::EngineId const &)=0
Extracts the next random number seed.
template<typename SEED>
virtual void rndm::details::RandomSeedPolicyBase< SEED >::print ( std::ostream &  out) const
inlinevirtual
template<typename SEED>
virtual bool rndm::details::RandomSeedPolicyBase< SEED >::yieldsUniqueSeeds ( ) const
inlineoverridevirtual

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.

80 { return true; }
template<typename SEED>
virtual bool rndm::details::RandomSeedPolicyBase< SEED >::yieldsUniqueSeeds ( ) const
inlinevirtual

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.

125 { return true; }

Member Data Documentation

template<typename SEED>
std::string rndm::details::RandomSeedPolicyBase< SEED >::name
protected

name of the policy

Definition at line 83 of file BasePolicies.h.

Referenced by rndm::details::RandomSeedPolicyBase< SEED >::getName().


The documentation for this class was generated from the following files: