|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
WeightCalculator that varies nuclear matrix element strengths according to their experimental uncertainties. Three modes are available: "multisim" (dimidiated Gaussian random draws), "shift" (deterministic systematic shifts of all matrix elements), and "unisim" (deterministic systematic shifts of a single matrix element at a time). More...
#include <StrengthVariationWeightCalculator.hh>
Public Types | |
| enum class | VariationMode { multisim , shift , unisim } |
| Supported variation modes. More... | |
Public Member Functions | |
| virtual double | weight (HepMC3::GenEvent &event, marley::Generator &gen) const override |
| Compute the weight for the given event. | |
Public Member Functions inherited from marley::WeightCalculator | |
| WeightCalculator (const marley::JSON &config) | |
| WeightCalculator (const std::string &name) | |
| const std::string & | name () const |
Static Public Member Functions | |
| static std::vector< std::shared_ptr< StrengthVariationWeightCalculator > > | create_instances (const marley::JSON &config, marley::Generator &gen) |
| Static factory: validates JSON configuration and creates all variation instances. Called by the Weighter for each strength_variation entry in the weights config array. | |
Protected Member Functions | |
| void | ensure_initialized (marley::Generator &gen) const |
| Lazy initialization of per-instance varied strengths. | |
Protected Attributes | |
| const DiscreteNuclearReaction * | dnr_ = nullptr |
| Pointer to the matched DiscreteNuclearReaction. | |
| bool | initialized_ = false |
| Whether lazy initialization has been completed. | |
| size_t | me_idx_ = 0 |
| Index of the single matrix element to vary (unisim mode) | |
| VariationMode | mode_ |
| Variation mode for this instance. | |
| Reaction::ProcessType | process_type_ = Reaction::ProcessType::Unknown |
| Process type of the matched Reaction. | |
| std::string | resolved_reaction_file_ |
| Resolved path of the reaction input file of interest. | |
| std::shared_ptr< std::mt19937_64 > | rng_ |
| Shared RNG (seeded once, shared across N instances) | |
| double | sigma_factor_ = 0. |
| Signed sigma factor for systematic shifts (shift and unisim modes) | |
| int | target_pdg_ = 0 |
| Target nucleus PDG code for the matched Reaction. | |
| std::vector< double > | varied_ |
| Pre-generated varied strengths (one per matrix element in the matched Reaction) | |
Protected Attributes inherited from marley::WeightCalculator | |
| std::string | name_ |
| Name used to label the output event weight. | |
WeightCalculator that varies nuclear matrix element strengths according to their experimental uncertainties. Three modes are available: "multisim" (dimidiated Gaussian random draws), "shift" (deterministic systematic shifts of all matrix elements), and "unisim" (deterministic systematic shifts of a single matrix element at a time).
Definition at line 45 of file StrengthVariationWeightCalculator.hh.
|
strong |
Supported variation modes.
Definition at line 50 of file StrengthVariationWeightCalculator.hh.
|
static |
Static factory: validates JSON configuration and creates all variation instances. Called by the Weighter for each strength_variation entry in the weights config array.
| config | JSON configuration for this calculator |
| gen | Generator whose loaded reactions are used by the unisim mode to determine the number of matrix elements |
Definition at line 127 of file StrengthVariationWeightCalculator.cc.
References marley::Reaction::AntiNeutrinoCC_Discrete, marley::FileManager::find_file(), marley::Generator::get_reactions(), marley::FileManager::Instance(), marley::DiscreteNuclearReaction::matrix_elements(), marley::Reaction::NC_Discrete, and marley::Reaction::NeutrinoCC_Discrete.
|
protected |
Lazy initialization of per-instance varied strengths.
Definition at line 380 of file StrengthVariationWeightCalculator.cc.
References marley::Reaction::AntiNeutrinoCC_Discrete, dnr_, marley::Generator::get_reactions(), initialized_, me_idx_, mode_, marley::Reaction::NC_Discrete, marley::Reaction::NeutrinoCC_Discrete, process_type_, resolved_reaction_file_, rng_, sigma_factor_, target_pdg_, and varied_.
Referenced by weight().
|
overridevirtual |
Compute the weight for the given event.
Implements marley::WeightCalculator.
Definition at line 480 of file StrengthVariationWeightCalculator.cc.
References dnr_, ensure_initialized(), process_type_, target_pdg_, and varied_.
|
mutableprotected |
Pointer to the matched DiscreteNuclearReaction.
Definition at line 112 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized(), and weight().
|
mutableprotected |
Whether lazy initialization has been completed.
Definition at line 109 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized().
|
protected |
Index of the single matrix element to vary (unisim mode)
Definition at line 106 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized().
|
protected |
Variation mode for this instance.
Definition at line 99 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized().
|
mutableprotected |
Process type of the matched Reaction.
Definition at line 115 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized(), and weight().
|
protected |
Resolved path of the reaction input file of interest.
Definition at line 96 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized().
|
protected |
Shared RNG (seeded once, shared across N instances)
Definition at line 93 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized().
|
protected |
Signed sigma factor for systematic shifts (shift and unisim modes)
Definition at line 103 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized().
|
mutableprotected |
Target nucleus PDG code for the matched Reaction.
Definition at line 119 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized(), and weight().
|
mutableprotected |
Pre-generated varied strengths (one per matrix element in the matched Reaction)
Definition at line 123 of file StrengthVariationWeightCalculator.hh.
Referenced by ensure_initialized(), and weight().