VarVals.h
Go to the documentation of this file.
1 /*
2  * \file VarVals.h
3  * \brief Base container for the Vars that constitute an event.
4  *
5  * Created on: \date June 13, 2016
6  * Original author: \author J. Wolcott <jwolcott@fnal.gov>
7  *
8  */
9 
10 #ifndef FNEX_CORE_VARVALS_H_
11 #define FNEX_CORE_VARVALS_H_
12 
13 #include <string>
14 
15 #include "cetlib_except/exception.h"
17 
21 
22 namespace fnex
23 {
24  //----------------------------------------------------------------------------
25  // Constant keys for the different variables. Allows us to not know what the
26  // key values are anywhere else in the code. Reserve 0 for unknown
27  static const unsigned char kUnknownVar = 0;
28 
29  // Data info - kFake_Weight is in this group because it only applies to fake data
30 // static const unsigned char kNuE_LID = 9;
31 // static const unsigned char kNuE_LEM = 10;
32  static const unsigned char kNuE_CVN = 1;
33  static const unsigned char kNuE_NumMichel = 2;
34  static const unsigned char kHad_RecoE = 3;
35  static const unsigned char kLep_RecoE = 4;
36  static const unsigned char kNu_RecoE = 5;
37  static const unsigned char kLep_RecoE_MCFrac = 6;
38  static const unsigned char kRecoQ2 = 7;
39  static const unsigned char kFake_Weight = 8;
40 
41  // Truth information
42  static const unsigned char kTrueE = 9;
43  static const unsigned char kTruePDG = 10;
44  static const unsigned char kTrueCCNC = 11;
45  static const unsigned char kTrueIntType = 12;
46  static const unsigned char kTruePDGOrig = 13;
47  static const unsigned char kTrueParentPDG = 14;
48  static const unsigned char kTrueParentPT = 15;
49  static const unsigned char kTrueParentPZ = 16;
50  static const unsigned char kTrueParentDecay = 17;
51  static const unsigned char kTrueParentTargetPDG = 18;
52  static const unsigned char kTrueHitNuc = 19;
53  static const unsigned char kTrueIntMode = 20;
54 
55  // MC Reweighting info
56  static const unsigned char kXSecCVPPFX_Weight = 21;
57  static const unsigned char kRPACCQE_Weight = 22;
58  static const unsigned char kRPARES_Weight = 23;
59  static const unsigned char kDISvnCC1pi_Weight = 24;
60  static const unsigned char kEmpiricalMEC_Weight = 25;
61  static const unsigned char kEmpiricalMECtoGENIEQE_Weight = 26;
62  static const unsigned char kEmpiricalMECtoGENIERES_Weight = 27;
63  static const unsigned char kOtherDIS_Weight = 28;
64 
65  static const unsigned char kMinus2Sigma = 29;
66  static const unsigned char kMinus1Sigma = 30;
67  static const unsigned char kPlus1Sigma = 31;
68  static const unsigned char kPlus2Sigma = 32;
69 
70  static const unsigned char kMaCCQE = 33;
71  static const unsigned char kMaCCRES = 34;
72  static const unsigned char kMaNCRES = 35;
73  static const unsigned char kMvCCRES = 36;
74  static const unsigned char kRPACCQEshapeEnh = 37;
75  static const unsigned char kRPACCQEshapeSupp = 38;
76  static const unsigned char kFormZone = 39;
77  static const unsigned char kFrInel_pi = 40;
78  static const unsigned char kFrCEx_N = 41;
79  static const unsigned char kFrElas_N = 42;
80  static const unsigned char kFrAbs_N = 43;
81  static const unsigned char kCCQEPauliSupViaKF = 44;
82 
83  //Variables glommed into SumSmallXSecJoint2017:
84  static const unsigned char kSumSmallXSecJoint2017 = 45;
85  static const unsigned char kMaNCEL = 46;
86  static const unsigned char kEtaNCEL = 47;
87  static const unsigned char kVecCCQE_shape = 48;
88  static const unsigned char kMvNCRES = 49;
89  static const unsigned char kMaCOHpi = 50;
90  static const unsigned char kR0COHpi = 51;
91  static const unsigned char kAhtBY = 52;
92  static const unsigned char kBhtBY = 53;
93  static const unsigned char kCV1uBY = 54;
94  static const unsigned char kCV2uBY = 55;
95  static const unsigned char kNormDISCC = 56;
96  static const unsigned char kRnubarnuCC = 57;
97  static const unsigned char kDISNuclMod = 58;
98  static const unsigned char kAGKY_xF1pi = 59;
99  static const unsigned char kAGKY_pT1pi = 60;
100  static const unsigned char kMFP_pi = 61;
101  static const unsigned char kMFP_N = 62;
102  static const unsigned char kFrCEx_pi = 63;
103  static const unsigned char kFrElas_pi = 64;
104  static const unsigned char kFrAbs_pi = 65;
105  static const unsigned char kFrPiProd_pi = 66;
106  static const unsigned char kFrInel_N = 67;
107  static const unsigned char kFrPiProd_N = 68;
108  static const unsigned char kCCQEMomDistroFGtoSF = 69;
109  static const unsigned char kBR1gamma = 70;
110  static const unsigned char kBR1eta = 71;
111  static const unsigned char kTheta_Delta2Npi = 72;
112 
113 
114  // special keys for determining bin sizes
115  static const unsigned char kLep_RecoE_UBL = 73;
116  static const unsigned char kHad_RecoE_UBL = 74;
117  static const unsigned char kNu_RecoE_UBL = 75;
118  static const unsigned char kNu_RecoE_Quantiles_NuMu = 76;
119  static const unsigned char kNu_RecoE_NuE_Peripheral = 77;
120 
121  // The following variables are not currently used
122  /* static const unsigned char kNormCCQE_EnuDep = 26; */
123  /* static const unsigned char kNormCCRES = 30; */
124  /* static const unsigned char kMaCCRES_shape = 31; */
125  /* static const unsigned char kMvCCRES_shape = 32; */
126  /* static const unsigned char kNormNCRES = 35; */
127  /* static const unsigned char kMaNCRES_shape = 36; */
128  /* static const unsigned char kMvNCRES_shape = 37; */
129  /* static const unsigned char kNCGENIE = 69; */
130  /* static const unsigned char kNormCCQE = 31; */
131  /* static const unsigned char kMaCCQE_shape = 32; */
132  /* static const unsigned char kRvpCC1pi = 60; */
133  /* static const unsigned char kRvpCC2pi = 61; */
134  /* static const unsigned char kRvpNC1pi = 62; */
135  /* static const unsigned char kRvpNC2pi = 63; */
136  /* static const unsigned char kRvnCC1pi = 64; */
137  /* static const unsigned char kRvnCC2pi = 65; */
138  /* static const unsigned char kRvnNC1pi = 66; */
139  /* static const unsigned char kRvnNC2pi = 67; */
140  /* static const unsigned char kRvbarpCC1pi = 68; */
141  /* static const unsigned char kRvbarpCC2pi = 69; */
142  /* static const unsigned char kRvbarpNC1pi = 70; */
143  /* static const unsigned char kRvbarpNC2pi = 71; */
144  /* static const unsigned char kRvbarnCC1pi = 72; */
145  /* static const unsigned char kRvbarnCC2pi = 73; */
146  /* static const unsigned char kRvbarnNC1pi = 74; */
147  /* static const unsigned char kRvbarnNC2pi = 75; */
148 
149  //----------------------------------------------------------------------------
150  // method to check if a variable is part of the glommed GENIEOther
151  inline bool isSumSmallXSecJoint2017Key(unsigned char const& varkey)
152  {
153  if(varkey == kSumSmallXSecJoint2017 ||
154  varkey == kMaNCEL ||
155  varkey == kEtaNCEL ||
156  varkey == kVecCCQE_shape ||
157  varkey == kMvNCRES ||
158  varkey == kMaCOHpi ||
159  varkey == kR0COHpi ||
160  varkey == kAhtBY ||
161  varkey == kBhtBY ||
162  varkey == kCV1uBY ||
163  varkey == kCV2uBY ||
164  varkey == kNormDISCC ||
165  varkey == kRnubarnuCC ||
166  varkey == kDISNuclMod ||
167  varkey == kAGKY_xF1pi ||
168  varkey == kAGKY_pT1pi ||
169  varkey == kFormZone ||
170  varkey == kMFP_pi ||
171  varkey == kMFP_N ||
172  varkey == kFrCEx_pi ||
173  varkey == kFrElas_pi ||
174  varkey == kFrInel_pi ||
175  varkey == kFrAbs_pi ||
176  varkey == kFrPiProd_pi ||
177  varkey == kFrCEx_N ||
178  varkey == kFrElas_N ||
179  varkey == kFrInel_N ||
180  varkey == kFrAbs_N ||
181  varkey == kFrPiProd_N ||
182  varkey == kCCQEPauliSupViaKF ||
183  varkey == kCCQEMomDistroFGtoSF ||
184  varkey == kBR1gamma ||
185  varkey == kBR1eta ||
186  varkey == kTheta_Delta2Npi) return true;
187 
188  return false;
189  }
190 
191  //----------------------------------------------------------------------------
192  // method to check if a variable is part of the glommed GENIEOther
193  inline bool isSumSmallXSecJoint2017Name(std::string const& varname)
194  {
195 
196  if(varname.compare("SumSmallXSecJoint2017") == 0 ||
197  varname.compare("SumSmallXSecNumu2017") == 0 ||
198  varname.compare("SumSmallXSecNue2017") == 0 ||
199  varname.compare("MaNCEL") == 0 ||
200  varname.compare("EtaNCEL") == 0 ||
201  varname.compare("VecCCQE_shape") == 0 ||
202  varname.compare("MvNCRES") == 0 ||
203  varname.compare("MaCOHpi") == 0 ||
204  varname.compare("R0COHpi") == 0 ||
205  varname.compare("AhtBY") == 0 ||
206  varname.compare("BhtBY") == 0 ||
207  varname.compare("CV1uBY") == 0 ||
208  varname.compare("CV2uBY") == 0 ||
209  varname.compare("NormDISCC") == 0 ||
210  varname.compare("RnubarnuCC") == 0 ||
211  varname.compare("DISNuclMod") == 0 ||
212  varname.compare("AGKY_xF1pi") == 0 ||
213  varname.compare("AGKY_pT1pi") == 0 ||
214  varname.compare("FormZone") == 0 ||
215  varname.compare("MFP_pi") == 0 ||
216  varname.compare("MFP_N") == 0 ||
217  varname.compare("FrCEx_pi") == 0 ||
218  varname.compare("FrElas_pi") == 0 ||
219  varname.compare("FrInel_pi") == 0 ||
220  varname.compare("FrAbs_pi") == 0 ||
221  varname.compare("FrPiProd_pi") == 0 ||
222  varname.compare("FrCEx_N") == 0 ||
223  varname.compare("FrElas_N") == 0 ||
224  varname.compare("FrInel_N") == 0 ||
225  varname.compare("FrAbs_N") == 0 ||
226  varname.compare("FrPiProd_N") == 0 ||
227  varname.compare("CCQEPauliSupViaKF") == 0 ||
228  varname.compare("CCQEMomDistroFGtoSF") == 0 ||
229  varname.compare("BR1gamma") == 0 ||
230  varname.compare("BR1eta") == 0 ||
231  varname.compare("Theta_Delta2Npi") == 0 ) return true;
232 
233  return false;
234  }
235 
236  //----------------------------------------------------------------------------
237  // method to check if a variable is used at all
238  inline bool isUnusedGENIEName(std::string const& varname)
239  {
240 
241  if(varname.compare("AhtBYshape") == 0 ||
242  varname.compare("BhtBYshape") == 0 ||
243  varname.compare("CV1uBYshape") == 0 ||
244  varname.compare("CV2uBYshape") == 0 ||
245  varname.compare("NormCCQE_EnuDep") == 0 ||
246  varname.compare("NormCCRES") == 0 ||
247  varname.compare("MaCCRES_shape") == 0 ||
248  varname.compare("MvCCRES_shape") == 0 ||
249  varname.compare("NormNCRES") == 0 ||
250  varname.compare("MaNCRES_shape") == 0 ||
251  varname.compare("MvNCRES_shape") == 0 ||
252  varname.compare("NCGENIE") == 0 ||
253  varname.compare("NC") == 0 ||
254  varname.compare("NormCCQE") == 0 ||
255  varname.compare("MaCCQE_shape") == 0 ||
256  varname.compare("RvpCC1pi") == 0 ||
257  varname.compare("RvpCC2pi") == 0 ||
258  varname.compare("RvpNC1pi") == 0 ||
259  varname.compare("RvpNC2pi") == 0 ||
260  varname.compare("RvnCC1pi") == 0 ||
261  varname.compare("RvnCC2pi") == 0 ||
262  varname.compare("RvnNC1pi") == 0 ||
263  varname.compare("RvnNC2pi") == 0 ||
264  varname.compare("RvbarpCC1pi") == 0 ||
265  varname.compare("RvbarpCC2pi") == 0 ||
266  varname.compare("RvbarpNC1pi") == 0 ||
267  varname.compare("RvbarpNC2pi") == 0 ||
268  varname.compare("RvbarnCC1pi") == 0 ||
269  varname.compare("RvbarnCC2pi") == 0 ||
270  varname.compare("RvbarnNC1pi") == 0 ||
271  varname.compare("RvbarnNC2pi") == 0 ) return true;
272 
273  return false;
274  }
275 
276  //-----------------------------------------------------------------------
277  // Helper function to turn a Variable Name string into the key for the map
278  // number the keys from 1, 0 is reserved for an undefined key
279  inline unsigned char VarNameToKey(std::string const& name)
280  {
281 // if (name.compare("NuE_LID" ) == 0) return kNuE_LID;
282 // else if(name.compare("NuE_LEM" ) == 0) return kNuE_LEM;
283  if(name.compare("NuE_CVN" ) == 0) return kNuE_CVN;
284  else if(name.compare("NuE_NumMichel" ) == 0) return kNuE_NumMichel;
285  else if(name.compare("Had_RecoE" ) == 0) return kHad_RecoE;
286  else if(name.compare("Had_RecoE_UBL" ) == 0) return kHad_RecoE_UBL;
287  else if(name.compare("Lep_RecoE" ) == 0) return kLep_RecoE;
288  else if(name.compare("Lep_RecoE_UBL" ) == 0) return kLep_RecoE_UBL;
289  else if(name.compare("Nu_RecoE" ) == 0) return kNu_RecoE;
290  else if(name.compare("Nu_RecoE_UBL" ) == 0) return kNu_RecoE_UBL;
291  else if(name.compare("Nu_RecoE_Quantiles_NuMu" ) == 0) return kNu_RecoE_Quantiles_NuMu;
292  else if(name.compare("Nu_RecoE_NuE_Peripheral" ) == 0) return kNu_RecoE_NuE_Peripheral;
293  else if(name.compare("Lep_RecoE_MCFrac" ) == 0) return kLep_RecoE_MCFrac;
294  else if(name.compare("Reco_Q2" ) == 0) return kRecoQ2;
295  else if(name.compare("Fake_Weight" ) == 0) return kFake_Weight;
296 
297  else if(name.compare("TrueE" ) == 0) return kTrueE;
298  else if(name.compare("TruePDG" ) == 0) return kTruePDG;
299  else if(name.compare("TrueCCNC" ) == 0) return kTrueCCNC;
300  else if(name.compare("TrueIntType" ) == 0) return kTrueIntType;
301  else if(name.compare("TruePDGOrig" ) == 0) return kTruePDGOrig;
302  else if(name.compare("TrueParentPDG" ) == 0) return kTrueParentPDG;
303  else if(name.compare("TrueParentPT" ) == 0) return kTrueParentPT;
304  else if(name.compare("TrueParentPZ" ) == 0) return kTrueParentPZ;
305  else if(name.compare("TrueParentDecay" ) == 0) return kTrueParentDecay;
306  else if(name.compare("TrueParentTargetPDG") == 0) return kTrueParentTargetPDG;
307  else if(name.compare("TrueHitNuc" ) == 0) return kTrueHitNuc;
308  else if(name.compare("TrueIntMode" ) == 0) return kTrueIntMode;
309 
310  else if(name.compare("XsecCVWgt" ) == 0) return kXSecCVPPFX_Weight;
311  else if(name.compare("RPACCQEWgt" ) == 0) return kRPACCQE_Weight;
312  else if(name.compare("RPARESWgt" ) == 0) return kRPARES_Weight;
313  else if(name.compare("DISvnCC1piWgt" ) == 0) return kDISvnCC1pi_Weight;
314  else if(name.compare("EmpiricalMECWgt" ) == 0) return kEmpiricalMEC_Weight;
315  else if(name.compare("EmpiricalMECtoGENIEQEWgt" ) == 0)
316  return kEmpiricalMECtoGENIEQE_Weight;
317  else if(name.compare("EmpiricalMECtoGENIERESWgt") == 0)
318  return kEmpiricalMECtoGENIERES_Weight;
319  else if(name.compare("OtherDISWgt" ) == 0) return kOtherDIS_Weight;
320 
321  // the next two are for backwards compatibility with files using an
322  // old naming scheme for those variables
323  else if(name.compare("TuftsCC_Weight" ) == 0) return kXSecCVPPFX_Weight;
324  else if(name.compare("RPACCQE_Weight" ) == 0) return kRPACCQE_Weight;
325 
326  else if(name.compare("-2sigma" ) == 0) return kMinus2Sigma;
327  else if(name.compare("-1sigma" ) == 0) return kMinus1Sigma;
328  else if(name.compare("+1sigma" ) == 0) return kPlus1Sigma;
329  else if(name.compare("+2sigma" ) == 0) return kPlus2Sigma;
330 
331  //GENIE knobs
332  //else if( isSumSmallXSecJoint2017Name(name) ) return kSumSmallXSecJoint2017;
333  //else if( isUnusedGENIEName (name) ) return 0;
334 
335  // NC elastic parameters
336  else if(name.compare("MaNCEL" ) == 0) return kMaNCEL;
337  else if(name.compare("EtaNCEL" ) == 0) return kEtaNCEL;
338 
339  // CCQE parameters
340  //else if(name.compare("NormCCQE" ) == 0) return kNormCCQE;
341  //else if(name.compare("NormCCQE_EnuDep" ) == 0) return kNormCCQE_EnuDep;
342  //else if(name.compare("MaCCQE_shape" ) == 0) return kMaCCQE_shape;
343  else if(name.compare("MaCCQE" ) == 0) return kMaCCQE;
344  else if(name.compare("VecCCQE_shape" ) == 0) return kVecCCQE_shape;
345 
346  // Resonant production: CC
347  //else if(name.compare("NormCCRES" ) == 0) return kNormCCRES;
348  //else if(name.compare("MaCCRES_shape" ) == 0) return kMaCCRES_shape;
349  //else if(name.compare("MvCCRES_shape" ) == 0) return kMvCCRES_shape;
350  else if(name.compare("MaCCRES" ) == 0) return kMaCCRES;
351  else if(name.compare("MvCCRES" ) == 0) return kMvCCRES;
352 
353  // Resonant production: NC
354  //else if(name.compare("NormNCRES" ) == 0) return kNormNCRES;
355  //else if(name.compare("MaNCRES_shape" ) == 0) return kMaNCRES_shape;
356  //else if(name.compare("MvNCRES_shape" ) == 0) return kMvNCRES_shape;
357  else if(name.compare("MaNCRES" ) == 0) return kMaNCRES;
358  else if(name.compare("MvNCRES" ) == 0) return kMvNCRES;
359 
360  // Coherent pion production
361  else if(name.compare("MaCOHpi" ) == 0) return kMaCOHpi;
362  else if(name.compare("R0COHpi" ) == 0) return kR0COHpi;
363 
364  // Non-resonant background
365  //else if(name.compare("RvpCC1pi" ) == 0) return kRvpCC1pi;
366  //else if(name.compare("RvpCC2pi" ) == 0) return kRvpCC2pi;
367  //else if(name.compare("RvpNC1pi" ) == 0) return kRvpNC1pi;
368  //else if(name.compare("RvpNC2pi" ) == 0) return kRvpNC2pi;
369  //else if(name.compare("RvnCC1pi" ) == 0) return kRvnCC1pi;
370  //else if(name.compare("RvnCC2pi" ) == 0) return kRvnCC2pi;
371  //else if(name.compare("RvnNC1pi" ) == 0) return kRvnNC1pi;
372  //else if(name.compare("RvnNC2pi" ) == 0) return kRvnNC2pi;
373  //else if(name.compare("RvbarpCC1pi" ) == 0) return kRvbarpCC1pi;
374  //else if(name.compare("RvbarpCC2pi" ) == 0) return kRvbarpCC2pi;
375  //else if(name.compare("RvbarpNC1pi" ) == 0) return kRvbarpNC1pi;
376  //else if(name.compare("RvbarpNC2pi" ) == 0) return kRvbarpNC2pi;
377  //else if(name.compare("RvbarnCC1pi" ) == 0) return kRvbarnCC1pi;
378  //else if(name.compare("RvbarnCC2pi" ) == 0) return kRvbarnCC2pi;
379  //else if(name.compare("RvbarnNC1pi" ) == 0) return kRvbarnNC1pi;
380  //else if(name.compare("RvbarnNC2pi" ) == 0) return kRvbarnNC2pi;
381 
382  // DIS tweaking parameters
383  else if(name.compare("AhtBY" ) == 0) return kAhtBY;
384  else if(name.compare("BhtBY" ) == 0) return kBhtBY;
385  else if(name.compare("CV1uBY" ) == 0) return kCV1uBY;
386  else if(name.compare("CV2uBY" ) == 0) return kCV2uBY;
387  //else if(name.compare("AhtBYshape" ) == 0) return kAhtBYshape;
388  //else if(name.compare("BhtBYshape" ) == 0) return kBhtBYshape;
389  //else if(name.compare("CV1uBYshape" ) == 0) return kCV1uBYshape;
390  //else if(name.compare("CV2uBYshape" ) == 0) return kCV2uBYshape;
391  else if(name.compare("NormDISCC" ) == 0) return kNormDISCC;
392  else if(name.compare("RnubarnuCC" ) == 0) return kRnubarnuCC;
393  else if(name.compare("DISNuclMod" ) == 0) return kDISNuclMod;
394 
395  //else if(name.compare("NC" ) == 0) return kNCGENIE;
396 
397  // Hadronization (free nucleon target)
398  else if(name.compare("AGKY_xF1pi" ) == 0) return kAGKY_xF1pi;
399  else if(name.compare("AGKY_pT1pi" ) == 0) return kAGKY_pT1pi;
400 
401  // Medium-effects to hadronization
402  else if(name.compare("FormZone" ) == 0) return kFormZone;
403 
404  // Intranuclear rescattering parameters.
405  else if(name.compare("MFP_pi" ) == 0) return kMFP_pi;
406  else if(name.compare("MFP_N" ) == 0) return kMFP_N;
407  else if(name.compare("FrCEx_pi" ) == 0) return kFrCEx_pi;
408  else if(name.compare("FrElas_pi" ) == 0) return kFrElas_pi;
409  else if(name.compare("FrInel_pi" ) == 0) return kFrInel_pi;
410  else if(name.compare("FrAbs_pi" ) == 0) return kFrAbs_pi;
411  else if(name.compare("FrPiProd_pi" ) == 0) return kFrPiProd_pi;
412  else if(name.compare("FrCEx_N" ) == 0) return kFrCEx_N;
413  else if(name.compare("FrElas_N" ) == 0) return kFrElas_N;
414  else if(name.compare("FrInel_N" ) == 0) return kFrInel_N;
415  else if(name.compare("FrAbs_N" ) == 0) return kFrAbs_N;
416  else if(name.compare("FrPiProd_N" ) == 0) return kFrPiProd_N;
417 
418  // Nuclear model
419  else if(name.compare("CCQEPauliSupViaKF" ) == 0) return kCCQEPauliSupViaKF;
420  else if(name.compare("CCQEMomDistroFGtoSF") == 0) return kCCQEMomDistroFGtoSF;
421 
422  // Resonance decays
423  else if(name.compare("BR1gamma" ) == 0) return kBR1gamma;
424  else if(name.compare("BR1eta" ) == 0) return kBR1eta;
425  else if(name.compare("Theta_Delta2Npi" ) == 0) return kTheta_Delta2Npi;
426 
427  // 2017 RPA shape systematics
428  else if(name.compare("RPACCQEshapeEnh" ) == 0) return kRPACCQEshapeEnh;
429  else if(name.compare("RPACCQEshapeSupp" ) == 0) return kRPACCQEshapeSupp;
430 
431  // if we passed it the name Unknown intentionally, just return 0
432  else if(name.compare("Unknown" ) == 0) return 0;
433 
434  LOG_DEBUG("VarNameToKey")
435  << "Variable name "
436  << name
437  << " does not correspond to any key, returning 0";
438 
439  return 0;
440  }
441 
442  //-----------------------------------------------------------------------
443  // Helper function to turn a key for the map into a Variable Name string
444  // a key of 0 is an undefined variable name
445  inline std::string KeyToVarName(unsigned char const& key)
446  {
447  // else if(key == kNuE_LID ) return "NuE_LID";
448  // else if(key == kNuE_LEM ) return "NuE_LEM";
449  if(key == kNuE_CVN ) return "NuE_CVN";
450  else if(key == kNuE_NumMichel ) return "NuE_NumMichel";
451  else if(key == kHad_RecoE ) return "Had_RecoE";
452  else if(key == kHad_RecoE_UBL ) return "Had_RecoE_UBL";
453  else if(key == kLep_RecoE ) return "Lep_RecoE";
454  else if(key == kLep_RecoE_UBL ) return "Lep_RecoE_UBL";
455  else if(key == kNu_RecoE ) return "Nu_RecoE";
456  else if(key == kNu_RecoE_UBL ) return "Nu_RecoE_UBL";
457  else if(key == kNu_RecoE_Quantiles_NuMu ) return "Nu_RecoE_Quantiles_NuMu";
458  else if(key == kNu_RecoE_NuE_Peripheral ) return "Nu_RecoE_NuE_Peripheral";
459  else if(key == kLep_RecoE_MCFrac ) return "Lep_RecoE_MCFrac";
460  else if(key == kRecoQ2 ) return "Reco_Q2";
461  else if(key == kFake_Weight ) return "Fake_Weight";
462 
463  else if(key == kTrueE ) return "TrueE";
464  else if(key == kTruePDG ) return "TruePDG";
465  else if(key == kTrueCCNC ) return "TrueCCNC";
466  else if(key == kTrueIntType ) return "TrueIntType";
467  else if(key == kTruePDGOrig ) return "TruePDGOrig";
468  else if(key == kTrueParentPDG ) return "TrueParentPDG";
469  else if(key == kTrueParentPT ) return "TrueParentPT";
470  else if(key == kTrueParentPZ ) return "TrueParentPZ";
471  else if(key == kTrueParentDecay ) return "TrueParentDecay";
472  else if(key == kTrueParentTargetPDG) return "TrueParentTargetPDG";
473  else if(key == kTrueHitNuc ) return "TrueHitNuc";
474  else if(key == kTrueIntMode ) return "TrueIntMode";
475 
476  else if(key == kXSecCVPPFX_Weight ) return "XsecCVWgt";
477  else if(key == kRPACCQE_Weight ) return "RPACCQEWgt";
478  else if(key == kRPARES_Weight ) return "RPARESWgt";
479  else if(key == kDISvnCC1pi_Weight ) return "DISvnCC1piWgt";
480  else if(key == kEmpiricalMEC_Weight ) return "EmpiricalMECWgt";
481  else if(key == kEmpiricalMECtoGENIEQE_Weight ) return "EmpiricalMECtoGENIEQEWgt";
482  else if(key == kEmpiricalMECtoGENIERES_Weight) return "EmpiricalMECtoGENIERESWgt";
483  else if(key == kOtherDIS_Weight ) return "OtherDISWgt";
484 
485  else if(key == kMinus2Sigma ) return "-2sigma";
486  else if(key == kMinus1Sigma ) return "-1sigma";
487  else if(key == kPlus1Sigma ) return "+1sigma";
488  else if(key == kPlus2Sigma ) return "+2sigma";
489 
490  //GENIE knobs
491  //else if( isSumSmallXSecJoint2017Key(key) ) return "SumSmallXSecJoint2017";
492 
493  // NC elastic parameters
494  else if(key == kMaNCEL ) return "MaNCEL";
495  else if(key == kEtaNCEL ) return "EtaNCEL";
496 
497  // CCQE parameters
498  //else if(key == kNormCCQE ) return "NormCCQE";
499  //else if(key == kNormCCQE_EnuDep ) return "NormCCQE_EnuDep";
500  //else if(key == kMaCCQE_shape ) return "MaCCQE_shape";
501  else if(key == kMaCCQE ) return "MaCCQE";
502  else if(key == kVecCCQE_shape ) return "VecCCQE_shape";
503 
504  // Resonant production: CC
505  //else if(key == kNormCCRES ) return "NormCCRES";
506  //else if(key == kMaCCRES_shape ) return "MaCCRES_shape";
507  //else if(key == kMvCCRES_shape ) return "MvCCRES_shape";
508  else if(key == kMaCCRES ) return "MaCCRES";
509  else if(key == kMvCCRES ) return "MvCCRES";
510 
511  // Resonant production: NC
512  //else if(key == kNormNCRES ) return "NormNCRES";
513  //else if(key == kMaNCRES_shape ) return "MaNCRES_shape";
514  //else if(key == kMvNCRES_shape ) return "MvNCRES_shape";
515  else if(key == kMaNCRES ) return "MaNCRES";
516  else if(key == kMvNCRES ) return "MvNCRES";
517 
518  // Coherent pion production
519  else if(key == kMaCOHpi ) return "MaCOHpi";
520  else if(key == kR0COHpi ) return "R0COHpi";
521 
522  // Non-resonant background
523  //else if(key == kRvpCC1pi ) return "RvpCC1pi";
524  //else if(key == kRvpCC2pi ) return "RvpCC2pi";
525  //else if(key == kRvpNC1pi ) return "RvpNC1pi";
526  //else if(key == kRvpNC2pi ) return "RvpNC2pi";
527  //else if(key == kRvnCC1pi ) return "RvnCC1pi";
528  //else if(key == kRvnCC2pi ) return "RvnCC2pi";
529  //else if(key == kRvnNC1pi ) return "RvnNC1pi";
530  //else if(key == kRvnNC2pi ) return "RvnNC2pi";
531  //else if(key == kRvbarpCC1pi ) return "RvbarpCC1pi";
532  //else if(key == kRvbarpCC2pi ) return "RvbarpCC2pi";
533  //else if(key == kRvbarpNC1pi ) return "RvbarpNC1pi";
534  //else if(key == kRvbarpNC2pi ) return "RvbarpNC2pi";
535  //else if(key == kRvbarnCC1pi ) return "RvbarnCC1pi";
536  //else if(key == kRvbarnCC2pi ) return "RvbarnCC2pi";
537  //else if(key == kRvbarnNC1pi ) return "RvbarnNC1pi";
538  //else if(key == kRvbarnNC2pi ) return "RvbarnNC2pi";
539 
540  // DIS tweaking parameters
541  else if(key == kAhtBY ) return "AhtBY";
542  else if(key == kBhtBY ) return "BhtBY";
543  else if(key == kCV1uBY ) return "CV1uBY";
544  else if(key == kCV2uBY ) return "CV2uBY";
545  //else if(key == kAhtBYshape ) return "AhtBYshape";
546  //else if(key == kBhtBYshape ) return "BhtBYshape";
547  //else if(key == kCV1uBYshape ) return "CV1uBYshape";
548  //else if(key == kCV2uBYshape ) return "CV2uBYshape";
549  else if(key == kNormDISCC ) return "NormDISCC";
550  else if(key == kRnubarnuCC ) return "RnubarnuCC";
551  else if(key == kDISNuclMod ) return "DISNuclMod";
552 
553  //else if(key == kNCGENIE ) return "NC";
554 
555  // Hadronization (free nucleon target)
556  else if(key == kAGKY_xF1pi ) return "AGKY_xF1pi";
557  else if(key == kAGKY_pT1pi ) return "AGKY_pT1pi";
558 
559  // Medium-effects to hadronization
560  else if(key == kFormZone ) return "FormZone";
561 
562  // Intranuclear rescattering parameters.
563  else if(key == kMFP_pi ) return "MFP_pi";
564  else if(key == kMFP_N ) return "MFP_N";
565  else if(key == kFrCEx_pi ) return "FrCEx_pi";
566  else if(key == kFrElas_pi ) return "FrElas_pi";
567  else if(key == kFrInel_pi ) return "FrInel_pi";
568  else if(key == kFrAbs_pi ) return "FrAbs_pi";
569  else if(key == kFrPiProd_pi ) return "FrPiProd_pi";
570  else if(key == kFrCEx_N ) return "FrCEx_N";
571  else if(key == kFrElas_N ) return "FrElas_N";
572  else if(key == kFrInel_N ) return "FrInel_N";
573  else if(key == kFrAbs_N ) return "FrAbs_N";
574  else if(key == kFrPiProd_N ) return "FrPiProd_N";
575 
576  // Nuclear model
577  else if(key == kCCQEPauliSupViaKF ) return "CCQEPauliSupViaKF";
578  else if(key == kCCQEMomDistroFGtoSF) return "CCQEMomDistroFGtoSF";
579 
580  // Resonance decays
581  else if(key == kBR1gamma ) return "BR1gamma";
582  else if(key == kBR1eta ) return "BR1eta";
583  else if(key == kTheta_Delta2Npi ) return "Theta_Delta2Npi";
584 
585  // 2017 RPA shape systematics
586  else if(key == kRPACCQEshapeEnh ) return "RPACCQEshapeEnh";
587  else if(key == kRPACCQEshapeSupp ) return "RPACCQEshapeSupp";
588 
589  return "Unknown";
590  }
591 
592  //----------------------------------------------------------------------------
593  inline std::string KeyToLatex(unsigned char const& varkey)
594  {
596 
597  if(varkey == fnex::kNu_RecoE) latex = "E_{#nu} (GeV)";
598 
599  return latex;
600 
601  }
602 
603  //----------------------------------------------------------------------------
604  inline bool IsMCVar(unsigned char const& key)
605  {
606  return (key > fnex::kFake_Weight);
607  }
608 
609  //----------------------------------------------------------------------------
610  // Helper function to identify MC related variables
611  inline bool IsMCVar(std::string const& name)
612  {
613  return fnex::IsMCVar(fnex::VarNameToKey(name));
614  }
615 
616  //----------------------------------------------------------------------------
617  inline bool IsDataVar(unsigned char const& key)
618  {
619  return (key > 0 && key <= fnex::kFake_Weight);
620  }
621 
622  //----------------------------------------------------------------------------
623  // Helper function to identify MC related variables
624  inline bool IsDataVar(std::string const& name)
625  {
626  return fnex::IsDataVar(fnex::VarNameToKey(name));
627  }
628 
629  struct TruthVars{
630 
632  : fTrueE (std::numeric_limits<float>::min())
633  , fTruePDG (std::numeric_limits<float>::min())
634  , fTrueCCNC (std::numeric_limits<float>::min())
635  , fTrueIntType (std::numeric_limits<float>::min())
636  , fTruePDGOrig (std::numeric_limits<float>::min())
637  , fTrueParentPDG (std::numeric_limits<float>::min())
638  , fTrueParentPT (std::numeric_limits<float>::min())
639  , fTrueParentPZ (std::numeric_limits<float>::min())
640  , fTrueParentDecay (std::numeric_limits<float>::min())
641  , fTrueParentTargetPDG(std::numeric_limits<float>::min())
642  , fTrueHitNuc (std::numeric_limits<float>::min())
643  , fTrueIntMode (std::numeric_limits<float>::min())
644  {}
645 
646  float fTrueE; ///< True nu energy
647  float fTruePDG; ///< true PDG
648  float fTrueCCNC; ///< true cc vs nc
649  float fTrueIntType; ///< true interaction type
650  float fTruePDGOrig; ///< true PDG of original neutrino
651  float fTrueParentPDG; ///< true PDG of neutrino parent
652  float fTrueParentPT; ///< true p_T of neutrino parent
653  float fTrueParentPZ; ///< true p_Z of neutrino parent
654  float fTrueParentDecay; ///< true parent decay mode
655  float fTrueParentTargetPDG; ///< true parent pdg code off the target
656  float fTrueHitNuc; ///< true hit nucleus
657  float fTrueIntMode; ///< true interaction mode
658  };
659 
660  struct EventId{
661 
663  : run (std::numeric_limits<int>::min())
664  , subrun(std::numeric_limits<int>::min())
665  , event (std::numeric_limits<int>::min())
666  , cycle (std::numeric_limits<int>::min())
667  , slice (std::numeric_limits<int>::min())
668  {}
669 
670  EventId(int r,
671  int s,
672  int e,
673  int c,
674  int slc)
675  : run (r)
676  , subrun(s)
677  , event (e)
678  , cycle (c)
679  , slice (slc)
680  {}
681 
682  int run;
683  int subrun;
684  int event;
685  int cycle;
686  int slice;
687 
688  friend std::ostream& operator << (std::ostream & o, fnex::EventId const& evid);
689 
690  bool operator<(EventId const& evid) const;
691  bool operator==(EventId const& evid) const;
692 
693  };
694 
695  struct DataVars{
696 
697  // initialize the Fake_Weight to be 1, it will be reset if Fake_Data are generated
699 // : fNuE_LID (std::numeric_limits<float>::min())
700 // , fNuE_LEM (std::numeric_limits<float>::min())
701  : fNuE_CVN (std::numeric_limits<float>::min())
702  , fNuE_NumMichel (std::numeric_limits<float>::min())
703  , fHad_RecoE (std::numeric_limits<float>::min())
704  , fLep_RecoE (std::numeric_limits<float>::min())
705  , fLep_RecoE_MCFrac(0.)
706  , fRecoQ2 (std::numeric_limits<float>::min())
707  , fFake_Weight (1.)
708  {}
709 
710  DataVars(float nuecvn,
711  float nuenummichel,
712  float hadrece,
713  float leprece,
714  float leprecemcfrac,
715  float recoQ2,
716  float fakewgt)
717  : fNuE_CVN (nuecvn)
718  , fNuE_NumMichel (nuenummichel)
719  , fHad_RecoE (hadrece)
720  , fLep_RecoE (leprece)
721  , fLep_RecoE_MCFrac(leprecemcfrac)
722  , fRecoQ2 (recoQ2)
723  , fFake_Weight (fakewgt)
724  {}
725 
726 
727 // float fNuE_LID; ///< LID PID value, comment out in favor of CVN
728 // float fNuE_LEM; ///< LEM PID value, comment out in favor of CVN
729  float fNuE_CVN; ///<
730  float fNuE_NumMichel; ///<
731  float fHad_RecoE; ///<
732  float fLep_RecoE; ///<
733  float fLep_RecoE_MCFrac; ///< fraction of leptonic energy in muon catcher
734  float fRecoQ2; ///< reconstructed Q^2
735  float fFake_Weight; ///< Weight for fake data events
736  };
737 
738  // set the default values to be unity, ie no weighting applied
739  struct WeightVars{
740 
742  : fXSecCVPPFX_Weight(1.)
743  , fRPACCQE_Weight(1.)
744  , fRPARES_Weight(1.)
745  , fDISvnCC1pi_Weight(1.)
746  , fEmpiricalMEC_Weight(1.)
747  , fEmpiricalMECtoGENIEQE_Weight(1.)
748  , fEmpiricalMECtoGENIERES_Weight(1.)
749  , fOtherDIS_Weight(1.)
750  {}
751 
752  float fXSecCVPPFX_Weight; ///< Was Tufts weight for SA
753  float fRPACCQE_Weight; ///<
754  float fRPARES_Weight; ///< To be used for systematic evaluation ONLY
755  float fDISvnCC1pi_Weight; ///< To be used for systematic evaluation ONLY
756  float fEmpiricalMEC_Weight; ///< Ditto
759  float fOtherDIS_Weight; ///< Ditto
760  };
761 
762  // set the default values to be unity, ie no weighting applied
763  struct GENIEVar{
764 
766  : fMinus2Sigma(1.)
767  , fMinus1Sigma(1.)
768  , fPlus1Sigma (1.)
769  , fPlus2Sigma (1.)
770  {}
771 
774  float fPlus1Sigma ;
775  float fPlus2Sigma ;
776  };
777 
778  struct GENIEVars{
785 
786  //2018 edits: remove SumSmall, add newly used systs
787  //GENIEVar fSumSmallXSecJoint2017; ///< 7
794 
796 
797  GENIEVar GENIEVarByKey(unsigned char const varkey) const;
798 
799  // 2017: the variables below are just glommed into SumSmallXSecJoint2017, or not used at all
800  //GENIEVar fEtaNCEL; ///<
801  //GENIEVar fVecCCQE_shape; ///<
802  //GENIEVar fMaCOHpi; ///<
803  //GENIEVar fR0COHpi; ///<
804  //GENIEVar fRvpCC1pi; ///<
805  //GENIEVar fRvpCC2pi; ///<
806  //GENIEVar fRvpNC1pi; ///<
807  //GENIEVar fRvpNC2pi; ///<
808  //GENIEVar fRvnCC1pi; ///<
809  //GENIEVar fRvnCC2pi; ///<
810  //GENIEVar fRvnNC1pi; ///<
811  //GENIEVar fRvnNC2pi; ///<
812  //GENIEVar fRvbarpCC1pi; ///<
813  //GENIEVar fRvbarpCC2pi; ///<
814  //GENIEVar fRvbarpNC1pi; ///<
815  //GENIEVar fRvbarpNC2pi; ///<
816  //GENIEVar fRvbarnCC1pi; ///<
817  //GENIEVar fRvbarnCC2pi; ///<
818  //GENIEVar fRvbarnNC1pi; ///<
819  //GENIEVar fRvbarnNC2pi; ///<
820  //GENIEVar fAhtBY; ///<
821  //GENIEVar fBhtBY; ///<
822  //GENIEVar fCV1uBY; ///<
823  //GENIEVar fCV2uBY; ///<
824  //GENIEVar fAGKY_xF1pi; ///<
825  //GENIEVar fAGKY_pT1pi; ///<
826  //GENIEVar fMFP_pi; ///<
827  //GENIEVar fBR1gamma; ///<
828  //GENIEVar fBR1eta; ///<
829  //GENIEVar fTheta_Delta2Npi; ///<
830 
831  // the following GENIE knobs are not currently used in the analysis, so
832  // remove them to save the memory of storing them and their 4 sigma values
833 // GENIEVar fNormCCQE_EnuDep; ///<
834 // GENIEVar fMaCCQE; ///<
835 // GENIEVar fNormCCRES; ///<
836 // GENIEVar fMaCCRES_shape; ///<
837 // GENIEVar fMvCCRES_shape; ///<
838 // GENIEVar fNormNCRES; ///<
839 // GENIEVar fAhtBYshape; ///<
840 // GENIEVar fBhtBYshape; ///<
841 // GENIEVar fCV1uBYshape; ///<
842 // GENIEVar fCV2uBYshape; ///<
843 // GENIEVar fNC; ///<
844 // GENIEVar fMFP_N; ///<
845 
846  /* GENIEVar fMaNCEL; ///< 1 */
847  /* GENIEVar fNormCCQE; ///< 2 */
848  /* GENIEVar fMaCCQE_shape; ///< 3 */
849  /* GENIEVar fMaCCRES; ///< 4 */
850  /* GENIEVar fMvCCRES; ///< 5 */
851  /* GENIEVar fMaNCRES; ///< 6 */
852  /* GENIEVar fMvNCRES; ///< 7 */
853  /* GENIEVar fNormDISCC; ///< 8 */
854  /* GENIEVar fRnubarnuCC; ///< 9 */
855  /* GENIEVar fDISNuclMod; ///< 10 */
856  /* GENIEVar fFormZone; ///< 11 */
857  /* GENIEVar fFrCEx_pi; ///< 12 */
858  /* GENIEVar fFrElas_pi; ///< 13 */
859  /* GENIEVar fFrInel_pi; ///< 14 */
860  /* GENIEVar fFrAbs_pi; ///< 15 */
861  /* GENIEVar fFrPiProd_pi; ///< 16 */
862  /* GENIEVar fFrCEx_N; ///< 17 */
863  /* GENIEVar fFrElas_N; ///< 18 */
864  /* GENIEVar fFrInel_N; ///< 19 */
865  /* GENIEVar fFrAbs_N; ///< 20 */
866  /* GENIEVar fFrPiProd_N; ///< 21 */
867  /* GENIEVar fCCQEPauliSupViaKF; ///< 22 */
868  /* GENIEVar fCCQEMomDistroFGtoSF; ///< 23 */
869 
870 
871  };
872 
873  /// \brief Base container for the MC related Vars that constitute an event.
874  class MCVarVals
875  {
876  private:
880 
881  void SetGENIEVarVal(GENIEVar & var,
882  std::string const& sigma,
883  float const& wgts);
884 
885  public:
886  MCVarVals () = default;
888  fnex::WeightVars const& wv,
889  fnex::GENIEVars const& gv)
890  : fTruthVars (tv)
891  , fWeightVars(wv)
892  , fGENIEVars (gv)
893  {}
895  fnex::WeightVars const& wv,
896  std::vector<fnex::GENIEVar> const& gv)
897  : fTruthVars (tv)
898  , fWeightVars(wv)
899  { this->set_GENIEVars(gv); }
900 
901  /// Access a Var by name.
902  float val_at(unsigned char const& varkey) const;
903  float val_at(std::string const& varkey) const;
904 
905  void set_val_at(std::string const& varkey,
906  float const& val);
907  void set_val_at(unsigned char const& varkey,
908  float const& val);
909 
910  void set_GENIEVars(std::vector<fnex::GENIEVar> const& gv);
911  void set_GENIEWgt(unsigned char const& varkey,
912  std::string const& sigma,
913  float const& wgt);
914  void set_GENIEWgt(std::string const& varname,
915  std::string const& sigma,
916  float const& wgt);
917  std::map<float, float> GENIEWgts(unsigned char const& varkey);
918  std::map<float, float> GENIEWgts(std::string const& varname);
919 
920  friend std::ostream& operator << (std::ostream & o, fnex::MCVarVals const& mcvv);
921 
922  // The following functions should only be used for making eventlist trees
923  fnex::TruthVars const& TruthVars() const { return fTruthVars; }
924  fnex::WeightVars const& WeightVars() const { return fWeightVars; }
925  fnex::GENIEVars const& GENIEVars() const { return fGENIEVars; }
926 
927  };
928 
929  /// \brief Base container for the MC related Vars that constitute an event.
931  {
932  private:
933 
934  float NuRecoEVal(fnex::MetaData const& md) const;
935  float NuRecoEVal2017(fnex::MetaData const& md) const;
936  float NuRecoEVal2018(fnex::MetaData const& md) const;
937 
939 
940  public:
941  DataVarVals () = default;
942 
944  : fDataVars(dv)
945  {}
946 
947  /// Access a Var by name.
948  /// Throws if the var doesn't exist
949  float val_at(unsigned char const& varkey,
950  fnex::MetaData const& md) const;
951  float val_at(std::string const& varkey,
952  fnex::MetaData const& md) const;
953 
954  void set_val_at(std::string const& varkey,
955  float const& val);
956  void set_val_at(unsigned char const& varkey,
957  float const& val);
958 
959  friend std::ostream& operator << (std::ostream & o, fnex::DataVarVals const& dvv);
960 
961  // The following function should only be used for making eventlist trees
962  fnex::DataVars const& DataVars() const { return fDataVars; }
963 
964  };
965 
966 } /* namespace fnex */
967 
968 //----------------------------------------------------------------------------
970  std::string const& sigma,
971  float const& wgt)
972 {
973  // the weights are constructed as 1 for each sigma. Multiply by the passed
974  // value because the SumSmallXSecJoint2017 is the product of all the components
976  else if(fnex::VarNameToKey(sigma) == fnex::kMinus1Sigma) var.fMinus1Sigma *= wgt;
977  else if(fnex::VarNameToKey(sigma) == fnex::kPlus1Sigma ) var.fPlus1Sigma *= wgt;
978  else if(fnex::VarNameToKey(sigma) == fnex::kPlus2Sigma ) var.fPlus2Sigma *= wgt;
979  else
980  LOG_WARNING("MCVarVals")
981  << "GENIE var sigma "
982  << sigma
983  << "is not recognized, will not set weight";
984 
985  return;
986 }
987 
988 
989 
990 #endif /* FNEX_CORE_VARVALS_H_ */
float fTrueCCNC
true cc vs nc
Definition: VarVals.h:648
unsigned char VarNameToKey(std::string const &name)
Definition: VarVals.h:279
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
fnex::WeightVars fWeightVars
Definition: VarVals.h:878
const XML_Char * name
Definition: expat.h:151
static const unsigned char kNu_RecoE
Definition: VarVals.h:36
void latex(double x, double y, std::string txt, double ang=0, int align=22, double size=0.042)
static const unsigned char kEtaNCEL
Definition: VarVals.h:86
static const unsigned char kNuE_CVN
Definition: VarVals.h:32
static const unsigned char kTheta_Delta2Npi
Definition: VarVals.h:111
GENIEVar fMaCCQE
1
Definition: VarVals.h:779
static const unsigned char kRnubarnuCC
Definition: VarVals.h:96
float fNuE_CVN
Definition: VarVals.h:729
float fPlus1Sigma
Definition: VarVals.h:774
float fLep_RecoE
Definition: VarVals.h:732
static const unsigned char kMaCOHpi
Definition: VarVals.h:89
static const unsigned char kFrElas_N
Definition: VarVals.h:79
static const unsigned char kMinus1Sigma
Definition: VarVals.h:66
static const unsigned char kEmpiricalMEC_Weight
Definition: VarVals.h:60
static const unsigned char kCCQEMomDistroFGtoSF
Definition: VarVals.h:108
static const unsigned char kTrueParentPT
Definition: VarVals.h:48
static const unsigned char kOtherDIS_Weight
Definition: VarVals.h:63
static const unsigned char kFrPiProd_N
Definition: VarVals.h:107
static const unsigned char kNu_RecoE_NuE_Peripheral
Definition: VarVals.h:119
GENIEVar fMaCCRES
2
Definition: VarVals.h:780
static const unsigned char kMvCCRES
Definition: VarVals.h:73
static const unsigned char kDISvnCC1pi_Weight
Definition: VarVals.h:59
Base container for the MC related Vars that constitute an event.
Definition: VarVals.h:930
static const unsigned char kMaNCRES
Definition: VarVals.h:72
static const unsigned char kEmpiricalMECtoGENIERES_Weight
Definition: VarVals.h:62
static const unsigned char kFrElas_pi
Definition: VarVals.h:103
GENIEVar fRPACCQEshapeEnh
5
Definition: VarVals.h:783
float fXSecCVPPFX_Weight
Was Tufts weight for SA.
Definition: VarVals.h:752
static const unsigned char kUnknownVar
Definition: VarVals.h:27
static const unsigned char kMvNCRES
Definition: VarVals.h:88
static const unsigned char kVecCCQE_shape
Definition: VarVals.h:87
static const unsigned char kRecoQ2
Definition: VarVals.h:38
static const unsigned char kRPACCQEshapeSupp
Definition: VarVals.h:75
static const unsigned char kXSecCVPPFX_Weight
Definition: VarVals.h:56
bool isUnusedGENIEName(std::string const &varname)
Definition: VarVals.h:238
static const unsigned char kNu_RecoE_Quantiles_NuMu
Definition: VarVals.h:118
static const unsigned char kTrueHitNuc
Definition: VarVals.h:52
MCVarVals(fnex::TruthVars const &tv, fnex::WeightVars const &wv, std::vector< fnex::GENIEVar > const &gv)
Definition: VarVals.h:894
static const unsigned char kBR1gamma
Definition: VarVals.h:109
static const unsigned char kFormZone
Definition: VarVals.h:76
fnex::GENIEVars const & GENIEVars() const
Definition: VarVals.h:925
GENIEVar fDefault
Definition: VarVals.h:795
static const unsigned char kFake_Weight
Definition: VarVals.h:39
Create a list of fnex::Events to be used in fits.
static const unsigned char kFrAbs_N
Definition: VarVals.h:80
float fTruePDGOrig
true PDG of original neutrino
Definition: VarVals.h:650
float fTrueIntMode
true interaction mode
Definition: VarVals.h:657
fnex::TruthVars fTruthVars
Definition: VarVals.h:877
float fRPACCQE_Weight
Definition: VarVals.h:753
static const unsigned char kTrueParentPDG
Definition: VarVals.h:47
static const unsigned char kMaNCEL
Definition: VarVals.h:85
static const unsigned char kRPARES_Weight
Definition: VarVals.h:58
GENIEVar fFrElas_N
10
Definition: VarVals.h:791
float fTrueParentPZ
true p_Z of neutrino parent
Definition: VarVals.h:653
static const unsigned char kBhtBY
Definition: VarVals.h:92
fnex::DataVars const & DataVars() const
Definition: VarVals.h:962
GENIEVar fFormZone
7
Definition: VarVals.h:788
static const unsigned char kLep_RecoE_UBL
Definition: VarVals.h:115
float fOtherDIS_Weight
Ditto.
Definition: VarVals.h:759
static const unsigned char kTruePDGOrig
Definition: VarVals.h:46
static const unsigned char kNormDISCC
Definition: VarVals.h:95
static const unsigned char kTrueCCNC
Definition: VarVals.h:44
float fTrueHitNuc
true hit nucleus
Definition: VarVals.h:656
const XML_Char * s
Definition: expat.h:262
GENIEVar fFrAbs_N
11
Definition: VarVals.h:792
void SetGENIEVarVal(GENIEVar &var, std::string const &sigma, float const &wgts)
Definition: VarVals.h:969
float fNuE_NumMichel
Definition: VarVals.h:730
float fLep_RecoE_MCFrac
fraction of leptonic energy in muon catcher
Definition: VarVals.h:733
fnex::TruthVars const & TruthVars() const
Definition: VarVals.h:923
float fTrueParentTargetPDG
true parent pdg code off the target
Definition: VarVals.h:655
fnex::DataVars fDataVars
Definition: VarVals.h:938
static const unsigned char kDISNuclMod
Definition: VarVals.h:97
float fRecoQ2
reconstructed Q^2
Definition: VarVals.h:734
float fHad_RecoE
Definition: VarVals.h:731
GENIEVar fFrCEx_N
9
Definition: VarVals.h:790
static const unsigned char kAGKY_pT1pi
Definition: VarVals.h:99
static const unsigned char kPlus1Sigma
Definition: VarVals.h:67
static const unsigned char kCV1uBY
Definition: VarVals.h:93
static const unsigned char kLep_RecoE_MCFrac
Definition: VarVals.h:37
float fTruePDG
true PDG
Definition: VarVals.h:647
std::string KeyToLatex(unsigned char const &varkey)
Definition: VarVals.h:593
static const unsigned char kMaCCQE
Definition: VarVals.h:70
static const unsigned char kNuE_NumMichel
Definition: VarVals.h:33
GenericCut< T > operator<(double c, const GenericVar< T > &v)
Definition: Var.h:153
float fFake_Weight
Weight for fake data events.
Definition: VarVals.h:735
DataVarVals(fnex::DataVars const &dv)
Definition: VarVals.h:943
float fEmpiricalMEC_Weight
Ditto.
Definition: VarVals.h:756
static const unsigned char kCCQEPauliSupViaKF
Definition: VarVals.h:81
float fRPARES_Weight
To be used for systematic evaluation ONLY.
Definition: VarVals.h:754
float fPlus2Sigma
Definition: VarVals.h:775
static const unsigned char kTrueIntType
Definition: VarVals.h:45
std::ostream & operator<<(std::ostream &o, fnex::Event const &event)
Definition: Event.cxx:27
bool operator==(FC &A, FC &B)
static const unsigned char kFrAbs_pi
Definition: VarVals.h:104
static const unsigned char kTrueParentDecay
Definition: VarVals.h:50
const ana::Var wgt
MCVarVals(fnex::TruthVars const &tv, fnex::WeightVars const &wv, fnex::GENIEVars const &gv)
Definition: VarVals.h:887
double sigma(TH1F *hist, double percentile)
Definition: run.py:1
static const unsigned char kR0COHpi
Definition: VarVals.h:90
#define LOG_WARNING(category)
static const unsigned char kFrPiProd_pi
Definition: VarVals.h:105
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
static const unsigned char kTrueParentTargetPDG
Definition: VarVals.h:51
static const unsigned char kSumSmallXSecJoint2017
Definition: VarVals.h:84
static const unsigned char kFrInel_pi
Definition: VarVals.h:77
static const unsigned char kMFP_N
Definition: VarVals.h:101
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
EventId(int r, int s, int e, int c, int slc)
Definition: VarVals.h:670
static const unsigned char kBR1eta
Definition: VarVals.h:110
static const unsigned char kEmpiricalMECtoGENIEQE_Weight
Definition: VarVals.h:61
bool IsMCVar(unsigned char const &key)
Definition: VarVals.h:604
bool IsDataVar(unsigned char const &key)
Definition: VarVals.h:617
static const unsigned char kCV2uBY
Definition: VarVals.h:94
static const unsigned char kRPACCQE_Weight
Definition: VarVals.h:57
float fTrueE
True nu energy.
Definition: VarVals.h:646
fnex::WeightVars const & WeightVars() const
Definition: VarVals.h:924
DataVars(float nuecvn, float nuenummichel, float hadrece, float leprece, float leprecemcfrac, float recoQ2, float fakewgt)
Definition: VarVals.h:710
static const unsigned char kMFP_pi
Definition: VarVals.h:100
static const unsigned char kMinus2Sigma
Definition: VarVals.h:65
static const unsigned char kTrueE
Definition: VarVals.h:42
static const unsigned char kPlus2Sigma
Definition: VarVals.h:68
GENIEVar fMvCCRES
4
Definition: VarVals.h:782
static const unsigned char kAhtBY
Definition: VarVals.h:91
float fTrueIntType
true interaction type
Definition: VarVals.h:649
TRandom3 r(0)
float fMinus2Sigma
Definition: VarVals.h:772
bool isSumSmallXSecJoint2017Name(std::string const &varname)
Definition: VarVals.h:193
static const unsigned char kAGKY_xF1pi
Definition: VarVals.h:98
static const unsigned char kHad_RecoE
Definition: VarVals.h:34
GENIEVar fRPACCQEshapeSupp
6
Definition: VarVals.h:784
std::string KeyToVarName(unsigned char const &key)
Definition: VarVals.h:445
static const unsigned char kTrueIntMode
Definition: VarVals.h:53
static const unsigned char kFrCEx_N
Definition: VarVals.h:78
float fEmpiricalMECtoGENIERES_Weight
Ditto.
Definition: VarVals.h:758
static const unsigned char kFrCEx_pi
Definition: VarVals.h:102
float fMinus1Sigma
Definition: VarVals.h:773
static const unsigned char kRPACCQEshapeEnh
Definition: VarVals.h:74
float fDISvnCC1pi_Weight
To be used for systematic evaluation ONLY.
Definition: VarVals.h:755
Float_t e
Definition: plot.C:35
static const unsigned char kMaCCRES
Definition: VarVals.h:71
static const unsigned char kLep_RecoE
Definition: VarVals.h:35
bool isSumSmallXSecJoint2017Key(unsigned char const &varkey)
Definition: VarVals.h:151
float fEmpiricalMECtoGENIEQE_Weight
Ditto.
Definition: VarVals.h:757
float fTrueParentDecay
true parent decay mode
Definition: VarVals.h:654
float fTrueParentPT
true p_T of neutrino parent
Definition: VarVals.h:652
static const unsigned char kNu_RecoE_UBL
Definition: VarVals.h:117
static const unsigned char kTrueParentPZ
Definition: VarVals.h:49
Base container for the MC related Vars that constitute an event.
Definition: VarVals.h:874
fnex::GENIEVars fGENIEVars
Definition: VarVals.h:879
static const unsigned char kHad_RecoE_UBL
Definition: VarVals.h:116
static const unsigned char kFrInel_N
Definition: VarVals.h:106
GENIEVar fFrInel_pi
8
Definition: VarVals.h:789
GENIEVar fMaNCRES
3
Definition: VarVals.h:781
GENIEVar fCCQEPauliSupViaKF
12
Definition: VarVals.h:793
float fTrueParentPDG
true PDG of neutrino parent
Definition: VarVals.h:651
static const unsigned char kTruePDG
Definition: VarVals.h:43