StaticFuncs.h
Go to the documentation of this file.
1 //
2 // Created by Brian Rebel on 10/31/19.
3 //
4 
5 #ifndef COVARIANCEMATRIXFIT_STATICFUNCS_H
6 #define COVARIANCEMATRIXFIT_STATICFUNCS_H
7 
9 #include "NovaDAQConventions/DAQConventions.h"
10 
12 
13 namespace cmf{
14 
15  static inline long DetectorTypeKey (cmf::DetType_t const& det) { return det * 1000000000; }
16  static inline long PeriodKey (long const& ep ) { return ep * 10000000; }
17  static inline long FileTypeKey (cmf::FileType_t const& ft ) { return (ft + 1) * 100000; }
18  static inline long BeamTypeKey (cmf::BeamType_t const& bt ) { return (bt + 1) * 10000; }
19  static inline long SelectionTypeKey (cmf::SelectionType_t const& st ) { return (st + 1) * 100; }
20  static inline long InteractionTypeKey(cmf::InteractionType_t const& it ) { return it * 1; }
21 
23  cmf::BeamType_t const& bt,
24  cmf::SelectionType_t const& sel);
25 
26  static cmf::DetType_t KeyToDetectorType (long const& key);
27  static int KeyToEpoch (long const& key);
28  static cmf::FileType_t KeyToFileType (long const& key);
29  static cmf::BeamType_t KeyToBeamType (long const& key);
30  static cmf::SelectionType_t KeyToSelectionType (long const& key);
31  static cmf::InteractionType_t KeyToInteractionType(long const& key);
32  static std::string KeyToString (long const& key);
33 
34  static int BeamToPeriod(cmf::BeamType_t const& beam);
35 
37  static cmf::BeamType_t StringToBeamType (std::string const& str);
42 
43  static cmf::BeamType_t PeriodToBeamType(std::string const& str);
44 
45  static bool IsOscillationParameter(std::string const& str);
46  static bool IsAngleParameter(cmf::OscParm_t const& par);
47 
48  static bool IsNuMuSelected (cmf::SelectionType_t const& sel);
49  static bool IsNuMuQuantiles(cmf::SelectionType_t const& sel);
50  static bool IsNuESelected (cmf::SelectionType_t const& sel);
51 
52  static uint8_t VarNameToKey(std::string const& name);
53  static std::string KeyToVarName(uint8_t const& key );
54 
55 }
56 
57 //------------------------------------------------------------------------------
59  cmf::BeamType_t const& bt,
60  cmf::SelectionType_t const& sel)
61 {
63 }
64 
65 //------------------------------------------------------------------------------
66 inline static cmf::DetType_t cmf::KeyToDetectorType(long const& key)
67 {
68  if(key < 1000000000) return cmf::kUnknownDet;
69 
70  LOG_DEBUG("StaticFuncs")
71  << "KeyToDetector: "
72  << key
73  << " "
74  << (key / 1000000000);
75 
76  return (cmf::DetType_t)(key / 1000000000);
77 }
78 
79 //------------------------------------------------------------------------------
80 inline static int cmf::KeyToEpoch(long const& key)
81 {
82  auto detType = cmf::KeyToDetectorType(key);
83 
84  long tmpKey = key;
85  if(detType != cmf::kUnknownDet) tmpKey -= cmf::DetectorTypeKey(detType);
86 
87  if(tmpKey < 10000000) return 0;
88 
89  LOG_DEBUG("StaticFuncs")
90  << "KeyToEpoch: "
91  << key
92  << " "
93  << detType
94  << "/"
95  << cmf::DetectorTypeKey(detType)
96  << " "
97  << tmpKey
98  << " "
99  << (tmpKey / 10000000);
100 
101  return (tmpKey / 10000000);
102 }
103 
104 //------------------------------------------------------------------------------
105 inline static cmf::FileType_t cmf::KeyToFileType(long const& key)
106 {
107  auto detType = cmf::KeyToDetectorType(key);
108  auto epoch = cmf::KeyToEpoch(key);
109 
110  // if the epoch is not part of the key, KeyToEpoch returns 0
111  long tmpKey = key - cmf::PeriodKey(epoch);
112  if(detType != cmf::kUnknownDet) tmpKey -= cmf::DetectorTypeKey(detType);
113 
114  if(tmpKey < 100000) return cmf::kUnknownFileType;
115 
116  LOG_DEBUG("StaticFuncs")
117  << "KeyToFile: "
118  << key
119  << " "
120  << detType
121  << "/"
122  << cmf::DetectorTypeKey(detType)
123  << " "
124  << tmpKey
125  << " "
126  << (tmpKey / 100000) - 1;
127 
128  return (cmf::FileType_t)((tmpKey / 100000) - 1);
129 }
130 
131 //------------------------------------------------------------------------------
132 inline static cmf::BeamType_t cmf::KeyToBeamType(long const& key)
133 {
134  auto detType = cmf::KeyToDetectorType(key);
135  auto fileType = cmf::KeyToFileType(key);
136  auto epoch = cmf::KeyToEpoch(key);
137 
138  long tmpKey = key - cmf::PeriodKey(epoch);
139 
140  if(detType != cmf::kUnknownDet ) tmpKey -= cmf::DetectorTypeKey(detType);
142 
143  if(tmpKey < 10000) return cmf::kUnknownBeam;
144 
145  LOG_DEBUG("StaticFuncs")
146  << "KeyToBeam: "
147  << key
148  << " "
149  << detType
150  << "/"
151  << cmf::DetectorTypeKey(detType)
152  << " "
153  << fileType
154  << "/"
156  << " "
157  << tmpKey
158  << " "
159  << (tmpKey / 10000) - 1;
160 
161 
162  return (cmf::BeamType_t)((tmpKey / 10000) - 1);
163 }
164 
165 //------------------------------------------------------------------------------
167 {
168  auto detType = cmf::KeyToDetectorType(key);
169  auto beamType = cmf::KeyToBeamType(key);
170  auto fileType = cmf::KeyToFileType(key);
171  auto epoch = cmf::KeyToEpoch(key);
172 
173  long tmpKey = key - cmf::PeriodKey(epoch);
174  if(detType != cmf::kUnknownDet ) tmpKey -= cmf::DetectorTypeKey(detType);
175  if(beamType != cmf::kUnknownBeam ) tmpKey -= cmf::BeamTypeKey(beamType);
177 
178  if(tmpKey < 100) return cmf::kUnknownSelection;
179 
180  LOG_DEBUG("StaticFuncs")
181  << "KeyToSelection: "
182  << key
183  << " "
184  << detType
185  << "/"
186  << cmf::DetectorTypeKey(detType)
187  << " "
188  << beamType
189  << "/"
190  << cmf::BeamTypeKey(beamType)
191  << " "
192  << fileType
193  << "/"
195  << " "
196  << tmpKey
197  << " "
198  << (tmpKey / 100) - 1;
199 
200  return (cmf::SelectionType_t)((tmpKey / 100) - 1);
201 }
202 
203 //------------------------------------------------------------------------------
205 {
206  auto detType = cmf::KeyToDetectorType(key);
207  auto beamType = cmf::KeyToBeamType(key);
208  auto fileType = cmf::KeyToFileType(key);
209  auto selType = cmf::KeyToSelectionType(key);
210  auto epoch = cmf::KeyToEpoch(key);
211 
212  long tmpKey = key - cmf::PeriodKey(epoch);
213  if(detType != cmf::kUnknownDet ) tmpKey -= cmf::DetectorTypeKey(detType);
214  if(beamType != cmf::kUnknownBeam ) tmpKey -= cmf::BeamTypeKey(beamType);
216  if(selType != cmf::kUnknownSelection) tmpKey -= cmf::SelectionTypeKey(selType);
217 
218  if(tmpKey < 1) return cmf::kUnknownInteraction;
219 
220  return (cmf::InteractionType_t)(tmpKey);
221 }
222 
223 //------------------------------------------------------------------------------
224 inline static std::string cmf::KeyToString(long const& key)
225 {
227  "Period" +
233 }
234 
235 //------------------------------------------------------------------------------
236 inline static int cmf::BeamToPeriod(cmf::BeamType_t const& beam)
237 {
238  if (beam == cmf::kFHC) return 1;
239  else if(beam == cmf::kRHC) return 4;
240 
241  return 0;
242 }
243 
244 //------------------------------------------------------------------------------
246 {
247  if (str == "NuESel_LowPID" ) return cmf::kNuESelectionLowPID;
248  else if(str == "NuESel_HighPID" ) return cmf::kNuESelectionHighPID;
249  else if(str == "NuESel_Peripheral") return cmf::kNuESelectionPeripheral;
250  else if(str == "NuESel_AllPID" ) return cmf::kNuESelection;
251  else if(str == "NuMuSel" ) return cmf::kNuMuSelection;
252  else if(str == "NuMuSelQ1" ) return cmf::kNuMuSelectionQ1;
253  else if(str == "NuMuSelQ2" ) return cmf::kNuMuSelectionQ2;
254  else if(str == "NuMuSelQ3" ) return cmf::kNuMuSelectionQ3;
255  else if(str == "NuMuSelQ4" ) return cmf::kNuMuSelectionQ4;
256  else if(str == "NCSel" ) return cmf::kNCSelection;
257 
258  return cmf::kUnknownSelection;
259 }
260 
261 //------------------------------------------------------------------------------
263 {
264  if (str == "RHC") return cmf::kRHC;
265  else if(str == "FHC") return cmf::kFHC;
266 
267  return cmf::kUnknownBeam;
268 }
269 
270 //------------------------------------------------------------------------------
272 {
273  if (str.find("Near") != std::string::npos) return cmf::kNEARDET;
274  else if(str.find("Far") != std::string::npos) return cmf::kFARDET;
275 
276  return cmf::kUnknownDet;
277 }
278 
279 //------------------------------------------------------------------------------
281 {
282  for(int i = 0; i < (int)cmf::kNumOscParams; ++i){
283  if(str == cmf::cOscParams_Strings[i]) return (cmf::OscParm_t)i;
284  }
285 
286  LOG_WARNING("StringToOscParmType")
287  << str
288  << " not found in list for oscillation parameters, returning max enumeration";
289 
290  return cmf::kNumOscParams;
291 }
292 
293 //------------------------------------------------------------------------------
295 {
296  if (str == "CovMat" ) return cmf::kCovMat;
297  else if(str == "CNP" ) return cmf::kCNP;
298  else if(str == "Gauss" ) return cmf::kGauss;
299  else if(str == "Poisson") return cmf::kPoisson;
300 
301  return cmf::kUnknownChiSqr;
302 }
303 
304 //------------------------------------------------------------------------------
306 {
307  if (str == "Asimov" ) return cmf::kAsimovContour;
308  else if(str == "Median" ) return cmf::kMedianContour;
309  else if(str == "FC" ) return cmf::kFCContour;
310  else if(str == "Data" ) return cmf::kDataContour;
311 
312  return cmf::kUnknownContour;
313 }
314 
315 //------------------------------------------------------------------------------
317 {
318 
319  if (str.find("102") != std::string::npos) return cmf::BeamType_t::kRHC;
320  else if (str.find("101") != std::string::npos) return cmf::BeamType_t::kFHC;
321  else if (str.find("10") != std::string::npos) return cmf::BeamType_t::kFHC;
322  else if (str.find("9") != std::string::npos) return cmf::BeamType_t::kFHC;
323  else if (str.find("8") != std::string::npos) return cmf::BeamType_t::kRHC;
324  else if (str.find("7") != std::string::npos) return cmf::BeamType_t::kRHC;
325  else if (str.find("6") != std::string::npos) return cmf::BeamType_t::kRHC;
326  else if (str.find("5") != std::string::npos) return cmf::BeamType_t::kFHC;
327  else if (str.find("4") != std::string::npos) return cmf::BeamType_t::kRHC;
328  else if (str.find("3") != std::string::npos) return cmf::BeamType_t::kFHC;
329  else if (str.find("2") != std::string::npos) return cmf::BeamType_t::kFHC;
330  else if (str.find("1") != std::string::npos) return cmf::BeamType_t::kFHC;
331  else return cmf::BeamType_t::kUnknownBeam;
332 
333 }
334 
335 //------------------------------------------------------------------------------
336 inline static bool cmf::IsOscillationParameter(const std::string &str)
337 {
338  for(int i = 0; i < cmf::kNumOscParams; ++i){
339  if(str == cmf::cOscParams_Strings[i]) return true;
340  }
341 
342  return false;
343 }
344 
345 //------------------------------------------------------------------------------
346 inline static bool cmf::IsAngleParameter(cmf::OscParm_t const& par)
347 {
348  if(par == cmf::kTh13 ||
349  par == cmf::kTh23 ||
350  par == cmf::kTh14 ||
351  par == cmf::kTh24 ||
352  par == cmf::kTh34 ) return true;
353 
354  return false;
355 }
356 
357 //------------------------------------------------------------------------------
358 inline static bool cmf::IsNuMuSelected(cmf::SelectionType_t const& sel)
359 {
360  return (sel == cmf::kNuMuSelection ||
361  cmf::IsNuMuQuantiles(sel));
362 }
363 
364 //------------------------------------------------------------------------------
365 inline static bool cmf::IsNuMuQuantiles(cmf::SelectionType_t const& sel)
366 {
367  return (sel >= cmf::kNuMuSelectionQ1 &&
368  sel <= cmf::kNuMuSelectionQ4);
369 }
370 
371 //------------------------------------------------------------------------------
372 inline static bool cmf::IsNuESelected(cmf::SelectionType_t const& sel)
373 {
374  return (sel >= cmf::kNuESelection &&
376 }
377 
378 //-----------------------------------------------------------------------
379 // Helper function to turn a Variable Name string into the key for the map
380 // number the keys from 1, 0 is reserved for an undefined key
381 inline static uint8_t cmf::VarNameToKey(std::string const& name)
382 {
383  auto const& itr = cmf::kVarNameToKey.find(name);
384  if(itr != cmf::kVarNameToKey.end()) return itr->second;
385  // if (name.find("NuE_CVN") != std::string::npos) return cmf::kNuE_CVN;
386  // else if(name.find("NuE_NumMichel") != std::string::npos) return cmf::kNuE_NumMichel;
387  // else if(name.find("Had_RecoE") != std::string::npos) return cmf::kHad_RecoE;
388  // else if(name.find("Lep_RecoE") != std::string::npos) return cmf::kLep_RecoE;
389  // else if(name.find("Nu_RecoE") != std::string::npos) return cmf::kNu_RecoE;
390  // else if(name.find("Lep_RecoE_MCFrac") != std::string::npos) return cmf::kLep_RecoE_MCFrac;
391  // else if(name.find("Reco_Q2") != std::string::npos) return cmf::kRecoQ2;
392  // else if(name.find("Fake_Weight") != std::string::npos) return cmf::kFake_Weight;
393 
394  // else if(name.find("TrueE") != std::string::npos) return cmf::kTrueE;
395  // else if(name.find("TruePDG") != std::string::npos) return cmf::kTruePDG;
396  // else if(name.find("TrueCCNC") != std::string::npos) return cmf::kTrueCCNC;
397  // else if(name.find("TrueIntType") != std::string::npos) return cmf::kTrueIntType;
398  // else if(name.find("TruePDGOrig") != std::string::npos) return cmf::kTruePDGOrig;
399  // else if(name.find("TrueParentPDG") != std::string::npos) return cmf::kTrueParentPDG;
400  // else if(name.find("TrueParentPT") != std::string::npos) return cmf::kTrueParentPT;
401  // else if(name.find("TrueParentPZ") != std::string::npos) return cmf::kTrueParentPZ;
402  // else if(name.find("TrueParentDecay") != std::string::npos) return cmf::kTrueParentDecay;
403  // else if(name.find("TrueParentTargetPDG") != std::string::npos) return cmf::kTrueParentTargetPDG;
404  // else if(name.find("TrueHitNuc") != std::string::npos) return cmf::kTrueHitNuc;
405  // else if(name.find("TrueIntMode") != std::string::npos) return cmf::kTrueIntMode;
406 
407  // // TODO change XSecCVWgt to include PPFX label
408  // // else if(name.find("XsecCVWgt") != std::string::npos) return cmf::kXSecCVPPFX_Weight;
409  // else if(name.find("XsecCV2020") != std::string::npos) return cmf::kXSecCV2020Wgt;
410  // else if(name.find("PPFXFluxCV") != std::string::npos) return cmf::kPPFXFluxCVWgt;
411  // else if(name.find("RPARES") != std::string::npos) return cmf::kRPARES_Weight;
412 
413  // // Variables for the size of a shift
414  // else if(name.find("-2sigma") != std::string::npos) return cmf::kMinus2Sigma;
415  // else if(name.find("-1sigma") != std::string::npos) return cmf::kMinus1Sigma;
416  // else if(name.find("+1sigma") != std::string::npos) return cmf::kPlus1Sigma;
417  // else if(name.find("+2sigma") != std::string::npos) return cmf::kPlus2Sigma;
418 
419  // // Calibration
420  // else if(name.find("lightmodel-lightdown") != std::string::npos) return cmf::kLightModelLightDownCalibUp;
421  // else if(name.find("lightmodel-lightup") != std::string::npos) return cmf::kLightModelLightUpCalibDown;
422  // else if(name.find("ckv-proton") != std::string::npos) return cmf::kCkvProtonShiftDown;
423  // else if(name.find("RelativeCalibration") != std::string::npos) return cmf::kRelativeCalibration;
424  // else if(name.find("AbsoluteCalibration") != std::string::npos) return cmf::kAbsoluteCalibration;
425  // else if(name.find("CalibrationShape") != std::string::npos) return cmf::kCalibShape;
426 
427  // //GENIE knobs
428 
429  // // NC elastic parameters
430  // else if(name.find("MaNCEL") != std::string::npos) return cmf::kMaNCEL;
431  // else if(name.find("EtaNCEL") != std::string::npos) return cmf::kEtaNCEL;
432 
433  // // DIS tweaking parameters
434  // else if(name.find("AhtBY") != std::string::npos) return cmf::kAhtBY;
435  // else if(name.find("BhtBY") != std::string::npos) return cmf::kBhtBY;
436  // else if(name.find("CV1uBY") != std::string::npos) return cmf::kCV1uBY;
437  // else if(name.find("CV2uBY") != std::string::npos) return cmf::kCV2uBY;
438 
439  // // Hadronization (free nucleon target)
440  // else if(name.find("AGKY_xF1pi") != std::string::npos) return cmf::kAGKY_xF1pi;
441  // else if(name.find("AGKY_pT1pi") != std::string::npos) return cmf::kAGKY_pT1pi;
442 
443  // // Resonance decays
444  // else if(name.find("BR1gamma") != std::string::npos) return cmf::kBR1gamma;
445  // else if(name.find("BR1eta") != std::string::npos) return cmf::kBR1eta;
446  // else if(name.find("Theta_Delta2Npi") != std::string::npos) return cmf::kTheta_Delta2Npi;
447 
448  // else if(name.find("MvCCRES") != std::string::npos) return cmf::kMvCCRES;
449  // else if(name.find("MaCCRES") != std::string::npos) return cmf::kMaCCRES;
450  // else if(name.find("MaNCRES") != std::string::npos) return cmf::kMaNCRES;
451  // else if(name.find("RPACCQEshapeEnh") != std::string::npos) return cmf::kRPACCQEshapeEnh;
452  // else if(name.find("RPACCQEshapeSupp") != std::string::npos) return cmf::kRPACCQEshapeSupp;
453 
454  // // coherent scattering
455  // else if(name.find("COHCCScale2018") != std::string::npos) return cmf::kCOHCCScaleSyst2018;
456  // else if(name.find("COHNCScale2018") != std::string::npos) return cmf::kCOHNCScaleSyst2018;
457 
458  // // 2020
459  // else if(name.find("ZExpAxialFFSyst2020_eV1") != std::string::npos) return cmf::kZExpEV1Syst2020;
460  // else if(name.find("ZExpAxialFFSyst2020_eV2") != std::string::npos) return cmf::kZExpEV2Syst2020;
461  // else if(name.find("ZExpAxialFFSyst2020_eV3") != std::string::npos) return cmf::kZExpEV3Syst2020;
462  // else if(name.find("ZExpAxialFFSyst2020_eV4") != std::string::npos) return cmf::kZExpEV4Syst2020;
463  // else if(name.find("ZNormCCQE") != std::string::npos) return cmf::kZNormCCQE;
464  // else if(name.find("RESLowQ2SuppSyst2020") != std::string::npos) return cmf::kRESLowQ2SuppSyst2020;
465  // else if(name.find("hNFSISyst2020_MFP") != std::string::npos) return cmf::khNFSISyst2020_MFP;
466  // else if(name.find("hNFSISyst2020_EV1") != std::string::npos) return cmf::khNFSISyst2020_EV1;
467  // else if(name.find("MECEnuShapeSyst2020Nu") != std::string::npos) return cmf::kMECEnuShapeSyst2020Nu;
468  // else if(name.find("MECEnuShapeSyst2020AntiNu") != std::string::npos) return cmf::kMECEnuShapeSyst2020AntiNu;
469  // else if(name.find("MECShapeSyst2020Nu") != std::string::npos) return cmf::kMECShapeSyst2020Nu;
470  // else if(name.find("MECShapeSyst2020AntiNu") != std::string::npos) return cmf::kMECShapeSyst2020AntiNu;
471  // else if(name.find("MECInitStateNPFracSyst2020Nu") != std::string::npos) return cmf::kMECInitStateNPFracSyst2020Nu;
472  // else if(name.find("MECInitStateNPFracSyst2020AntiNu") != std::string::npos) return cmf::kMECInitStateNPFracSyst2020AntiNu;
473  // else if(name.find("RadCorrNue") != std::string::npos) return cmf::kRadCorrNue;
474  // else if(name.find("RadCorrNuebar") != std::string::npos) return cmf::kRadCorrNuebar;
475  // else if(name.find("2ndClassCurrs") != std::string::npos) return cmf::k2ndClassCurrs;
476  // else if(name.find("GENIEPCA00") != std::string::npos) return cmf::kGENIEPCA00;
477  // else if(name.find("GENIEPCA01") != std::string::npos) return cmf::kGENIEPCA01;
478  // else if(name.find("GENIEPCA02") != std::string::npos) return cmf::kGENIEPCA02;
479  // else if(name.find("GENIEPCA03") != std::string::npos) return cmf::kGENIEPCA03;
480  // else if(name.find("GENIEPCA04") != std::string::npos) return cmf::kGENIEPCA04;
481  // else if(name.find("GENIEPCA05") != std::string::npos) return cmf::kGENIEPCA05;
482  // else if(name.find("GENIEPCA06") != std::string::npos) return cmf::kGENIEPCA06;
483  // else if(name.find("GENIEPCA07") != std::string::npos) return cmf::kGENIEPCA07;
484  // else if(name.find("GENIEPCA08") != std::string::npos) return cmf::kGENIEPCA08;
485  // else if(name.find("GENIEPCA09") != std::string::npos) return cmf::kGENIEPCA09;
486  // else if(name.find("GENIEPCA10") != std::string::npos) return cmf::kGENIEPCA10;
487  // else if(name.find("GENIEPCA11") != std::string::npos) return cmf::kGENIEPCA11;
488  // else if(name.find("MvNCRES") != std::string::npos) return cmf::kMvNCRES;
489  // else if(name.find("UnCorrNDMuEScaleSyst2020") != std::string::npos) return cmf::kUnCorrNDMuEScaleSyst2020 ;
490  // else if(name.find("UnCorrMuCatMuESyst2020") != std::string::npos) return cmf::kUnCorrMuCatMuESyst2020 ;
491  // else if(name.find("PileupMuESyst2020") != std::string::npos) return cmf::kPileupMuESyst2020 ;
492  // else if(name.find("CorrMuEScaleSyst2020") != std::string::npos) return cmf::kCorrMuEScaleSyst2020 ;
493  // else if(name.find("NeutronVisEScalePrimariesSyst2018") != std::string::npos) return cmf::kNeutronVisEScalePrimariesSyst2018;
494  // else if(name.find("MichelTaggingSyst2020") != std::string::npos) return cmf::kMichelTaggingSyst2020 ;
495  // else if(name.find("Ana2020NormFHC") != std::string::npos) return cmf::kAna2020NormFHC ;
496  // else if(name.find("Ana2020NormRHC") != std::string::npos) return cmf::kAna2020NormRHC ;
497  // else if(name.find("Norm_1Nux" ) != std::string::npos) return cmf::kNorm_1Nux ;
498  // else if(name.find("MeanQ0_1Nux" ) != std::string::npos) return cmf::kMeanQ0_1Nux ;
499  // else if(name.find("MeanQ3_1Nux" ) != std::string::npos) return cmf::kMeanQ3_1Nux ;
500  // else if(name.find("SigmaQ0_1Nux") != std::string::npos) return cmf::kSigmaQ0_1Nux ;
501  // else if(name.find("SigmaQ3_1Nux") != std::string::npos) return cmf::kSigmaQ3_1Nux ;
502  // else if(name.find("Corr_1Nux") != std::string::npos) return cmf::kCorr_1Nux ;
503  // else if(name.find("Norm_2Nux" ) != std::string::npos) return cmf::kNorm_2Nux ;
504  // else if(name.find("MeanQ0_2Nux" ) != std::string::npos) return cmf::kMeanQ0_2Nux ;
505  // else if(name.find("MeanQ3_2Nux" ) != std::string::npos) return cmf::kMeanQ3_2Nux ;
506  // else if(name.find("SigmaQ0_2Nux") != std::string::npos) return cmf::kSigmaQ0_2Nux ;
507  // else if(name.find("SigmaQ3_2Nux") != std::string::npos) return cmf::kSigmaQ3_2Nux ;
508  // else if(name.find("Corr_2Nux") != std::string::npos) return cmf::kCorr_2Nux ;
509  // else if(name.find("BaselineNux") != std::string::npos) return cmf::kBaselineNux ;
510  // else if(name.find("TauScaleSyst") != std::string::npos) return cmf::kTauScaleSyst ;
511  // else if(name.find("DISvpCC0pi_2020") != std::string::npos) return cmf::kDISvpCC0pi_2020 ;
512  // else if(name.find("DISvpCC1pi_2020") != std::string::npos) return cmf::kDISvpCC1pi_2020 ;
513  // else if(name.find("DISvpCC2pi_2020") != std::string::npos) return cmf::kDISvpCC2pi_2020 ;
514  // else if(name.find("DISvpCC3pi_2020") != std::string::npos) return cmf::kDISvpCC3pi_2020 ;
515  // else if(name.find("DISvpNC0pi_2020") != std::string::npos) return cmf::kDISvpNC0pi_2020 ;
516  // else if(name.find("DISvpNC1pi_2020") != std::string::npos) return cmf::kDISvpNC1pi_2020 ;
517  // else if(name.find("DISvpNC2pi_2020") != std::string::npos) return cmf::kDISvpNC2pi_2020 ;
518  // else if(name.find("DISvpNC3pi_2020") != std::string::npos) return cmf::kDISvpNC3pi_2020 ;
519  // else if(name.find("DISvnCC0pi_2020") != std::string::npos) return cmf::kDISvnCC0pi_2020 ;
520  // else if(name.find("DISvnCC1pi_2020") != std::string::npos) return cmf::kDISvnCC1pi_2020 ;
521  // else if(name.find("DISvnCC2pi_2020") != std::string::npos) return cmf::kDISvnCC2pi_2020 ;
522  // else if(name.find("DISvnCC3pi_2020") != std::string::npos) return cmf::kDISvnCC3pi_2020 ;
523  // else if(name.find("DISvnNC0pi_2020") != std::string::npos) return cmf::kDISvnNC0pi_2020 ;
524  // else if(name.find("DISvnNC1pi_2020") != std::string::npos) return cmf::kDISvnNC1pi_2020 ;
525  // else if(name.find("DISvnNC2pi_2020") != std::string::npos) return cmf::kDISvnNC2pi_2020 ;
526  // else if(name.find("DISvnNC3pi_2020") != std::string::npos) return cmf::kDISvnNC3pi_2020 ;
527  // else if(name.find("DISvbarpCC0pi_2020") != std::string::npos) return cmf::kDISvbarpCC0pi_2020 ;
528  // else if(name.find("DISvbarpCC1pi_2020") != std::string::npos) return cmf::kDISvbarpCC1pi_2020 ;
529  // else if(name.find("DISvbarpCC2pi_2020") != std::string::npos) return cmf::kDISvbarpCC2pi_2020 ;
530  // else if(name.find("DISvbarpCC3pi_2020") != std::string::npos) return cmf::kDISvbarpCC3pi_2020 ;
531  // else if(name.find("DISvbarpNC0pi_2020") != std::string::npos) return cmf::kDISvbarpNC0pi_2020 ;
532  // else if(name.find("DISvbarpNC1pi_2020") != std::string::npos) return cmf::kDISvbarpNC1pi_2020 ;
533  // else if(name.find("DISvbarpNC2pi_2020") != std::string::npos) return cmf::kDISvbarpNC2pi_2020 ;
534  // else if(name.find("DISvbarpNC3pi_2020") != std::string::npos) return cmf::kDISvbarpNC3pi_2020 ;
535  // else if(name.find("DISvbarnCC0pi_2020") != std::string::npos) return cmf::kDISvbarnCC0pi_2020 ;
536  // else if(name.find("DISvbarnCC1pi_2020") != std::string::npos) return cmf::kDISvbarnCC1pi_2020 ;
537  // else if(name.find("DISvbarnCC2pi_2020") != std::string::npos) return cmf::kDISvbarnCC2pi_2020 ;
538  // else if(name.find("DISvbarnCC3pi_2020") != std::string::npos) return cmf::kDISvbarnCC3pi_2020 ;
539  // else if(name.find("DISvbarnNC0pi_2020") != std::string::npos) return cmf::kDISvbarnNC0pi_2020 ;
540  // else if(name.find("DISvbarnNC1pi_2020") != std::string::npos) return cmf::kDISvbarnNC1pi_2020 ;
541  // else if(name.find("DISvbarnNC2pi_2020") != std::string::npos) return cmf::kDISvbarnNC2pi_2020 ;
542  // else if(name.find("DISvbarnNC3pi_2020") != std::string::npos) return cmf::kDISvbarnNC3pi_2020 ;
543  // else if(name.find("FormZone_2020") != std::string::npos) return cmf::kFormZone_2020 ;
544  // else if(name.find("hNFSISyst2020_EV2") != std::string::npos) return cmf::khNFSISyst2020_EV2 ;
545  // else if(name.find("hNFSISyst2020_EV3") != std::string::npos) return cmf::khNFSISyst2020_EV3 ;
546  // else if(name.find("COHCCScaleSyst2018") != std::string::npos) return cmf::kCOHCCScaleSyst2018 ;
547  // else if(name.find("COHNCScaleSyst2018") != std::string::npos) return cmf::kCOHNCScaleSyst2018 ;
548 
549  LOG_VERBATIM("VarNameToKey")
550  << "Variable name "
551  << name
552  << " does not correspond to any key, returning 0";
553 
554  return cmf::kUnknownVar;
555 }
556 
557 //-----------------------------------------------------------------------
558 // Helper function to turn a key for the map into a Variable Name string
559 // a key of 0 is an undefined variable name
560 inline static std::string cmf::KeyToVarName(uint8_t const& key)
561 {
562  for(auto const& itr : cmf::kVarNameToKey){
563  if(itr.second == key) return itr.first;
564  }
565  // if (key == cmf::kNuE_CVN ) return "NuE_CVN";
566  // else if(key == cmf::kNuE_NumMichel ) return "NuE_NumMichel";
567  // else if(key == cmf::kHad_RecoE ) return "Had_RecoE";
568  // else if(key == cmf::kLep_RecoE ) return "Lep_RecoE";
569  // else if(key == cmf::kNu_RecoE ) return "Nu_RecoE";
570  // else if(key == cmf::kLep_RecoE_MCFrac) return "Lep_RecoE_MCFrac";
571  // else if(key == cmf::kRecoQ2 ) return "Reco_Q2";
572  // else if(key == cmf::kFake_Weight ) return "Fake_Weight";
573 
574  // else if(key == cmf::kTrueE ) return "TrueE";
575  // else if(key == cmf::kTruePDG ) return "TruePDG";
576  // else if(key == cmf::kTrueCCNC ) return "TrueCCNC";
577  // else if(key == cmf::kTrueIntType ) return "TrueIntType";
578  // else if(key == cmf::kTruePDGOrig ) return "TruePDGOrig";
579  // else if(key == cmf::kTrueParentPDG ) return "TrueParentPDG";
580  // else if(key == cmf::kTrueParentPT ) return "TrueParentPT";
581  // else if(key == cmf::kTrueParentPZ ) return "TrueParentPZ";
582  // else if(key == cmf::kTrueParentDecay ) return "TrueParentDecay";
583  // else if(key == cmf::kTrueParentTargetPDG) return "TrueParentTargetPDG";
584  // else if(key == cmf::kTrueHitNuc ) return "TrueHitNuc";
585  // else if(key == cmf::kTrueIntMode ) return "TrueIntMode";
586 
587  // else if(key == cmf::kXSecCVPPFX_Weight) return "XsecCVWgt";
588  // else if(key == cmf::kXSecCV2020Wgt ) return "XsecCV2020";
589  // else if(key == cmf::kPPFXFluxCVWgt ) return "PPFXFluxCV";
590  // else if(key == cmf::kRPARES_Weight ) return "RPARESWgt";
591 
592  // else if(key == cmf::kMinus2Sigma) return "-2sigma";
593  // else if(key == cmf::kMinus1Sigma) return "-1sigma";
594  // else if(key == cmf::kPlus1Sigma ) return "+1sigma";
595  // else if(key == cmf::kPlus2Sigma ) return "+2sigma";
596 
597  // // calibration
598  // else if(key == cmf::kLightModelLightUpCalibDown) return "lightmodel-lightdown-calibupWgt";
599  // else if(key == cmf::kLightModelLightDownCalibUp) return "lightmodel-lightup-calibdownWgt";
600  // else if(key == cmf::kCkvProtonShiftDown ) return "ckv-proton-shift-downWgt";
601  // else if(key == cmf::kRelativeCalibration ) return "RelativeCalibrationWgt";
602  // else if(key == cmf::kAbsoluteCalibration ) return "AbsoluteCalibrationWgt";
603  // else if(key == cmf::kCalibShape ) return "CalibrationShapeWgt";
604 
605  // //GENIE knobs
606 
607  // // NC elastic parameters
608  // else if(key == cmf::kMaNCEL ) return "MaNCEL";
609  // else if(key == cmf::kEtaNCEL) return "EtaNCEL";
610 
611  // // DIS tweaking parameters
612  // else if(key == cmf::kAhtBY ) return "AhtBY";
613  // else if(key == cmf::kBhtBY ) return "BhtBY";
614  // else if(key == cmf::kCV1uBY) return "CV1uBY";
615  // else if(key == cmf::kCV2uBY) return "CV2uBY";
616 
617  // // Hadronization (free nucleon target)
618  // else if(key == cmf::kAGKY_xF1pi) return "AGKY_xF1pi";
619  // else if(key == cmf::kAGKY_pT1pi) return "AGKY_pT1pi";
620 
621  // // Resonance decays
622  // else if(key == cmf::kBR1gamma ) return "BR1gamma";
623  // else if(key == cmf::kBR1eta ) return "BR1eta";
624  // else if(key == cmf::kTheta_Delta2Npi) return "Theta_Delta2Npi";
625 
626  // else if(key == cmf::kMvCCRES ) return "MvCCRES";
627  // else if(key == cmf::kMaCCRES ) return "MaCCRES";
628  // else if(key == cmf::kMaNCRES ) return "MaNCRES";
629  // else if(key == cmf::kRPACCQEshapeEnh ) return "RPACCQEshapeEnh";
630  // else if(key == cmf::kRPACCQEshapeSupp) return "RPACCQEshapeSupp";
631 
632  // // coherent scattering
633  // else if(key == cmf::kCOHCCScaleSyst2018) return "COHCCScale2018";
634  // else if(key == cmf::kCOHNCScaleSyst2018) return "COHNCScale2018";
635 
636  // // 2020
637  // else if(key == cmf::kZExpEV1Syst2020 ) return "ZExpAxialFFSyst2020_eV1";
638  // else if(key == cmf::kZExpEV2Syst2020 ) return "ZExpAxialFFSyst2020_eV2";
639  // else if(key == cmf::kZExpEV3Syst2020 ) return "ZExpAxialFFSyst2020_eV3";
640  // else if(key == cmf::kZExpEV4Syst2020 ) return "ZExpAxialFFSyst2020_eV4";
641  // else if(key == cmf::kZNormCCQE ) return "ZNormCCQE";
642  // else if(key == cmf::kRESLowQ2SuppSyst2020 ) return "RESLowQ2SuppSyst2020";
643  // else if(key == cmf::khNFSISyst2020_MFP ) return "hNFSISyst2020_MFP";
644  // else if(key == cmf::khNFSISyst2020_EV1 ) return "hNFSISyst2020_EV1";
645  // else if(key == cmf::kMECEnuShapeSyst2020Nu ) return "MECEnuShapeSyst2020Nu";
646  // else if(key == cmf::kMECEnuShapeSyst2020AntiNu ) return "MECEnuShapeSyst2020AntiNu";
647  // else if(key == cmf::kMECShapeSyst2020Nu ) return "MECShapeSyst2020Nu";
648  // else if(key == cmf::kMECShapeSyst2020AntiNu ) return "MECShapeSyst2020AntiNu";
649  // else if(key == cmf::kMECInitStateNPFracSyst2020Nu ) return "MECInitStateNPFracSyst2020Nu";
650  // else if(key == cmf::kMECInitStateNPFracSyst2020AntiNu ) return "MECInitStateNPFracSyst2020AntiNu";
651  // else if(key == cmf::kRadCorrNue ) return "RadCorrNue";
652  // else if(key == cmf::kRadCorrNuebar ) return "RadCorrNuebar";
653  // else if(key == cmf::k2ndClassCurrs ) return "2ndClassCurrs";
654  // else if(key == cmf::kGENIEPCA00 ) return "GENIEPCA00";
655  // else if(key == cmf::kGENIEPCA01 ) return "GENIEPCA01";
656  // else if(key == cmf::kGENIEPCA02 ) return "GENIEPCA02";
657  // else if(key == cmf::kGENIEPCA03 ) return "GENIEPCA03";
658  // else if(key == cmf::kGENIEPCA04 ) return "GENIEPCA04";
659  // else if(key == cmf::kGENIEPCA05 ) return "GENIEPCA05";
660  // else if(key == cmf::kGENIEPCA06 ) return "GENIEPCA06";
661  // else if(key == cmf::kGENIEPCA07 ) return "GENIEPCA07";
662  // else if(key == cmf::kGENIEPCA08 ) return "GENIEPCA08";
663  // else if(key == cmf::kGENIEPCA09 ) return "GENIEPCA09";
664  // else if(key == cmf::kGENIEPCA10 ) return "GENIEPCA10";
665  // else if(key == cmf::kGENIEPCA11 ) return "GENIEPCA11";
666  // else if(key == cmf::kMvNCRES ) return "MvNCRES";
667  // else if(key == cmf::kUnCorrNDMuEScaleSyst2020 ) return "UnCorrNDMuEScaleSyst2020";
668  // else if(key == cmf::kUnCorrMuCatMuESyst2020 ) return "UnCorrMuCatMuESyst2020";
669  // else if(key == cmf::kPileupMuESyst2020 ) return "PileupMuESyst2020";
670  // else if(key == cmf::kCorrMuEScaleSyst2020 ) return "CorrMuEScaleSyst2020";
671  // else if(key == cmf::kNeutronVisEScalePrimariesSyst2018) return "NeutronVisEScalePrimariesSyst2018";
672  // else if(key == cmf::kMichelTaggingSyst2020 ) return "MichelTaggingSyst2020";
673  // else if(key == cmf::kAna2020NormFHC ) return "Ana2020NormFHC";
674  // else if(key == cmf::kAna2020NormRHC ) return "Ana2020NormRHC";
675  // else if(key == cmf::kNorm_1Nux ) return "Norm_1Nux";
676  // else if(key == cmf::kMeanQ0_1Nux ) return "MeanQ0_1Nux";
677  // else if(key == cmf::kMeanQ3_1Nux ) return "MeanQ3_1Nux";
678  // else if(key == cmf::kSigmaQ0_1Nux ) return "SigmaQ0_1Nux";
679  // else if(key == cmf::kSigmaQ3_1Nux ) return "SigmaQ3_1Nux";
680  // else if(key == cmf::kCorr_1Nux ) return "Corr_1Nux";
681  // else if(key == cmf::kNorm_2Nux ) return "Norm_2Nux";
682  // else if(key == cmf::kMeanQ0_2Nux ) return "MeanQ0_2Nux";
683  // else if(key == cmf::kMeanQ3_2Nux ) return "MeanQ3_2Nux";
684  // else if(key == cmf::kSigmaQ0_2Nux ) return "SigmaQ0_2Nux";
685  // else if(key == cmf::kSigmaQ3_2Nux ) return "SigmaQ3_2Nux";
686  // else if(key == cmf::kCorr_2Nux ) return "Corr_2Nux";
687  // else if(key == cmf::kBaselineNux ) return "BaselineNux";
688  // else if(key == cmf::kTauScaleSyst ) return "TauScaleSyst";
689  // else if(key == cmf::kDISvpCC0pi_2020 ) return "DISvpCC0pi_2020";
690  // else if(key == cmf::kDISvpCC1pi_2020 ) return "DISvpCC1pi_2020";
691  // else if(key == cmf::kDISvpCC2pi_2020 ) return "DISvpCC2pi_2020";
692  // else if(key == cmf::kDISvpCC3pi_2020 ) return "DISvpCC3pi_2020";
693  // else if(key == cmf::kDISvpNC0pi_2020 ) return "DISvpNC0pi_2020";
694  // else if(key == cmf::kDISvpNC1pi_2020 ) return "DISvpNC1pi_2020";
695  // else if(key == cmf::kDISvpNC2pi_2020 ) return "DISvpNC2pi_2020";
696  // else if(key == cmf::kDISvpNC3pi_2020 ) return "DISvpNC3pi_2020";
697  // else if(key == cmf::kDISvnCC0pi_2020 ) return "DISvnCC0pi_2020";
698  // else if(key == cmf::kDISvnCC1pi_2020 ) return "DISvnCC1pi_2020";
699  // else if(key == cmf::kDISvnCC2pi_2020 ) return "DISvnCC2pi_2020";
700  // else if(key == cmf::kDISvnCC3pi_2020 ) return "DISvnCC3pi_2020";
701  // else if(key == cmf::kDISvnNC0pi_2020 ) return "DISvnNC0pi_2020";
702  // else if(key == cmf::kDISvnNC1pi_2020 ) return "DISvnNC1pi_2020";
703  // else if(key == cmf::kDISvnNC2pi_2020 ) return "DISvnNC2pi_2020";
704  // else if(key == cmf::kDISvnNC3pi_2020 ) return "DISvnNC3pi_2020";
705  // else if(key == cmf::kDISvbarpCC0pi_2020 ) return "DISvbarpCC0pi_2020";
706  // else if(key == cmf::kDISvbarpCC1pi_2020 ) return "DISvbarpCC1pi_2020";
707  // else if(key == cmf::kDISvbarpCC2pi_2020 ) return "DISvbarpCC2pi_2020";
708  // else if(key == cmf::kDISvbarpCC3pi_2020 ) return "DISvbarpCC3pi_2020";
709  // else if(key == cmf::kDISvbarpNC0pi_2020 ) return "DISvbarpNC0pi_2020";
710  // else if(key == cmf::kDISvbarpNC1pi_2020 ) return "DISvbarpNC1pi_2020";
711  // else if(key == cmf::kDISvbarpNC2pi_2020 ) return "DISvbarpNC2pi_2020";
712  // else if(key == cmf::kDISvbarpNC3pi_2020 ) return "DISvbarpNC3pi_2020";
713  // else if(key == cmf::kDISvbarnCC0pi_2020 ) return "DISvbarnCC0pi_2020";
714  // else if(key == cmf::kDISvbarnCC1pi_2020 ) return "DISvbarnCC1pi_2020";
715  // else if(key == cmf::kDISvbarnCC2pi_2020 ) return "DISvbarnCC2pi_2020";
716  // else if(key == cmf::kDISvbarnCC3pi_2020 ) return "DISvbarnCC3pi_2020";
717  // else if(key == cmf::kDISvbarnNC0pi_2020 ) return "DISvbarnNC0pi_2020";
718  // else if(key == cmf::kDISvbarnNC1pi_2020 ) return "DISvbarnNC1pi_2020";
719  // else if(key == cmf::kDISvbarnNC2pi_2020 ) return "DISvbarnNC2pi_2020";
720  // else if(key == cmf::kDISvbarnNC3pi_2020 ) return "DISvbarnNC3pi_2020";
721  // else if(key == cmf::kFormZone_2020 ) return "FormZone_2020";
722  // else if(key == cmf::khNFSISyst2020_EV2 ) return "hNFSISyst2020_EV2";
723  // else if(key == cmf::khNFSISyst2020_EV3 ) return "hNFSISyst2020_EV3";
724  // else if(key == cmf::kCOHCCScaleSyst2018 ) return "COHCCScaleSyst2018";
725  // else if(key == cmf::kCOHNCScaleSyst2018 ) return "COHNCScaleSyst2018";
726 
727  return "Unknown";
728 
729  //else if( isSumSmallXSecJoint2017Key(key) ) return "SumSmallXSecJoint2017";
730 
731  // CCQE parameters
732  //else if(key == cmf::kNormCCQE ) return "NormCCQE";
733  //else if(key == cmf::kNormCCQE_EnuDep ) return "NormCCQE_EnuDep";
734  //else if(key == cmf::kMaCCQE_shape ) return "MaCCQE_shape";
735  //else if(key == cmf::kVecCCQE_shape ) return "VecCCQE_shape";
736 
737  // Resonant production: CC
738  //else if(key == cmf::kNormCCRES ) return "NormCCRES";
739  //else if(key == cmf::kMaCCRES_shape ) return "MaCCRES_shape";
740  //else if(key == cmf::kMvCCRES_shape ) return "MvCCRES_shape";
741  //else if(key == cmf::kMaCCRES ) return "MaCCRES";
742 
743  // Resonant production: NC
744  //else if(key == cmf::kNormNCRES ) return "NormNCRES";
745  //else if(key == cmf::kMaNCRES_shape ) return "MaNCRES_shape";
746  //else if(key == cmf::kMvNCRES_shape ) return "MvNCRES_shape";
747 
748  // Coherent pion production
749  //else if(key == cmf::kMaCOHpi ) return "MaCOHpi";
750  //else if(key == cmf::kR0COHpi ) return "R0COHpi";
751 
752  // Non-resonant background
753  //else if(key == cmf::kRvpCC1pi ) return "RvpCC1pi";
754  //else if(key == cmf::kRvpCC2pi ) return "RvpCC2pi";
755  //else if(key == cmf::kRvpNC1pi ) return "RvpNC1pi";
756  //else if(key == cmf::kRvpNC2pi ) return "RvpNC2pi";
757  //else if(key == cmf::kRvnCC1pi ) return "RvnCC1pi";
758  //else if(key == cmf::kRvnCC2pi ) return "RvnCC2pi";
759  //else if(key == cmf::kRvnNC1pi ) return "RvnNC1pi";
760  //else if(key == cmf::kRvnNC2pi ) return "RvnNC2pi";
761  //else if(key == cmf::kRvbarpCC1pi ) return "RvbarpCC1pi";
762  //else if(key == cmf::kRvbarpCC2pi ) return "RvbarpCC2pi";
763  //else if(key == cmf::kRvbarpNC1pi ) return "RvbarpNC1pi";
764  //else if(key == cmf::kRvbarpNC2pi ) return "RvbarpNC2pi";
765  //else if(key == cmf::kRvbarnCC1pi ) return "RvbarnCC1pi";
766  //else if(key == cmf::kRvbarnCC2pi ) return "RvbarnCC2pi";
767  //else if(key == cmf::kRvbarnNC1pi ) return "RvbarnNC1pi";
768  //else if(key == cmf::kRvbarnNC2pi ) return "RvbarnNC2pi";
769 
770  //else if(key == cmf::kAhtBYshape ) return "AhtBYshape";
771  //else if(key == cmf::kBhtBYshape ) return "BhtBYshape";
772  //else if(key == cmf::kCV1uBYshape ) return "CV1uBYshape";
773  //else if(key == cmf::kCV2uBYshape ) return "CV2uBYshape";
774  //else if(key == cmf::kNormDISCC ) return "NormDISCC";
775  //else if(key == cmf::kRnubarnuCC ) return "RnubarnuCC";
776  //else if(key == cmf::kDISNuclMod ) return "DISNuclMod";
777 
778  //else if(key == cmf::kNCGENIE ) return "NC";
779 
780  // Medium-effects to hadronization
781 
782  // Intranuclear rescattering parameters.
783 // else if(key == cmf::kMFP_pi ) return "MFP_pi";
784 // else if(key == cmf::kMFP_N ) return "MFP_N";
785 // else if(key == cmf::kFrPiProd_pi ) return "FrPiProd_pi";
786 // else if(key == cmf::kFrPiProd_N ) return "FrPiProd_N";
787 
788  // Nuclear model
789 // else if(key == cmf::kCCQEMomDistroFGtoSF) return "CCQEMomDistroFGtoSF";
790 
791 
792  // 2017 RPA shape systematics
793 }
794 
795 #endif //COVARIANCEMATRIXFIT_STATICFUNCS_H
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const XML_Char * name
Definition: expat.h:151
enum cmf::osc_params OscParm_t
static cmf::ContourType_t StringToContourType(std::string const &str)
enum cmf::interaction_type InteractionType_t
static long SelectionTypeKey(cmf::SelectionType_t const &st)
Definition: StaticFuncs.h:19
set< int >::iterator it
const std::string cSelectionType_Strings[12]
Definition: Constants.h:93
static long DetectorTypeKey(cmf::DetType_t const &det)
Definition: StaticFuncs.h:15
static long DetectorBeamSelectionTypesToKey(cmf::DetType_t const &det, cmf::BeamType_t const &bt, cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:58
Int_t par
Definition: SimpleIterate.C:24
enum cmf::cont_type ContourType_t
enum cmf::det_type DetType_t
static cmf::InteractionType_t KeyToInteractionType(long const &key)
Definition: StaticFuncs.h:204
static cmf::BeamType_t KeyToBeamType(long const &key)
Definition: StaticFuncs.h:132
enum cmf::sel_type SelectionType_t
static bool IsNuESelected(cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:372
static bool IsAngleParameter(cmf::OscParm_t const &par)
Definition: StaticFuncs.h:346
static bool IsNuMuQuantiles(cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:365
static cmf::BeamType_t StringToBeamType(std::string const &str)
Definition: StaticFuncs.h:262
const std::string cOscParams_Strings[kNumOscParams]
Definition: Constants.h:272
fileType
Definition: mkDefs.py:113
static bool IsNuMuSelected(cmf::SelectionType_t const &sel)
Definition: StaticFuncs.h:358
const std::string cInteractionType_Strings[11]
Definition: Constants.h:149
const std::string cFileTypeStrings[10]
Definition: Constants.h:176
static uint8_t VarNameToKey(std::string const &name)
Definition: StaticFuncs.h:381
static cmf::SelectionType_t StringToSelectionType(std::string const &str)
Definition: StaticFuncs.h:245
static cmf::DetType_t KeyToDetectorType(long const &key)
Definition: StaticFuncs.h:66
static long PeriodKey(long const &ep)
Definition: StaticFuncs.h:16
static cmf::DetType_t StringToDetectorType(std::string const &str)
Definition: StaticFuncs.h:271
static cmf::BeamType_t PeriodToBeamType(std::string const &str)
static cmf::FileType_t KeyToFileType(long const &key)
Definition: StaticFuncs.h:105
static int BeamToPeriod(cmf::BeamType_t const &beam)
Definition: StaticFuncs.h:236
static long InteractionTypeKey(cmf::InteractionType_t const &it)
Definition: StaticFuncs.h:20
static int KeyToEpoch(long const &key)
Definition: StaticFuncs.h:80
#define LOG_WARNING(category)
static bool IsOscillationParameter(std::string const &str)
static cmf::ChiSqrCalc_t StringToChiSqrType(std::string const &str)
Module to combine a set of results into a single file currently only does one data product type at a ...
Definition: Event.cxx:24
static const std::map< std::string, uint8_t > kVarNameToKey({{"NuE_CVN", cmf::kNuE_CVN},{"NuE_NumMichel", cmf::kNuE_NumMichel},{"Had_RecoE", cmf::kHad_RecoE},{"Lep_RecoE", cmf::kLep_RecoE},{"Nu_RecoE", cmf::kNu_RecoE},{"Lep_RecoE_MCFrac", cmf::kLep_RecoE_MCFrac},{"Reco_Q2", cmf::kRecoQ2},{"Fake_Weight", cmf::kFake_Weight},{"TrueE", cmf::kTrueE},{"TruePDG", cmf::kTruePDG},{"TrueCCNC", cmf::kTrueCCNC},{"TrueIntType", cmf::kTrueIntType},{"TruePDGOrig", cmf::kTruePDGOrig},{"TrueParentPDG", cmf::kTrueParentPDG},{"TrueParentPT", cmf::kTrueParentPT},{"TrueParentPZ", cmf::kTrueParentPZ},{"TrueParentDecay", cmf::kTrueParentDecay},{"TrueParentTargetPDG", cmf::kTrueParentTargetPDG},{"TrueHitNuc", cmf::kTrueHitNuc},{"TrueIntMode", cmf::kTrueIntMode},{"XsecCV2020", cmf::kXSecCV2020Wgt},{"PPFXFluxCV", cmf::kPPFXFluxCVWgt},{"RPARES", cmf::kRPARES_Weight},{"-2sigma", cmf::kMinus2Sigma},{"-1sigma", cmf::kMinus1Sigma},{"+1sigma", cmf::kPlus1Sigma},{"+2sigma", cmf::kPlus2Sigma},{"lightmodel-lightdown", cmf::kLightModelLightDownCalibUp},{"lightmodel-lightup", cmf::kLightModelLightUpCalibDown},{"ckv-proton", cmf::kCkvProtonShiftDown},{"RelativeCalibration", cmf::kRelativeCalibration},{"AbsoluteCalibration", cmf::kAbsoluteCalibration},{"CalibrationShape", cmf::kCalibShape},{"MaNCEL", cmf::kMaNCEL},{"EtaNCEL", cmf::kEtaNCEL},{"AhtBY", cmf::kAhtBY},{"BhtBY", cmf::kBhtBY},{"CV1uBY", cmf::kCV1uBY},{"CV2uBY", cmf::kCV2uBY},{"AGKY_xF1pi", cmf::kAGKY_xF1pi},{"AGKY_pT1pi", cmf::kAGKY_pT1pi},{"BR1gamma", cmf::kBR1gamma},{"BR1eta", cmf::kBR1eta},{"Theta_Delta2Npi", cmf::kTheta_Delta2Npi},{"MvCCRES", cmf::kMvCCRES},{"MaCCRES", cmf::kMaCCRES},{"MvNCRES", cmf::kMvNCRES},{"MaNCRES", cmf::kMaNCRES},{"RPACCQEshapeEnh", cmf::kRPACCQEshapeEnh},{"RPACCQEshapeSupp", cmf::kRPACCQEshapeSupp},{"COHCCScale2018", cmf::kCOHCCScaleSyst2018},{"COHNCScale2018", cmf::kCOHNCScaleSyst2018},{"ZExpAxialFFSyst2020_eV1", cmf::kZExpEV1Syst2020},{"ZExpAxialFFSyst2020_eV2", cmf::kZExpEV2Syst2020},{"ZExpAxialFFSyst2020_eV3", cmf::kZExpEV3Syst2020},{"ZExpAxialFFSyst2020_eV4", cmf::kZExpEV4Syst2020},{"ZNormCCQE", cmf::kZNormCCQE},{"RESLowQ2SuppSyst2020", cmf::kRESLowQ2SuppSyst2020},{"hNFSISyst2020_MFP", cmf::khNFSISyst2020_MFP},{"hNFSISyst2020_EV1", cmf::khNFSISyst2020_EV1},{"MECEnuShapeSyst2020Nu", cmf::kMECEnuShapeSyst2020Nu},{"MECEnuShapeSyst2020AntiNu", cmf::kMECEnuShapeSyst2020AntiNu},{"MECShapeSyst2020Nu", cmf::kMECShapeSyst2020Nu},{"MECShapeSyst2020AntiNu", cmf::kMECShapeSyst2020AntiNu},{"MECInitStateNPFracSyst2020Nu", cmf::kMECInitStateNPFracSyst2020Nu},{"MECInitStateNPFracSyst2020AntiNu", cmf::kMECInitStateNPFracSyst2020AntiNu},{"RadCorrNue", cmf::kRadCorrNue},{"RadCorrNuebar", cmf::kRadCorrNuebar},{"2ndClassCurrs", cmf::k2ndClassCurrs},{"GENIEPCA00", cmf::kGENIEPCA00},{"GENIEPCA01", cmf::kGENIEPCA01},{"GENIEPCA02", cmf::kGENIEPCA02},{"GENIEPCA03", cmf::kGENIEPCA03},{"GENIEPCA04", cmf::kGENIEPCA04},{"GENIEPCA05", cmf::kGENIEPCA05},{"GENIEPCA06", cmf::kGENIEPCA06},{"GENIEPCA07", cmf::kGENIEPCA07},{"GENIEPCA08", cmf::kGENIEPCA08},{"GENIEPCA09", cmf::kGENIEPCA09},{"GENIEPCA10", cmf::kGENIEPCA10},{"GENIEPCA11", cmf::kGENIEPCA11},{"UnCorrNDMuEScaleSyst2020", cmf::kUnCorrNDMuEScaleSyst2020},{"UnCorrMuCatMuESyst2020", cmf::kUnCorrMuCatMuESyst2020},{"PileupMuESyst2020", cmf::kPileupMuESyst2020},{"CorrMuEScaleSyst2020", cmf::kCorrMuEScaleSyst2020},{"NeutronVisEScalePrimariesSyst2018", cmf::kNeutronVisEScalePrimariesSyst2018},{"MichelTaggingSyst2020", cmf::kMichelTaggingSyst2020},{"Ana2020NormFHC", cmf::kAna2020NormFHC},{"Ana2020NormRHC", cmf::kAna2020NormRHC},{"Norm_1Nux", cmf::kNorm_1Nux},{"MeanQ0_1Nux", cmf::kMeanQ0_1Nux},{"MeanQ3_1Nux", cmf::kMeanQ3_1Nux},{"SigmaQ0_1Nux", cmf::kSigmaQ0_1Nux},{"SigmaQ3_1Nux", cmf::kSigmaQ3_1Nux},{"Corr_1Nux", cmf::kCorr_1Nux},{"Norm_2Nux", cmf::kNorm_2Nux},{"MeanQ0_2Nux", cmf::kMeanQ0_2Nux},{"MeanQ3_2Nux", cmf::kMeanQ3_2Nux},{"SigmaQ0_2Nux", cmf::kSigmaQ0_2Nux},{"SigmaQ3_2Nux", cmf::kSigmaQ3_2Nux},{"Corr_2Nux", cmf::kCorr_2Nux},{"BaselineNux", cmf::kBaselineNux},{"TauScaleSyst", cmf::kTauScaleSyst},{"DISvpCC0pi_2020", cmf::kDISvpCC0pi_2020},{"DISvpCC1pi_2020", cmf::kDISvpCC1pi_2020},{"DISvpCC2pi_2020", cmf::kDISvpCC2pi_2020},{"DISvpCC3pi_2020", cmf::kDISvpCC3pi_2020},{"DISvpNC0pi_2020", cmf::kDISvpNC0pi_2020},{"DISvpNC1pi_2020", cmf::kDISvpNC1pi_2020},{"DISvpNC2pi_2020", cmf::kDISvpNC2pi_2020},{"DISvpNC3pi_2020", cmf::kDISvpNC3pi_2020},{"DISvnCC0pi_2020", cmf::kDISvnCC0pi_2020},{"DISvnCC1pi_2020", cmf::kDISvnCC1pi_2020},{"DISvnCC2pi_2020", cmf::kDISvnCC2pi_2020},{"DISvnCC3pi_2020", cmf::kDISvnCC3pi_2020},{"DISvnNC0pi_2020", cmf::kDISvnNC0pi_2020},{"DISvnNC1pi_2020", cmf::kDISvnNC1pi_2020},{"DISvnNC2pi_2020", cmf::kDISvnNC2pi_2020},{"DISvnNC3pi_2020", cmf::kDISvnNC3pi_2020},{"DISvbarpCC0pi_2020", cmf::kDISvbarpCC0pi_2020},{"DISvbarpCC1pi_2020", cmf::kDISvbarpCC1pi_2020},{"DISvbarpCC2pi_2020", cmf::kDISvbarpCC2pi_2020},{"DISvbarpCC3pi_2020", cmf::kDISvbarpCC3pi_2020},{"DISvbarpNC0pi_2020", cmf::kDISvbarpNC0pi_2020},{"DISvbarpNC1pi_2020", cmf::kDISvbarpNC1pi_2020},{"DISvbarpNC2pi_2020", cmf::kDISvbarpNC2pi_2020},{"DISvbarpNC3pi_2020", cmf::kDISvbarpNC3pi_2020},{"DISvbarnCC0pi_2020", cmf::kDISvbarnCC0pi_2020},{"DISvbarnCC1pi_2020", cmf::kDISvbarnCC1pi_2020},{"DISvbarnCC2pi_2020", cmf::kDISvbarnCC2pi_2020},{"DISvbarnCC3pi_2020", cmf::kDISvbarnCC3pi_2020},{"DISvbarnNC0pi_2020", cmf::kDISvbarnNC0pi_2020},{"DISvbarnNC1pi_2020", cmf::kDISvbarnNC1pi_2020},{"DISvbarnNC2pi_2020", cmf::kDISvbarnNC2pi_2020},{"DISvbarnNC3pi_2020", cmf::kDISvbarnNC3pi_2020},{"FormZone_2020", cmf::kFormZone_2020},{"hNFSISyst2020_EV2", cmf::khNFSISyst2020_EV2},{"hNFSISyst2020_EV3", cmf::khNFSISyst2020_EV3},{"COHCCScaleSyst2018", cmf::kCOHCCScaleSyst2018},{"COHNCScaleSyst2018", cmf::kCOHNCScaleSyst2018}, {"FluxPCA00", cmf::kFluxPCA00},{"FluxPCA01", cmf::kFluxPCA01},{"FluxPCA02", cmf::kFluxPCA02},{"FluxPCA03", cmf::kFluxPCA03},{"FluxPCA04", cmf::kFluxPCA04},{"KaonSyst", cmf::kKaonSyst}})
static long FileTypeKey(cmf::FileType_t const &ft)
Definition: StaticFuncs.h:17
enum cmf::beam_type BeamType_t
static cmf::SelectionType_t KeyToSelectionType(long const &key)
Definition: StaticFuncs.h:166
#define LOG_VERBATIM(category)
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
const std::string cDetType_Strings[5]
Definition: Constants.h:29
const std::string cBeamType_Strings[4]
Definition: Constants.h:51
static cmf::OscParm_t StringToOscParmType(std::string const &str)
static std::string KeyToVarName(uint8_t const &key)
Definition: StaticFuncs.h:560
static long BeamTypeKey(cmf::BeamType_t const &bt)
Definition: StaticFuncs.h:18
static std::string KeyToString(long const &key)
Definition: StaticFuncs.h:224
enum cmf::chisqr_type ChiSqrCalc_t
enum cmf::file_type FileType_t
enum BeamMode string