LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#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... | |
size_t | Configure (fhicl::ParameterSet const &cfg, art::EngineCreator &ec) |
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 39 of file WeightManager.h.
evwgh::WeightManager::WeightManager | ( | const std::string | name = "WeightManager" | ) |
|
inline |
Default destructor.
Definition at line 47 of file WeightManager.h.
References Configure(), e, Name(), and Run().
size_t evwgh::WeightManager::Configure | ( | fhicl::ParameterSet const & | cfg, |
art::EngineCreator & | ec | ||
) |
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 21 of file WeightManager.cxx.
References _configured, evwgh::WeightCalcFactory::Create(), rndm::NuRandomService::createEngine(), evwgh::Weight_t::fNmultisims, evwgh::Weight_t::fWeightCalc, fWeightCalcMap, evwgh::Weight_t::fWeightCalcType, and fhicl::ParameterSet::get().
Referenced by evwgh::EventWeight::EventWeight(), and ~WeightManager().
|
inline |
Returns the map between calculator name and Weight_t product.
Definition at line 79 of file WeightManager.h.
References fWeightCalcMap.
Referenced by evwgh::EventWeight::endJob().
const std::string & evwgh::WeightManager::Name | ( | ) | const |
Name getter.
Definition at line 18 of file WeightManager.cxx.
References _name.
Referenced by ~WeightManager().
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 67 of file WeightManager.cxx.
References _configured, evwgh::MCEventWeight::fWeight, and fWeightCalcMap.
Referenced by evwgh::EventWeight::produce(), and ~WeightManager().
|
private |
Readiness flag.
Definition at line 92 of file WeightManager.h.
Referenced by Configure(), Reset(), Run(), and WeightManager().
|
private |
|
private |
A set of custom weight calculators.
Definition at line 90 of file WeightManager.h.
Referenced by Configure(), GetWeightCalcMap(), and Run().