8 #include "CAFAna/Analysis/Fit.h" 10 #include "CAFAna/Analysis/Surface.h" 12 #include "CAFAna/Cuts/NumuCuts.h" 21 #include "CAFAna/Vars/FitVarsNumu.h" 23 #include "OscLib/func/OscCalculatorPMNSOpt.h" 36 const double pot = 6.e20;
44 if(
sr->
mc.
nnu == 0)
return false;
67 std::cout <<
"\nrun : ---- Running CAF NuMu sensitivity (no tau).\n";
73 osc::OscCalculatorPMNSOpt
calc;
87 std::cout <<
"\nrun : --- run loaders.\n";
92 std::cout <<
"\nrun : --- Make surfaces.\n";
101 Surface* sensitivity =
new Surface( &fakeExpt, &calc,
105 std::cout <<
"\nrun : --- save output.\n";
106 TFile*
f =
new TFile(kOutputFileName.c_str(),
"RECREATE");
109 TH2*
surf = sensitivity->ToTH2();
110 surf->SetName(
"reco-sensitivity_surface-numu_selection");
114 TGraph* bestFit =
new TGraph;
115 bestFit->SetPoint(0, sensitivity->fMinX, sensitivity->fMinY);
116 bestFit->SetName(
"reco-sensitivity_bestfit-numu_selection");
117 bestFit->GetXaxis()->SetLimits(0.3, 0.7);
118 bestFit->GetYaxis()->SetLimits(2.0, 3.0);
124 margX->SetName(
"reco-sensitivity_1DmarginX-numu_selection");
125 margY->SetName(
"reco-sensitivity_1DmarginY-numu_selection");
130 TCanvas*
c =
new TCanvas(
"c",
"c");
131 c->SetLeftMargin(0.12);
132 c->SetBottomMargin(0.15);
134 TList *ObjList = c->GetListOfPrimitives();
138 TGraph* g68 =
new TGraph;
139 TGraph* g90 =
new TGraph;
144 while(obj=(TObject *)
next())
146 if(!obj->InheritsFrom(TGraph::Class()))
continue;
147 g68 = (TGraph*) obj->Clone(
"reco-sensitivity_68pc_contour-numu_selection");
158 while(obj=(TObject *)
next())
160 if(!obj->InheritsFrom(TGraph::Class()))
continue;
161 g90 = (TGraph*) obj->Clone(
"reco-sensitivity_90pc_contour-numu_selection");
166 TH1D* TotalPOT =
new TH1D(
"meta-TotalPOT",
"TotalPOT", 1, 0, 1);
167 TotalPOT->SetBinContent(1,
pot);
179 int nY = h2->GetYaxis()->GetNbins();
180 int nX = h2->GetXaxis()->GetNbins();
182 double Xmin = h2->GetXaxis()->GetXmin();
183 double Xmax = h2->GetXaxis()->GetXmax();
184 double Ymin = h2->GetYaxis()->GetXmin();
185 double Ymax = h2->GetYaxis()->GetXmax();
187 TH1D *h1Dim =
new TH1D(
"",
"",nX,Xmin,Xmax);
190 double minchi = 999999.;
193 if(val < minchi) minchi =
val;
195 h1Dim->SetBinContent(
binx,minchi);
203 int nY = h2->GetYaxis()->GetNbins();
204 int nX = h2->GetXaxis()->GetNbins();
206 double Xmin = h2->GetXaxis()->GetXmin();
207 double Xmax = h2->GetXaxis()->GetXmax();
208 double Ymin = h2->GetYaxis()->GetXmin();
209 double Ymax = h2->GetYaxis()->GetXmax();
211 TH1D *h1Dim =
new TH1D(
"",
"",nY,Ymin,Ymax);
214 double minchi = 999999.;
217 if(val < minchi) minchi =
val;
219 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.
Spectrum FakeData(double pot) const
Synonymous with AsimovData(). Retained for compatibility.
virtual void Go() override
Load all the registered spectra.
TH1D * GetXMarginalisation(TH2 *h2)
const ConstrainedFitVarWithPrior fitDmSq32Scaled_UniformPrior & kFitDmSq32Scaled
short nnu
Number of neutrinos in nu vector (0 or 1)
void caf_numu_sensitivity_no_tau(std::string kInputNonSwapFileName, std::string kInputSwapFileName, std::string kOutputFileName)
The StandardRecord is the primary top-level object in the Common Analysis File trees.
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)
TH1D * GetYMarginalisation(TH2 *h2)
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.