plotContProf.C
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////02
2 // //
3 // plotContProf.C //
4 // picks up output root files from plotsContProf_Extrap.C //
5 // and from plotsContProf.C //
6 // to draw both contours and profiles in the same canvas //
7 // //
8 ////////////////////////////////////////////////////////////
9 
10 #include "includes.h"
11 #include "varsandcuts.h"
12 #include "tools.h"
13 
14 
15 void DrawContourCanvas (double minx = 0, double maxx = 2,
16  double miny = 0, double maxy = 1){
17 
18  auto c1 = new TCanvas(ana::UniqueName().c_str());
19  c1->SetFillStyle(0);
20  c1->SetLeftMargin(0.14);
21  c1->SetBottomMargin(0.15);
22  TH2* axes = new TH2F();
23  TString title;
24  title=";sin^{2}#theta_{23};#Deltam^{2}_{32} (10^{-3}eV^{2})";
25  axes = new TH2F("",title,100,minx,maxx,100,miny,maxy);
26  CenterTitles(axes);
27  axes->Draw();
28  //axes->GetXaxis()->SetTitleSize(kBlessedTitleFontSize);
29  //axes->GetYaxis()->SetTitleSize(kBlessedTitleFontSize);
30  //axes->GetXaxis()->SetLabelSize(kBlessedLabelFontSize);
31  //axes->GetYaxis()->SetLabelSize(kBlessedLabelFontSize);
32  axes->GetXaxis()->SetTitleOffset(0.8);
33  axes->GetYaxis()->SetTitleOffset(0.8);
34  TGaxis::SetMaxDigits(3);
35  axes->GetYaxis()->SetDecimals() ;
36  axes->GetYaxis()->SetTitleOffset(0.85);
37  axes->GetYaxis()->SetLabelOffset(0.002);
38  axes->GetYaxis()->SetLabelSize(0.058);
39  axes->GetYaxis()->SetTitleSize(0.078);
40  c1->RedrawAxis();
41 
42 }
43 
44 
45 void plotContProf(int sampleCut = 9){
46 
47  bool preliminary = true;
48  bool lazyprint = true;
49  bool numuonly = true;
50  bool onlycf = true;
51  // print only confidence levels so it
52  // does or doesnt change contour colors
53  // already define colors
54  Color_t color68joint = kBlue-7;
55  Color_t color90joint = kViolet+2;
56  Color_t color99joint = kMagenta+1;
57  Color_t colorjoint = kBlack;
58  Color_t colornumu = kBlack;
59  Color_t colorsa = kGreen+2;
60  Color_t colort2k = kBlue;
61  Color_t colorminos = kRed;
62  Color_t colorsens = kGray+1;
63 
64  Style_t line68joint = kSolid;
65  Style_t line90joint = kSolid;
66  Style_t line99joint = kSolid;
67  Style_t linejoint = kSolid;
68  Style_t linenumu = kSolid;
69  Style_t linesa = kDashed;
70  Style_t linet2k = kDotted;
71  Style_t lineminos = kDashed;
72  Style_t linesens = kDashed;
73 
74  Style_t marker68joint = kFullCircle;
75  Style_t marker90joint = kFullCircle;
76  Style_t marker99joint = kFullCircle;
77  Style_t markerjoint = kFullCircle;
78  Style_t markernumu = kFullCircle;
79  Style_t markersa = kFullCircle;
80  Style_t markersens = kFullCircle;
81 
82  std::cout << "\nLoading input files" << std::endl;
83  std::string inDir = "/nova/ana/nu_mu_ana/Ana2017/Results";
84  std::string outDir = "";
85 
86  std::vector<std::string> input;
87  input.push_back(inDir + "/ContProf_StatsOnly_3ABestFit_3ACut_3AEnergy_OptBinning_9e20_Cosmics.root"); // stats
88  input.push_back(inDir + "/ContProf_WithSysts_3ABestFit_3ACut_3AEnergy_OptBinning_9e20_Cosmics.root"); // systs
89  input.push_back(inDir + "/ContProfSens_StatsOnly_3ABestFit_3ACut_3AEnergy_OptBinning_9e20_Cosmics.root"); // sens stats
90  input.push_back(inDir + "/ContProfSens_WithSysts_3ABestFit_3ACut_3AEnergy_OptBinning_9e20_Cosmics.root"); // sens systs
91  //contours with direct numu systs (for comparison with erikarl)
92  //input.push_back(inDir + "/ContProf_Exposures_StatsOnly_3ABestFit_3ACut_3AEnergy_OptBinning_9e20_Cosmics.root"); // stats
93  //input.push_back(inDir + "/ContProf_Exposures_WithSysts_3ABestFit_3ACut_3AEnergy_OptBinning_9e20_Cosmics.root"); // systs
94 
95 
96  std::vector<Style_t> stylesurf = {kDashed, kSolid, kDashed, kSolid, kDashed, kSolid};
97  std::vector<Color_t> color = {kBlack, kBlack, kBlue, kBlue, kGreen + 2, kGreen + 2};
98  std::vector<TFile*> infile;
99  std::vector<FrequentistSurface*> surf;
100  std::vector<TH1*> proftheta;
101  std::vector<TH1*> profdelta;
102  std::vector<double> rejmaxmix;
103  for(unsigned int fileId = 0; fileId < input.size(); fileId ++){
104  infile.push_back( new TFile(input[fileId].c_str()) );
105  surf.push_back( LoadFrom<FrequentistSurface>(infile[fileId], "surface")).release() ;
106  proftheta.push_back( (TH1*)infile[fileId]->Get("profiletheta23") );
107  profdelta.push_back( (TH1*)infile[fileId]->Get("profiledelta32") );
108  surf[fileId]->SetTitle("");
109  proftheta[fileId]->SetTitle("");
110  profdelta[fileId]->SetTitle("");
111  proftheta[fileId]->SetLineColor(color[fileId]);
112  profdelta[fileId]->SetLineColor(color[fileId]);
113  //infile[fileId]->Clear();
114  rejmaxmix.push_back( sqrt(proftheta[fileId]->Interpolate(0.5)) );
115  std::cout << "rejmaxmix " << fileId << " = " << rejmaxmix[fileId] << std::endl;
116  }
117 
118 
119  std::string inputJoint = "/nova/ana/nu_e_ana/Ana2017/Results/contours/th23_dmsq/hist_contours_2017_joint_realDatacombo_dmsq_systs.root";
120  TFile* infileJoint = new TFile(inputJoint.c_str());
121  Style_t styleJoint = kSolid;
122  Color_t colorJoint = kGreen;
123  //auto surfJoint = *FrequentistSurface::LoadFrom(infileJoint, "surf_th23_dm32_NH");
124  FrequentistSurface* surfJoint = LoadFrom<FrequentistSurface>(infileJoint, "surf_th23_dm32_NH").release();
125  auto mins =* (TVectorD*)infileJoint->Get("overall_minchi");
126  double minchi23 = mins[0];
127 
128  // for FC
129  TString fcFolder="/nova/ana/nu_e_ana/Ana2017/FC/";
130  TString fcFileName ((TString)"FCCol_NH_surf_dmsq32ssth23_v2.root");
131  FCSurface *fcXH = 0;
132  auto fccol = FCCollection::LoadFromFile((fcFolder + fcFileName).Data()).release();
133  fcXH = new FCSurface(20,0.3,0.7,20,0.002,0.003);
134  fcXH->Add(*fccol);
135  TH2* surf_1Sigma = fcXH->SurfaceForSignificance(0.6827);
136  TH2* surf_90Perc = fcXH->SurfaceForSignificance(0.90);
137  surf_1Sigma->Smooth();
138  surf_90Perc->Smooth();
139 
140 
141 
142  /*
143  DrawContourCanvas(0.3, 0.7, 2.0, 3.3);
144  surfJoint->DrawContour(Gaussian68Percent2D(*surfJoint), kDashed, kBlack);
145  surfJoint->DrawContour(surf_1Sigma, kSolid, kBlack, minchi23);
146  gPad->Print("test_fc.png");
147  gPad->Print("test_fc.pdf");
148  gPad->Print("test_fc.eps");
149  */
150 
151 
152 
153  // Get other results:
154  TFile* fT2K = new TFile(FindCAFAnaDir().c_str() + (TString)"/data/expt/T2KJointNuNuBarOscillation_Run17c_2016/sinsqth23Vsdmsq_Run17c_Data_react_nh.root");
155  TGraph *t2kplot = (TGraph*)fT2K->Get("g90_valor_0");
156  fT2K -> Close();
157  for (int point = 0; point < t2kplot->GetN(); point++) {
158  double xval, yval;
159  t2kplot->GetPoint(point,xval,yval);
160  yval = yval * 1000.0; // rescale into units of 10^-3 ev^2 for our plots
161  t2kplot->SetPoint(point,xval,yval);
162  }
163  t2kplot->SetLineStyle(linet2k);
164  t2kplot->SetLineColor(colort2k);
165  t2kplot->SetLineWidth(3);
166 
167 
168  // get and rescale minos result
169  const std::string minospath = FindCAFAnaDir() +
170  "/data/expt/MINOSPlus_ThreeFlavour_PreliminaryContours_June2014.root";
171  TFile minosfile(minospath.c_str(),"READ");
172  TGraph *minosplot = (TGraph*)minosfile.Get("minosPlus_nu2014_prelim_contour_sinsq23_dmsq32_normal_90CL");
173  minosfile.Close();
174  for (int point = 0; point < minosplot->GetN(); point++) {
175  double xval, yval;
176  minosplot->GetPoint(point,xval,yval);
177  yval = yval * 1000.0; // rescale into units of 10^-3 ev^2 for our plots
178  minosplot->SetPoint(point,xval,yval);
179  }
180  minosplot->SetLineStyle(lineminos);
181  minosplot->SetLineColor(colorminos);
182  minosplot->SetLineWidth(3);
183 
184 
185 
186  TFile* fNOvASA = new TFile("NOvA_official_numu_2017.root");
187  TGraph* gUO = (TGraph*)fNOvASA->Get("contour_FC90percent_UO_NH");
188  TGraph* gLO = (TGraph*)fNOvASA->Get("contour_FC90percent_LO_NH");
189  TMarker* mUO = (TMarker*)fNOvASA->Get("bestfit_UO_NH");
190  TMarker* mLO = (TMarker*)fNOvASA->Get("bestfit_LO_NH");
191  fNOvASA -> Close();
192  gUO -> SetLineColor(colorsa);
193  gLO -> SetLineColor(colorsa);
194  gUO -> SetLineStyle(linesa);
195  gLO -> SetLineStyle(linesa);
196  mUO -> SetMarkerColor(colorsa);
197  mLO -> SetMarkerColor(colorsa);
198  mUO -> SetMarkerStyle(markersa);
199  mLO -> SetMarkerStyle(markersa);
200 
201 
202 
203  /*
204  if(lazyprint){
205  numuonly = false;
206  // 90% stats + 90% systs
207  std::ofstream file;
208  new TCanvas("canvas");
209  TString out = outDir + "/contours_SystsStatsJoint_90CL_NoFC__WineCheese";
210  gPad->SetFillStyle(0);
211  gPad->SetBottomMargin(0.115);
212  gStyle->SetTitleOffset(0.82,"x"); //override style script so nothing is clipped or overlapping with axis labels
213  gStyle->SetTitleOffset(0.85,"y");
214  TH2F *axes = new TH2F("setaxes","" ,38 ,0.32001, 0.7, 52, 2.0, 3.3);
215  axes->GetXaxis()->SetTitle("sin^{2}#theta_{23}");
216  axes->GetYaxis()->SetTitle("#Deltam^{2}_{32} (10^{-3} eV^{2})");
217  axes->GetXaxis()->CenterTitle();
218  axes->GetYaxis()->CenterTitle();
219  axes->SetTitle("");
220  axes->Draw();
221  axes->Draw();
222  surf[0]->DrawContour(Gaussian90Percent2D(*surf[0]), kDashed, kGray+1);
223  drawBFMirror(surf[0] -> fBestFitX, surf[0] -> fBestFitY, kGray+1, kFullCircle);
224  surf[1]->DrawContour(Gaussian90Percent2D(*surf[1]), kSolid, kBlack);
225  drawBFMirror(surf[1] -> fBestFitX, surf[1] -> fBestFitY, kBlack, kFullCircle);
226  if(preliminary) Preliminary();
227  TLegend *legend = new TLegend(0.35,0.60,0.65,0.88,NULL,"brNDC");
228  legend->SetTextSize(0.04); //no border for legend
229  legend->SetBorderSize(0);
230  legend->SetLineColor(1);
231  legend->SetLineStyle(1);
232  legend->SetLineWidth(0);
233  legend->SetFillColor(10);
234  legend->SetFillStyle(0);
235  TLegendEntry *entry = legend->AddEntry("NULL","NOvA Normal Hierarchy","h");
236  legend->AddEntry("NULL","8.85#times10^{20} POT-equiv.","h");
237  entry->SetLineColor(1);
238  entry->SetLineStyle(1);
239  entry->SetTextFont(42);
240  entry = legend->AddEntry("black","90% C.L. with systematics","L");
241  entry->SetLineColor(1);
242  entry->SetLineStyle(1);
243  entry->SetLineWidth(3);
244  entry->SetTextFont(42);
245  entry = legend->AddEntry("black","90% C.L. no systematics","L");
246  entry->SetLineColor(kGray+1);
247  entry->SetLineStyle(kDashed);
248  entry->SetLineWidth(3);
249  entry->SetTextFont(42);
250  legend->Draw();
251  if(numuonly) NumuOnly();
252  if(!numuonly) JointAnalysis();
253 
254  gPad->Modified();
255  gPad->Print(out + ".png");
256  gPad->Print(out + ".pdf");
257  gPad->Print(out + ".eps");
258  file.open (out + ".txt");
259  file << "90% confidence level contours for NOvA third numu analysis result with and without systematics. *** So far it has the numu only contour, it will be updated with the joint fit contour (and probably more confidence levels) ***";
260  file.close();
261 
262 }
263 
264 
265 
266  if(lazyprint){
267  numuonly = false;
268  // 90% systs + 90% sens at 3A bf
269  std::ofstream file;
270  new TCanvas("canvas");
271  TString out = outDir + "/contours_SystsSensJoint_90CL_NoFC__WineCheese";
272  gPad->SetFillStyle(0);
273  gPad->SetBottomMargin(0.115);
274  gStyle->SetTitleOffset(0.82,"x"); //override style script so nothing is clipped or overlapping with axis labels
275  gStyle->SetTitleOffset(0.85,"y");
276  TH2F *axes = new TH2F("setaxes","" ,38 ,0.32001, 0.7, 52, 2.0, 3.3);
277  axes->GetXaxis()->SetTitle("sin^{2}#theta_{23}");
278  axes->GetYaxis()->SetTitle("#Deltam^{2}_{32} (10^{-3} eV^{2})");
279  axes->GetXaxis()->CenterTitle();
280  axes->GetYaxis()->CenterTitle();
281  axes->SetTitle("");
282  axes->Draw();
283  axes->Draw();
284  surf[3]->DrawContour(Gaussian90Percent2D(*surf[3]), kDashed, kGray+1);
285  drawBFMirror(surf[3] -> fBestFitX, surf[3] -> fBestFitY, kGray+1, kFullCircle);
286  surf[1]->DrawContour(Gaussian90Percent2D(*surf[1]), kSolid, kBlack);
287  drawBFMirror(surf[1] -> fBestFitX, surf[1] -> fBestFitY, kBlack, kFullCircle);
288  if(preliminary) Preliminary();
289  TLegend *legend = new TLegend(0.35,0.63,0.65,0.88,NULL,"brNDC");
290  legend->SetTextSize(0.040); //no border for legend
291  legend->SetBorderSize(0);
292  legend->SetLineColor(1);
293  legend->SetLineStyle(1);
294  legend->SetLineWidth(0);
295  legend->SetFillColor(10);
296  legend->SetFillStyle(0);
297  TLegendEntry *entry = legend->AddEntry("NULL","NOvA Normal Hierarchy","h");
298  legend->AddEntry("NULL","8.85#times10^{20} POT-equiv.","h");
299  entry->SetLineColor(1);
300  entry->SetLineStyle(1);
301  entry->SetTextFont(42);
302  entry = legend->AddEntry("black","90% C.L. Result","L");
303  entry->SetLineColor(1);
304  entry->SetLineStyle(1);
305  entry->SetLineWidth(3);
306  entry->SetTextFont(42);
307  entry = legend->AddEntry("black","90% C.L. Sensitivity","L");
308  entry->SetLineColor(kGray+1);
309  entry->SetLineStyle(kDashed);
310  entry->SetLineWidth(3);
311  entry->SetTextFont(42);
312  legend->Draw();
313  if(numuonly) NumuOnly();
314  if(!numuonly) JointAnalysis();
315  gPad->Modified();
316  gPad->Print(out + ".png");
317  gPad->Print(out + ".pdf");
318  gPad->Print(out + ".eps");
319  file.open (out + ".txt");
320  file<< "90% confidence level contours for NOvA's joint analysis result and sensitivity with systematics. *** So far it has the numu only contour ***";
321  file.close();
322 
323 
324  }
325 
326 
327 
328 
329  if(onlycf){
330  // JOINT 68%, 90% AND 99% CL
331  // WITH SA
332  if(lazyprint){
333  numuonly=false;
334  std::ofstream file;
335  new TCanvas("canvas");
336  TString out = outDir + "/contours_Systs3ASAJoint_68_90_99__WineCheese";
337  gPad->SetFillStyle(0);
338  gPad->SetBottomMargin(0.115);
339  gStyle->SetTitleOffset(0.82,"x"); //override style script so nothing is clipped or overlapping with axis labels
340  gStyle->SetTitleOffset(0.85,"y");
341  TH2F *axes = new TH2F("setaxes","" ,38 ,0.32001, 0.7, 52, 2.0, 3.3);
342  axes->GetXaxis()->SetTitle("sin^{2}#theta_{23}");
343  axes->GetYaxis()->SetTitle("#Deltam^{2}_{32} (10^{-3} eV^{2})");
344  axes->GetXaxis()->CenterTitle();
345  axes->GetYaxis()->CenterTitle();
346  axes->SetTitle("");
347  axes->Draw();
348  axes->Draw();
349  surfJoint->DrawContour(Gaussian90Percent2D(*surfJoint), line90joint, color90joint);
350  gLO -> Draw("same");
351  gUO -> Draw("same");
352  mUO -> Draw("same");
353  mLO -> Draw("same");
354  surfJoint->DrawContour(Gaussian68Percent2D(*surfJoint), line68joint, color68joint);
355  surfJoint->DrawContour(Gaussian90Percent2D(*surfJoint), line90joint, color90joint);
356  surfJoint->DrawContour(Gaussian99Percent2D(*surfJoint), line99joint, color99joint);
357  drawBFMirror(surfJoint -> fBestFitX, surfJoint -> fBestFitY, color68joint, kFullStar);
358  mUO -> Draw("same");
359  mLO -> Draw("same");
360  if(preliminary) Preliminary();
361  TLegend *legend = new TLegend(0.35,0.60,0.65,0.88,NULL,"brNDC");
362  legend->SetTextSize(0.040); //no border for legend
363  legend->SetBorderSize(0);
364  legend->SetLineColor(1);
365  legend->SetLineStyle(1);
366  legend->SetLineWidth(0);
367  legend->SetFillColor(10);
368  legend->SetFillStyle(0);
369  TLegendEntry *entry = legend->AddEntry("NULL","NOvA Normal Hierarchy","h");
370  legend->AddEntry("NULL","8.85#times10^{20} POT-equiv.","h");
371  entry = legend->AddEntry("azure","68% C.L.","L");
372  entry->SetLineColor(color68joint);
373  entry->SetLineStyle(line68joint);
374  entry->SetLineWidth(3);
375  entry->SetTextFont(42);
376  entry = legend->AddEntry("teal","90% C.L.","L");
377  entry->SetLineColor(color90joint);
378  entry->SetLineStyle(line90joint);
379  entry->SetLineWidth(3);
380  entry->SetTextFont(42);
381  entry = legend->AddEntry("gray","99% C.L.","L");
382  entry->SetLineColor(color99joint);
383  entry->SetLineStyle(line99joint);
384  entry->SetLineWidth(3);
385  entry->SetTextFont(42);
386  entry = legend->AddEntry("black","PRL.118.151802","L");
387  entry->SetLineColor(colorsa);
388  entry->SetLineStyle(linesa);
389  entry->SetLineWidth(3);
390  entry->SetTextFont(42);
391  legend->Draw();
392  if(numuonly) NumuOnly();
393  if(!numuonly) JointAnalysis();
394  DrawLegendBF(surfJoint -> fBestFitX, surfJoint -> fBestFitY, color68joint, kFullStar);
395  gPad->Modified();
396  gPad->Print(out + ".png");
397  gPad->Print(out + ".pdf");
398  gPad->Print(out + ".eps");
399  file.open (out + ".txt");
400  file<< "68%, 90% and 99% confidence level contours for NOvA 8.85e20 POT-equiv. joint analysis and 90% confidence level contour from the second numu analysis result.";
401  file.close();
402 
403  }
404 
405 
406  } // if onlycl
407 
408 
409 
410 
411 
412  ////////////////////////////////////
413  // COMPARASION ==> NUMU ONLY JOINT
414  ///////////////////////////////////
415  if(lazyprint){
416  // 90% systs numu only + joint
417  std::ofstream file;
418  new TCanvas("canvas");
419  TString out = outDir + "/contours_SystsNumuOnlyJoint_90CL__WineCheese";
420  gPad->SetFillStyle(0);
421  gPad->SetBottomMargin(0.115);
422  gStyle->SetTitleOffset(0.82,"x"); //override style script so nothing is clipped or overlapping with axis labels
423  gStyle->SetTitleOffset(0.85,"y");
424  TH2F *axes = new TH2F("setaxes","" ,38 ,0.32001, 0.7, 52, 2.0, 3.3);
425  axes->GetXaxis()->SetTitle("sin^{2}#theta_{23}");
426  axes->GetYaxis()->SetTitle("#Deltam^{2}_{32} (10^{-3} eV^{2})");
427  axes->GetXaxis()->CenterTitle();
428  axes->GetYaxis()->CenterTitle();
429  axes->SetTitle("");
430  axes->Draw();
431  axes->Draw();
432  surf[1]->DrawContour(Gaussian90Percent2D(*surf[1]), kDashed, colorsens);
433  drawBFMirror(surf[1] -> fBestFitX, surf[1] -> fBestFitY, colorsens, markernumu);
434  surfJoint->DrawContour(Gaussian90Percent2D(*surfJoint), linejoint, colorjoint);
435  drawBFMirror(surfJoint -> fBestFitX, surfJoint -> fBestFitY, colorjoint, markerjoint);
436  if(preliminary) Preliminary();
437  TLegend *legend = new TLegend(0.35,0.60,0.65,0.88,NULL,"brNDC");
438  legend->SetTextSize(0.04); //no border for legend
439  legend->SetBorderSize(0);
440  legend->SetLineColor(1);
441  legend->SetLineStyle(1);
442  legend->SetLineWidth(0);
443  legend->SetFillColor(10);
444  legend->SetFillStyle(0);
445  TLegendEntry *entry = legend->AddEntry("NULL","NOvA Normal Hierarchy","h");
446  legend->AddEntry("NULL","8.85#times10^{20} POT-equiv.","h");
447  entry->SetLineColor(1);
448  entry->SetLineStyle(1);
449  entry->SetTextFont(42);
450  entry = legend->AddEntry("black","90% C.L. joint analysis","L");
451  entry->SetLineColor(colorjoint);
452  entry->SetLineStyle(linejoint);
453  entry->SetLineWidth(3);
454  entry->SetTextFont(42);
455  entry = legend->AddEntry("black","90% C.L. #nu_{#mu} only","L");
456  entry->SetLineColor(colorsens);
457  entry->SetLineStyle(kDashed);
458  entry->SetLineWidth(3);
459  entry->SetTextFont(42);
460  legend->Draw();
461  DrawLegendBF2(surfJoint -> fBestFitX, surfJoint -> fBestFitY, colorjoint, markerjoint, surf[1] -> fBestFitX, surf[1] -> fBestFitY, colorsens, markernumu);
462  gPad->Modified();
463  gPad->Print(out + ".png");
464  gPad->Print(out + ".pdf");
465  gPad->Print(out + ".eps");
466  file.open (out + ".txt");
467  file<< "90% confidence level contour for NOvA's numu only and joint analyses with systematics. *** Will be updated with FC correction if available for numu only ***";
468  file.close();
469 
470  }
471 
472 */
473 
474 
475 
476  ////////////////////////////////
477  // CHANGE TO ==> JOINT FIT
478  ////////////////////////////////
479  // draw comparison joint gauss vs joint fc
480  if(lazyprint){
481  numuonly = false;
482  // 90% systs
483  std::ofstream file;
484  new TCanvas("canvas");
485  TString out = outDir + "/contours_SystsJointGaussFC_90CL__WineCheese";
486  gPad->SetFillStyle(0);
487  gPad->SetBottomMargin(0.115);
488  gStyle->SetTitleOffset(0.82,"x"); //override style script so nothing is clipped or overlapping with axis labels
489  gStyle->SetTitleOffset(0.85,"y");
490  TH2F *axes = new TH2F("setaxes","" ,38 ,0.32001, 0.7, 52, 2.0, 3.3);
491  axes->GetXaxis()->SetTitle("sin^{2}#theta_{23}");
492  axes->GetYaxis()->SetTitle("#Deltam^{2}_{32} (10^{-3} eV^{2})");
493  axes->GetXaxis()->CenterTitle();
494  axes->GetYaxis()->CenterTitle();
495  axes->SetTitle("");
496  axes->Draw();
497  axes->Draw();
498  surfJoint->DrawContour(Gaussian90Percent2D(*surfJoint), kDashed, kGray+2);
499  surfJoint->DrawContour(surf_90Perc, kSolid, colorjoint, minchi23);
500  drawBFMirror(surfJoint -> fBestFitX, surfJoint -> fBestFitY, colorjoint, markerjoint);
501  if(preliminary) Preliminary();
502  TLegend *legend = new TLegend(0.35,0.65,0.65,0.88,NULL,"brNDC");
503  legend->SetTextSize(0.040); //no border for legend
504  legend->SetLineColor(1);
505  legend->SetLineStyle(1);
506  legend->SetLineWidth(0);
507  legend->SetFillColor(10);
508  legend->SetFillStyle(0);
509  TLegendEntry *entry = legend->AddEntry("NULL","NOvA Normal Hierarchy","h");
510  legend->AddEntry("NULL","8.85#times10^{20} POT-equiv.","h");
511  entry->SetLineColor(1);
512  entry->SetLineStyle(1);
513  entry->SetTextFont(42);
514  entry = legend->AddEntry("black","90% C.L. Feldman-Cousins","L");
515  entry->SetLineColor(colorjoint);
516  entry->SetLineStyle(kSolid);
517  entry = legend->AddEntry("black","90% C.L. Gaussian","L");
518  entry->SetLineColor(kGray+2);
519  entry->SetLineStyle(kDashed);
520  entry->SetLineWidth(3);
521  entry->SetTextFont(42);
522  legend->Draw();
523  if(numuonly) NumuOnly();
524  if(!numuonly) JointAnalysis();
525  gPad->Print(out + ".png");
526  gPad->Print(out + ".pdf");
527  gPad->Print(out + ".eps");
528  file.open (out + ".txt");
529  file<< "90% confidence level contour for NOvA's joint analysis result with systematics, comparing Gaussian fit with Feldman-Cousins correction.";
530  file.close();
531 
532  }
533 
534 
535 
536  if(lazyprint){
537  numuonly = false;
538  // 90% systs
539  std::ofstream file;
540  new TCanvas("canvas");
541  TString out = outDir + "/contours_SystsJointFC_90CL__WineCheese";
542  gPad->SetFillStyle(0);
543  gPad->SetBottomMargin(0.115);
544  gStyle->SetTitleOffset(0.82,"x"); //override style script so nothing is clipped or overlapping with axis labels
545  gStyle->SetTitleOffset(0.85,"y");
546  TH2F *axes = new TH2F("setaxes","" ,38 ,0.32001, 0.7, 52, 2.0, 3.3);
547  axes->GetXaxis()->SetTitle("sin^{2}#theta_{23}");
548  axes->GetYaxis()->SetTitle("#Deltam^{2}_{32} (10^{-3} eV^{2})");
549  axes->GetXaxis()->CenterTitle();
550  axes->GetYaxis()->CenterTitle();
551  axes->SetTitle("");
552  axes->Draw();
553  axes->Draw();
554  surfJoint->DrawContour(surf_90Perc, linejoint, colorjoint, minchi23);
555  //surfJoint->DrawContour(Gaussian90Percent2D(*surfJoint), linejoint, colorjoint);
556  drawBFMirror(surfJoint -> fBestFitX, surfJoint -> fBestFitY, colorjoint, markerjoint);
557  if(preliminary) Preliminary();
558  TLegend *legend = new TLegend(0.35,0.73,0.65,0.88,NULL,"brNDC");
559  legend->SetTextSize(0.040); //no border for legend
560  legend->SetBorderSize(0);
561  legend->SetLineColor(1);
562  legend->SetLineStyle(1);
563  legend->SetLineWidth(0);
564  legend->SetFillColor(10);
565  legend->SetFillStyle(0);
566  TLegendEntry *entry = legend->AddEntry("NULL","NOvA Normal Hierarchy","h");
567  entry->SetLineColor(1);
568  entry->SetLineStyle(1);
569  entry->SetTextFont(42);
570  entry = legend->AddEntry("black","90% C.L. 8.85#times10^{20} POT-equiv.","L");
571  entry->SetLineColor(colorjoint);
572  entry->SetLineStyle(linejoint);
573  entry->SetLineWidth(3);
574  entry->SetTextFont(42);
575  legend->Draw();
576  if(numuonly) NumuOnly();
577  if(!numuonly) JointAnalysis();
578  gPad->Print(out + ".png");
579  gPad->Print(out + ".pdf");
580  gPad->Print(out + ".eps");
581  file.open (out + ".txt");
582  file<< "90% confidence level contour for NOvA's joint analysis result with systematics and Feldman-Cousins correction.";
583  file.close();
584 
585  }
586 
587 
588 
589 
590 
591  if(lazyprint){
592  numuonly = false;
593  // canvas
594  // 90% systs + T2K + MINOS
595  std::ofstream file;
596  new TCanvas("canvas");
597  TString out = outDir + "/contours_Systs3AJointFC_T2kMinos_90CL__WineCheese";
598  gPad->SetFillStyle(0);
599  gPad->SetBottomMargin(0.115);
600  gStyle->SetTitleOffset(0.82,"x"); //override style script so nothing is clipped or overlapping with axis labels
601  gStyle->SetTitleOffset(0.85,"y");
602  TH2F *axes = new TH2F("setaxes","" ,38 ,0.32001, 0.7, 52, 2.0, 3.3);
603  axes->GetXaxis()->SetTitle("sin^{2}#theta_{23}");
604  axes->GetYaxis()->SetTitle("#Deltam^{2}_{32} (10^{-3} eV^{2})");
605  axes->GetXaxis()->CenterTitle();
606  axes->GetYaxis()->CenterTitle();
607  axes->SetTitle("");
608  axes->Draw();
609  axes->Draw();
610  surfJoint->DrawContour(surf_90Perc, linejoint, colorjoint, minchi23);
611  //surfJoint->DrawContour(Gaussian90Percent2D(*surfJoint), linejoint, colorjoint);
612  drawBFMirror(surfJoint -> fBestFitX, surfJoint -> fBestFitY, colorjoint, markerjoint);
613  t2kplot -> Draw("same");
614  minosplot-> Draw("same");
615  surfJoint->DrawContour(surf_90Perc, linejoint, colorjoint, minchi23);
616  //surfJoint->DrawContour(Gaussian90Percent2D(*surfJoint), linejoint, colorjoint);
617  drawBFMirror(surfJoint -> fBestFitX, surfJoint -> fBestFitY, linejoint, markerjoint);
618  if(preliminary) Preliminary();
619  TLegend *legend = new TLegend(0.35,0.63,0.65,0.88,NULL,"brNDC");
620  legend->SetTextSize(0.040); //no border for legend
621  legend->SetBorderSize(0);
622  legend->SetLineColor(1);
623  legend->SetLineStyle(1);
624  legend->SetLineWidth(0);
625  legend->SetFillColor(10);
626  legend->SetFillStyle(0);
627  TLegendEntry *entry = legend->AddEntry("NULL","Normal Hierarchy 90% C.L.","h");
628  entry->SetLineColor(1);
629  entry->SetLineStyle(1);
630  entry->SetTextFont(42);
631  entry = legend->AddEntry("black","NOvA 8.85#times10^{20} POT-equiv.","L");
632  entry->SetLineColor(colorjoint);
633  entry->SetLineStyle(linejoint);
634  entry->SetLineWidth(3);
635  entry->SetTextFont(42);
636  entry = legend->AddEntry("blue","T2K 2016","L");
637  entry->SetLineColor(colort2k);
638  entry->SetLineStyle(linet2k);
639  entry->SetLineWidth(3);
640  entry->SetTextFont(42);
641  entry = legend->AddEntry("blue","MINOS 2014","L");
642  entry->SetLineColor(colorminos);
643  entry->SetLineStyle(lineminos);
644  entry->SetLineWidth(3);
645  entry->SetTextFont(42);
646  legend->Draw();
647  if(numuonly) NumuOnly();
648  if(!numuonly) JointAnalysis();
649  gPad->Modified();
650  gPad->Print(out + ".png");
651  gPad->Print(out + ".pdf");
652  gPad->Print(out + ".eps");
653  file.open (out + ".txt");
654  file<< "90% confidence level contours for NOvA joint analysis result, with Feldman-Cousins correction, overlayed with T2K 2016 and MINOS 2014 results.";
655  file.close();
656 
657  }
658 
659 
660 
661 } // End of function
tree Draw("slc.nhit")
enum BeamMode kRed
void NumuOnly()
Definition: tools.h:37
double maxy
hmean SetLineStyle(2)
T sqrt(T number)
Definition: d0nt_math.hpp:156
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
fVtxDx SetMarkerStyle(20)
std::string FindCAFAnaDir()
Definition: Utilities.cxx:204
std::string outDir
Log-likelihood scan across two parameters.
TString inDir
void drawBFMirror(double bfSin, double bfDm, Color_t color, Style_t style=kFullCircle)
Definition: tools.h:342
string infile
void CenterTitles(TH1 *h)
void DrawContour(TH2 *fc, Style_t style, Color_t color, double minchi=-1)
Definition: ISurface.cxx:44
hmean SetLineColor(4)
h1 SetMarkerColor(4)
Int_t preliminary
Definition: SimpleIterate.C:63
def Interpolate(x1, y1, x2, y2, yvalue)
Definition: HandyFuncs.py:218
void Add(const FCPoint &pt, std::string plot)
Definition: FCSurface.cxx:39
c1 Close()
void Preliminary()
OStream cout
Definition: OStream.cxx:6
TH2 * Gaussian90Percent2D(const FrequentistSurface &s)
Up-value surface for 90% confidence in 2D in gaussian approximation.
enum BeamMode kViolet
void plotContProf(int sampleCut=9)
Definition: plotContProf.C:45
TFile * file
Definition: cellShifts.C:17
c1
Definition: demo5.py:24
void JointAnalysis()
Definition: tools.h:47
TH2 * SurfaceForSignificance(double sig)
Definition: FCSurface.cxx:103
enum BeamMode kGreen
enum BeamMode kBlue
def entry(str)
Definition: HTMLTools.py:26
std::string UniqueName()
Return a different string each time, for creating histograms.
Definition: Utilities.cxx:29
void DrawContourCanvas(double minx=0, double maxx=2, double miny=0, double maxy=1)
Definition: plotContProf.C:15
FileContents LoadFromFile(const std::string &filename)
Pseudo-experiments, binned to match a log-likelihood surface.
Definition: FCSurface.h:14
surf
Definition: demo5.py:35
enum BeamMode string