#include <WeightManager.h>
Public Member Functions | |
WeightManager (const std::string name="WeightManager") | |
Default constructor. More... | |
~WeightManager () | |
Default destructor. More... | |
const std::string & | Name () const |
Name getter. More... | |
template<typename Module > | |
size_t | Configure (fhicl::ParameterSet const &cfg, Module &module) |
Configuration function. More... | |
MCEventWeight | Run (art::Event &e, const int inu) |
Core function (previous call to Configure is needed) More... | |
std::map< std::string, Weight_t * > | GetWeightCalcMap () |
Returns the map between calculator name and Weight_t product. More... | |
void | Reset () |
Reset. More... | |
void | PrintConfig () |
Private Attributes | |
std::map< std::string, Weight_t * > | fWeightCalcMap |
A set of custom weight calculators. More... | |
bool | _configured {false} |
Readiness flag. More... | |
std::string | _name |
Name. More... | |
Definition at line 28 of file WeightManager.h.
evwgh::WeightManager::WeightManager | ( | const std::string | name = "WeightManager" | ) |
|
inline |
size_t evwgh::WeightManager::Configure | ( | fhicl::ParameterSet const & | cfg, |
Module & | module | ||
) |
Configuration function.
cfg | the input parameters for settings |
the | enging creator for the random seed (usually passed with *this) CONFIGURE FUNCTION: created the weights algorithms in the following way: 0) Looks at the weight_functions fcl parameter to get the name of the calculators 1) Creates the Calculators requested in step 0, and assigne a different random seed to each one 3) The future call WeightManager::Run will run the calculators |
Definition at line 85 of file WeightManager.h.
|
inline |
Returns the map between calculator name and Weight_t product.
Definition at line 69 of file WeightManager.h.
const std::string & evwgh::WeightManager::Name | ( | void | ) | const |
void evwgh::WeightManager::PrintConfig | ( | void | ) |
Definition at line 51 of file WeightManager.cxx.
|
inline |
MCEventWeight evwgh::WeightManager::Run | ( | art::Event & | e, |
const int | inu | ||
) |
Core function (previous call to Configure is needed)
e | the art event |
inu | the index of the simulated neutrino in the event CORE FUNCTION: executes algorithms to assign a weight to the event as requested users. WeightManager::Configure needs to be called first The execution takes following steps: 0) Loos over all the previously emplaced calculators 1) For each of them calculates the weights (more weight can be requested per calculator) 3) Returns a map from "calculator name" to vector of weights calculated which is available inside MCEventWeight |
Definition at line 19 of file WeightManager.cxx.
|
private |
Readiness flag.
Definition at line 80 of file WeightManager.h.
|
private |
Name.
Definition at line 81 of file WeightManager.h.
|
private |
A set of custom weight calculators.
Definition at line 79 of file WeightManager.h.