saveContours_oscpar.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_addExpt = new TFile("../Predictions/Prediction_epoch3b_extrap_kCCE.root");
12  PredictionInterp* prediction_ugly = LoadFrom<PredictionInterp>(fPred_addExpt->GetDirectory("pred_ugly")).release();
13  PredictionInterp* prediction_bad = LoadFrom<PredictionInterp>(fPred_addExpt->GetDirectory("pred_bad")).release();
14  PredictionInterp* prediction_good = LoadFrom<PredictionInterp>(fPred_addExpt->GetDirectory("pred_good")).release();
15 
16  PredictionInterp* prediction_std = LoadFrom<PredictionInterp>(fPred_addExpt->GetDirectory("pred_std")).release();
17 
18  fPred_addExpt->Close();
19 
20  osc::OscCalculatorPMNSOpt calc;
21  ana::ResetOscCalcToDefault(&calc); // This seeds to default (in particular max-mixing)
22 
23  calc.SetTh23(TMath::ASin(sqrt(0.403))); // Second analysis best fit
24  calc.SetDmsq32(2.67e-3); // Same
25 
26  // std::vector<const IFitVar*> oscpar = getNumuMarginalisedOscParam(); --> This gives all the osc param
27  std::vector<const IFitVar*> someOscpar = {&kFitSinSq2Theta13}; // to seeep up, th13
28 
29  Spectrum fakePred = prediction_std->Predict(&calc);
30  Spectrum fakeData = fakePred.FakeData(kSecondAnaPOT);
31 
32  // Split experiments data
33  Spectrum fakePred_ugly = prediction_ugly->Predict(&calc);
34  Spectrum fakeData_ugly = fakePred_ugly.FakeData(kSecondAnaPOT);
35 
36  Spectrum fakePred_bad = prediction_bad->Predict(&calc);
37  Spectrum fakeData_bad = fakePred_bad.FakeData(kSecondAnaPOT);
38 
39  Spectrum fakePred_good = prediction_good->Predict(&calc);
40  Spectrum fakeData_good = fakePred_good.FakeData(kSecondAnaPOT);
41 
42  // Experiments with constraints
43 
44  SingleSampleExperiment fakeExpt(prediction_std, fakeData);
45  std::vector<const IExperiment*> vConstraints;
46  vConstraints.push_back(&fakeExpt);
47  vConstraints.push_back(new SolarConstraints());
48  vConstraints.push_back(WorldReactorConstraint2016());
49  MultiExperiment ExptWconstr(vConstraints);
50 
51 
52  // Multiple exprts
53  SingleSampleExperiment fakeExpt_ugly(prediction_ugly, fakeData_ugly);
54  SingleSampleExperiment fakeExpt_bad(prediction_bad, fakeData_bad);
55  SingleSampleExperiment fakeExpt_good(prediction_good, fakeData_good);
56  /// Combine experiments
57  std::vector<const IExperiment*> vExpts;
58  vExpts.push_back(&fakeExpt_ugly);
59  vExpts.push_back(&fakeExpt_bad);
60  vExpts.push_back(&fakeExpt_good);
61  vExpts.push_back(new SolarConstraints());
62  vExpts.push_back(WorldReactorConstraint2016());
63 
64  MultiExperiment multiExpt(vExpts);
65 
66  // 2D Fits
67 
68  Surface* surface = new Surface( &ExptWconstr, &calc,
69  &kFitSinSqTheta23, 40, 0.3, 0.7,
70  &kFitDmSq32Scaled, 35, 2.3, 3.0, someOscpar);
71 
72  Surface* surfaceExtra = new Surface( &multiExpt, &calc,
73  &kFitSinSqTheta23, 40, 0.3, 0.7,
74  &kFitDmSq32Scaled, 35, 2.3, 3.0, someOscpar);
75 
76  // Plot
77  TCanvas* c = new TCanvas();
78  c->SetLeftMargin(0.12);
79  c->SetBottomMargin(0.15);
80 
81  surface->DrawBestFit(kBlue);
82  surface->DrawContour( Gaussian90Percent2D(*surface), kSolid, kBlue);
83 
84  surfaceExtra->DrawBestFit(kRed);
85  surfaceExtra->DrawContour( Gaussian90Percent2D(*surfaceExtra), kDashed, kRed);
86 
87  c->SaveAs("../Contours/ExtrapAndOscpar.root");
88  c->SaveAs("../Contours/ExtrapAndOscpar.pdf");
89 
90  c->Clear();
91 
92  // Get 1D marginalised plots
93  TH1* profileSinsq = Profile(&ExptWconstr, &calc,
94  &kFitSinSqTheta23, 40, 0.3, 0.7, -1,
96 
97  TH1* profileSinsqMulti = Profile(&multiExpt, &calc,
98  &kFitSinSqTheta23, 40, 0.3, 0.7, -1,
100 
101  profileSinsq->SetLineColor(kBlue);
102  profileSinsq->Draw("hist");
103  profileSinsqMulti->SetLineColor(kRed);
104  profileSinsqMulti->SetLineStyle(7);
105  profileSinsqMulti->Draw("hist same");
106 
107  std::cout << "Max-mix rej 1 : " << sqrt(profileSinsq->Interpolate(0.5)) << std::endl;
108  std::cout << "Max-mix rej Multi: " << sqrt(profileSinsqMulti->Interpolate(0.5)) << std::endl;
109 
110  c->SaveAs("../Contours/1D_OscPar.root");
111  c->SaveAs("../Contours/1D_OscPar.pdf");
112  c->Close();
113 
114 } // End of function
115 
116 
117 #endif
Implements systematic errors by interpolation between shifted templates.
enum BeamMode kRed
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calculator to default assumptions for all parameters.
Definition: Calcs.cxx:23
Constraints on the parameters and from solar experiments.
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 FakeData(double pot) const
Synonymous with AsimovData(). Retained for compatibility.
Definition: Spectrum.cxx:349
const ReactorExperiment * WorldReactorConstraint2016()
Updated value for SecondAna based on the latest PDG.
const ConstrainedFitVarWithPrior fitDmSq32Scaled_UniformPrior & kFitDmSq32Scaled
OStream cout
Definition: OStream.cxx:6
void saveContours_oscpar()
Spectrum Predict(osc::IOscCalc *calc) const override
Combine multiple component experiments.
TH2 * Gaussian90Percent2D(const FrequentistSurface &s)
Up-value surface for 90% confidence in 2D in gaussian approximation.
const ConstrainedFitVarWithPrior fitSsqTh23_UniformPriorSsqTh23 & kFitSinSqTheta23
const FitSinSq2Theta13 kFitSinSq2Theta13
Definition: FitVars.cxx:13
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.