LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
WeightManager.h
Go to the documentation of this file.
1 
10 #ifndef WEIGHTMANAGER_H
11 #define WEIGHTMANAGER_H
12 
27 #include "fhiclcpp/ParameterSet.h"
29 
30 #include "Weight_t.h"
31 #include "MCEventWeight.h"
32 #include "WeightCalc.h"
33 #include "WeightCalcFactory.h"
34 
35 namespace evwgh {
39  class WeightManager {
40 
41  public:
42 
44  WeightManager(const std::string name="WeightManager");
45 
48 
50  const std::string& Name() const;
51 
61  size_t Configure(fhicl::ParameterSet const & cfg, art::EngineCreator & ec);
62 
74  MCEventWeight Run(art::Event &e, const int inu);
75 
79  std::map<std::string, Weight_t*> GetWeightCalcMap() { return fWeightCalcMap; }
80 
82  void Reset()
83  { _configured = false; }
84 
85  void PrintConfig();
86 
87 
88  private:
89 
90  std::map<std::string, Weight_t*> fWeightCalcMap;
91 
92  bool _configured = false;
93 
94  std::string _name;
95 
96  };
97 }
98 
99 #endif
100 
size_t Configure(fhicl::ParameterSet const &cfg, art::EngineCreator &ec)
Configuration function.
std::string _name
Name.
Definition: WeightManager.h:94
void Reset()
Reset.
Definition: WeightManager.h:82
std::map< std::string, Weight_t * > GetWeightCalcMap()
Returns the map between calculator name and Weight_t product.
Definition: WeightManager.h:79
An art service to assist in the distribution of guaranteed unique seeds to all engines within an art ...
bool _configured
Readiness flag.
Definition: WeightManager.h:92
WeightManager(const std::string name="WeightManager")
Default constructor.
std::map< std::string, Weight_t * > fWeightCalcMap
A set of custom weight calculators.
Definition: WeightManager.h:90
~WeightManager()
Default destructor.
Definition: WeightManager.h:47
Float_t e
Definition: plot.C:34
MCEventWeight Run(art::Event &e, const int inu)
Core function (previous call to Configure is needed)
const std::string & Name() const
Name getter.
Tools and modules for checking out the basics of the Monte Carlo.