8 #include "CAFAna/Analysis/Fit.h" 10 #include "CAFAna/Analysis/Surface.h" 12 #include "CAFAna/Cuts/NumuCuts.h" 20 #include "CAFAna/Vars/FitVarsNumu.h" 22 #include "OscLib/func/OscCalculatorPMNSOpt.h" 35 const double pot = 6.e20;
43 if(
sr->
mc.
nnu == 0)
return false;
66 std::cout <<
"\nrun : ---- Running CAF NuMu sensitivity.\n";
73 osc::OscCalculatorPMNSOpt
calc;
88 std::cout <<
"\nrun : --- run loaders.\n";
94 std::cout <<
"\nrun : --- Make surfaces.\n";
103 Surface* sensitivity =
new Surface( &fakeExpt, &calc,
107 std::cout <<
"\nrun : --- save output.\n";
108 TFile*
f =
new TFile(kOutputFileName.c_str(),
"RECREATE");
111 TH2*
surf = sensitivity->ToTH2();
112 surf->SetName(
"reco-sensitivity_surface-numu_selection");
116 TGraph* bestFit =
new TGraph;
117 bestFit->SetPoint(0, sensitivity->fMinX, sensitivity->fMinY);
118 bestFit->SetName(
"reco-sensitivity_bestfit-numu_selection");
119 bestFit->GetXaxis()->SetLimits(0.3, 0.7);
120 bestFit->GetYaxis()->SetLimits(2.0, 3.0);
126 margX->SetName(
"reco-sensitivity_1DmarginX-numu_selection");
127 margY->SetName(
"reco-sensitivity_1DmarginY-numu_selection");
132 TCanvas*
c =
new TCanvas(
"c",
"c");
133 c->SetLeftMargin(0.12);
134 c->SetBottomMargin(0.15);
136 TList *ObjList = c->GetListOfPrimitives();
140 TGraph* g68 =
new TGraph;
141 TGraph* g90 =
new TGraph;
146 while(obj=(TObject *)
next())
148 if(!obj->InheritsFrom(TGraph::Class()))
continue;
149 g68 = (TGraph*) obj->Clone(
"reco-sensitivity_68pc_contour-numu_selection");
160 while(obj=(TObject *)
next())
162 if(!obj->InheritsFrom(TGraph::Class()))
continue;
163 g90 = (TGraph*) obj->Clone(
"reco-sensitivity_90pc_contour-numu_selection");
168 TH1D* TotalPOT =
new TH1D(
"meta-TotalPOT",
"TotalPOT", 1, 0, 1);
169 TotalPOT->SetBinContent(1,
pot);
181 int nY = h2->GetYaxis()->GetNbins();
182 int nX = h2->GetXaxis()->GetNbins();
184 double Xmin = h2->GetXaxis()->GetXmin();
185 double Xmax = h2->GetXaxis()->GetXmax();
186 double Ymin = h2->GetYaxis()->GetXmin();
187 double Ymax = h2->GetYaxis()->GetXmax();
189 TH1D *h1Dim =
new TH1D(
"",
"",nX,Xmin,Xmax);
192 double minchi = 999999.;
195 if(val < minchi) minchi =
val;
197 h1Dim->SetBinContent(
binx,minchi);
205 int nY = h2->GetYaxis()->GetNbins();
206 int nX = h2->GetXaxis()->GetNbins();
208 double Xmin = h2->GetXaxis()->GetXmin();
209 double Xmax = h2->GetXaxis()->GetXmax();
210 double Ymin = h2->GetYaxis()->GetXmin();
211 double Ymax = h2->GetYaxis()->GetXmax();
213 TH1D *h1Dim =
new TH1D(
"",
"",nY,Ymin,Ymax);
216 double minchi = 999999.;
219 if(val < minchi) minchi =
val;
221 h1Dim->SetBinContent(
biny,minchi);
Cuts and Vars for the 2020 FD DiF Study.
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calculator to default assumptions for all parameters.
const Var kSlcMaxZ([](const caf::SRProxy *sr){return sr->slc.boxmax.Z()/100.;})
const Var kSlcMaxY([](const caf::SRProxy *sr){return sr->slc.boxmax.Y()/100.;})
SRVector3D boxmax
Maximum coordinates box containing all the hits [cm].
TH2 * Gaussian68Percent2D(const FrequentistSurface &s)
Up-value surface for 68% confidence in 2D in gaussian approximation.
void SetSpillCut(const SpillCut &cut)
const Var kSlcMaxX([](const caf::SRProxy *sr){return sr->slc.boxmax.X()/100.;})
Representation of a spectrum in any variable, with associated POT.
TH1D * GetXMarginalisation(TH2 *h2)
Spectrum FakeData(double pot) const
Synonymous with AsimovData(). Retained for compatibility.
TH1D * GetYMarginalisation(TH2 *h2)
virtual void Go() override
Load all the registered spectra.
const ConstrainedFitVarWithPrior fitDmSq32Scaled_UniformPrior & kFitDmSq32Scaled
short nnu
Number of neutrinos in nu vector (0 or 1)
The StandardRecord is the primary top-level object in the Common Analysis File trees.
void caf_numu_sensitivity(std::string kInputNonSwapFileName, std::string kInputSwapFileName, std::string kInputTauFileName, std::string kOutputFileName)
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
TH2 * Gaussian90Percent2D(const FrequentistSurface &s)
Up-value surface for 90% confidence in 2D in gaussian approximation.
const ConstrainedFitVarWithPrior fitSsqTh23_UniformPriorSsqTh23 & kFitSinSqTheta23
assert(nhit_max >=nhit_nbins)
SRSlice slc
Slice branch: nhit, extents, time, etc.
SRTruthBranch mc
Truth branch for MC: energy, flavor, etc.
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
std::vector< SRNeutrino > nu
implemented as a vector to maintain mc.nu structure, i.e. not a pointer, but with 0 or 1 entries...
Compare a single data spectrum to the MC + cosmics expectation.