Test the SeedMaster object, core of NuRandomService. More...
#include <cstdlib>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include "cetlib/filepath_maker.h"
#include "fhiclcpp/ParameterSet.h"
#include "fhiclcpp/intermediate_table.h"
#include "fhiclcpp/make_ParameterSet.h"
#include "fhiclcpp/parse.h"
#include "fhiclcpp/exception.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "canvas/Utilities/Exception.h"
#include "nutools/RandomUtils/Providers/SeedMaster.h"
Go to the source code of this file.
Typedefs | |
using | seed_t = unsigned long |
using | SeedMaster_t = rndm::SeedMaster< seed_t > |
Functions | |
seed_t | ObtainSeed (SeedMaster_t &seeds, std::string module_name, std::string instance_name="") |
Returns the seed for the specified module/instance, or 0 on error. More... | |
fhicl::ParameterSet | GetConfiguration (const fhicl::ParameterSet &full_pset, std::string key) |
fhicl::ParameterSet | FindSeedServiceConfiguration (const fhicl::ParameterSet &full_pset, std::string key="services.NuRandomService") |
std::vector< fhicl::ParameterSet > | FindModulesConfiguration (const fhicl::ParameterSet &full_pset, const std::vector< std::string > &module_types, std::string base_key="physics.analyzers") |
std::string | GetModuleID (fhicl::ParameterSet const &pset) |
Returns a string "ModuleType[ModuleName]" out of specified module config. More... | |
void | StartMessageFacility (fhicl::ParameterSet const &pset) |
int | TestModule (SeedMaster_t &seeds, const fhicl::ParameterSet &pset) |
Tests a "module" with a given configuration. More... | |
int | main (int argc, const char **argv) |
Test the SeedMaster object, core of NuRandomService.
The test runs based on the configuration file specified on the command line.
Usage: SeedMaster_test ConfigFile [ParameterSetPath [ModuleType ...]]
In general, the configuration files good for SeedTest01 module should be good for this one as well (as long as ParameterSetPath is specified as services.NuRandomService).
The configuration is in FHiCL format; no search of the FHiCL file is performed: the path of the configuration file must be available from the current directory (or you can specify it as absolute path).
The optional parameter set path selects which part of the configuration file should be used to configure the SeedMaster. For a typical art configuration, it would be "services.NuRandomService". An empty path (default) uses the whole configuration directly.
For each specified ModuleType, all the art modules with that type are considered as having test module configuration (in a art-like configuration, "physics.analyzers" and "physics.producers").
Definition in file SeedMaster_test.cc.
using seed_t = unsigned long |
Definition at line 58 of file SeedMaster_test.cc.
using SeedMaster_t = rndm::SeedMaster<seed_t> |
Definition at line 59 of file SeedMaster_test.cc.
std::vector<fhicl::ParameterSet> FindModulesConfiguration | ( | const fhicl::ParameterSet & | full_pset, |
const std::vector< std::string > & | module_types, | ||
std::string | base_key = "physics.analyzers" |
||
) |
Definition at line 100 of file SeedMaster_test.cc.
|
inline |
Definition at line 92 of file SeedMaster_test.cc.
|
inline |
Definition at line 86 of file SeedMaster_test.cc.
|
inline |
Returns a string "ModuleType[ModuleName]" out of specified module config.
Definition at line 133 of file SeedMaster_test.cc.
int main | ( | int | argc, |
const char ** | argv | ||
) |
Definition at line 253 of file SeedMaster_test.cc.
seed_t ObtainSeed | ( | SeedMaster_t & | seeds, |
std::string | module_name, | ||
std::string | instance_name = "" |
||
) |
Returns the seed for the specified module/instance, or 0 on error.
Definition at line 63 of file SeedMaster_test.cc.
void StartMessageFacility | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 142 of file SeedMaster_test.cc.
int TestModule | ( | SeedMaster_t & | seeds, |
const fhicl::ParameterSet & | pset | ||
) |
Tests a "module" with a given configuration.
Definition at line 177 of file SeedMaster_test.cc.