LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "WeightManager.h"
Public Member Functions | |
WeightManager (const std::string name="WeightManager") | |
const std::string & | Name () const |
Name getter. More... | |
template<typename EngineCreator > | |
size_t | Configure (fhicl::ParameterSet const &cfg, EngineCreator engineCreator) |
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" | ) |
size_t evwgh::WeightManager::Configure | ( | fhicl::ParameterSet const & | cfg, |
EngineCreator | engineCreator | ||
) |
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 77 of file WeightManager.h.
References _configured, evwgh::WeightCalcFactory::Create(), evwgh::Weight_t::fNmultisims, evwgh::Weight_t::fWeightCalc, fWeightCalcMap, evwgh::Weight_t::fWeightCalcType, fhicl::ParameterSet::get(), and rndm::NuRandomService::registerAndSeedEngine().
Referenced by evwgh::EventWeight::EventWeight().
|
inline |
Returns the map between calculator name and Weight_t product.
Definition at line 63 of file WeightManager.h.
References fWeightCalcMap.
Referenced by evwgh::EventWeight::endJob().
const std::string & evwgh::WeightManager::Name | ( | ) | const |
void evwgh::WeightManager::PrintConfig | ( | ) |
|
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 18 of file WeightManager.cxx.
References _configured, util::empty(), evwgh::MCEventWeight::fWeight, and fWeightCalcMap.
Referenced by evwgh::EventWeight::produce().
|
private |
Readiness flag.
Definition at line 72 of file WeightManager.h.
Referenced by Configure(), Reset(), Run(), and WeightManager().
|
private |
|
private |
A set of custom weight calculators.
Definition at line 71 of file WeightManager.h.
Referenced by Configure(), GetWeightCalcMap(), and Run().