numu_demo_split_plot.C
Go to the documentation of this file.
2 
3 #include "CAFAna/Cuts/Cuts.h"
4 #include "CAFAna/Cuts/NumuCuts.h"
5 #include "CAFAna/Vars/FitVars.h"
11 #include "CAFAna/Vars/Vars.h"
13 
14 #include "TCanvas.h"
15 #include "TH1.h"
16 
17 //#include <cmath>
18 //#include <iostream>
19 
20 //#include "Utilities/func/MathUtil.h"
21 
22 // No Cosmics, no Systematics, S13-06-18 hadded cafs
23 // Use with Nova style ROOT logon script
24 
25 const double pot = 18e20;
26 
27 using namespace ana;
28 
30 {
31  const std::string fname = "$NOVA_DATA/mc/S13-06-18/genie/fd/fd_r000000?_s01_S13-06-18_v1_genie_3000_fhc_nonswap_20121129_181947.sim.caf.root";
32  const std::string fnameSwap = "$NOVA_DATA/mc/S13-06-18/genie/fd/fd_r000000?_s01_S13-06-18_v1_genie_3000_fhc_fluxswap_20121129_181947.sim.caf.root";
33 
35 
36  calc.SetL(810);
37  calc.SetRho(0); // No matter effects
38  calc.SetDmsq21(7.59e-5);
39  calc.SetDmsq32(2.4e-3);
40  calc.SetTh12(.601);
41  calc.SetTh13(.1567);
42  // calc.SetdCP(TMath::Pi()/2);
43  calc.SetdCP(0);
44  calc.SetTh23(TMath::Pi()/4-.1);
45 
46  SpectrumLoader loader(fname);
47  SpectrumLoader loaderSwap(fnameSwap);
48 
49  // Load up the necessary histograms, seperated by flavour etc
50  PredictionNoExtrap predCC(loader, loaderSwap,
51  "Simple Energy (GeV)", kNumuEnergyBinning,
52  kCCE, kNumuNCRej && /*kCosContain &&*/ !kNumuQESel);
53 
54  PredictionNoExtrap predQE(loader, loaderSwap,
55  "QE Energy (GeV)", kNumuEnergyBinning,
56  kQEE, kNumuNCRej && /*kCosContain &&*/ kNumuQESel);
57 
58  loader.Go();
59  loaderSwap.Go();
60 
61  Spectrum obsCC = predCC.Predict(&calc);
62  Spectrum obsQE = predQE.Predict(&calc);
63  Spectrum fakeCC = obsCC.FakeData(pot);
64  Spectrum fakeQE = obsQE.FakeData(pot);
65  SingleSampleExperiment exptCC(&predCC, fakeCC);
66  SingleSampleExperiment exptQE(&predQE, fakeQE);
67 
68  new TCanvas("comp1a","CC spectra 1"); // plot spectra for each sample
69  DataMCComparisonComponents(fakeCC, &predCC, &calc);
70  TH1* ccu = predCC.PredictUnoscillated().ToTH1(pot);
71  ccu->SetLineStyle(7);
72  ccu->Draw("hist same");
73  new TCanvas("comp2a","QE spectra 1");
74  DataMCComparisonComponents(fakeQE, &predQE, &calc);
75  TH1* qeu = predQE.PredictUnoscillated().ToTH1(pot);
76  qeu->SetLineStyle(7);
77  qeu->Draw("hist same");
78 
79  MultiExperiment exptAll({&exptCC, &exptQE});
80 
81  //The log-likelihood surface: FHC
82  new TCanvas("contoursfhc1","contoursfhc1") ;
83  NumuSurface surfCC(&exptCC, &calc,
84  20, .3, .7,
85  20, 2.1, 2.8);
86  surfCC.DrawBestFit(kRed);
88  Gaussian90Percent2D(*surfCC.fSurfInv),
89  kSolid, kRed);
90 
91  NumuSurface surfQE(&exptQE, &calc,
92  20, .3, .7,
93  20, 2.1, 2.8);
94  surfQE.DrawBestFit(kBlue);
95  surfQE.DrawContour90(kSolid, kBlue);
96 
97  NumuSurface surfAll(&exptAll, &calc,
98  20, .3, .7,
99  20, 2.1, 2.8);
100  surfAll.DrawBestFit(kBlack);
101  surfAll.DrawContour90(kSolid, kBlack);
102 }
osc::OscCalculatorDumb calc
Spectrum Predict(osc::IOscCalculator *calc) const override
Oscillation analysis framework, runs over CAF files outside of ART.
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:553
void SetDmsq21(const T &dmsq21) override
Optimized version of OscCalculatorPMNS.
Definition: StanTypedefs.h:28
TH1 * DataMCComparisonComponents(const Spectrum &data, const IPrediction *mc, osc::IOscCalculator *calc)
Plot MC broken down into flavour components, overlayed with data.
Definition: Plots.cxx:113
string fnameSwap
Definition: demo4.py:6
void DrawBestFit(Color_t color) const
Draw the best fit point.
virtual Spectrum PredictUnoscillated() const
Definition: IPrediction.cxx:82
FrequentistSurface * fSurfInv
Definition: NumuSurface.h:53
void SetTh23(const T &th23) override
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:37
void SetDmsq32(const T &dmsq32) override
void SetdCP(const T &dCP) override
const Binning kNumuEnergyBinning
Definition: Binning.h:79
Spectrum FakeData(double pot) const
Fake data is a MC spectrum scaled to the POT expected in the data.
Definition: Spectrum.cxx:819
const Cut kNumuQESel([](const caf::SRProxy *sr){std::cout<< "WARNING! Attempting to access kNumuQESel which relies on qepid (which no longer exists.) Aborting..."<< std::endl;abort(); return false;})
Definition: NumuCuts.h:37
const Var kCCE
Definition: Vars.h:90
void SetL(double L) override
virtual void Go() override
Load all the registered spectra.
void SetTh13(const T &th13) override
const double pot
const Cut kNumuNCRej([](const caf::SRProxy *sr){return(sr->sel.remid.pid >0.75);})
Definition: NumuCuts.h:23
loader
Definition: demo0.py:10
FrequentistSurface * fSurfNorm
Definition: NumuSurface.h:53
Combine multiple component experiments.
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void DrawContour(TH2 *fcNorm, TH2 *fcInv, Style_t style, Color_t color, double minchi=-1)
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
void SetTh12(const T &th12) override
TH2 * Gaussian90Percent2D(const FrequentistSurface &s)
Up-value surface for 90% confidence in 2D in gaussian approximation.
const Var kQEE
Energy estimator for quasielastic CC events.
Definition: Vars.cxx:83
Surface with axes and .
Definition: NumuSurface.h:12
void numu_demo_split_plot()
void SetRho(double rho) override
Prediction that just uses FD MC, with no extrapolation.
Float_t e
Definition: plot.C:35
loaderSwap
Definition: demo4.py:9
void DrawContour90(Style_t style, Color_t color, double minchi=-1)
Compare a single data spectrum to the MC + cosmics expectation.