66 std::string genie_tune_name = p.get<std::string>(
"TuneName",
"${GENIE_XSEC_TUNE}");
71 std::string evgen_list_name = p.get<std::string>(
"EventGeneratorList",
"");
77 p, [
this](std::string
const&
type, std::string
const&
instance) -> CLHEP::HepRandomEngine& {
80 if (n_func > 0) produces<std::vector<MCEventWeight>>();
86 auto mcwghvec = std::make_unique<std::vector<MCEventWeight>>();
90 std::vector<art::Ptr<simb::MCTruth>> mclist;
97 for (
unsigned int inu = 0; inu < mclist.size(); ++inu) {
99 mcwghvec->push_back(mcwgh);
102 e.
put(std::move(mcwghvec));
110 std::stringstream job_summary;
111 job_summary << std::setprecision(2);
112 for (
int i = 1; i <= 110; i++)
114 job_summary << std::endl;
115 job_summary << std::setw(20) <<
"WeightCalc" << std::setw(15) <<
"Type" << std::setw(15)
116 <<
"#RW neutrinos" << std::setw(15) <<
"#Multisims" << std::setw(15) <<
"Min" 117 << std::setw(15) <<
"Max" << std::setw(15) <<
"Avg" << std::endl;
118 for (
int i = 1; i <= 110; i++)
120 job_summary << std::endl;
121 for (
auto it = weightCalcMap.begin(); it != weightCalcMap.end(); it++) {
122 job_summary << std::setw(20) << it->first << std::setw(15) << (it->second->fWeightCalcType)
123 << std::setw(15) << (it->second->fNcalls) << std::setw(15)
124 << (it->second->fNmultisims) << std::setw(15) << (it->second->fMinWeight)
125 << std::setw(15) << (it->second->fMaxWeight) << std::setw(15)
126 << (it->second->fAvgWeight) << std::endl;
128 for (
int i = 1; i <= 110; i++)
130 job_summary << std::endl;
void produce(art::Event &e) override
base_engine_t & createEngine(seed_t seed)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
EDProducer(fhicl::ParameterSet const &pset)
std::string fGenieModuleLabel
Allows to interface to EventWeight calculators.
const std::string instance
EventWeight & operator=(EventWeight const &)=delete
Functions for transforming GENIE objects into ART objects (and back)
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
#define DEFINE_ART_MODULE(klass)
std::map< std::string, Weight_t * > GetWeightCalcMap()
Returns the map between calculator name and Weight_t product.
WeightManager _wgt_manager
EventWeight(fhicl::ParameterSet const &p)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
void SetEventGeneratorListAndTune(const std::string &evtlistname="", const std::string &tunename="${GENIE_XSEC_TUNE}")
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
MCEventWeight Run(art::Event &e, const int inu)
Core function (previous call to Configure is needed)
size_t Configure(fhicl::ParameterSet const &cfg, EngineCreator engineCreator)
Configuration function.