XsecTunes.h
Go to the documentation of this file.
1 /// XsecTunes.h:
2 /// Global cross section "tunes" suitable for various analyses.
3 /// Details and references below.
4 ///
5 /// Tunes are often flexible and configurable.
6 /// However, if you need fine-grained control for some particular study,
7 /// look at GenieWeights.h for Vars corresponding to individual weights.
8 
9 #pragma once
10 
11 #include "NOvARwgt/rwgt/Tune.h"
12 #include "NOvARwgt/rwgt/tunes/TunesSA.h"
13 #include "NOvARwgt/rwgt/tunes/Tunes2017.h"
14 #include "NOvARwgt/rwgt/tunes/Tunes2018.h"
15 #include "NOvARwgt/rwgt/tunes/Tunes2020.h"
16 
17 #include "CAFAna/Core/Var.h"
19 #include "CAFAna/Vars/TruthVars.h"
20 
21 namespace ana
22 {
23  /// Build a CAFAna NuTruthVar from a novarwgt::Tune instance.
24  NuTruthVar VarFromNOvATune(const novarwgt::Tune &tune);
25 
26  //-------------------------- Second Analysis ------------------------------------------------------
27 
28  /// SA era master XSec weight
30  const Var kTuftsWeightCC = VarFromNuTruthVar(kTuftsWeightCCST, 1);
31 
32  //--------------------------- "2017" analysis -----------------------------------------------------
33 
34  /// 2017 analysis master weight
36  const Var kXSecCVWgt2017 = VarFromNuTruthVar(kXSecCVWgt2017ST, 1);
37 
38  //--------------------------- "2018" analysis -----------------------------------------------------
39 
40  /// 2018 analysis master weight
41  // First version of 2018 cross section weight
43 
44  // Second version for 2018 cross section weight with smaller DIS
45  // (except that in reality, it's the same as the first one since
46  // kXSecCVWgt2018 was already 10% DIS scale)
48  const Var kXSecCVWgt2018 = VarFromNuTruthVar(kXSecCVWgt2018_smallerDISScale_NT, 1);
49 
50  // 2018 cross section weight updated after Hydrogen RPA bug fix
52  const Var kXSecCVWgt2018RPAFix = VarFromNuTruthVar(kXSecCVWgt2018RPAFix_smallerDISScale_NT, 1);
53 
54  // 2018 cross section weight updated after Hydrogen RPA bug fix but without DIS tweak
56  const Var kXSecCVWgt2018RPAFix_noDIS = VarFromNuTruthVar(kXSecCVWgt2018RPAFix_noDISScale_NT, 1);
57 
58 // ----------------------------- for miniprod5 validation purposes ------------------------------
59 
60  // Rescale MEC in miniprod5 to get the same number of events than prod4
62  const Var kScaleMECWgtminiprod5 = VarFromNuTruthVar(kScaleMECWgtminiprod5_NT,1);
63 
64  // All 2019 cross section weights with MEC unweighted
66  const Var kXSecCVWgt2019_UntunedMEC = VarFromNuTruthVar(kXSecCVWgt2019_UntunedMEC_NT,1);
67 
68  // All 2019 cross section weights except for MEC-> only rescaled x1.6 instead of q0q3 weights
69  // Intended to be used only with miniprod 5 (rescales MEC to have same number of events as prod4)
71  const Var kXSecCVWgt2019_UntunedMECRescaled = VarFromNuTruthVar(kXSecCVWgt2019_UntunedMECRescaled_NT,1);
72 
73  // 2019 xsec weights but remove MEC
75  const Var kXSecCVWgt2019_NoMEC = VarFromNuTruthVar(kXSecCVWgt2019_NoMEC_NT ,1);
76 
77  // Now the same but with 2018 ?
78  // All 2018 cross section weights with MEC unweighted
80  const Var kXSecCVWgt2018_UntunedMEC = VarFromNuTruthVar(kXSecCVWgt2018_UntunedMEC_NT ,1);
81 
82  // All 2018 cross section weights except for MEC-> only rescaled x1.6 instead of q0q3 weights
84  const Var kXSecCVWgt2018_UntunedMECRescaled = VarFromNuTruthVar(kXSecCVWgt2018_UntunedMECRescaled_NT ,1);
85 
86  // All 2018 cross section weights but remove MEC
88  const Var kXSecCVWgt2018_NoMEC = VarFromNuTruthVar(kXSecCVWgt2018_NoMEC_NT ,1);
89 
90  // ------------------ 2020 tunes ----------------------------//
91 
92  extern const novarwgt::Tune kXsecCVTune2020_Provisional;
93 
94  const NuTruthVar kXSecCVWgt2020_Provisional_NT = VarFromNOvATune(kXsecCVTune2020_Provisional);
95  const Var kXSecCVWgt2020_Provisional = VarFromNuTruthVar(kXSecCVWgt2020_Provisional_NT,1);
96 
97  /// First attempt at tuning MEC using a double Gaussian parameterization.
98  extern const novarwgt::Tune kXsecCVTune2020Gauss_Provisional;
99 
100  const NuTruthVar kXSecCVWgt2020Gauss_NT = VarFromNOvATune(kXsecCVTune2020Gauss_Provisional);
101  const Var kXSecCVWgt2020Gauss = VarFromNuTruthVar(kXSecCVWgt2020Gauss_NT,1);
102 
103  /// Final 2020 xsec tune. See documentation in NOvARwgt.
105  const Var kXSecCVWgt2020 = VarFromNuTruthVar(kXSecCVWgt2020_NT,1);
106 
107  // MCNP files version of 2020 xsec tune.
109  const Var kXSecCVWgt2020MCNP = VarFromNuTruthVar(kXSecCVWgt2020MCNP_NT,1);
110 
111 } // namespace ana
const NuTruthVar kRescaleMAQE_NT
Definition: GenieWeights.h:60
const NuTruthVar kXSecCVWgt2018_NoMEC_NT
Definition: XsecTunes.h:87
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kXSecCVWgt2020_Provisional
Definition: XsecTunes.h:95
const Var kXSecCVWgt2020MCNP
Definition: XsecTunes.h:109
const Var kXSecCVWgt2018_UntunedMEC
Definition: XsecTunes.h:80
const novarwgt::Tune kCVTuneSA({{"Nonres1pi", novarwgt::GetWeighter< Nonres1PiWgt >(true, false)},{"MEC", novarwgt::GetWeighter< Tufts2p2hWgtSA >()},},{})
const NuTruthVar kRPAWeightRES2019_NT
Definition: GenieWeights.h:119
const Var kXSecCVWgt2020Gauss
Definition: XsecTunes.h:101
const NuTruthVar kXSecCVWgt2020_NT
Final 2020 xsec tune. See documentation in NOvARwgt.
Definition: XsecTunes.h:104
const NuTruthVar kXSecCVWgt2019_UntunedMECRescaled_NT
Definition: XsecTunes.h:70
const Var kXSecCVWgt2019_UntunedMECRescaled
Definition: XsecTunes.h:71
const NuTruthVar kRPAWeightCCQE2018_NT
Definition: GenieWeights.h:95
const Var kXSecCVWgt2018_NoMEC
Definition: XsecTunes.h:88
const novarwgt::Tune kCVTune2018_RPAfix_noDIStweak({{"MA_QE", novarwgt::GetWeighter< MAQEWeight_2018 >()},{"RPA_QE", novarwgt::GetWeighter< RPAWeightCCQE_2017 >("CV", novarwgt::kScQuasiElastic, false, false, true)},{"RPA_RES", novarwgt::GetWeighter< RPAWeightQ2_2017 >(novarwgt::kRxnCC, novarwgt::kScResonant)},{"Nonres1pi", novarwgt::GetWeighter< Nonres1PiWgt >(false, true)},{"MEC", novarwgt::GetWeighter< EmpiricalMECWgt2018RPAFix >()},}, k2018GENIEKnobs|k2018MECKnobs_RPAFix|k2018OtherCustomKnobs)
NuTruthVar VarFromNOvATune(const novarwgt::Tune &tune)
Build a CAFAna NuTruthVar from a novarwgt::Tune instance.
Definition: XsecTunes.cxx:19
const NuTruthVar kXSecCVWgt2018RPAFix_noDISScale_NT
Definition: XsecTunes.h:55
const NuTruthVar kXSecCVWgt2019_UntunedMEC_NT
Definition: XsecTunes.h:65
const NuTruthVar kScaleMECWgtminiprod5_NT([](const caf::SRNeutrinoProxy *truth){if(truth->mode!=caf::kMEC) return 1.0;double weight=1.6;return weight;})
Definition: XsecTunes.h:61
const NuTruthVar kRescaleHighWDIS_NT
Definition: GenieWeights.h:315
const NuTruthVar kXSecCVWgt2020_Provisional_NT
Definition: XsecTunes.h:94
const novarwgt::Tune kCVTune2020MCNP({{"MEC", novarwgt::GetWeighter< novarwgt::ValenciaMECWgt2020MCNP >()},{"hN-FSI", novarwgt::GetWeighter< novarwgt::hNCVWgt2020 >()},}, k2020GENIEKnobs|k2020OtherCustomKnobs|k2020MECMCNPKnobs)
const NuTruthVar kXSecCVWgt2018_UntunedMECRescaled_NT
Definition: XsecTunes.h:83
const novarwgt::Tune kXsecCVTune2020_Provisional
_Var< caf::SRNeutrinoProxy > NuTruthVar
Var designed to be used over the nuTree, ie all neutrinos, not just those that got slices...
Definition: Var.h:82
const Var kXSecCVWgt2019_UntunedMEC
Definition: XsecTunes.h:66
const novarwgt::Tune kCVTune2018({{"MA_QE", novarwgt::GetWeighter< MAQEWeight_2018 >()}, {"RPA_QE", novarwgt::GetWeighter< RPAWeightCCQE_2017 >("CV", novarwgt::kScQuasiElastic, true, false, true)},{"RPA_RES", novarwgt::GetWeighter< RPAWeightQ2_2017 >(novarwgt::kRxnCC, novarwgt::kScResonant, true)},{"Nonres1pi", novarwgt::GetWeighter< Nonres1PiWgt >(false, true)},{"HighW", novarwgt::GetWeighter< HighWDISWgt_2018 >()},{"MEC", novarwgt::GetWeighter< EmpiricalMECWgt2018 >()},}, k2018GENIEKnobs|k2018MECKnobs|k2018OtherCustomKnobs)
CV tune used for 2018 analysis.
const NuTruthVar kXSecCVWgt2018_smallerDISScale_NT
Definition: XsecTunes.h:47
const Var kXSecCVWgt2018RPAFix
Definition: XsecTunes.h:52
const NuTruthVar kXSecCVWgt2020Gauss_NT
Definition: XsecTunes.h:100
const NuTruthVar kRPAWeightCCQE2019_NT
Definition: GenieWeights.h:101
const novarwgt::Tune kCVTune2018_RPAfix({{"MA_QE", novarwgt::GetWeighter< MAQEWeight_2018 >()},{"RPA_QE", novarwgt::GetWeighter< RPAWeightCCQE_2017 >("CV", novarwgt::kScQuasiElastic, false, false, true)},{"RPA_RES", novarwgt::GetWeighter< RPAWeightQ2_2017 >(novarwgt::kRxnCC, novarwgt::kScResonant)},{"Nonres1pi", novarwgt::GetWeighter< Nonres1PiWgt >(false, true)},{"HighW", novarwgt::GetWeighter< HighWDISWgt_2018 >()},{"MEC", novarwgt::GetWeighter< EmpiricalMECWgt2018RPAFix >()},}, k2018GENIEKnobs|k2018MECKnobs_RPAFix|k2018OtherCustomKnobs)
const NuTruthVar kXSecCVWgt2018_NT
2018 analysis master weight
Definition: XsecTunes.h:42
const NuTruthVar kTuftsWeightCCST
SA era master XSec weight.
Definition: XsecTunes.h:29
const NuTruthVar kXSecCVWgt2018_UntunedMEC_NT
Definition: XsecTunes.h:79
const novarwgt::Tune kCVTune2017({{"RPA_QE", novarwgt::GetWeighter< RPAWeightCCQE_2017 >("CV", novarwgt::kScNull, true, true, false)},{"Nonres1pi", novarwgt::GetWeighter< Nonres1PiWgt >(true, false)},{"MEC", novarwgt::GetWeighter< EmpiricalMECWgt2017 >()},}, k2017GENIEKnobs|k2017CustomKnobs)
CV MC tune used in 2017 analyses.
Var VarFromNuTruthVar(const NuTruthVar &stv, double _default)
Definition: Var.cxx:7
const Var kTuftsWeightCC
Definition: XsecTunes.h:30
const Var kXSecCVWgt2018
Definition: XsecTunes.h:48
const NuTruthVar kXSecCVWgt2019_NoMEC_NT
Definition: XsecTunes.h:74
const NuTruthVar kXSecCVWgt2018RPAFix_smallerDISScale_NT
Definition: XsecTunes.h:51
const Var kScaleMECWgtminiprod5
Definition: XsecTunes.h:62
const NuTruthVar kXSecCVWgt2017ST
2017 analysis master weight
Definition: XsecTunes.h:35
const Var kXSecCVWgt2019_NoMEC
Definition: XsecTunes.h:75
const Var kXSecCVWgt2018_UntunedMECRescaled
Definition: XsecTunes.h:84
const Var kXSecCVWgt2017
Definition: XsecTunes.h:36
Template for Var and SpillVar.
const NuTruthVar kRPAWeightRES2017_NT
Definition: GenieWeights.h:114
const novarwgt::Tune kCVTune2020({{"MEC", novarwgt::GetWeighter< novarwgt::ValenciaMECWgt2020 >()},{"hN-FSI", novarwgt::GetWeighter< novarwgt::hNCVWgt2020 >()},}, k2020GENIEKnobs|k2020OtherCustomKnobs|k2020MECKnobs)
const NuTruthVar kXSecCVWgt2020MCNP_NT
Definition: XsecTunes.h:108
const NuTruthVar kFixNonres1PiST
Definition: GenieWeights.h:126
const Var kXSecCVWgt2018RPAFix_noDIS
Definition: XsecTunes.h:56
const novarwgt::Tune kXsecCVTune2020Gauss_Provisional
First attempt at tuning MEC using a double Gaussian parameterization.
const NuTruthVar kDytmanMEC_DisableST([](const caf::SRNeutrinoProxy *nu){if(nu->mode!=caf::kMEC) return 1.;return 0.;})
weight all &#39;MEC&#39; events to 0. leave everything else alone.
Definition: TruthVars.h:14
const Var kXSecCVWgt2020
Definition: XsecTunes.h:105