saveContours_simple.C
Go to the documentation of this file.
1 #ifdef __CINT__
3  std::cout << "Sorry, you must run in compiled mode" << std::endl;
4 }
5 #else
6 
7 #include "../WorkshopIncludes.h"
8 
10 {
11  TFile* fPred_epoch3b = new TFile("../Predictions/Prediction_epoch3b_simple_kCCE.root");
12 
13  PredictionNoExtrap* prediction_epoch3b = LoadFrom<PredictionNoExtrap>(fPred_epoch3b->GetDirectory("pred_3b")).release();
14 
15  fPred_epoch3b->Close();
16 
17  osc::OscCalculatorPMNSOpt calc;
18  ana::ResetOscCalcToDefault(&calc); // This seeds to default (in particular max-mixing)
19 
20  calc.SetTh23(TMath::ASin(sqrt(0.403))); // Second analysis best fit
21  calc.SetDmsq32(2.67e-3); // Same
22 
23  Spectrum fakePred = prediction_epoch3b->Predict(&calc);
24  Spectrum fakeData = fakePred.FakeData(kSecondAnaPOT);
25 
26  // Experiment
27 
28  SingleSampleExperiment fakeExpt(prediction_epoch3b, fakeData);
29 
30  // 2D Fit
31 
32  Surface* surface = new Surface( &fakeExpt, &calc,
33  &kFitSinSqTheta23, 40, 0.3, 0.7,
34  &kFitDmSq32Scaled, 35, 2.3, 3.0);
35 
36  // Plot
37  TCanvas* c = new TCanvas();
38  c->SetLeftMargin(0.12);
39  c->SetBottomMargin(0.15);
40 
41  surface->DrawBestFit(kBlue);
42  surface->DrawContour( Gaussian90Percent2D(*surface), kSolid, kBlue);
43 
44  c->SaveAs("../Contours/Simple.root"); //Advice: save stuff to be able to edit later
45  c->SaveAs("../Contours/Simple.pdf");
46 
47  c->Clear();
48 
49  // Get 1D marginalised plot
50  TH1* profileSinsq = Profile(&fakeExpt, &calc,
51  &kFitSinSqTheta23, 40, 0.3, 0.7, -1,
52  {&kFitDmSq32Scaled} );
53 
54  profileSinsq->SetLineColor(kBlue);
55  profileSinsq->Draw("hist");
56  std::cout << "Max-mix rej: " << sqrt(profileSinsq->Interpolate(0.5)) << std::endl;
57 
58  c->SaveAs("../Contours/1D_simple.root");
59  c->SaveAs("../Contours/1D_simple.pdf");
60  c->Close();
61 
62 } // End of function
63 
64 
65 #endif
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calculator to default assumptions for all parameters.
Definition: Calcs.cxx:23
void saveContours_simple()
T sqrt(T number)
Definition: d0nt_math.hpp:156
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
osc::OscCalcDumb calc
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
Spectrum Predict(osc::IOscCalc *calc) const override
Spectrum FakeData(double pot) const
Synonymous with AsimovData(). Retained for compatibility.
Definition: Spectrum.cxx:349
const ConstrainedFitVarWithPrior fitDmSq32Scaled_UniformPrior & kFitDmSq32Scaled
OStream cout
Definition: OStream.cxx:6
TH2 * Gaussian90Percent2D(const FrequentistSurface &s)
Up-value surface for 90% confidence in 2D in gaussian approximation.
const ConstrainedFitVarWithPrior fitSsqTh23_UniformPriorSsqTh23 & kFitSinSqTheta23
Prediction that just uses FD MC, with no extrapolation.
Float_t e
Definition: plot.C:35
const double kSecondAnaPOT
Definition: Exposures.h:87
enum BeamMode kBlue
Compare a single data spectrum to the MC + cosmics expectation.