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 //#include "TH2.h"
11 
12 #include "NOvARwgt/rwgt/Tune.h"
13 #include "NOvARwgt/rwgt/tunes/TunesSA.h"
14 #include "NOvARwgt/rwgt/tunes/Tunes2017.h"
15 #include "NOvARwgt/rwgt/tunes/Tunes2018.h"
16 #include "NOvARwgt/rwgt/tunes/Tunes2020.h"
17 
18 #include "CAFAna/Core/Var.h"
20 #include "CAFAna/Vars/TruthVars.h"
21 
22 namespace ana
23 {
24  /// Build a CAFAna NuTruthVar from a novarwgt::Tune instance.
25  NuTruthVar VarFromNOvATune(const novarwgt::Tune &tune);
26 
27  //-------------------------- Second Analysis ------------------------------------------------------
28 
29  /// SA era master XSec weight
31  const Var kTuftsWeightCC = VarFromNuTruthVar(kTuftsWeightCCST, 1);
32 
33  //--------------------------- "2017" analysis -----------------------------------------------------
34 
35  /// 2017 analysis master weight
37  const Var kXSecCVWgt2017 = VarFromNuTruthVar(kXSecCVWgt2017ST, 1);
38 
39  //--------------------------- "2018" analysis -----------------------------------------------------
40 
41  /// 2018 analysis master weight
42  // First version of 2018 cross section weight
44 
45  // Second version for 2018 cross section weight with smaller DIS
46  // (except that in reality, it's the same as the first one since
47  // kXSecCVWgt2018 was already 10% DIS scale)
49  const Var kXSecCVWgt2018 = VarFromNuTruthVar(kXSecCVWgt2018_smallerDISScale_NT, 1);
50 
51  // 2018 cross section weight updated after Hydrogen RPA bug fix
53  const Var kXSecCVWgt2018RPAFix = VarFromNuTruthVar(kXSecCVWgt2018RPAFix_smallerDISScale_NT, 1);
54 
55  // 2018 cross section weight updated after Hydrogen RPA bug fix but without DIS tweak
57  const Var kXSecCVWgt2018RPAFix_noDIS = VarFromNuTruthVar(kXSecCVWgt2018RPAFix_noDISScale_NT, 1);
58 
59 // ----------------------------- for miniprod5 validation purposes ------------------------------
60 
61  // Rescale MEC in miniprod5 to get the same number of events than prod4
63  const Var kScaleMECWgtminiprod5 = VarFromNuTruthVar(kScaleMECWgtminiprod5_NT,1);
64 
65  // All 2019 cross section weights with MEC unweighted
67  const Var kXSecCVWgt2019_UntunedMEC = VarFromNuTruthVar(kXSecCVWgt2019_UntunedMEC_NT,1);
68 
69  // All 2019 cross section weights except for MEC-> only rescaled x1.6 instead of q0q3 weights
70  // Intended to be used only with miniprod 5 (rescales MEC to have same number of events as prod4)
72  const Var kXSecCVWgt2019_UntunedMECRescaled = VarFromNuTruthVar(kXSecCVWgt2019_UntunedMECRescaled_NT,1);
73 
74  // 2019 xsec weights but remove MEC
76  const Var kXSecCVWgt2019_NoMEC = VarFromNuTruthVar(kXSecCVWgt2019_NoMEC_NT ,1);
77 
78  // Now the same but with 2018 ?
79  // All 2018 cross section weights with MEC unweighted
81  const Var kXSecCVWgt2018_UntunedMEC = VarFromNuTruthVar(kXSecCVWgt2018_UntunedMEC_NT ,1);
82 
83  // All 2018 cross section weights except for MEC-> only rescaled x1.6 instead of q0q3 weights
85  const Var kXSecCVWgt2018_UntunedMECRescaled = VarFromNuTruthVar(kXSecCVWgt2018_UntunedMECRescaled_NT ,1);
86 
87  // All 2018 cross section weights but remove MEC
89  const Var kXSecCVWgt2018_NoMEC = VarFromNuTruthVar(kXSecCVWgt2018_NoMEC_NT ,1);
90 
91  // ------------------ 2020 tunes ----------------------------//
92 
93  extern const novarwgt::Tune kXsecCVTune2020_Provisional;
94 
95  const NuTruthVar kXSecCVWgt2020_Provisional_NT = VarFromNOvATune(kXsecCVTune2020_Provisional);
96  const Var kXSecCVWgt2020_Provisional = VarFromNuTruthVar(kXSecCVWgt2020_Provisional_NT,1);
97 
98  /// First attempt at tuning MEC using a double Gaussian parameterization.
99  extern const novarwgt::Tune kXsecCVTune2020Gauss_Provisional;
100 
101  const NuTruthVar kXSecCVWgt2020Gauss_NT = VarFromNOvATune(kXsecCVTune2020Gauss_Provisional);
102  const Var kXSecCVWgt2020Gauss = VarFromNuTruthVar(kXSecCVWgt2020Gauss_NT,1);
103 
104  /// Final 2020 xsec tune. See documentation in NOvARwgt.
106  const Var kXSecCVWgt2020 = VarFromNuTruthVar(kXSecCVWgt2020_NT,1);
107 
108 
109 } // namespace ana
const NuTruthVar kRescaleMAQE_NT
Definition: GenieWeights.h:60
const NuTruthVar kXSecCVWgt2018_NoMEC_NT
Definition: XsecTunes.h:88
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kXSecCVWgt2020_Provisional
Definition: XsecTunes.h:96
const Var kXSecCVWgt2018_UntunedMEC
Definition: XsecTunes.h:81
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:102
const NuTruthVar kXSecCVWgt2020_NT
Final 2020 xsec tune. See documentation in NOvARwgt.
Definition: XsecTunes.h:105
const NuTruthVar kXSecCVWgt2019_UntunedMECRescaled_NT
Definition: XsecTunes.h:71
const Var kXSecCVWgt2019_UntunedMECRescaled
Definition: XsecTunes.h:72
const NuTruthVar kRPAWeightCCQE2018_NT
Definition: GenieWeights.h:95
const Var kXSecCVWgt2018_NoMEC
Definition: XsecTunes.h:89
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:56
const NuTruthVar kXSecCVWgt2019_UntunedMEC_NT
Definition: XsecTunes.h:66
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:62
const NuTruthVar kRescaleHighWDIS_NT
Definition: GenieWeights.h:315
const NuTruthVar kXSecCVWgt2020_Provisional_NT
Definition: XsecTunes.h:95
const NuTruthVar kXSecCVWgt2018_UntunedMECRescaled_NT
Definition: XsecTunes.h:84
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:67
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:48
const Var kXSecCVWgt2018RPAFix
Definition: XsecTunes.h:53
const NuTruthVar kXSecCVWgt2020Gauss_NT
Definition: XsecTunes.h:101
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:43
const NuTruthVar kTuftsWeightCCST
SA era master XSec weight.
Definition: XsecTunes.h:30
const NuTruthVar kXSecCVWgt2018_UntunedMEC_NT
Definition: XsecTunes.h:80
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:31
const Var kXSecCVWgt2018
Definition: XsecTunes.h:49
const NuTruthVar kXSecCVWgt2019_NoMEC_NT
Definition: XsecTunes.h:75
const NuTruthVar kXSecCVWgt2018RPAFix_smallerDISScale_NT
Definition: XsecTunes.h:52
const Var kScaleMECWgtminiprod5
Definition: XsecTunes.h:63
const NuTruthVar kXSecCVWgt2017ST
2017 analysis master weight
Definition: XsecTunes.h:36
const Var kXSecCVWgt2019_NoMEC
Definition: XsecTunes.h:76
const Var kXSecCVWgt2018_UntunedMECRescaled
Definition: XsecTunes.h:85
const Var kXSecCVWgt2017
Definition: XsecTunes.h:37
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 kFixNonres1PiST
Definition: GenieWeights.h:126
const Var kXSecCVWgt2018RPAFix_noDIS
Definition: XsecTunes.h:57
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:106