LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Implementation of the "preDefinedOffset" policy. More...
#include "BasePolicies.h"
Public Types | |
using | base_t = PerInstancePolicy< SEED > |
using | this_t = PredefinedOffsetPolicy< SEED > |
using | seed_t = typename base_t::seed_t |
using | base_t = PerInstancePolicy< SEED > |
using | this_t = PredefinedOffsetPolicy< 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 | |
PredefinedOffsetPolicy (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 configuration of this policy. More... | |
PredefinedOffsetPolicy (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 configuration of this policy. More... | |
virtual seed_t | getSeed (SeedMasterHelper::EngineId const &id) |
Returns the next random number. More... | |
virtual seed_t | getSeed (SeedMasterHelper::EngineId const &id) override |
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 | createSeed (SeedMasterHelper::EngineId const &id) override |
Returns the seed stored in the parameter set. More... | |
void | static_configure (fhicl::ParameterSet const &) |
virtual seed_t | createSeed (SeedMasterHelper::EngineId const &id) override |
Returns the seed stored in the parameter set. More... | |
void | static_configure (fhicl::ParameterSet const &) |
seed_t | getInstanceSeed (SeedMasterHelper::EngineId const &id) const |
Retrieves the parameter (seed) for the specified engine ID. More... | |
seed_t | getInstanceSeed (SeedMasterHelper::EngineId const &id) const |
Retrieves the parameter (seed) for the specified engine ID. More... | |
virtual void | ensureRange (SeedMasterHelper::EngineId const &id, seed_t seed) const |
Performs the range checks and complains if needed. More... | |
virtual void | ensureRange (SeedMasterHelper::EngineId const &id, seed_t seed) const |
Performs the range checks and complains if needed. More... | |
void | CheckRangeConfiguration () const |
Check that the configuration is complete. More... | |
void | CheckRangeConfiguration () const |
Check that the configuration is complete. More... | |
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... | |
Static Protected Member Functions | |
template<typename T > | |
static T | getInstanceParameter (fhicl::ParameterSet const &pset, SeedMasterHelper::EngineId const &id) |
Retrieves the parameter (seed) for the specified engine ID. More... | |
template<typename T > | |
static T | getInstanceParameter (fhicl::ParameterSet const &pset, SeedMasterHelper::EngineId const &id) |
Retrieves the parameter (seed) for the specified engine ID. More... | |
Protected Attributes | |
seed_t | base_seed |
fhicl::ParameterSet | parameters |
configuration parameters More... | |
RangeCheckHelper< seed_t > | range_check |
std::string | name |
name of the policy More... | |
Implementation of the "preDefinedOffset" policy.
This is heavily based on CheckedRangePolicy.
Definition at line 693 of file BasePolicies.h.
using rndm::details::PredefinedOffsetPolicy< SEED >::base_t = PerInstancePolicy<SEED> |
Definition at line 276 of file StandardPolicies.h.
using rndm::details::PredefinedOffsetPolicy< SEED >::base_t = PerInstancePolicy<SEED> |
Definition at line 695 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::PredefinedOffsetPolicy< SEED >::seed_t = typename base_t::seed_t |
Definition at line 278 of file StandardPolicies.h.
using rndm::details::PredefinedOffsetPolicy< SEED >::seed_t = typename base_t::seed_t |
Definition at line 697 of file BasePolicies.h.
using rndm::details::PredefinedOffsetPolicy< SEED >::this_t = PredefinedOffsetPolicy<SEED> |
Definition at line 277 of file StandardPolicies.h.
using rndm::details::PredefinedOffsetPolicy< SEED >::this_t = PredefinedOffsetPolicy<SEED> |
Definition at line 696 of file BasePolicies.h.
|
inline |
Configures from a parameter set
Definition at line 701 of file BasePolicies.h.
|
inline |
Configures from a parameter set
Definition at line 282 of file StandardPolicies.h.
References rndm::details::AutoIncrementPolicy< SEED >::configure().
|
protectedinherited |
Check that the configuration is complete.
Definition at line 323 of file BasePolicies.h.
References art::errors::Configuration, rndm::details::RandomSeedPolicyBase< SEED >::getName(), rndm::details::RangeCheckHelper< SEED >::isConfigured(), and rndm::details::RangeCheckHelper< SEED >::missingConfig().
Referenced by rndm::details::AutoIncrementPolicy< SEED >::createSeed(), rndm::details::LinearMappingPolicy< SEED >::createSeed(), rndm::details::PredefinedOffsetPolicy< SEED >::createSeed(), and rndm::details::CheckedRangePolicy< SEED >::ensureRange().
|
protectedinherited |
Check that the configuration is complete.
|
inlineoverridevirtual |
Configure this policy.
pset | the parameter set for the configuration |
Parameters:
The FHiCL grammar to specify the offsets takes two forms. If no instance name is given, the offset is given by:
moduleLabel : offset
When a module has multiple instances, the offsets are given by:
moduleLabel : { instanceName1 : offset1 instanceName2 : offset2 }
Reimplemented from rndm::details::PerInstancePolicy< SEED >.
Definition at line 311 of file StandardPolicies.h.
References rndm::details::CheckedRangePolicy< SEED >::configure(), rndm::details::AutoIncrementPolicy< SEED >::print(), rndm::details::CheckedRangePolicy< SEED >::range_check, rndm::details::RangeCheckHelper< SEED >::SetConfigLabels(), and rndm::details::AutoIncrementPolicy< SEED >::static_configure().
|
inlineoverridevirtual |
Configure this policy.
pset | the parameter set for the configuration |
Parameters:
The FHiCL grammar to specify the offsets takes two forms. If no instance name is given, the offset is given by:
moduleLabel : offset
When a module has multiple instances, the offsets are given by:
moduleLabel : { instanceName1 : offset1 instanceName2 : offset2 }
Reimplemented from rndm::details::PerInstancePolicy< SEED >.
Definition at line 730 of file BasePolicies.h.
References rndm::details::RandomSeedPolicyBase< SEED >::print().
|
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.
|
inlineoverrideprotectedvirtual |
Returns the seed stored in the parameter set.
Implements rndm::details::RandomSeedPolicyBase< SEED >.
Definition at line 326 of file StandardPolicies.h.
References rndm::details::CheckedRangePolicy< SEED >::CheckRangeConfiguration(), fhicl::ParameterSet::get(), rndm::details::CheckedRangePolicy< SEED >::print(), rndm::details::PredefinedOffsetPolicy< SEED >::print(), rndm::details::CheckedRangePolicy< SEED >::range_check, rndm::details::RangeCheckHelper< SEED >::SetBaseSeed(), rndm::details::AutoIncrementPolicy< SEED >::static_configure(), and rndm::details::PredefinedOffsetPolicy< SEED >::static_configure().
|
inlineoverrideprotectedvirtual |
Returns the seed stored in the parameter set.
Implements rndm::details::RandomSeedPolicyBase< SEED >.
Definition at line 745 of file BasePolicies.h.
References rndm::details::PredefinedOffsetPolicy< SEED >::static_configure().
|
inlineprotectedvirtualinherited |
Performs the range checks and complains if needed.
Definition at line 303 of file BasePolicies.h.
References rndm::details::RangeCheckHelper< SEED >::EnsureRange(), rndm::details::RandomSeedPolicyBase< SEED >::getName(), and rndm::details::CheckedRangePolicy< SEED >::static_configure().
|
inlineprotectedvirtualinherited |
Performs the range checks and complains if needed.
Definition at line 348 of file RandomSeedPolicyBase.h.
References rndm::details::CheckedRangePolicy< SEED >::CheckRangeConfiguration(), art::errors::Configuration, rndm::details::RangeCheckHelper< SEED >::configure(), rndm::details::RangeCheckHelper< SEED >::EnsureRange(), rndm::details::RangeCheckHelper< SEED >::isConfigured(), rndm::details::RangeCheckHelper< SEED >::missingConfig(), and rndm::details::CheckedRangePolicy< SEED >::static_configure().
|
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.
|
staticprotectedinherited |
Retrieves the parameter (seed) for the specified engine ID.
|
staticprotectedinherited |
Retrieves the parameter (seed) for the specified engine ID.
Definition at line 562 of file BasePolicies.h.
References art::errors::Configuration, fhicl::ParameterSet::get(), fhicl::ParameterSet::get_if_present(), fhicl::ParameterSet::get_names(), fhicl::ParameterSet::is_key_to_atom(), and fhicl::ParameterSet::is_key_to_table().
Referenced by rndm::details::PerInstancePolicy< SEED >::getInstanceSeed().
|
inlineprotectedinherited |
Retrieves the parameter (seed) for the specified engine ID.
Definition at line 414 of file RandomSeedPolicyBase.h.
References art::errors::Configuration, fhicl::ParameterSet::get(), fhicl::ParameterSet::get_if_present(), rndm::details::PerInstancePolicy< SEED >::getInstanceParameter(), fhicl::ParameterSet::has_key(), fhicl::ParameterSet::is_key_to_atom(), fhicl::ParameterSet::is_key_to_table(), and rndm::details::PerInstancePolicy< SEED >::static_configure().
|
inlineprotectedinherited |
Retrieves the parameter (seed) for the specified engine ID.
Definition at line 537 of file BasePolicies.h.
References rndm::details::PerInstancePolicy< SEED >::static_configure().
|
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 from rndm::details::RandomSeedPolicyBase< SEED >.
Definition at line 281 of file BasePolicies.h.
References rndm::details::RandomSeedPolicyBase< SEED >::createSeed(), and seed.
|
inlineoverridevirtualinherited |
Returns the next random number.
Reimplemented from rndm::details::RandomSeedPolicyBase< SEED >.
Definition at line 326 of file RandomSeedPolicyBase.h.
References rndm::details::ValidSeed< SEED >::seed.
|
overridevirtual |
Prints the configuration of this policy.
Reimplemented from rndm::details::CheckedRangePolicy< SEED >.
|
overridevirtual |
Prints the configuration of this policy.
Reimplemented from rndm::details::CheckedRangePolicy< SEED >.
Definition at line 764 of file BasePolicies.h.
Referenced by rndm::details::PredefinedOffsetPolicy< SEED >::createSeed().
|
protected |
|
protected |
Definition at line 755 of file BasePolicies.h.
References fhicl::ParameterSet::get().
Referenced by rndm::details::PredefinedOffsetPolicy< SEED >::createSeed().
|
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.
|
protected |
Definition at line 742 of file BasePolicies.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().
|
protectedinherited |
configuration parameters
Definition at line 531 of file BasePolicies.h.
|
protectedinherited |
Definition at line 296 of file BasePolicies.h.
Referenced by rndm::details::AutoIncrementPolicy< SEED >::configure(), rndm::details::LinearMappingPolicy< SEED >::configure(), rndm::details::PredefinedOffsetPolicy< SEED >::configure(), rndm::details::AutoIncrementPolicy< SEED >::createSeed(), rndm::details::LinearMappingPolicy< SEED >::createSeed(), rndm::details::PredefinedOffsetPolicy< SEED >::createSeed(), and rndm::details::PredefinedSeedPolicy< SEED >::static_configure().