PlotNus17PredSystsData.C
Go to the documentation of this file.
1 #include "TCanvas.h"
2 #include "TDirectory.h"
3 #include "TFile.h"
4 #include "TH1.h"
5 #include "TH2.h"
6 #include "TLatex.h"
7 #include "TLegend.h"
8 #include "TLine.h"
9 #include "TPad.h"
10 
11 #include "CAFAna/Analysis/Calcs.h"
13 #include "CAFAna/Fit/Fit.h"
14 #include "CAFAna/Analysis/Style.h"
16 #include "CAFAna/Core/IFitVar.h"
25 #include "OscLib/OscCalcSterile.h"
26 
28 
29 using namespace ana;
30 
31 // Definitions for organization
32 
33 // One struct to contain all values for angle fits
34 struct AngleValues{
35  int nbins23;
36  double min23;
37  double max23;
38 
39  int nbins34;
40  double min34;
41  double max34;
42 
43  int nbins24;
44  double min24;
45  double max24;
46 };
47 
48 void TexInfo();
49 
50 TLegend* MakeLegend(double x1, double y1, double x2, double y2, double textsize = 0.03)
51 {
52  TLegend* leg = new TLegend(x1, y1, x2, y2);
53  leg->SetBorderSize(0);
54  leg->SetFillColor(kWhite);
55  leg->SetFillStyle(0);
56  leg->SetFillStyle(0);
57  leg->SetTextFont(42);
58  leg->SetTextSize(textsize);
59  return leg;
60 }
61 
62 void SigmaLines(double xmin, double xmax);
63 
64 void PlotText(const double xpos, const double start, const double step);
65 
66 // Reset calculator values after each fit to preset defaults
68 
69 // Plot a single 1D slice canvas -- this function does the actual plotting
70 // The macro does not call this function directly in the main function
71 // \param expt The CAFAna experiment object, contains FD prediction and "data"
72 // \param calc Sterile calculator for oscillating the spectra
73 // \param var Parameter to fit for!
74 // \param profVars Vector of parameters to profile over
75 // \param rootOut Already open file for root output
76 // \param name Base of the string for creating the name for saving the root objects
77 
79  const IFitVar* var, std::vector<const IFitVar*> vars,
80  int nbins, double min, double max,
81  TDirectory* rootOut, std::string name, std::string special,
82  Color_t color, double minchi, std::vector<const ISyst*> systs = {});
83 
84 
85 void CompareSlices(TH1* stats, TH1* systs, std::string angle, TDirectory* rootOut, double xmin, double xmax);
86 
87 // Plot 2D slice surfaces
88 // The macro does not call this function directly
89 // \param rootOut Already open file for root output
90 // \param prof String indicating whether surfaces are profiled or not (optional)
91 void Plot2DSlice(IExperiment* expt1,
92  IExperiment* expt2,
93  osc::OscCalcSterile* calc,
94  const IFitVar* varA,
95  int nbinsA, double minA, double maxA,
96  const IFitVar* varB,
97  int nbinsB, double minB, double maxB,
98  TDirectory* rootOut, std::string angles,
99  std::vector<const IFitVar*> vars,
100  std::vector<const ISyst*> systs = {});
101 
102 
103 
104 
106 {
107  TH1::AddDirectory(0);
108 
109  // Set up path to file with filled CAFAna objects and for output of analysis
110  //std::string folder = "/nova/ana/steriles/Ana01/";
111  std::string folder = "$NOVA_ANA/steriles/Nus17/";
112  std::string filenm = "predInterpSysts_nus17_v1";
113 
114  std::string loadLocation = folder + filenm + ".root";
115  std::string saveLocation = "plot_" + filenm + "_shape_2D_lower.root";
116  std::string textLocation = "count_" + filenm + "_shape_2D_lower.txt";
117 
118  std::vector<const ISyst*> systs = getAllNusFDSysts();
119 
120  // Load in the NuMI data spectrum
121  Spectrum* intime = LoadFromFile<Spectrum>("$NOVA_ANA/steriles/Nus17/fout_nus17_box_opening_restricted.root","spec_nus_vise_numi").release();
122 
123  TH1 *hSpectrum = intime->ToTH1(intime->POT());
124  Spectrum data_spec(hSpectrum, intime->POT(), intime->Livetime());
125  std::cout << "Data spectrum: " << data_spec.POT()
126  <<" POT and "
127  << data_spec.ToTH1(intime->POT())->GetSumOfWeights()
128  << " events" << std::endl;
129  delete hSpectrum;
130  TFile *cos = new TFile("$NOVA_ANA/steriles/Nus17/nus17_cosmic_background.root","read");
131  TH1 *hcosmic = (TH1*)cos->Get("cosall");
133  std::cout << "Cosmic Data spectrum: " << cosmic.POT()
134  <<" POT and "
135  << cosmic.ToTH1(cosmic.POT())->GetSumOfWeights()
136  << " events"
137  << ", Livetime: "
138  << cosmic.Livetime() << std::endl;
139  delete hcosmic;
140  cos->Close();
141 
142  // Load filled objects from file
143  TFile* rootL = new TFile(loadLocation.c_str(), "UPDATE");
144  TDirectory* tmpL = gDirectory;
145  TDirectory* loadDir = gDirectory;
146 
147  loadDir->cd((loadLocation + ":/nus17_predI").c_str());
148  std::unique_ptr<PredictionInterp> pred = PredictionInterp::LoadFrom(gDirectory);
149 
150 
151  tmpL->cd();
152  rootL->Close(); // Don't forget to close the file!
153 
154  // Set up oscillation calculator that uses default 3 flavor parameters
157 
158  Spectrum prediction = pred.get()->Predict(calc3f);
159 
160 
162  calc4f->SetNFlavors(4);
163  ResetAngles(calc4f);
164 
165 
166  std::string labelEReco = "Visible Energy (GeV)";
167 
168  // // Open files for saving analysis output
169  TFile* rootF = new TFile(saveLocation.c_str(), "RECREATE");
170 
171  // Create Experiment objects, one each for the 1 data yr and 3 data yr predictions
172  GaussianConstraint s2th23Constraint(&kFitSinSqTheta23Sterile, 0.404, 0.030);
173  GaussianConstraint dmsq32Constraint(&kFitDmSq32Sterile, 2.67e-3, 0.11e-3);
174  // 0.404 +- 0.030 --> dCP = 1.48pi
175  // 0.624 +- 0.030 --> dCP = 0.74pi
176 
177  SingleSampleExperiment expt9s(pred.get(), data_spec, cosmic);
178  MultiExperiment multi9s({&s2th23Constraint, &dmsq32Constraint, &expt9s});
179  //MultiExperiment multi9s({&s2th23Constraint, &expt9s});
180 
181  // Set up values for slice and surface plots
182  AngleValues avals;
183  avals.nbins23 = 200;
184  avals.min23 = 20.;
185  avals.max23 = 70.;
186  avals.nbins34 = 200;
187  avals.min34 = 0.;
188  avals.max34 = 50.;
189  avals.nbins24 = 180;
190  avals.min24 = 0.;
191  avals.max24 = 45.;
192 
193  std::string fullname, special;
194 
195  const Color_t kStatsFitCol = kBlack;
196  const Color_t kRateCol = kAzure+2;
197  const Color_t kShapeCol = kBlack;
198 
199  const Color_t kFitColor = kRed;
200 
201  // fullname = "34";
202  // special = "statC_24e20";
203  // //Plot 1D fits for 9e20 experiment: Counting
204  // TH1* h34C_1 = Plot1DSlice(&multi9s, calc4f,
205  // &kFitTheta34InDegreesSterile,
206  // {&kFitSinSqTheta23Sterile,
207  // &kFitTheta24InDegreesSterile,
208  // &kFitDelta24InPiUnitsSterile},
209  // avals.nbins34, avals.min34, avals.max34,
210  // rootF, fullname, special, kRateCol,
211  // -1
212  // );
213 
214 
215  // special = "systS_9e20";
216  // //Plot 1D fits for 9e20 experiment: Sample
217  // TH1* h34S_1 = Plot1DSlice(&multi9s, calc4f,
218  // &kFitTheta34InDegreesSterile,
219  // {&kFitSinSqTheta23Sterile,
220  // &kFitTheta24InDegreesSterile,
221  // &kFitDelta24InPiUnitsSterile},
222  // avals.nbins34, avals.min34, avals.max34,
223  // rootF, fullname, special, kShapeCol,
224  // -1, systs
225  // );
226 
227  // CompareSlices(h34C_1, h34S_1, "34_stats_9e20", rootF,
228  // avals.min34, avals.max34);
229 
230  // fullname = "24";
231  // special = "statC_9e20";
232  // //Plot 1D fits for 9e20 experiment: Counting
233  // TH1* h24C_1 = Plot1DSlice(&multi9s, calc4f,
234  // &kFitTheta24InDegreesSterile,
235  // {&kFitSinSqTheta23Sterile,
236  // &kFitTheta34InDegreesSterile,
237  // &kFitDelta24InPiUnitsSterile},
238  // avals.nbins24, avals.min24, avals.max24,
239  // rootF, fullname, special, kRateCol,
240  // -1
241  // );
242 
243  // //fullname = "24";
244  // special = "systS_9e20";
245  // //Plot 1D fits for 9e20 experiment: Sample
246  // TH1* h24S_1 = Plot1DSlice(&multi9s, calc4f,
247  // &kFitTheta24InDegreesSterile,
248  // {&kFitSinSqTheta23Sterile,
249  // &kFitTheta34InDegreesSterile,
250  // &kFitDelta24InPiUnitsSterile},
251  // avals.nbins24, avals.min24, avals.max24,
252  // rootF, fullname, special, kShapeCol,
253  // -1, systs
254  // );
255 
256  // CompareSlices(h24C_1, h24S_1, "24_shape_9e20", rootF,
257  // avals.min24, avals.max24);
258 
259 
260  // //Lower the number of bins for surfaces
261 
262  avals.nbins34 = 50;
263  avals.min34 = 0.;
264  avals.max34 = 50.;
265  avals.nbins24 = 45;
266  avals.min24 = 0.;
267  avals.max24 = 45.;
268 
269 
270  special = "34vs24_9e20_shape";
271  //Plot the surfaces for 9e20 rate vs. shape experiment
272  Plot2DSlice(&multi9s, &multi9s, calc4f,
274  avals.nbins34, avals.min34, avals.max34,
276  avals.nbins24, avals.min24, avals.max24,
277  rootF, special,
278  {&kFitSinSqTheta23Sterile,
279  &kFitDelta24InPiUnitsSterile},
280  systs
281  );
282 
283  rootF->Close(); // Close the output root file
284 
285 }
286 
287 
288 //........................................................................
290  const IFitVar* var, std::vector<const IFitVar*> profVars,
291  int nbins, double min, double max,
292  TDirectory* rootOut, std::string indices,
293  std::string special, Color_t color,
294  double minchi, std::vector<const ISyst*> systs)
295 {
296  // Create slice histogram with/without profiling based on input profVars vector size
297  //TH1* h = Profile(expt, calc, var, nbins, min, max, -1, profVars, systs);
298  //TH1* h = systs.size() > 0 ? Profile(expt, calc, var, nbins, min, max, -1, profVars, systs, { {&kFitDelta24InPiUnitsSterile,{1.5} } }) :
299  //Profile(expt, calc, var, nbins, min, max, -1, profVars, {}, { {&kFitDelta24InPiUnitsSterile, {1.5} } });
300  ResetAngles(calc); // Don't forget to reset calculator...
301  TH1* h = systs.size() > 0 ? Profile(expt, calc, var, nbins, min, max, -1, profVars, systs) :
302  Profile(expt, calc, var, nbins, min, max, -1, profVars);
303 
304 
305  std::string fullname = indices + special;
306  // Formatting
307  h->SetLineColor(color);
308  h->SetMaximum(5);
309  h->SetMinimum(0);
310  h->SetName(fullname.c_str()); // Object name for saving
311  rootOut->WriteTObject(h); // Save raw histogram
312 
313 
314  std::cout << fullname << std::endl;
315  std::string cname = "c1D" + fullname;
316  std::string ctitle = "Theta" + indices + "_ChiSq1DSlice_" + special;
317  std::string htitle = "#theta_{"+indices+"} (deg.)";
318  h->GetXaxis()->SetTitle(htitle.c_str());
319 
320  // Actually draw things together
321  TCanvas* c = new TCanvas(cname.c_str(), ctitle.c_str(), 600, 500);
322  h->GetXaxis()->SetRangeUser(min+0.25,max);
323  h->Draw("l");
324  TexInfo();
325  SigmaLines(min, max);
326  PlotText(0.135, 0.82, 0.055);
327  TLegend* leg = 0;
328  // Special case legend position for each angle slice
329  if(indices.compare("34") == 0){
330  std::cout << "Making 34 legend" << std::endl;
331  leg = MakeLegend(0.135, 0.35, 0.435, 0.50, 0.037);
332  }
333  if(indices.compare("24") == 0)
334  leg = MakeLegend(0.600, 0.35, 0.900, 0.50, 0.037);
335  if(indices.compare("23") == 0)
336  leg = MakeLegend(0.350, 0.35, 0.650, 0.50, 0.037);
337 
338  if(systs.size() > 0)
339  leg->AddEntry(h,"syst.","L");
340  else
341  leg->AddEntry(h,"stat.","L");
342 
343  leg->Draw();
344 
345  //Simulation();
346  Preliminary();
347  CenterTitles(h);
348  rootOut->WriteTObject(c);
349 
350  return h;
351 }
352 
353 
354 void CompareSlices(TH1* stats, TH1* systs, std::string indices, TDirectory* rootOut, double min, double max)
355 {
356 
357  std::string cname = "c1DComp" + indices;
358  std::string ctitle = "Theta" + indices + " ChiSq1Dcomp";
359  TCanvas* c = new TCanvas(cname.c_str(), ctitle.c_str(), 600, 500);
360  stats->GetXaxis()->SetRangeUser(min+0.25,max);
361  systs->GetXaxis()->SetRangeUser(min+0.25,max);
362  stats->Draw("l");
363  systs->Draw("l same");
364  TexInfo();
365  SigmaLines(min, max);
366  //Simulation();
367  Preliminary();
368  PlotText(0.135, 0.82, 0.055);
369  TLegend* leg = 0;
370  // Special case legend for angle slice
371  if(indices.compare("34") == 0)
372  leg = MakeLegend(0.135, 0.35, 0.435, 0.50, 0.037);
373  if(indices.compare("24") == 0)
374  leg = MakeLegend(0.600, 0.35, 0.900, 0.50, 0.037);
375  if(indices.compare("23") == 0)
376  leg = MakeLegend(0.350, 0.35, 0.650, 0.50, 0.037);
377  else leg = MakeLegend(0.135, 0.35, 0.435, 0.50, 0.037);
378  leg->AddEntry(stats,"stat.","L");
379  leg->AddEntry(systs,"syst.","L");
380  leg->Draw();
381  rootOut->WriteTObject(c);
382 
383  return;
384 }
385 
386 
388  IExperiment* expt2,
389  osc::OscCalcSterile* calc,
390  const IFitVar* varA,
391  int nbinsA, double minA, double maxA,
392  const IFitVar* varB,
393  int nbinsB, double minB, double maxB,
394  TDirectory* rootOut, std::string indices,
395  std::vector<const IFitVar*> vars,
396  std::vector<const ISyst*> systs)
397 {
398 
399  ResetAngles(calc);
400  std::string cname = "c2D" + indices;
401  std::string cnamestat = "c2D" + indices + "statC";
402  std::string cnamesyst = "c2D" + indices + "statS";
403  std::string hnamestat = "h" + indices + "statC";
404  std::string hnamesyst = "h" + indices + "statS";
405  std::string ctitle = "Surface for Theta" + indices;
406  std::string ctitlestat = "Surface for Theta" + indices + " statC";
407  std::string ctitlesyst = "Surface for Theta" + indices + " systS";
408 
409  FrequentistSurface surfStat(expt1, calc,
410  varA, nbinsA, minA, maxA,
411  varB, nbinsB, minB, maxB,
412  vars//, {}, { {&kFitDelta24InPiUnitsSterile, {1.5} } }
413  );
414  ResetAngles(calc);
415 
416  FrequentistSurface surfSyst(expt2, calc,
417  varA, nbinsA, minA, maxA,
418  varB, nbinsB, minB, maxB,
419  vars, systs//, { {&kFitDelta24InPiUnitsSterile, {1.5} } }
420  );
421  ResetAngles(calc);
422 
423  TH1* hSurfStat = surfStat.ToTH2(); // Create a histogram from the surfaces
424  hSurfStat->SetName(hnamestat.c_str()); // Set the name for saving
425  rootOut->WriteTObject(hSurfStat); // Save the raw histogram
426 
427  TH1* hSurfSyst = surfSyst.ToTH2(); // Create a histogram from the surfaces
428  hSurfSyst->SetName(hnamesyst.c_str()); // Set the name for saving
429  rootOut->WriteTObject(hSurfSyst); // Save the raw histogram
430 
431  TCanvas* c = new TCanvas(cname.c_str(), ctitle.c_str());
432 
433  surfStat.DrawContour(Gaussian68Percent1D(surfStat), kDashed, kAzure+2);
434  surfStat.DrawContour(Gaussian90Percent1D(surfStat), kSolid, kAzure+2);
435  surfSyst.DrawContour(Gaussian68Percent1D(surfSyst), kDashed, kBlack);
436  surfSyst.DrawContour(Gaussian90Percent1D(surfSyst), kSolid, kBlack);
437 
438  PlotText(0.135, 0.82, 0.055);
439  TLegend* legcomp = MakeLegend(0.500, 0.62, 0.800, 0.82, 0.037);
440  TH1* dummy = new TH1F("","",1,0,1);
441 
442  dummy->SetLineColor(kAzure+2);
443  dummy->SetLineStyle(kDashed);
444  dummy->SetLineWidth(2);
445  legcomp->AddEntry(dummy->Clone(),"68% C.L. (stat.)","L");
446  dummy->SetLineColor(kAzure+2);
447  dummy->SetLineStyle(kSolid);
448  legcomp->AddEntry(dummy->Clone(),"90% C.L. (stat.)","L");
449  dummy->SetLineColor(kBlack);
450  dummy->SetLineStyle(kDashed);
451  legcomp->AddEntry(dummy->Clone(),"68% C.L. (syst.)","L");
452  dummy->SetLineColor(kBlack);
453  dummy->SetLineStyle(kSolid);
454  legcomp->AddEntry(dummy->Clone(),"90% C.L. (syst.)","L");
455  legcomp->Draw();
456  //Simulation();
457  Preliminary();
458  rootOut->WriteTObject(c);
459 
460  // Plot Experiment 1
461  TCanvas* cStat = new TCanvas(cnamestat.c_str(), ctitlestat.c_str());
462 
463  surfStat.DrawContour(Gaussian68Percent1D(surfStat), kDashed, kAzure+2);
464  surfStat.DrawContour(Gaussian90Percent1D(surfStat), kSolid, kAzure+2);
465 
466  PlotText(0.135, 0.82, 0.055);
467  TLegend* legStat = MakeLegend(0.500, 0.62, 0.800, 0.82, 0.037);
468 
469  dummy->SetLineColor(kAzure+2);
470  dummy->SetLineStyle(kDashed);
471  dummy->SetLineWidth(2);
472 
473  legStat->AddEntry(dummy->Clone(),"68% C.L. (stat.)","L");
474  dummy->SetLineColor(kAzure+2);
475  dummy->SetLineStyle(kSolid);
476  legStat->AddEntry(dummy->Clone(),"90% C.L. (stat.)","L");
477 
478  legStat->Draw();
479  //Simulation();
480  Preliminary();
481  rootOut->WriteTObject(cStat);
482 
483  //Plot Experiment 2
484  TCanvas* cSyst = new TCanvas(cnamesyst.c_str(), ctitlesyst.c_str());
485 
486  surfSyst.DrawContour(Gaussian68Percent1D(surfSyst), kDashed, kBlack);
487  surfSyst.DrawContour(Gaussian90Percent1D(surfSyst), kSolid, kBlack);
488 
489  PlotText(0.135, 0.82, 0.055);
490  TLegend* legSyst = MakeLegend(0.500, 0.62, 0.800, 0.82, 0.037);
491  dummy->SetLineColor(kBlack);
492  dummy->SetLineStyle(kDashed);
493  dummy->SetLineWidth(2);
494  legSyst->AddEntry(dummy->Clone(),"68% C.L. (syst.)","L");
495  dummy->SetLineColor(kBlack);
496  dummy->SetLineStyle(kSolid);
497  legSyst->AddEntry(dummy->Clone(),"90% C.L. (syst.)","L");
498  legSyst->Draw();
499  //Simulation();
500  Preliminary();
501  rootOut->WriteTObject(cSyst);
502 
503  return;
504 }
505 
506 void PlotText(const double xpos, const double start, const double step)
507 {
508  TLatex* tex = new TLatex();
509  tex->SetNDC();
510  tex->SetTextFont(42);
511  tex->SetTextSize(0.037);
512  tex->SetTextAlign(11);
513  tex->DrawLatex(xpos, start, "NOvA 8.85 #times 10^{20} POT-equiv.");
514  tex->DrawLatex(xpos, start - 1*step, "#Deltam^{2}_{32} = 2.67#times10^{-3} eV^{2}");
515  tex->DrawLatex(xpos, start - 2*step, "#theta_{13} = 8.5#circ, ^{}sin^{2}#theta_{23} = 0.404");
516  tex->DrawLatex(xpos, start - 3*step, "#Deltam^{2}_{41} = 0.5 eV^{2}, ^{}#delta_{13} = 1.48#pi");
517 }
518 
519 void TexInfo()
520 {
521  const double xtex = 0.76;
522  const double y68 = 0.28;
523  const double y90 = 0.55;
524 
525  TLatex *tex = new TLatex();
526  tex->SetNDC();
527  tex->SetTextFont(42);
528  tex->SetTextSize(0.037);
529  tex->SetTextAlign(11);
530  tex->DrawLatex(xtex, y68, "68% C.L."); // 1-sigma
531  tex->DrawLatex(xtex, y90, "90% C.L."); // 2-sigma
532 }
533 
534 void SigmaLines(double xmin, double xmax)
535 {
536  TLine* line68 = new TLine();
537  TLine* line90 = new TLine();
538  // Fixes horizontal effects at max canvas value
539  TLine* line05 = new TLine();
540  // Dashed line for 1 and 2 sigma lines
541  line68->SetLineStyle(kDashed);
542  line90->SetLineStyle(kDashed);
543 
544  line68->SetLineWidth(2);
545  line90->SetLineWidth(2);
546  line05->SetLineWidth(2);
547  line68->DrawLine(xmin, 1, xmax, 1);
548  line90->DrawLine(xmin, 2.71, xmax, 2.71);
549  line05->DrawLine(xmin, 5, xmax, 5);
550 }
551 
552 
553 //........................................................................
555 {
557  calc->SetDm(4, 0.5); // #deltam41 = 0.5 eV^2
558  //calc->SetAngle(2, 3, M_PI/4); // 45 degrees (maximal mixing)
559  calc->SetAngle(3, 4, 0); // 0, icecube
560  calc->SetAngle(2, 4, 0); // 0, sk
561  calc->SetDelta(1, 3, 1.48*M_PI);
562  //calc->SetDelta(2, 4, 3*M_PI/2);
563  calc->SetDm(3, 7.53e-5 + 2.67e-3);
564  calc->SetAngle(2, 3, (asin(sqrt(0.404))));
565 
566  return;
567 }
const XML_Char * name
Definition: expat.h:151
void PlotText(const double xpos, const double start, const double step)
TCut intime("tave>=217.0 && tave<=227.8")
Double_t angle
Definition: plot.C:86
TH2 * Gaussian90Percent1D(const FrequentistSurface &s)
Up-value surface for 90% confidence in 1D in gaussian approximation.
enum BeamMode kRed
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void SetNFlavors(int nflavors)
std::map< std::string, double > xmax
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
void CompareSlices(TH1 *stats, TH1 *systs, std::string angle, TDirectory *rootOut, double xmin, double xmax)
Float_t y1[n_points_granero]
Definition: compare.C:5
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
A simple Gaussian constraint on an arbitrary IFitVar.
Float_t x1[n_points_granero]
Definition: compare.C:5
T sqrt(T number)
Definition: d0nt_math.hpp:156
void SetDelta(int i, int j, double delta)
Adapt the PMNS_Sterile calculator to standard interface.
const FitDmSq32Sterile kFitDmSq32Sterile
int stats(TString inputFilePath, Int_t firstRun, Int_t lastRun, Float_t thresh, TString myDet)
Definition: stats.C:13
const double kAna2017POT
Definition: Exposures.h:174
TGraph * Profile(const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double input_minchi, const std::vector< const IFitVar * > &profVars, const std::vector< const ISyst * > &profSysts, const SeedList &seedPts, const std::vector< SystShifts > &systSeedPts, std::map< const IFitVar *, TGraph * > &profVarsMap, std::map< const ISyst *, TGraph * > &profSystsMap, MinuitFitter::FitOpts opts)
scan in one variable, profiling over all others
Definition: Fit.cxx:48
void CenterTitles(TH1 *histo)
Definition: Plots.cxx:1481
const FitTheta24InDegreesSterile kFitTheta24InDegreesSterile
void TexInfo()
osc::OscCalcDumb calc
#define M_PI
Definition: SbMath.h:34
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
void PlotNus17PredSystsData()
Log-likelihood scan across two parameters.
const int nbins
Definition: cellShifts.C:15
osc::OscCalcSterile * DefaultSterileCalc(int nflavors)
Create a sterile calculator with default assumptions for all parameters.
Definition: Calcs.cxx:97
expt
Definition: demo5.py:34
const double kAna2017Livetime
Definition: Exposures.h:200
Sum up livetimes from individual cosmic triggers.
void DrawContour(TH2 *fc, Style_t style, Color_t color, double minchi=-1)
Definition: ISurface.cxx:44
void SigmaLines(double xmin, double xmax)
const std::map< std::pair< std::string, std::string >, Variable > vars
void Plot2DSlice(IExperiment *expt1, IExperiment *expt2, osc::OscCalcSterile *calc, const IFitVar *varA, int nbinsA, double minA, double maxA, const IFitVar *varB, int nbinsB, double minB, double maxB, TDirectory *rootOut, std::string angles, std::vector< const IFitVar * > vars, std::vector< const ISyst * > systs={})
void ResetAngles(osc::OscCalcSterile *calc)
void ResetSterileCalcToDefault(osc::OscCalcSterile *calc)
Reset calculator to default assumptions for all parameters.
Definition: Calcs.cxx:76
double POT() const
Definition: Spectrum.h:227
void Preliminary()
OStream cout
Definition: OStream.cxx:6
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
TH2 * ToTH2(double minchi=-1) const
Definition: ISurface.cxx:161
Combine multiple component experiments.
void SetAngle(int i, int j, double th)
TH1 * Plot1DSlice(IExperiment *expt, osc::OscCalcSterile *calc, const IFitVar *var, std::vector< const IFitVar * > vars, int nbins, double min, double max, TDirectory *rootOut, std::string name, std::string special, Color_t color, double minchi, std::vector< const ISyst * > systs={})
static std::unique_ptr< PredictionInterp > LoadFrom(TDirectory *dir, const std::string &name)
void SetDm(int i, double dm)
const FitSinSqTheta23Sterile kFitSinSqTheta23Sterile
TLatex * tex
Definition: f2_nu.C:499
Base class defining interface for experiments.
Definition: IExperiment.h:14
T cos(T number)
Definition: d0nt_math.hpp:78
const FitTheta34InDegreesSterile kFitTheta34InDegreesSterile
Interface definition for fittable variables.
Definition: IFitVar.h:16
TLegend * MakeLegend(double x1, double y1, double x2, double y2, double textsize=0.03)
Float_t e
Definition: plot.C:35
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
double Livetime() const
Seconds. For informational purposes only. No calculations use this.
Definition: Spectrum.h:230
TH2 * Gaussian68Percent1D(const FrequentistSurface &s)
Up-value surface for 68% confidence in 1D in gaussian approximation.
T asin(T number)
Definition: d0nt_math.hpp:60
Compare a single data spectrum to the MC + cosmics expectation.
enum BeamMode string