XSecSysts.cxx
Go to the documentation of this file.
2 #include <iostream>
3 
4 namespace ana {
5  ///////////////////////////////////////////////////////////////////////
6  // iterating through an enum is bad practice but sometimes
7  // we'll need to do just that. Do it in a way that's more explicit
8  std::vector<XSecSysts::Syst_t>
10  {
11  std::vector<XSecSysts::Syst_t>
12  list = {kNominal,
13  kCalibNeg,
14  kCalibPos,
19  };
20  return list;
21  }
22 
23  ///////////////////////////////////////////////////////////////////////
24  TString
26  {
27  switch(syst) {
28  case(kNominal) : return "kNominal";
29  case(kCalibNeg) : return "kCalibNeg";
30  case(kCalibPos) : return "kCalibPos";
31  case(kCalibShape) : return "kCalibShape";
32  case(kLightUpCalibDown) : return "kLightUpCalibDown";
33  case(kLightDownCalibUp) : return "kLightDownCalibUp";
34  case(kCherenkov) : return "kCherenkov";
35  default : {
36  std::cout << "Your Syst_t is not a member of XSecSysts. Consider deriving a new class." << std::endl;
37  abort();
38  }
39  }
40  }
41 
42  ///////////////////////////////////////////////////////////////////////
45  {
46 
47  if(label == "kNominal") return kNominal;
48  else if(label == "kCalibNeg") return kCalibNeg;
49  else if(label == "kCalibPos") return kCalibPos;
50  else if(label == "kCalibShape") return kCalibShape;
51  else if(label == "kLightUpCalibDown") return kLightUpCalibDown;
52  else if(label == "kLightDownCalibUp") return kLightDownCalibUp;
53  else if(label == "kCherenkov") return kCherenkov;
54  else {
55  std::cout << "Your label is not a member of XSecSysts. Consider deriving a new class" << std::endl;
56  abort();
57  }
58  }
59 }
static TString LabelFromSystematic(Syst_t)
Definition: XSecSysts.cxx:25
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const char * label
static Syst_t SystematicFromLabel(TString)
Definition: XSecSysts.cxx:44
static std::vector< Syst_t > GetAllSystematics()
Definition: XSecSysts.cxx:9
OStream cout
Definition: OStream.cxx:6