joint_fit_2019_loader_tools.h
Go to the documentation of this file.
1 #pragma once
13 #include "CAFAna/Systs/XSecSysts.h"
14 #include "CAFAna/Vars/FitVars.h"
15 #include "OscLib/IOscCalc.h"
16 #include "CAFAna/Analysis/Style.h"
18 
20 //#include "./joint_fit_2019_style_tools.h"
21 
22 #include "TCanvas.h"
23 #include "TBox.h"
24 #include "TLatex.h"
25 #include "TColor.h"
26 #include "TGraph.h"
27 #include "TVectorD.h"
28 #include "TF1.h"
29 #include "TLegend.h"
30 #include "TLine.h"
31 #include "TMarker.h"
32 #include "TStyle.h"
33 #include "TSystem.h"
34 #include "TGaxis.h"
35 #include "TFile.h"
36 
37 using namespace ana;
38 
39 
40 TFile* GetGaussianSurface(TString par, TString hier)
41 {
42  cout<<"\n\n ============= You're loading gaussian surface ============="<<endl;
43  TString subdir = par.Contains("ssth23dmsq32")? "th23_dmsq" : "delta_th23";
44  TString gaussDir = "/nova/ana/nu_e_ana/Ana2018/Results/RHC_and_FHC/contours/"+subdir+"/syst/";
45  TString gaussName = "hist_contours_2018_joint_realData_both_only";
46  gaussName += hier;
47  if(par.Contains("ssth23dmsq32"))
48  gaussName += "combo_dmsq_systs.root";
49  else
50  gaussName += "combo_systs.root";
51 
52  std::cout << "Opening " << gaussDir + gaussName << std::endl;
53  TFile* ret = TFile::Open(gaussDir + gaussName);
54  return ret;
55 }
56 
57 std::string GetNuePredPath(std::string beam, bool isFakeData, bool NERSC) {
59  bool isFHC = true;
60  if(beam == "rhc") isFHC = false;
61 
62  if(!NERSC) return "";
63  else {
64  std::string dir = std::string(getenv("FCHELPERANA2018_LIB_PATH")) + "/Predictions/provisional_singles";
65  if(isFHC && !isFakeData)
66  ret = dir + "/NueProd4SystematicsOnRealNDData_2018-05-22/pred_allxp_Nue2018Axis_full_FHCAllSyst_nueconcat_realNDData_2018-05-22.root";
67  else if(!isFHC && !isFakeData)
68  ret = dir + "/NueProd4SystematicsOnRealNDData_2018-05-22/pred_allxp_Nue2018Axis_full_RHCAllSyst_nueconcat_realNDData_2018-05-22.root";
69  else if(isFHC && isFakeData)
70  ret = dir + "/NueProd4SystematicsOnFakeNDData_2018-05-03/pred_allxp_Nue2018Axis_full_FHCAllSysts_nueconcat_fakeNDData_05_03_2018_merged.root";
71  else if(!isFHC & isFakeData)
72  ret = dir + "/NueProd4SystematicsOnFakeNDData_2018-05-03/pred_allxp_Nue2018Axis_full_RHCAllSysts_nueconcat_fakeNDData_05_03_2018_merged.root";
73  }
74  return ret;
75 }
76 
77 
80  bool corrSysts,
82  bool isFakeData,
83  bool GetFromUPS=false,
84  bool minimizeMemory = false,
85  bool NERSC = false){
86 
87  cout<<"\n\n ============= You're loading Nue predictions ============="<<endl;
88 
90  if(decomp == "noextrap") extrap = kNoExtrap;
91  if(decomp == "prop") extrap = kProportional;
92  if(decomp == "combo") extrap = kCombo;
93  if(decomp == "fakexp") extrap = kFake;
94 
95  PredictionSystJoint2018 * pred_fid;
96  std::string nue_pred_path = GetNuePredPath(beam, isFakeData, NERSC);
97  // Interactive running
98  if (!GetFromUPS){
99  if(corrSysts){
100  std::cout << "Getting Nue Prediction from " + nue_pred_path << endl;
101  if(beam=="rhc") pred_fid = new PredictionSystJoint2018 (extrap, calc,
103  beam, isFakeData, true,
104  nue_pred_path, minimizeMemory);
105  else if(beam=="fhc") pred_fid = new PredictionSystJoint2018 (extrap, calc,
107  beam, isFakeData, true,
108  nue_pred_path, minimizeMemory);
109  else{ std::cout << "Beam mode needs to be either fhc or rhc" << endl; exit(1);}
110  }
111  else pred_fid = new PredictionSystJoint2018 (extrap, calc,{}, beam, isFakeData,
112  true, nue_pred_path, minimizeMemory);
113  }
114  // Grid running
115  else{
116  std::string upsname = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2018/"; // not ups but similar idea
117  std::string name = "";
118  if(beam=="fhc" && !isFakeData) name = "pred_allxp_Nue2018Axis_full_FHCAllSyst_nueconcat_realNDData_2018-05-22.root";
119  else if(beam=="rhc" && !isFakeData) name = "pred_allxp_Nue2018Axis_full_RHCAllSyst_nueconcat_realNDData_2018-05-22.root";
120 
121  if(corrSysts){
122  if(beam=="rhc") pred_fid = new PredictionSystJoint2018(extrap, calc,
124  beam, isFakeData, true,
125  upsname+name, minimizeMemory);
126  else if(beam=="fhc") pred_fid = new PredictionSystJoint2018(extrap, calc,
128  beam, isFakeData, true,
129  upsname+name, minimizeMemory);
130  else{ std::cout << "Beam mode should be either fhc or rhc" << endl; exit(1);}
131  }
132  else
133  pred_fid = new PredictionSystJoint2018(extrap, calc, {},beam, isFakeData,
134  true, upsname+name, minimizeMemory);
135  }
136 
137  double pot;
138  if(beam=="rhc") pot = kAna2019RHCPOT;
139  else pot = kAna2019FHCPOT;
140  std::cout << "Scale to "<<pot<<std::endl;
141  std::cout << "Nue prediction (no rock)"
142  << pred_fid->Predict(calc).Integral(pot) <<std::endl;
143  // Load rock
144  double nonsScale = 1./10.45;
145  double swapScale = 1./12.91;
146  std::string dirName = "/nova/ana/nu_e_ana/Ana2018/Predictions/FDRock/";
147  if(NERSC) dirName = std::string(getenv("FCHELPERANA2018_LIB_PATH"))+"/Predictions/FDRock/";
148  if(GetFromUPS) dirName = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2018/";
149  std::string fName2 = "fdrock_nue2018.root";
150  std::string rName;
151 
152  if(beam=="rhc") rName = "pred_FDRock_merg_rhc";
153  else rName = "pred_FDRock_merg_fhc";
154  if( decomp == "noextrap"){
155  if(beam=="rhc") rName = "pred_FDRock_rhc";
156  else rName = "pred_FDRock_fhc";
157  }
158 
159  auto rock = LoadFromFile<PredictionNoExtrap>(dirName + fName2, rName).release();
160 
161  std::cout << "Nue prediction (rock only - not scaled) "
162  << rock->Predict(calc).Integral(pot) <<std::endl;
163  std::cout << "Adding Rock" << endl;
164  auto nue_pred = new PredictionAddRock (pred_fid, rock, nonsScale, swapScale);
165  std::cout << "Nue prediction (rock added) "
166  << nue_pred->Predict(calc).Integral(pot) << std::endl;
167  std::cout << "Pure rock events: "
168  << nue_pred->Predict(calc).Integral(pot) - pred_fid->Predict(calc).Integral(pot) << std::endl;
169 
170  return nue_pred;
171 }
172 
173 //////////////////////////////////////////////////////////////////////
174 
175 std::pair <TH1D*, double > GetNueCosmics2019 (std::string beam, bool GetFromUPS=false, bool NERSC=false){
176 
177  cout<<"\n\n ============= You're loading Nue cosmics ============="<<endl;
178 
179  cout<<"\n\nCall 2019 cosmic predictions "<<endl;
180  Spectrum* outtime2019;
182  std::string anaDir = "/nova/ana/nu_e_ana/Ana2019/Cosmics/";
183  if(NERSC) anaDir = std::string(getenv("FCHELPERANA2019_LIB_PATH")) + "Cosmics/";
184  if(GetFromUPS) anaDir = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2019/";
185  if(beam=="rhc") name = "cosmic_spect_rhc_2019";
186  else name="cosmic_spect_fhc_2018";
187  outtime2019 = LoadFromFile<Spectrum>
188  (anaDir+"cosmic_prediction_real_data_2019.root", name ).release();
189 
190  double livetime;
191  if(beam=="rhc") livetime = kAna2019RHCLivetime ;
192  else livetime = kAna2019FHCLivetime ;
193 
194  double outN = outtime2019->Integral(outtime2019->Livetime(), 0, kLivetime);
195  //double outN = outtime2019->Integral(livetime, 0, kLivetime);
196 
197  std::cout << "\nAdding " << outtime2019->Integral(outtime2019->Livetime(), 0, kLivetime)
198  << " cosmics from out-of-time." << std::endl;
199  std::cout << "Which scale to " << outtime2019->Integral(livetime, 0,
200  kLivetime)
201  << " in the spill window." << std::endl;
202  std::cout << " livetime " << livetime <<" internal livetime "<<outtime2019->Livetime() <<std::endl;
203  std::cout << "uncertainty " << 1/sqrt(outN) << std::endl;
204 
205  TH1 *h = outtime2019->ToTH1(livetime, kBlack, kSolid, kLivetime);
206 
207  return {outtime2019->ToTH1(livetime, kBlack, kSolid, kLivetime), 1/sqrt(outN)};
208 
209  outtime2019->Clear();
210 }
211 
212 /// Temporary function for getting 2018 cosmic. We will use it for cross checks
213 
214 std::pair <TH1D*, double > GetNueCosmics2018 (std::string beam, bool GetFromUPS=false, bool NERSC=false){
215 
216  cout<<"\n\n ============= You're loading Nue cosmics ============="<<endl;
217 
218  cout<<"\n\nCall 2018 cosmic predictions "<<endl;
219  Spectrum* outtime2018;
221  std::string anaDir = "/nova/ana/nu_e_ana/Ana2018/Predictions/cosmic/";
222  if(NERSC) anaDir = std::string(getenv("FCHELPERANA2018_LIB_PATH")) + "Predictions/cosmic/";
223  if(GetFromUPS) anaDir = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2018/";
224  if(beam=="rhc") name = "cosmic_spect_rhc";
225  else name="cosmic_spect_fhc";
226 
227  outtime2018 = LoadFromFile<Spectrum>(anaDir+"cosmic_prediction_real_data.root", name ).release();
228 
229  double livetime;
230  if(beam=="rhc") livetime = kAna2018RHCLivetime ;
231  else livetime = kAna2018FHCLivetime ;
232 
233  //double outN = outtime->Integral(outtime->Livetime(), 0, kLivetime);
234  double outN = outtime2018->Integral(livetime, 0, kLivetime);
235 
236  std::cout << "\nAdding " << outtime2018->Integral(livetime, 0, kLivetime)
237  << " cosmics from out-of-time." << std::endl;
238  std::cout << "Which scale to " << outtime2018->Integral(livetime, 0, kLivetime)
239  << " in the spill window." << std::endl;
240  std::cout << " livetime " << livetime <<" internal livetime "<<outtime2018->Livetime() <<std::endl;
241  std::cout << "uncertainty " << 1/sqrt(outN) << std::endl;
242 
243  TH1 *h = outtime2018->ToTH1(livetime, kBlack, kSolid, kLivetime);
244 
245  return {outtime2018->ToTH1(livetime, kBlack, kSolid, kLivetime), 1/sqrt(outN)};
246 
247  outtime2018->Clear();
248 }
249 
250 //////////////////////////////////////////////////////////////////////
251 
252 Spectrum* GetNueData2019 (std::string beam, bool GetFromUPS=false){
253 
254  cout<<"\n\n ============= You're loading Nue real data ============="<<endl;
255 
256  Spectrum* intime;
257  std::string anaDir = "/nova/ana/nu_e_ana/Ana2019/Data2019/";
258  if(GetFromUPS) anaDir = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2019/";
259 
260  if(beam=="fhc"){
261  intime = LoadFromFile<Spectrum>(anaDir+"nue_data_2019.root", "spect_fhc").release();
262  }
263  else if(beam=="rhc"){
264  intime = LoadFromFile<Spectrum>(anaDir+"nue_data_2019.root", "spect_rhc").release();
265  }
266  else{ std::cout << "Beam mode != fhc or rhc" << std::endl; exit(1);}
267  double POT, livetime;
268  if(beam == "rhc") {livetime = kAna2019RHCLivetime; POT = kAna2019RHCPOT;}
269  if(beam == "fhc") {livetime = kAna2019FHCLivetime; POT = kAna2019FHCPOT;}
270  std::cout << "Loaded data spectrum:\n"
271  << "POT " << intime->POT()
272  << " (expected " << POT << ")\n"
273  << "Livetime " << intime->Livetime()
274  << " (expected " << livetime << ")\n"
275  << "Integral " << intime->Integral(intime->POT())
276  << std::endl;
277  return intime;
278 }
279 
280 //////////////////////////////////////////////////////////////////////
281 
282 std::vector <const IPrediction*> GetNumuPredictions2019(const int nq = 4,
283  bool useSysts = true,
284  std::string beam="fhc",
285  bool GetFromUPS=false,
286  ENu2018ExtrapType numuExtrap = kNuMu,
287  bool minimizeMemory = false,
288  bool NERSC = false)
289 {
290 
291  cout<<"\n\n ============= You're loading Numu predictions ============="<<endl;
292 
293  auto calc = DefaultOscCalc();
294 
295  std::vector <const IPrediction*> numu_preds;
296 
298  std::string anaDir = "/nova/ana/nu_mu_ana/Ana2018/";
299  if(NERSC) anaDir = std::string(getenv("FCHELPERANA2018_LIB_PATH"));
300  if(beam=="rhc") filename=anaDir + "/Predictions/pred_numuconcat_rhc__numu2018.root";
301  else filename= anaDir + "/Predictions/pred_numuconcat_fhc__numu2018.root";
302 
303  std::cout << "\nLoading Numu Predictions\n" ;
304  for (int quant = 0; quant < nq; ++quant){
305  if (GetFromUPS){
306  std::string upsname = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2018/";
307  std::string fname ="";
308  if(beam=="rhc") fname="pred_numuconcat_rhc__numu2018.root";
309  else fname= "pred_numuconcat_fhc__numu2018.root";
310 
311  if(!useSysts) {
312  numu_preds.push_back(new PredictionSystJoint2018(numuExtrap, calc, beam,
313  quant+1,{}, upsname+fname,
314  minimizeMemory));
315  }
316  else{
317  numu_preds.push_back(new PredictionSystJoint2018(numuExtrap, calc, beam, quant+1,
319  upsname+fname, minimizeMemory));
320  }
321  }
322  else{
323  if(!useSysts) {
324  numu_preds.push_back(new PredictionSystJoint2018(numuExtrap, calc, beam, quant+1,
325  {}, filename, minimizeMemory));
326  }
327  else {
328  numu_preds.push_back(new PredictionSystJoint2018(numuExtrap, calc, beam, quant+1,
330  filename, minimizeMemory));
331  }
332  }
333  }
334  return numu_preds;
335 }
336 //////////////////////////////////////////////////////////////////////
337 
338 std::vector <std::pair <TH1D*, double> > GetNumuCosmics2019(const int nq = 4, std::string beam="fhc",
339  bool GetFromUPS=false, bool NERSC = false)
340 {
341 
342  cout<<"\n\n ============= You're loading Numu cosmics ============="<<endl;
343  cout<<"Beam is "<<beam<<endl;
344 
345  std::string dir = "/nova/ana/nu_mu_ana/Ana2019/Cosmics/";
346  if(NERSC) dir = std::string(getenv("FCHELPERANA2019_LIB_PATH"));
347  if(GetFromUPS) dir = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2019/";
348  std::string filename = "";
349  if (beam=="rhc") filename="cosmics_rhc__numu2019.root";
350  else filename="cosmics_fhc__numu2018.root";
351  TFile * fcosm = TFile::Open((dir+filename).c_str());
352 
353  if(fcosm->IsZombie()) {std::cerr<< "bad cosmics\n"; exit(1);}
354  std::vector <std::pair <TH1D*, double > > numu_cosmics;
355 
356  for (int i = 1; i <=nq; ++i) {
357  auto h = (TH1D*) fcosm->Get((TString)"cosmics_q"+std::to_string(i))
358  ->Clone(UniqueName().c_str());
359  auto h_trigger = (TH1D*) fcosm->Get((TString)"trigger_q"+std::to_string(i));
360  numu_cosmics.push_back({h,1/sqrt(h_trigger->Integral())});
361  std::cout << "Cosmics all periods quantile " << i << " "
362  << h->Integral()
363  << " scale error "
364  << 1/sqrt(h_trigger->Integral())
365  << "\n";
366  }//end quantiles
367 
368  return numu_cosmics;
369 }
370 
371 /// Temp. function for getting 2018 cosmics. We will use it for cross checks
372 
373 std::vector <std::pair <TH1D*, double> > GetNumuCosmics2018(const int nq = 4, std::string beam="fhc",
374  bool GetFromUPS=false, bool NERSC = false)
375 {
376 
377  cout<<"\n\n ============= You're loading Numu cosmics ============="<<endl;
378  cout<<"Beam is "<<beam<<endl;
379 
380  std::string dir = "/nova/ana/nu_mu_ana/Ana2018/Cosmics/";
381  if(NERSC) dir = std::string(getenv("FCHELPERANA2018_LIB_PATH"));
382  if(GetFromUPS) dir = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2018/";
383 
384  std::string filename = "";
385  if (beam=="rhc") filename="cosmics_rhc__numu2018.root";
386  else filename="cosmics_fhc__numu2018.root";
387  TFile * fcosm = TFile::Open((dir+filename).c_str());
388 
389  if(fcosm->IsZombie()) {std::cerr<< "bad cosmics\n"; exit(1);}
390  std::vector <std::pair <TH1D*, double > > numu_cosmics;
391 
392  for (int i = 1; i <=nq; ++i) {
393  auto h = (TH1D*) fcosm->Get((TString)"cosmics_q"+std::to_string(i))->Clone(UniqueName().c_str());
394  numu_cosmics.push_back({h,1/sqrt(h->Integral())});
395  std::cout << "Cosmics all periods quantile " << i << " "
396  << h->Integral()
397  << " scale error "
398  << 1/sqrt(h->Integral())
399  << "\n";
400  }//end quantiles
401 
402  return numu_cosmics;
403 
404 }
405 
406 //////////////////////////////////////////////////////////////////////
407 
408 std::vector <Spectrum * > GetNumuData2019(const int nq = 4, std::string beam = "fhc", bool GetFromUPS = false){
409 
410  cout<<"\n\n ============= You're loading Numu real data ============="<<endl;
411 
412  std::string anaDir = "/nova/ana/nu_e_ana/Ana2019/Data2019/";
413  if(GetFromUPS) anaDir = "/cvmfs/nova.osgstorage.org/analysis/nue/Ana2019/";
414 
415  std::string file = anaDir+"numu_data_2019_fhc.root";
416  if(beam == "rhc") file = anaDir+"numu_data_2019_rhc.root";
417 
418  std::vector <Spectrum *> numu_data;
419  double POT = kAna2019FHCPOT; double livetime = kAna2019FHCLivetime;
420  if(beam == "rhc") {livetime = kAna2019RHCLivetime; POT = kAna2019RHCPOT;}
421 
422  for (int i = 1; i <=nq; ++i) {
423 
424  auto f= new TFile(file.c_str());
425  if(f->IsZombie()) {std::cerr<< "bad data\n"; exit(1);}
426  auto intime = Spectrum::LoadFrom(f, ("data_q"+std::to_string(i)).c_str()).release();
427  numu_data.push_back(intime);
428 
429  std::cout << "Loaded numu data spectrum Q"<<i
430  << " POT " << intime->POT()
431  << " (expected " << POT << ")\n"
432  << " Livetime " << intime->Livetime()
433  << " (expected " << livetime << ")\n"
434  << " Integral " << intime->Integral(intime->POT())
435  << std::endl;
436  }//end quantiles
437 
438 
439  return numu_data;
440 }
441 
442 
443 //////////////////////////////////////////////////////////////////////
444 
445 std::vector<const ISyst*> GetJointFitSystematicList(bool corrSysts, bool nueExclusive = false, bool numuExclusive=false, bool isFHC = true, bool isRHC = true , bool intersection = true){
446  std::vector<const ISyst*> ret ={} ;
447  if(corrSysts){
448  if(! intersection){
449  if(nueExclusive){
450 
451  ret.push_back(&kRadCorrNue);
452  ret.push_back(&kRadCorrNuebar);
453  ret.push_back(&k2ndClassCurrs);
456 
457  }
458  if(numuExclusive){
459 
463  if(isFHC) ret.push_back(&kAna2018NormRHC);
464  if(isRHC) ret.push_back(&kAna2018NormFHC);
466 
467  }
468  }
469  else{
470  if(nueExclusive) ret = getAllAna2018Systs(kNueAna2018);
471  if(numuExclusive) ret = getAllAna2018Systs(kNumuAna2018);
472  if(!nueExclusive && !numuExclusive) ret = getAllAna2018Systs(kJointAna2018, true, kBoth, true);
473  //std::cout <<"I'm in else" <<std::endl;
474  //if(!nueExclusive && !numuExclusive) ret = getAllAna2018Systs(kJointAna2018, true, true);
475  }
476  }
477  std::cout << "Return list of systematics: " ;
478  for(auto & s:ret) std::cout << s->ShortName() << ", ";
479  std::cout << std::endl;
480  return ret;
481 }
482 
483 std::vector<std::pair<const ISyst*,const ISyst*> > GetCorrelations (bool isNue, bool isFHC){
484  std::vector<std::pair<const ISyst*,const ISyst*> > ret ={};
485  std::cout<<(isNue?"not nue ":"not numu ")<<(isFHC&&!isNue?" ":(isFHC?" FHC ":" RHC "));
486  //to first approximation if they are not the same they are not correlated.
487  //might have to be more complicated later
488  auto badsyst = GetJointFitSystematicList(true, !isNue, isNue, isFHC, !isFHC, false);
489  for (auto & s:badsyst) ret.push_back ({s,NULL});
490 
491  return ret;
492 }
493 
494 
495 double GetPOT(bool isFHC = true){
496 
497  double tmp = kAna2019FHCPOT;
498  if (!isFHC) tmp = kAna2019RHCPOT;
499  return tmp;
500 
501 }
TFile * GetGaussianSurface(TString par, TString hier)
const XML_Char * name
Definition: expat.h:151
TCut intime("tave>=217.0 && tave<=227.8")
std::vector< std::pair< TH1D *, double > > GetNumuCosmics2018(const int nq=4, std::string beam="fhc", bool GetFromUPS=false, bool NERSC=false)
Temp. function for getting 2018 cosmics. We will use it for cross checks.
const NOvARwgtSyst k2ndClassCurrs("2ndclasscurr","Second class currents", novarwgt::kSimpleSecondClassCurrentsSystKnob)
Second-class current syst. See documentation in NOvARwgt.
Definition: XSecSysts.h:71
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
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.
Definition: Spectrum.cxx:148
const double kAna2019RHCLivetime
Definition: Exposures.h:227
subdir
Definition: cvnie.py:7
Loads shifted spectra from files.
std::vector< const IPrediction * > GetNumuPredictions2019(const int nq=4, bool useSysts=true, std::string beam="fhc", bool GetFromUPS=false, ENu2018ExtrapType numuExtrap=kNuMu, bool minimizeMemory=false, bool NERSC=false)
T sqrt(T number)
Definition: d0nt_math.hpp:156
General interface to oscillation calculators.
Definition: StanTypedefs.h:22
Int_t par
Definition: SimpleIterate.C:24
OStream cerr
Definition: OStream.cxx:7
string filename
Definition: shutoffs.py:106
void Clear()
Definition: Spectrum.cxx:372
Float_t tmp
Definition: plot.C:36
void AddJointAna2018NotCorrelSysts(std::vector< const ISyst * > &systs, const EAnaType2018 ana, const BeamType2018 beam)
double Integral(double exposure, double *err=0, EExposureType expotype=kPOT) const
Return total number of events scaled to pot.
Definition: Spectrum.cxx:272
osc::OscCalcDumb calc
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
const IPrediction * GetNuePrediction2019(std::string decomp, osc::IOscCalc *calc, bool corrSysts, std::string beam, bool isFakeData, bool GetFromUPS=false, bool minimizeMemory=false, bool NERSC=false)
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const NOvARwgtSyst kRadCorrNuebar("radcorrnuebar","Radiative corrections for #bar{#nu}_{e}", novarwgt::kSimpleRadiativeCorrNuebarXsecSystKnob)
Radiative corrections syst (nuebars). See documentation in NOvARwgt.
Definition: XSecSysts.h:67
const XML_Char * s
Definition: expat.h:262
std::vector< const ISyst * > getAllAna2018Systs(const EAnaType2018 ana, const bool smallgenie, const BeamType2018 beam, bool isFit)
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Spectrum.cxx:546
std::string getenv(std::string const &name)
std::string GetNuePredPath(std::string beam, bool isFakeData, bool NERSC)
#define pot
const double kAna2019FHCLivetime
Definition: Exposures.h:226
double POT() const
Definition: Spectrum.h:219
static bool isFHC
OStream cout
Definition: OStream.cxx:6
std::vector< double > POT
Spectrum * GetNueData2019(std::string beam, bool GetFromUPS=false)
const double kAna2019RHCPOT
Definition: Exposures.h:224
Spectrum Predict(osc::IOscCalc *calc) const override
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::pair< TH1D *, double > GetNueCosmics2018(std::string beam, bool GetFromUPS=false, bool NERSC=false)
Temporary function for getting 2018 cosmic. We will use it for cross checks.
const DummyAnaSyst kAna2018NormRHC("NormRHC2018","RHC. Norm.")
std::string dirName
Definition: PlotSpectra.h:47
std::vector< std::pair< TH1D *, double > > GetNumuCosmics2019(const int nq=4, std::string beam="fhc", bool GetFromUPS=false, bool NERSC=false)
std::vector< Spectrum * > GetNumuData2019(const int nq=4, std::string beam="fhc", bool GetFromUPS=false)
TDirectory * dir
Definition: macro.C:5
double livetime
Definition: saveFDMCHists.C:21
void AddNonLoadable2018Systs(std::vector< const ISyst * > &systs, const EAnaType2018 ana)
exit(0)
TFile * file
Definition: cellShifts.C:17
const double kAna2019FHCPOT
Definition: Exposures.h:223
double GetPOT(bool isFHC=true)
std::vector< std::pair< const ISyst *, const ISyst * > > GetCorrelations(bool isNue, bool isFHC, bool ptExtrap)
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
std::vector< const ISyst * > GetJointFitSystematicList(bool corrSysts, bool nueExclusive=false, bool numuExclusive=false, bool isFHC=true, bool isRHC=true, bool intersection=true, bool ptExtrap=true)
const NOvARwgtSyst kRadCorrNue("radcorrnue","Radiative corrections for #nu_{e}", novarwgt::kSimpleRadiativeCorrNueXsecSystKnob)
Radiative corrections syst (nues). See documentation in NOvARwgt.
Definition: XSecSysts.h:64
double Livetime() const
Seconds. For informational purposes only. No calculations use this.
Definition: Spectrum.h:222
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
void rock(std::string suffix="full")
Definition: rock.C:28
const DummyAnaSyst kAna2018NormFHC("NormFHC2018","FHC. Norm.")
const double kAna2018FHCLivetime
Definition: Exposures.h:213
const double kAna2018RHCLivetime
Definition: Exposures.h:214
std::pair< TH1D *, double > GetNueCosmics2019(std::string beam, bool GetFromUPS=false, bool NERSC=false)