SystVariations.h
Go to the documentation of this file.
1 #ifndef ANA_SYSTVARIATIONS_H
2 #define ANA_SYSTVARIATIONS_H
3 
6 
7 #include "TString.h"
8 
9 #include <iostream>
10 #include <vector>
11 #include <string>
12 
13 #pragma once
14 
15 namespace ana
16 {
17  std::vector<TString> allXSecSystNames {
18  "MaCCQEshape", "NormCCQE", "MaCOH", "CCQEPauliSupViaKF",
19  "MaRES", "MvRES", "allpi", "MECq0Shape", "MECEnuShape",
20  "MECNPfrac", "MECScaleSA", "RPACCQE", "RPARES"
21  }; ///< vector of cross-section systematic names
22 
23  /// Get shift for an individual cross-section systematic
24  ///
25  /// \param[in] systName - Name of cross-section systematic
26  /// \param[in] sigma - Number of sigma (int)
27  /// \param[out] shift - Value of the shift (double)
28  SystShifts GetShift(TString systName, double sigma)
29  {
30  std::cout << "[SystVariations::GetShift] Setting shift:"
31  << systName << ", " << sigma << "sigma" << std::endl;
32 
33  // Initialise SystShifts object
34  SystShifts shift;
35 
36  // Cross section systematics
37  if(systName == "MaCCQEshape")
38  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightMaCCQEshape), sigma);
39  if(systName == "NormCCQE")
40  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightNormCCQE), sigma);
41  if(systName == "MaCOH")
42  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightMaCOHpi), sigma);
43  if(systName == "CCQEPauliSupViaKF")
44  shift.SetShift(
45  GetGenieKnobSyst(rwgt::fReweightCCQEPauliSupViaKF), sigma);
46  if(systName == "MaRES")
47  {
48  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightMaCCRES), sigma);
49  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightMaNCRES), sigma);
50  }
51  if(systName == "MvRES")
52  {
53  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightMvCCRES), sigma);
54  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightMvNCRES), sigma);
55  }
56  if(systName == "allpi")
57  {
58  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvpCC1pi), sigma);
59  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvpNC1pi), sigma);
60  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvbarnCC1pi), sigma);
61  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvbarnNC1pi), sigma);
62  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvnCC1pi), sigma);
63  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvnNC1pi), sigma);
64  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvbarpCC1pi), sigma);
65  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvbarpNC1pi), sigma);
66  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvpCC2pi), sigma);
67  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvpNC2pi), sigma);
68  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvbarnCC2pi), sigma);
69  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvbarnNC2pi), sigma);
70  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvnCC2pi), sigma);
71  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvnNC2pi), sigma);
72  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvbarpCC2pi), sigma);
73  shift.SetShift(GetGenieKnobSyst(rwgt::fReweightRvbarpNC2pi), sigma);
74  }
75  // New for 2017
76  // MEC - flat scale weights
77  if (systName == "MECq0Shape")
78  shift.SetShift(&kMECq0ShapeSyst2017, sigma);
79  if (systName == "MECEnuShape")
80  shift.SetShift(&kMECEnuShapeSyst2017, sigma);
81  if (systName == "MECNPfrac")
83  if (systName == "MECScaleSA")
84  shift.SetShift(&kMECScaleSystSA, sigma);
85  // Combined doesn't work at the moment
86 
87  // RPA - flat scale weights
88  // Uncertainties from RPA CCQE effects - Rik Gran
89  //if (systName == "RPACCQE")
90  // shift.SetShift(&kRPAWeightCCQE2017, sigma);
91  // Uncertainties from RPA Res effects
92  //if (systName == "RPARES")
93  // shift.SetShift(&kRPAWeightRES2017, sigma);
94 
95  return shift;
96  };// GetShift
97 }// namespace ana
98 
99 #endif
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
const NOvARwgtSyst kMECScaleSystSA("mecScale","MEC Scale", novarwgt::kMECScaleSystSA)
Definition: MECSysts.h:48
const NOvARwgtSyst kMECEnuShapeSyst2017("MECEnuShape","MEC E_{#nu} shape", novarwgt::kMECEnuShapeSyst2017)
Definition: MECSysts.h:43
SystShifts GetShift(TString systName, double sigma)
double sigma(TH1F *hist, double percentile)
OStream cout
Definition: OStream.cxx:6
const NOvARwgtSyst kMECq0ShapeSyst2017("MECq0Shape","MEC q_{0} shape", novarwgt::kMECq0ShapeSyst2017)
Definition: MECSysts.h:41
std::vector< TString > allXSecSystNames
vector of cross-section systematic names
const NOvARwgtSyst * GetGenieKnobSyst(rwgt::ReweightLabel_t knobIdx, std::string altName, std::string altLabel)
Convenience function to get a GENIE knob syst. (Allows using the GENIE knob name & description as the...
Definition: XSecSysts.cxx:119
void SetShift(const ISyst *syst, double shift, bool force=false)
Definition: SystShifts.cxx:80
const NOvARwgtSyst kMECInitStateNPFracSyst2017("MECInitStateNPFrac","MEC initial state np fraction", novarwgt::kMECInitStateNPFracSyst2017)
Definition: MECSysts.h:42