All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbncode/sbncode/SBNEventWeight/Base/WeightManager.cxx
Go to the documentation of this file.
1 #include <string>
2 #include <vector>
4 #include "WeightManager.h"
5 
6 namespace sbn {
7  namespace evwgh {
8 
9 EventWeightMap WeightManager::Run(art::Event& e, const int inu) {
10  EventWeightMap mcwgh;
11 
12  for (auto it=fWeightCalcMap.begin(); it!=fWeightCalcMap.end(); ++it) {
13  const std::vector<float>& weights = it->second->GetWeight(e, inu);
14  std::string wname = it->first + "_" + it->second->GetType();
15  mcwgh.insert({ wname, weights });
16  }
17 
18  return mcwgh;
19 }
20 
21  } // namespace evwgh
22 } // namespace sbn
23 
std::map< std::string, std::vector< float > > EventWeightMap
Container for event-level weights.
std::map< std::string, WeightCalc * > fWeightCalcMap
A set of custom weight calculators.
do i e
EventWeightMap Run(art::Event &e, const int inu)