|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
EventProcessor that assigns event weights. More...
#include <Weighter.hh>
Public Member Functions | |
| Weighter (const marley::JSON &config, marley::Generator &gen) | |
| std::vector< double > | compute_weights (HepMC3::GenEvent &event, marley::Generator &gen) const |
| std::vector< std::shared_ptr< WeightCalculator > > & | get_weight_calculators () |
| Provides non-const access to the owned vector of weight calculators. | |
| std::vector< std::string > | get_weight_names () const |
| Returns the names of the weights associated with all configured weight calculators. | |
| virtual void | process_event (HepMC3::GenEvent &event, marley::Generator &gen) override |
| Processes an input GenEvent object. | |
| void | set_use_cv_weight (bool use_it) |
| Toggles inclusion of the central-value weight. | |
Protected Member Functions | |
| std::shared_ptr< marley::WeightCalculator > | make_cv_weight_calc () |
| Helper function to create the weight calculator that handles the central-value weights during event generation. | |
Protected Attributes | |
| std::vector< std::shared_ptr< WeightCalculator > > | calc_vec_ |
| Owned vector of weight calculators used to actually compute weights. | |
Static Protected Attributes | |
| static const std::string | CV_WEIGHT_NAME = "CV" |
| Reserved name for the central-value weights (required for compliance with the NuHepMC standard) | |
EventProcessor that assigns event weights.
Definition at line 32 of file Weighter.hh.
| marley::Weighter::Weighter | ( | const marley::JSON & | config, |
| marley::Generator & | gen ) |
Definition at line 36 of file Weighter.cc.
| std::vector< double > marley::Weighter::compute_weights | ( | HepMC3::GenEvent & | event, |
| marley::Generator & | gen ) const |
Definition at line 141 of file Weighter.cc.
|
inline |
Provides non-const access to the owned vector of weight calculators.
Definition at line 57 of file Weighter.hh.
References calc_vec_.
Referenced by marley::CommandHandler::cmd_reweight().
| std::vector< std::string > marley::Weighter::get_weight_names | ( | ) | const |
Returns the names of the weights associated with all configured weight calculators.
Definition at line 153 of file Weighter.cc.
References calc_vec_.
Referenced by marley::CommandHandler::cmd_reweight().
|
protected |
Helper function to create the weight calculator that handles the central-value weights during event generation.
Definition at line 192 of file Weighter.cc.
References CV_WEIGHT_NAME.
Referenced by set_use_cv_weight().
|
overridevirtual |
Processes an input GenEvent object.
| [in,out] | ev | The GenEvent object to be processed |
| [in] | gen | If needed, the Generator object to use during processing (e.g., for obtaining random numbers) |
Implements marley::EventProcessor.
Definition at line 113 of file Weighter.cc.
References calc_vec_.
Referenced by marley::CommandHandler::cmd_reweight().
| void marley::Weighter::set_use_cv_weight | ( | bool | use_it | ) |
Toggles inclusion of the central-value weight.
Definition at line 163 of file Weighter.cc.
References calc_vec_, CV_WEIGHT_NAME, and make_cv_weight_calc().
Referenced by marley::CommandHandler::cmd_reweight().
|
protected |
Owned vector of weight calculators used to actually compute weights.
Definition at line 67 of file Weighter.hh.
Referenced by get_weight_calculators(), get_weight_names(), process_event(), and set_use_cv_weight().
|
staticprotected |
Reserved name for the central-value weights (required for compliance with the NuHepMC standard)
Definition at line 63 of file Weighter.hh.
Referenced by make_cv_weight_calc(), and set_use_cv_weight().