Functions
test_nue2017Prediction.C File Reference
#include "OscLib/OscCalcDumb.h"
#include "CAFAna/Analysis/Calcs.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Core/LoadFromFile.h"
#include "CAFAna/Vars/FitVars.h"
#include "3FlavorAna/Prediction/PredictionExtendToPeripheral.h"
#include "3FlavorAna/Prediction/PredictionAddRock.h"
#include "CAFAna/Prediction/PredictionNoExtrap.h"
#include "Utilities/func/MathUtil.h"
#include "TCanvas.h"
#include "TH1.h"
#include "TFile.h"
#include <iostream>
#include <cmath>

Go to the source code of this file.

Functions

void test_nue2017Prediction ()
 

Function Documentation

void test_nue2017Prediction ( )

Definition at line 24 of file test_nue2017Prediction.C.

References calc, allTimeWatchdog::can, om::cout, dCP, ana::DefaultOscCalc(), dirName, dmsq32, allTimeWatchdog::endl, hsig, ana::Current::kCC, ana::kFitDeltaInPiUnits, ana::kFitDmSq32, ana::kFitSinSqTheta23, ana::Sign::kNu, ana::Flavors::kNuMuToNuE, kRed, pot, plot_validation_datamc::pred, ana::PredictionExtendToPeripheral::Predict(), ana::PredictionExtendToPeripheral::PredictComponent(), runNovaSAM::release, ana::FitVarWithPrior::SetValue(), ana::ConstrainedFitVarWithPrior::SetValue(), ana::FitDmSq32::SetValue(), ssth23, string, PandAna.Demos.pi0_spectra::tot, and ana::Spectrum::ToTH1().

25 {
26  double pot = 9.48e20; // From Nitish
27 
28  std::string dirName = "/nova/ana/users/dpershey/Extraps2017/";
29  std::string fName1 = "out_nue2017_extrap.root";
30  std::string fName2 = "out_fdrock.root";
31 
32  // First step, take the extrapolated core sample and extend the dcmp result
33  // to the peripheral sample
34  // The extrapolated result
35  PredictionExtrap *core_merge =
36  LoadFromFile<PredictionExtrap>(dirName+fName1,"predProp").release();
37  // The FD MC
38  PredictionNoExtrap *fdmc_merge =
39  LoadFromFile<PredictionNoExtrap>(dirName+fName1,"fdmcNom").release();
40  // Those together give the fiducial prediction
41  PredictionExtendToPeripheral pred_merge(core_merge,fdmc_merge,true);
42 
43 
44  PredictionExtrap *core =
45  LoadFromFile<PredictionExtrap>(dirName+fName1,"predProp").release();
46  // The FD MC
47  PredictionNoExtrap *fdmc =
48  LoadFromFile<PredictionNoExtrap>(dirName+fName1,"fdmcNom").release();
49  PredictionExtendToPeripheral pred(core,fdmc,false);
50 
51  // Now, make a plot
52  // Close to one of the SA best fit points
53  double dCP = 1.5;
54  double ssth23 = 0.402;
55  double dmsq32 = 0.0027;
56 
58 
59  kFitDeltaInPiUnits.SetValue(calc,dCP);
60  kFitDmSq32.SetValue(calc,dmsq32);
61  kFitSinSqTheta23.SetValue(calc,ssth23);
62 
63  Spectrum tot = pred.Predict(calc);
64  Spectrum sig = pred.PredictComponent(calc, Flavors::kNuMuToNuE,
66  Spectrum bb = pred.Predict(calc);
67  bb -= sig;
68 
69  TH1 *htot = tot.ToTH1(pot);
70  TH1 *hsig = sig.ToTH1(pot);
71  TH1 *hbb = bb. ToTH1(pot);
72 
73  htot->SetLineColor(kRed);
74  hsig->SetLineColor(kPink+9);
75  hbb ->SetLineColor(kAzure);
76 
77 
78 
79  TCanvas *can = new TCanvas();
80  htot->Draw("hist");
81  hsig->Draw("hist,same");
82  hbb ->Draw("hist,same");
83 
84 
85  Spectrum tot_merge = pred_merge.Predict(calc);
86  Spectrum sig_merge = pred_merge.PredictComponent(calc, Flavors::kNuMuToNuE,
88  Spectrum bb_merge = pred_merge.Predict(calc);
89  bb_merge -= sig_merge;
90 
91  TH1 *htot_merge = tot_merge.ToTH1(pot);
92  TH1 *hsig_merge = sig_merge.ToTH1(pot);
93  TH1 *hbb_merge = bb_merge. ToTH1(pot);
94 
95  htot_merge->SetLineColor(kRed);
96  hsig_merge->SetLineColor(kPink+9);
97  hbb_merge ->SetLineColor(kAzure);
98 
99  TCanvas *can_merge = new TCanvas();
100  htot_merge->Draw("hist");
101  hsig_merge->Draw("hist,same");
102  hbb_merge ->Draw("hist,same");
103 
104  std::cout << "Compare the event counts in the peripheral: " << std::endl;
105  std::cout << "Total: Merged - " << htot_merge->Integral(28,28) << " and Not Merged - " << htot->Integral(28,36) << std::endl;
106  std::cout << "Signal: Merged - " << hsig_merge->Integral(28,28) << " and Not Merged - " << hsig->Integral(28,36) << std::endl;
107  std::cout << "Beam Bkgd: Merged - " << hbb_merge->Integral(28,28) << " and Not Merged - " << hbb->Integral(28,36) << std::endl;
108 
109 
110 }
enum BeamMode kRed
double ssth23
(&#39; appearance&#39;)
Definition: IPrediction.h:18
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
const FitDmSq32 kFitDmSq32
Definition: FitVars.cxx:18
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
Definition: FitVars.cxx:177
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
Forward to wrapped Var&#39;s SetValue()
TH1F * hsig
Definition: Xdiff_gwt.C:59
osc::OscCalcDumb calc
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
Charged-current interactions.
Definition: IPrediction.h:39
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
double dCP
#define pot
Neutrinos-only.
Definition: IPrediction.h:49
OStream cout
Definition: OStream.cxx:6
std::string dirName
Definition: PlotSpectra.h:47
double dmsq32
const ConstrainedFitVarWithPrior fitSsqTh23_UniformPriorSsqTh23 & kFitSinSqTheta23
Prediction that just uses FD MC, with no extrapolation.
Take the output of an extrapolation and oscillate it as required.
const FitVarWithPrior fitDeltaInPiUnits_UniformPriordCP & kFitDeltaInPiUnits
enum BeamMode string