15 #include "TLorentzVector.h" 20 #include "Conventions/Units.h" 21 #include "EVGCore/EventRecord.h" 22 #include "GHEP/GHepUtils.h" 23 #include "Messenger/Messenger.h" 25 #include "ReWeight/GReWeightI.h" 26 #include "ReWeight/GSystSet.h" 27 #include "ReWeight/GSyst.h" 28 #include "ReWeight/GReWeight.h" 29 #include "ReWeight/GReWeightNuXSecNCEL.h" 30 #include "ReWeight/GReWeightNuXSecCCQE.h" 31 #include "ReWeight/GReWeightNuXSecCCRES.h" 32 #include "ReWeight/GReWeightNuXSecCOH.h" 33 #include "ReWeight/GReWeightNonResonanceBkg.h" 34 #include "ReWeight/GReWeightFGM.h" 35 #include "ReWeight/GReWeightDISNuclMod.h" 36 #include "ReWeight/GReWeightResonanceDecay.h" 37 #include "ReWeight/GReWeightFZone.h" 38 #include "ReWeight/GReWeightINuke.h" 39 #include "ReWeight/GReWeightAGKY.h" 40 #include "ReWeight/GReWeightNuXSecCCQEvec.h" 41 #include "ReWeight/GReWeightNuXSecNCRES.h" 42 #include "ReWeight/GReWeightNuXSecDIS.h" 43 #include "ReWeight/GReWeightNuXSecNC.h" 44 #include "ReWeight/GSystUncertainty.h" 45 #include "ReWeight/GReWeightUtils.h" 50 #include "Utils/StringUtils.h" 51 #include "Utils/XmlParserUtils.h" 52 #include "Interaction/InitialState.h" 53 #include "Interaction/Interaction.h" 54 #include "Interaction/Kinematics.h" 55 #include "Interaction/KPhaseSpace.h" 56 #include "Interaction/ProcessInfo.h" 57 #include "Interaction/XclsTag.h" 58 #include "GHEP/GHepParticle.h" 59 #include "PDG/PDGCodeList.h" 60 #include "Conventions/Constants.h" 64 #include "GENIE/Framework/Messenger/Messenger.h" 65 #include "GENIE/Framework/Conventions/Units.h" 66 #include "GENIE/Framework/Conventions/Constants.h" 67 #include "GENIE/Framework/GHEP/GHepUtils.h" 68 #include "GENIE/Framework/EventGen/EventRecord.h" 83 #include "RwFramework/GReWeightI.h" 84 #include "RwFramework/GSystSet.h" 85 #include "RwFramework/GSyst.h" 86 #include "RwFramework/GReWeight.h" 87 #include "RwFramework/GSystUncertainty.h" 88 #include "RwCalculators/GReWeightNuXSecNCEL.h" 89 #include "RwCalculators/GReWeightNuXSecCCQE.h" 90 #include "RwCalculators/GReWeightNuXSecCCRES.h" 91 #include "RwCalculators/GReWeightNuXSecCOH.h" 92 #include "RwCalculators/GReWeightNonResonanceBkg.h" 93 #include "RwCalculators/GReWeightFGM.h" 94 #include "RwCalculators/GReWeightDISNuclMod.h" 95 #include "RwCalculators/GReWeightResonanceDecay.h" 96 #include "RwCalculators/GReWeightFZone.h" 97 #include "RwCalculators/GReWeightINuke.h" 98 #include "RwCalculators/GReWeightAGKY.h" 99 #include "RwCalculators/GReWeightNuXSecCCQEvec.h" 100 #include "RwCalculators/GReWeightNuXSecNCRES.h" 101 #include "RwCalculators/GReWeightNuXSecDIS.h" 102 #include "RwCalculators/GReWeightNuXSecNC.h" 103 #include "RwCalculators/GReWeightUtils.h" 113 using genie::Messenger;
131 fReweightNCEL(false),
132 fReweightQEMA(false),
133 fReweightQEVec(false),
134 fReweightCCRes(false),
135 fReweightNCRes(false),
136 fReweightResBkg(false),
137 fReweightResDecay(false),
141 fReweightAGKY(false),
142 fReweightDISNucMod(false),
144 fReweightFZone(false),
145 fReweightINuke(false),
146 fReweightZexp(false),
149 fMaCCResShape(false),
150 fMaNCResShape(false),
154 LOG_INFO(
"GENIEReweight") <<
"Create GENIEReweight object";
156 fWcalc =
new genie::rew::GReWeight();
293 double nominal_value;
295 return nominal_value;
300 int label = (int)rLabel;
301 bool in_loop =
false;
302 bool found_par =
false;
303 double parameter = -10000;
312 if(found_par)
return parameter;
314 LOG_WARN(
"GENIEReweight") <<
"Parameter " << label <<
" not set yet or does not exist";
319 LOG_WARN(
"GENIEReweight") <<
"Vector of parameters has not been initialized yet (Size is 0).";
326 int label = (int)rLabel;
327 LOG_INFO(
"GENIEReweight") <<
"Adding parameter: " << genie::rew::GSyst::AsString(genie::rew::EGSyst(label)) <<
". With value: " <<
value;
335 int label = (int)rLabel;
350 LOG_INFO(
"GENIEReweight") <<
"Configure weight calculator";
465 case rwgt::fReweightFrElas_pi:
472 case rwgt::fReweightFrElas_N:
524 fWcalc =
new genie::rew::GReWeight();
532 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for NC Elastic Reweighting";
544 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for QE Axial Mass Reweighting";
552 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for QE Vector Mass Reweighting";
559 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Z-expansion QE Reweighting";
570 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for CC Resonance Reweighting";
581 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for NC Resonance Reweighting";
592 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for CC and NC Resonance Reweighting";
606 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Coherant Reweighting";
615 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Non-Resonance Background Reweighting (Neutrino Single Pion)";
626 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Non-Resonance Background Reweighting (Anti-Neutrino Single Pion)";
636 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Non-Resonance Background Reweighting (Neutrino Two Pion)";
647 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Non-Resonance Background Reweighting (Anti-Neutrino Two Pion)";
657 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Resoncance Decay Parameters";
672 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for NC Cross Section Scale";
679 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for DIS Form Factor Model Reweighting";
698 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for DIS Nuclear Model";
705 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for DIS AGKY Hadronization Model Reweighting";
717 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Intranuke Model Reweighting";
722 (name==rwgt::fReweightFrElas_pi) ||
729 (name==rwgt::fReweightFrElas_N) ||
737 LOG_WARN(
"GENIEReweight") <<
"That is not a valid Intranuke parameter Intranuke not configured";
744 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Formation Zone Reweighting";
751 LOG_INFO(
"GENIEReweight") <<
"Configuring GENIEReweight for Fermi Gas Model Reweighting";
762 LOG_INFO(
"GENIEReweight") <<
"Adding NC elastic weight calculator";
763 fWcalc->AdoptWghtCalc(
"xsec_ncel",
new GReWeightNuXSecNCEL );
768 LOG_INFO(
"GENIEReweight") <<
"Adding CCQE axial FF weight calculator ";
769 fWcalc->AdoptWghtCalc(
"xsec_ccqe",
new GReWeightNuXSecCCQE );
770 GReWeightNuXSecCCQE *rwccqe = dynamic_cast <GReWeightNuXSecCCQE*> (
fWcalc->WghtCalc(
"xsec_ccqe"));
773 LOG_INFO(
"GENIEReweight") <<
"in z-expansion mode";
774 rwccqe->SetMode(GReWeightNuXSecCCQE::kModeZExp);
777 LOG_INFO(
"GENIEReweight") <<
"in axial mass (QE) rate+shape mode";
778 rwccqe->SetMode(GReWeightNuXSecCCQE::kModeMa);
781 LOG_INFO(
"GENIEReweight") <<
"in axial mass (QE) shape only mode";
787 LOG_INFO(
"GENIEReweight") <<
"Adding CCQE vector FF weight calculator";
788 fWcalc->AdoptWghtCalc(
"xsec_ccqe_vec",
new GReWeightNuXSecCCQEvec );
793 LOG_INFO(
"GENIEReweight") <<
"Adding CC resonance weight calculator";
794 fWcalc->AdoptWghtCalc(
"xsec_ccres",
new GReWeightNuXSecCCRES );
796 LOG_INFO(
"GENIEReweight") <<
"in axial mass (Res) rate+shape mode";
797 GReWeightNuXSecCCRES * rwccres =
dynamic_cast<GReWeightNuXSecCCRES *
> (
fWcalc->WghtCalc(
"xsec_ccres"));
798 rwccres->SetMode(GReWeightNuXSecCCRES::kModeMaMv);
801 LOG_INFO(
"GENIEReweight") <<
"in axial mass (Res) shape only mode";
807 LOG_INFO(
"GENIEReweight") <<
"Adding NC resonance weight calculator";
808 fWcalc->AdoptWghtCalc(
"xsec_ncres",
new GReWeightNuXSecNCRES );
810 LOG_INFO(
"GENIEReweight") <<
"in axial mass (Res) rate+shape mode";
811 GReWeightNuXSecNCRES * rwncres =
dynamic_cast<GReWeightNuXSecNCRES *
> (
fWcalc->WghtCalc(
"xsec_ncres"));
812 rwncres->SetMode(GReWeightNuXSecNCRES::kModeMaMv);
815 LOG_INFO(
"GENIEReweight") <<
"in axial mass (Res) shape only mode";
821 LOG_INFO(
"GENIEReweight") <<
"Adding low Q^2 DIS (KNO) weight calculator";
822 fWcalc->AdoptWghtCalc(
"xsec_nonresbkg",
new GReWeightNonResonanceBkg );
827 LOG_INFO(
"GENIEReweight") <<
"Adding resonance decay weight calculator";
828 fWcalc->AdoptWghtCalc(
"hadro_res_decay",
new GReWeightResonanceDecay );
833 LOG_INFO(
"GENIEReweight") <<
"Adding NC total cross section weight calculator";
834 fWcalc->AdoptWghtCalc(
"xsec_nc",
new GReWeightNuXSecNC );
839 LOG_INFO(
"GENIEReweight") <<
"Adding DIS (Bodek-Yang) weight calculator";
840 fWcalc->AdoptWghtCalc(
"xsec_dis",
new GReWeightNuXSecDIS );
842 LOG_INFO(
"GENIEReweight") <<
"in shape+rate mode";
843 GReWeightNuXSecDIS * rwdis =
dynamic_cast<GReWeightNuXSecDIS *
> (
fWcalc->WghtCalc(
"xsec_dis"));
844 rwdis->SetMode(GReWeightNuXSecDIS::kModeABCV12u);
847 LOG_INFO(
"GENIEReweight") <<
"in shape only mode";
853 LOG_INFO(
"GENIEReweight") <<
"Adding coherant interaction model weight calculator";
854 fWcalc->AdoptWghtCalc(
"xsec_coh",
new GReWeightNuXSecCOH );
859 LOG_INFO(
"GENIEReweight") <<
"Adding hadronization (AGKY) model weight calculator";
860 fWcalc->AdoptWghtCalc(
"hadro_agky",
new GReWeightAGKY );
865 LOG_INFO(
"GENIEReweight") <<
"Adding DIS nuclear model weight calculator";
866 fWcalc->AdoptWghtCalc(
"nuclear_dis",
new GReWeightDISNuclMod );
871 LOG_INFO(
"GENIEReweight") <<
"Adding Fermi Gas Model (FGM) weight calculator";
872 fWcalc->AdoptWghtCalc(
"nuclear_qe",
new GReWeightFGM );
877 LOG_INFO(
"GENIEReweight") <<
"Adding Formation Zone weight calculator";
878 fWcalc->AdoptWghtCalc(
"hadro_fzone",
new GReWeightFZone );
883 LOG_INFO(
"GENIEReweight") <<
"Adding the Intra-Nuke weight calculator";
884 fWcalc->AdoptWghtCalc(
"hadro_intranuke",
new GReWeightINuke );
889 GSystSet & syst =
fWcalc->Systematics();
907 int iLabel = (int) label;
912 GSystUncertainty * gsysterr = GSystUncertainty::Instance();
921 sign = genie::utils::rew::Sign(value-nominal_def);
922 frac_err = gsysterr->OneSigmaErr( (GSyst_t)iLabel, sign);
923 sigma = (value - nominal_def)/(frac_err*nominal_def);
932 double wgt =
fWcalc->CalcWeight(evr);
void AddReweightValue(ReweightLabel_t rLabel, double value)
Change a reweight parameter. If it hasn't been added yet add it.
tweak inelastic probability for pions, for given total rescattering probability
void ReweightIntraNuke(ReweightLabel_t name, double sigma)
Simple Configuration of the Formation Zone reweight calculator.
tweak absorption probability for nucleons, for given total rescattering probability ...
void ReweightQEVec(double mv)
enum rwgt::EReweightLabel ReweightLabel_t
void ConfigureINuke()
configure the weight parameters being used
tweak the 2pi non-RES bkg in the RES region, for v+n CC
tweak the 1pi non-RES bkg in the RES region, for vbar+p NC
tweak Mv CCRES, affects d2sigma(CCRES)/dWdQ2 both in shape and normalization
tweak the Bodek-Yang model parameter B_{ht} - incl. both shape and normalization effect ...
tweak axial nucleon form factors (dipole -> z-expansion) - shape only effect of dsigma(CCQE)/dQ2 ...
void ConfigureCCRes()
Configure the NCRES calculator.
void ConfigureResBkg()
Configure the ResDecay weight calculator.
void ConfigureDIS()
Configure the Coherant model weight calculator.
void Configure()
Reconfigure the weight calculators.
tweak the Bodek-Yang model parameter CV2u - incl. both shape and normalization effect ...
tweak Ma CCRES, affects d2sigma(CCRES)/dWdQ2 in shape only (normalized to constant integral) ...
void ConfigureQEVec()
Configure the CCRES calculator.
void ReweightAGKY(double xF, double pT)
Simple Configuration of the Intranuke Nuclear model.
tweak the 2pi non-RES bkg in the RES region, for v+p CC
void ReweightResDecay(double gamma, double eta, double theta)
Simple Configuration of the Total NC cross section.
tweak inelastic probability for nucleons, for given total rescattering probability ...
void ConfigureParameters()
void ReweightCCRes(double ma, double mv=0.0)
Simple Configurtion of the NC Resonance weight calculator.
void ReweightDIS(double aht, double bht, double cv1u, double cv2u)
Simple Configuration of the DIS nuclear model.
std::map< int, double > fNominalParameters
tweak Z-expansion CCQE normalization (energy independent)
void ConfigureNC()
Configure the DIS (Bodek-Yang) weight calculator.
void ReweightFGM(double kF, double sf)
End of Simple Reweight Configurations.
void ConfigureFGM()
Configure the Formation Zone weight calculator.
double CalculateWeight(const genie::EventRecord &evr) const
tweak Resonance -> X + gamma branching ratio, eg Delta+(1232) -> p gamma
void ReweightQEMA(double ma)
Simple Configuration of the CCQE vector weight calculator.
tweak the 1pi non-RES bkg in the RES region, for vbar+p CC
tweak pion production probability for nucleons, for given total rescattering probability ...
tweak xF distribution for low multiplicity (N + pi) DIS f/s produced by AGKY
std::vector< int > fReWgtParameterName
void ConfigureFZone()
Configure the intranuke weight calculator.
tweak the 2pi non-RES bkg in the RES region, for v+p NC
tweak CCQE normalization (maintains dependence on neutrino energy)
void ReweightQEZExp(double norm, double a1, double a2, double a3, double a4)
Simple Configuration of the CC Resonance weight calculator.
tweak the 2pi non-RES bkg in the RES region, for vbar+n CC
tweak CCQE normalization (energy independent)
tweak the 2pi non-RES bkg in the RES region, for vbar+n NC
tweak the 2pi non-RES bkg in the RES region, for vbar+p NC
void ReweightNonResRvbarp1pi(double sigma)
Simple Configuration of the Non-Resonance Background weight calculator. Here it is being configured f...
void ConfigureQEMA()
Configure the QE vector FF weight calculator.
void ReweightCoh(double ma, double r0)
Simple Configuration of the Non-Resonance Background weight calculator.
void ConfgureResDecay()
Configure the NC weight calculator.
tweak pT distribution for low multiplicity (N + pi) DIS f/s produced by AGKY
tweak the 2pi non-RES bkg in the RES region, for v+n NC
void SetNominalValues()
Return the nominal value for the given parameter.
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
tweak Z-expansion coefficient 1, affects dsigma(CCQE)/dQ2 both in shape and normalization ...
GENIEReweight()
<constructor
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
tweak the 1pi non-RES bkg in the RES region, for v+n CC
genie::rew::GReWeight * fWcalc
void ReweightResGanged(double ma, double mv=0.0)
Simple Configuration of the Coherant weight calculator.
void ConfigureNCRes()
Configure the ResBkg (kno) weight calculator.
tweak absorption probability for pions, for given total rescattering probability
tweak NCRES normalization
tweak Z-expansion coefficient 2, affects dsigma(CCQE)/dQ2 both in shape and normalization ...
void Reconfigure()
Simple Configuration functions for configuring a single weight calculator.
Wrapper for reweight neutrino interactions with GENIE base class.
void ChangeParameterValue(ReweightLabel_t rLabel, double value)
Configure the weight calculators.
void ReweightNonResRvbarp2pi(double sigma)
Simple Configuration of the Resonance decay model weight calculator.
tweak the Bodek-Yang model parameter CV1u - incl. both shape and normalization effect ...
tweak the 1pi non-RES bkg in the RES region, for vbar+n NC
void ReweightNCRes(double ma, double mv=0.0)
Simple Configuration of the NC and CC Resonance weight calculator with the axial mass parameter for N...
tweak the 1pi non-RES bkg in the RES region, for vbar+n CC
tweak mean free path for pions
tweak the 1pi non-RES bkg in the RES region, for v+p NC
tweak the Bodek-Yang model parameter A_{ht} - shape only effect to d2sigma(DIS)/dxdy ...
void ConfigureAGKY()
Configure the DIS nuclear model weight calculator.
void ConfigureNCEL()
Configure the MaQE weight calculator.
distort pi angular distribution in Delta -> N + pi
double NominalParameterValue(ReweightLabel_t rLabel)
Return the configured value of the given parameter.
tweak DIS nuclear modification (shadowing, anti-shadowing, EMC). Does not appear to be working in GEN...
~GENIEReweight()
Set the nominal values for the reweight parameters.
tweak the inclusive DIS CC normalization (not currently working in genie)
tweak the Bodek-Yang model parameter CV2u - shape only effect to d2sigma(DIS)/dxdy ...
tweak Z-expansion coefficient 3, affects dsigma(CCQE)/dQ2 both in shape and normalization ...
tweak Mv CCRES, affects d2sigma(CCRES)/dWdQ2 in shape only (normalized to constant integral) ...
tweak Resonance -> X + eta branching ratio, eg N+(1440) -> p eta
std::vector< double > fReWgtParameterValue
double ReweightParameterValue(ReweightLabel_t rLabel)
Add reweight parameters to the list.
tweak the Bodek-Yang model parameter B_{ht} - shape only effect to d2sigma(DIS)/dxdy ...
tweak Ma NCEL, affects dsigma(NCEL)/dQ2 both in shape and normalization
void ReweightNCEL(double ma, double eta)
Simple Configurtion of the CCQE axial weight calculator.
void ReweightNonResRvp1pi(double sigma)
Simple Configuration of the Non-Resonance Background weight calculator.
tweak charge exchange probability for nucleons, for given total rescattering probability ...
tweak the Bodek-Yang model parameter A_{ht} - incl. both shape and normalization effect ...
double CalculateSigma(ReweightLabel_t label, double value)
Calculate the weights.
tweak Z-expansion coefficient 4, affects dsigma(CCQE)/dQ2 both in shape and normalization ...
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 in shape only (normalized to constant integral) ...
tweak Ma CCRES, affects d2sigma(CCRES)/dWdQ2 both in shape and normalization
tweak NCEL strange axial form factor eta, affects dsigma(NCEL)/dQ2 both in shape and normalization ...
tweak the 2pi non-RES bkg in the RES region, for vbar+p CC
tweak Ma CCQE, affects dsigma(CCQE)/dQ2 in shape only (normalized to constant integral) ...
tweak pion production probability for pions, for given total rescattering probability ...
tweak Ma CCQE, affects dsigma(CCQE)/dQ2 both in shape and normalization
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 in shape only (normalized to constant integral) ...
tweak charge exchange probability for pions, for given total rescattering probability ...
tweak the Bodek-Yang model parameter CV1u - shape only effect to d2sigma(DIS)/dxdy ...
tweak elastic nucleon form factors (BBA/default -> dipole) - shape only effect of dsigma(CCQE)/dQ2 ...
tweak mean free path for nucleons
void ReweightNC(double norm)
Simple Configuration of the DIS FF model weight calculator.
void ReweightNonResRvp2pi(double sigma)
Simple Configuration of the Non-Resonance Background weight calculator.
tweak the 1pi non-RES bkg in the RES region, for v+p CC
void ReweightFormZone(double sigma)
Simple Configuration of the Fermigas model reweight calculator.
tweak Ma for COH pion production
void ConfigureDISNucMod()
Configure the FG model weight calculator.
tweak CCRES normalization
tweak the 1pi non-RES bkg in the RES region, for v+n NC
tweak the ratio of ( CC) / ( CC) (not currently working in genie)
void ReweightDISnucl(bool mode)
Simple Configuration of the DIS AGKY hadronization model.
tweak R0 for COH pion production
void ConfigureCoh()
Configure the hadronization (AGKY) weight calculator.