5 #include "CAFAna/Prediction/PredictionInterpTemplates.h" 7 #include "CAFAna/Systs/NueSystsSecondAna.h" 38 const std::vector<ColumnDef>
cols =
48 std::unique_ptr<TH1D>
h(s.
ToTH1(pot));
50 if(cvnregion == 1)
return h->Integral(1, 9);
51 if(cvnregion == 2)
return h->Integral(10, 18);
52 if(cvnregion == 3)
return h->Integral(19, 27);
53 if(cvnregion == 4)
return h->Integral(28, 36);
54 if(cvnregion == 5)
return s.
Integral(pot);
59 double TotBkg(std::vector <double> integrals)
62 for(
auto it: integrals){
89 default:
std::cout <<
"Run me like <cafe 'syst_table_from_preds.C+(1/2/3/4/5)'> for CVN 1,2,3/peripheral/CVN >.75 region you want to study. \n" 90 <<
"1 is for 0.75 < CVN1 < 0.87; 2 is for 0.87 < CVN < 0.95; 3 is for CVN > 1.0; 4 is for peripheral region; 5 is for CVN > 0.75. \n" 98 const double kPOT= 9.0000e20;
100 const int kNumPreds = 2;
101 const std::string predNames[kNumPreds] = {
"pred_propDecomp",
"pred_comboDecomp"};
103 const int kNumSysts = 5;
104 const std::string systNames[kNumSysts] = {
"Nominal",
"Calibration",
"Lightlevel",
"Cherenkov",
"CalibShape"};
106 const int kNumShifts = 3;
107 const std::string shiftNames[kNumShifts] = {
"noShift",
"plusOne",
"minusOne"};
111 std::unique_ptr <PredictionExtrap> predsPropNom, predsPropShifted;
114 std::map <const std::string, std::unique_ptr <PredictionExtrap> > map_to_preds;
115 std::map <const std::string, std::unique_ptr <PredictionExtrap> >::iterator map_it;
119 for(
int predIdx = 0; predIdx < 1; ++predIdx)
121 const char* predName = predNames[predIdx].c_str();
124 predsPropNom = LoadFromFile<PredictionExtrap>(
fname,
TString::Format(
"%s/%s/%s/nue_pred_%s", predName, systNames[0].c_str(), shiftNames[0].c_str(), varName.c_str()).Data());
126 for(
int systIdx = 1; systIdx < kNumSysts; ++systIdx)
128 const char* systName = systNames[systIdx].c_str();
131 for(
int shiftIdx = 1; shiftIdx < kNumShifts; ++shiftIdx)
133 const char* shiftName = shiftNames[shiftIdx].c_str();
136 if ((systIdx == 3 || systIdx == 4) && shiftIdx == 2)
continue;
138 predsPropShifted = LoadFromFile<PredictionExtrap>(
fname,
TString::Format(
"%s/%s/%s/nue_pred_%s", predName, systName, shiftName, varName.c_str()).Data());
142 map_to_preds.insert(
make_pair(
makeKeyUnique(systNames[systIdx],shiftNames[shiftIdx]), std::move(predsPropShifted)));
150 std::cout <<
"*********************** For Nominal ************************ " <<
std::endl;
152 std::vector <double> nomintegrals;
155 auto spec = predsPropNom->PredictComponent(&dumbosc,
col.flav,
col.curr,
col.sign);
159 if ((
col.name ==
"beam NueCC") || (
col.name ==
"NC") || (
col.name ==
"Numu CC"))
160 nomintegrals.push_back (
Integral(spec,kPOT,cvnregion));
167 std::cout <<
"*********************** For Systematic Sample ************************ " <<
std::endl;
169 for (map_it = map_to_preds.begin(); map_it != map_to_preds.end(); ++map_it)
171 auto key = map_it->first;
172 auto pred = map_it->second.get();
174 std::vector <double> sysintegrals;
179 auto spec =
pred->PredictComponent(&dumbosc,
col.flav,
col.curr,
col.sign);
183 if ((
col.name ==
"beam NueCC") || (
col.name ==
"NC") || (
col.name ==
"Numu CC"))
184 sysintegrals.push_back (
Integral(spec,kPOT,cvnregion));
188 std::cout <<
" --------------------------- moving to next systematics -----------------" <<
std::endl;
189 std::cout <<
" ----------------------------------------------------------------------------" <<
std::endl;
Cuts and Vars for the 2020 FD DiF Study.
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
double Integral(const Spectrum &s, const double pot, int cvnregion)
double TotBkg(std::vector< double > integrals)
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
const std::string makeKeyUnique(const std::string &syst, const std::string &shift)
double Integral(double exposure, double *err=0, EExposureType expotype=kPOT) const
Return total number of events scaled to pot.
Representation of a spectrum in any variable, with associated POT.
Charged-current interactions.
Simple oscillation probability calculator that has no solar term or mass hierarchy or delta so it's s...
void syst_table_from_preds(int cvnregion, std::string fname="")
std::map< std::string, std::string > systNames
Neutral-current interactions.
const std::vector< ColumnDef > cols
Both neutrinos and antineutrinos.
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
All neutrinos, any flavor.