All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GenieWeightList.cxx
Go to the documentation of this file.
2 
3 #include <algorithm>
4 #include <iostream>
5 
6 namespace ana
7 {
8  //----------------------------------------------------------------------
9  std::vector<std::string> GetGenieWeightNames()
10  {
11  // I wonder if we can share this somehow with the code that generates these?
12  return {"MaCCQE","VecFFCCQEshape",
13  "MaNCEL","EtaNCEL","MaCCRES","MvCCRES",
14  "MaNCRES","MvNCRES","RDecBR1gamma","RDecBR1eta",
15  "Theta_Delta2Npi","AhtBY","BhtBY","CV1uBY",
16  "CV2uBY","FormZone","MFP_pi","FrCEx_pi",
17  "FrElas_pi","FrInel_pi","FrAbs_pi","FrPiProd_pi",
18  "MFP_N","FrCEx_N","FrElas_N","FrInel_N",
19  "FrAbs_N","FrPiProd_N","CCQEPauliSupViaKF","Mnv2p2hGaussEnhancement",
20  "MKSPP_ReWeight","E2p2h_A_nu","E2p2h_B_nu","E2p2h_A_nubar",
21  "E2p2h_B_nubar","NR_nu_n_CC_2Pi","NR_nu_n_CC_3Pi","NR_nu_p_CC_2Pi",
22  "NR_nu_p_CC_3Pi","NR_nu_np_CC_1Pi","NR_nu_n_NC_1Pi","NR_nu_n_NC_2Pi",
23  "NR_nu_n_NC_3Pi","NR_nu_p_NC_1Pi","NR_nu_p_NC_2Pi","NR_nu_p_NC_3Pi",
24  "NR_nubar_n_CC_1Pi","NR_nubar_n_CC_2Pi","NR_nubar_n_CC_3Pi","NR_nubar_p_CC_1Pi",
25  "NR_nubar_p_CC_2Pi","NR_nubar_p_CC_3Pi","NR_nubar_n_NC_1Pi","NR_nubar_n_NC_2Pi",
26  "NR_nubar_n_NC_3Pi","NR_nubar_p_NC_1Pi","NR_nubar_p_NC_2Pi","NR_nubar_p_NC_3Pi",
27  "BeRPA_A","BeRPA_B","BeRPA_D","BeRPA_E",
28  "C12ToAr40_2p2hScaling_nu","C12ToAr40_2p2hScaling_nubar",
29  "nuenuebar_xsec_ratio","nuenumu_xsec_ratio","SPPLowQ2Suppression"
30  };
31  }
32 
33  std::pair<double,double> GetGenieDialLimits(const std::string& name){
34 
35  static std::map<std::string,std::pair<double,double>> genieMap = {
36  // Regular dials
37  {"MaCCQE",{-3,3}},
38  {"MaNCEL",{-3,3}},
39  {"EtaNCEL",{-3,3}},
40  {"MaCCRES",{-3,3}},
41  {"MvCCRES",{-3,3}},
42  {"MaNCRES",{-3,3}},
43  {"MvNCRES",{-3,3}},
44  {"RDecBR1gamma",{-3,3}},
45  {"RDecBR1eta",{-3,3}},
46  {"AhtBY",{-3,3}},
47  {"BhtBY",{-3,3}},
48  {"CV1uBY",{-3,3}},
49  {"CV2uBY",{-3,3}},
50  {"BeRPA_A",{-3,3}},
51  {"BeRPA_B",{-3,3}},
52  {"BeRPA_D",{-3,3}},
53  {"BeRPA_E",{-3,3}},
54 
55  // NRpi dials
56  {"NR_nu_n_CC_2Pi",{-2,3}},
57  {"NR_nu_n_CC_3Pi",{-2,3}},
58  {"NR_nu_p_CC_2Pi",{-2,3}},
59  {"NR_nu_p_CC_3Pi",{-2,3}},
60  {"NR_nu_np_CC_1Pi",{-2,3}},
61  {"NR_nu_n_NC_1Pi",{-2,3}},
62  {"NR_nu_n_NC_2Pi",{-2,3}},
63  {"NR_nu_n_NC_3Pi",{-2,3}},
64  {"NR_nu_p_NC_1Pi",{-2,3}},
65  {"NR_nu_p_NC_2Pi",{-2,3}},
66  {"NR_nu_p_NC_3Pi",{-2,3}},
67  {"NR_nubar_n_CC_1Pi",{-2,3}},
68  {"NR_nubar_n_CC_2Pi",{-2,3}},
69  {"NR_nubar_n_CC_3Pi",{-2,3}},
70  {"NR_nubar_p_CC_1Pi",{-2,3}},
71  {"NR_nubar_p_CC_2Pi",{-2,3}},
72  {"NR_nubar_p_CC_3Pi",{-2,3}},
73  {"NR_nubar_n_NC_1Pi",{-2,3}},
74  {"NR_nubar_n_NC_2Pi",{-2,3}},
75  {"NR_nubar_n_NC_3Pi",{-2,3}},
76  {"NR_nubar_p_NC_1Pi",{-2,3}},
77  {"NR_nubar_p_NC_2Pi",{-2,3}},
78  {"NR_nubar_p_NC_3Pi",{-2,3}},
79 
80  // FSI
81  {"FormZone",{-2,2}},
82  {"MFP_pi",{-2,2}},
83  {"FrCEx_pi",{-2,2}},
84  {"FrElas_pi",{-2,2}},
85  {"FrInel_pi",{-2,2}},
86  {"FrAbs_pi",{-2,2}},
87  {"FrPiProd_pi",{-2,2}},
88  {"MFP_N",{-2,2}},
89  {"FrCEx_N",{-2,2}},
90  {"FrElas_N",{-2,2}},
91  {"FrInel_N",{-2,2}},
92  {"FrAbs_N",{-2,2}},
93  {"FrPiProd_N",{-2,2}},
94 
95  // On/Off dials
96  {"VecFFCCQEshape",{-1,1}},
97  {"Theta_Delta2Npi",{-1,1}},
98  {"CCQEPauliSupViaKF",{-1,1}},
99  {"Mnv2p2hGaussEnhancement",{-1,1}},
100  {"MKSPP_ReWeight",{-1,1}},
101  {"E2p2h_A_nu",{-1,1}},
102  {"E2p2h_B_nu",{-1,1}},
103  {"E2p2h_A_nubar",{-1,1}},
104  {"E2p2h_B_nubar",{-1,1}},
105  {"C12ToAr40_2p2hScaling_nu",{-1,1}},
106  {"C12ToAr40_2p2hScaling_nubar",{-1,1}},
107  {"nuenuebar_xsec_ratio",{-1,1}},
108  {"nuenumu_xsec_ratio",{-1,1}},
109  {"SPPLowQ2Suppression",{-1,1}}
110  };
111 
112  if (genieMap.find(name) == genieMap.end()){
113  std::cout << "Warning, no known systematic called " << name << " returning nominal" << std::endl;
114  return {-3,3};
115  }
116  return genieMap[name];
117  }
118 
119 
120  //----------------------------------------------------------------------
121  int GetGenieIndex(const std::string& name, bool quiet)
122  {
123  const std::vector<std::string> names = GetGenieWeightNames();
124 
125  auto it = std::find(names.begin(), names.end(), name);
126 
127  if(it == names.end()){
128  if(!quiet){
129  std::cerr << "Warning: couldn't find " << name
130  << " in list of genie systs" << std::endl;
131  }
132  return -1;
133  }
134 
135  return it-names.begin();
136  }
137 
138  std::string GetGenieWeightName(int index){
139  const std::vector<std::string> names = GetGenieWeightNames();
140  return names[index];
141  }
142 
143  double GetGenieMin(int index){
144  static const std::vector<std::string> names = GetGenieWeightNames();
145  return GetGenieDialLimits(names[index]).first;
146  }
147 
148  double GetGenieMax(int index){
149  static const std::vector<std::string> names = GetGenieWeightNames();
150  return GetGenieDialLimits(names[index]).second;
151  }
152 
153 }
int GetGenieIndex(const std::string &name, bool quiet)
std::vector< std::string > GetGenieWeightNames()
BEGIN_PROLOG could also be cerr
std::string GetGenieWeightName(int index)
double GetGenieMax(int index)
process_name opflashCryoW ana
double GetGenieMin(int index)
static const std::vector< std::string > names
std::pair< double, double > GetGenieDialLimits(const std::string &name)
then echo fcl name
BEGIN_PROLOG could also be cout