run_joint_fit_2020_contours.C
Go to the documentation of this file.
3 #include "CAFAna/Fit/Fit.h"
11 #include "CAFAna/FC/FCSurface.h"
16 #include "CAFAna/Vars/FitVars.h"
17 #include "Utilities/rootlogon.C"
18 #include "OscLib/IOscCalc.h"
19 
21 
22 #include "TCanvas.h"
23 #include "TMarker.h"
24 #include "TBox.h"
25 #include "TLatex.h"
26 #include "TColor.h"
27 #include "TGraph.h"
28 #include "TVectorD.h"
29 #include "TF1.h"
30 #include "TLegend.h"
31 #include "TLine.h"
32 #include "TMarker.h"
33 #include "TStyle.h"
34 #include "TSystem.h"
35 #include "TGaxis.h"
36 
37 #include <algorithm>
38 #include <vector>
39 #include <string>
40 
41 using namespace ana;
42 
43 void run_joint_fit_2020_contours(bool corrSysts = false,
44  bool runOnGrid = false,
45  TString options="joint_fake2019_both_onlyIH",
46  bool dmsqSurf = false,
47  bool th13Surf = false)
48 {
49  bool debug = 1;
50  bool nueOnly = options.Contains("nueOnly");
51  bool numuOnly = options.Contains("numuOnly");
52  bool joint = options.Contains("joint");
53  assert (nueOnly || numuOnly || joint);
54 
55  bool FHCOnly = options.Contains("FHCOnly");
56  bool RHCOnly = options.Contains("RHCOnly");
57  bool both = options.Contains("both");
58  assert (FHCOnly || RHCOnly || both);
59 
60  bool fake2019 = options.Contains("fake2019");
61  bool realData = options.Contains("realData");
62 
63  bool onlyNH = options.Contains("onlyNH");
64  bool onlyIH = options.Contains("onlyIH");
65 
66  TString tag;
67  if(FHCOnly) tag="FHCOnly/";
68  if(RHCOnly) tag="RHCOnly/";
69  if(both) tag = "RHC_and_FHC/";
70 
71  auto suffix = options;
72  if(dmsqSurf) suffix+= "_dmsq";
73  if(th13Surf) suffix+= "_th13";
74  if(corrSysts) suffix+="_systs";
75  else suffix+="_stats";
76 
77  TString outdir = "/nova/ana/nu_e_ana/Ana2020/prefits/";//"/nova/ana/nu_e_ana/Ana2020/Results/"+tag+"contours/FCInputs/";
78  if (runOnGrid) outdir = "./";
79  TString outFCfilename (outdir +"contours_FCInput_2020_" + suffix);
80 
81  // outdir="/nova/ana/nu_e_ana/Ana2020/Results/"+tag+"contours/";
82  /*if(th13Surf) outdir += "th13_delta/";
83  else if (dmsqSurf) outdir += "th23_dmsq/";
84  else outdir += "delta_th23/";
85  outdir += corrSysts?"syst/":"stat/";
86  if (runOnGrid) outdir = "./";*/
87  TString outfilename (outdir + "hist_contours_2020_" + suffix);
88 
89  //////////////////////////////////////////////////
90  // Load Nue and Numu experiments
91  //////////////////////////////////////////////////
92  //need numu only for prestage seeds
93 
94  //std::string decomp = "noPt"; // use Pt extrap all the times
95  std::string decomp = ""; // use Pt extrap all the times
96  std::vector <ana::predictions> preds = LoadPredictions (corrSysts, runOnGrid, decomp, nueOnly || joint, numuOnly || joint, FHCOnly || both, RHCOnly || both);
97  std::vector <ana::predictions> preds_numu_only = LoadPredictions (corrSysts, runOnGrid, decomp, false, numuOnly || joint, FHCOnly || both, RHCOnly || both);
98  std::vector <Spectrum * > data = LoadRealData (runOnGrid, nueOnly || joint, numuOnly || joint, FHCOnly || both, RHCOnly || both);
99  std::vector <Spectrum * > data_numu_only = LoadRealData (runOnGrid, false, numuOnly || joint, FHCOnly || both, RHCOnly || both);
100  std::vector <const IExperiment * > expts;
101  std::vector <const IExperiment * > expts_numu_only;
102 
103  int nnumu = 4;
104 
105  auto calc_fake = DefaultOscCalc();
106  if(fake2019) SetFakeCalc(calc_fake, 0.565, 2.48e-3, 0);
107  else if(!realData) {std::cerr << "need setting for data\n"; exit(1);}
108 
109  for(int i = 0; i < int(preds.size()); ++i){
110  double POT = preds[i].pot;
111  auto thisdata = GetFakeData (preds[i].pred, calc_fake, POT, preds[i].cos.first, preds[i].livetime);
112  if(realData) thisdata = data[i];
113  auto hcos = preds[i].cos.first->ToTH1(preds[i].livetime, kBlack, kSolid, kLivetime);
114  cout<<i<<" "<<preds[i].name<<" POT "<<POT<<" tot MC "<<preds[i].pred->Predict(calc_fake).Integral(POT)<<
115  " cos "<<hcos->Integral()<<" cos er "<<preds[i].cos.second<<" analyze data "<<thisdata->Integral(thisdata->POT())<<endl;
116  expts.push_back(new SingleSampleExperiment(preds[i].pred, *thisdata, *preds[i].cos.first, preds[i].cos.second, true));
117  if(debug){
118  new TCanvas();
119  DataMCComparison (*thisdata, preds[i].pred, DefaultOscCalc());
120  hcos->SetMarkerStyle(34);
121  hcos->SetMarkerColor(kCosmicBackgroundColor);
122  hcos->Draw("hist p same");
123  gPad->Print(outdir + (corrSysts?"syst/":"stat/")+ "debug_predictions_" + suffix + "_" + std::to_string(i) + ".pdf");
124  }//end debug
125  }
126 
127  cout<<"Make numu only experiment to get the seeds"<<endl;
128  //make numu only experiment for seeds:
129 
130  for(int i = 0; i < (int) preds_numu_only.size(); ++i){
131  double POT = preds_numu_only[i].pot;
132  auto thisdata = GetFakeData (preds_numu_only[i].pred, calc_fake, POT, preds_numu_only[i].cos.first, preds_numu_only[i].livetime);
133  if(realData) thisdata = data_numu_only[i];
134  auto hcos = preds_numu_only[i].cos.first->ToTH1(preds_numu_only[i].livetime, kBlack, kSolid, kLivetime);
135  cout<<i<<" "<<preds_numu_only[i].name<<" POT "<<POT<<" tot MC "<<preds_numu_only[i].pred->Predict(calc_fake).Integral(POT)<<
136  " cos "<<hcos->Integral()<<" cos er "<<preds_numu_only[i].cos.second<<" analyze data "<<thisdata->Integral(thisdata->POT())<<endl;
137  expts_numu_only.push_back(new SingleSampleExperiment(preds_numu_only[i].pred, *thisdata, *preds_numu_only[i].cos.first, preds_numu_only[i].cos.second, true));
138  }
139 
140  //////////////////////////////////////////////////
141  // Add constraints, make experiments
142  //////////////////////////////////////////////////
143  std::cout << "\nCreating multiexperiment\n" << std::endl;
144  if(!th13Surf){
145  std::cout << "Adding WorldReactorConstraint2019\n";
146  expts.push_back(WorldReactorConstraint2019());
147  }
148  if(nueOnly) {
149  std::cout << "Adding Dmsq32ConstraintPDG2019\n";
150  expts.push_back(&kDmsq32ConstraintPDG2019);
151  }
152  std::cout << "Creating Multiexperiment with a total of " << expts.size() << " experiments\n\n" << std::endl;
153  auto exptThis = new MultiExperiment(expts);
154 
155  std::cout << "Creating Multiexperiment of numu only SimpleExp with a total of "
156  << expts_numu_only.size() << " experiments\n\n" << std::endl;
157  auto exptThis_numu_only = new MultiExperiment(expts_numu_only);
158 
159  std::cout<<"Clean verctors"<<std::endl;
160  preds.clear();
161  preds_numu_only.clear();
162 
163  ////////////////////////////////////////////////////////////
164  // Systematics
165  ////////////////////////////////////////////////////////////
166 
167  bool ptExtrap = true;
168  if (decomp == "noPt") ptExtrap = false;
169  auto systs = GetJointFitSystematicList(corrSysts, nueOnly, numuOnly, FHCOnly||both, RHCOnly||both, true, ptExtrap);
170 
171  std::cout << "\n\nSystematic correlations...\n";
172  if(!nueOnly && ! numuOnly && corrSysts){
173  if(FHCOnly){
174  exptThis->SetSystCorrelations(0, GetCorrelations(true, true, ptExtrap));
175  auto notfornumu = GetCorrelations(false, true, ptExtrap);
176  for(int i =0; i < nnumu; ++i) exptThis->SetSystCorrelations(i+1, notfornumu);
177  }
178  if(RHCOnly){
179  exptThis->SetSystCorrelations(0, GetCorrelations(true, false, ptExtrap));
180  auto notfornumu = GetCorrelations(false, false, ptExtrap);
181  for(int i =0; i < nnumu; ++i) exptThis->SetSystCorrelations(i+1, notfornumu);
182  }
183  if(both){
184  exptThis->SetSystCorrelations(0, GetCorrelations(true, true, ptExtrap));
185  exptThis->SetSystCorrelations(1, GetCorrelations(true, false, ptExtrap));
186  auto notfornumufhc = GetCorrelations(false, true, ptExtrap);
187  for(int i =0; i < 4; ++i) exptThis->SetSystCorrelations(i+2, notfornumufhc);
188  auto notfornumurhc = GetCorrelations(false, false, ptExtrap);
189  for(int i =0; i < 4; ++i) exptThis->SetSystCorrelations(i+6, notfornumurhc);
190  }
191  }
192  if (nueOnly && corrSysts){
193  if (FHCOnly) exptThis->SetSystCorrelations(0, GetCorrelations(true, true, ptExtrap));
194  if (RHCOnly) exptThis->SetSystCorrelations(0, GetCorrelations(true, false, ptExtrap));
195  if (both) {
196  exptThis->SetSystCorrelations(0, GetCorrelations(true, true, ptExtrap));
197  exptThis->SetSystCorrelations(1, GetCorrelations(true, false, ptExtrap));
198  }
199  }
200 
201  std::cout << "Systematics for the numu only fit:\n";
202  auto systs_numu_only = GetJointFitSystematicList(corrSysts, false, true, FHCOnly||both, RHCOnly||both, true, ptExtrap);
203 
204  if (corrSysts && numuOnly && both){
205  auto notfornumufhc = GetCorrelations(false, true, ptExtrap);
206  for(int i =0; i < 4; ++i) {
207  exptThis->SetSystCorrelations(i, notfornumufhc);
208  exptThis_numu_only->SetSystCorrelations(i, notfornumufhc);
209  }
210  auto notfornumurhc = GetCorrelations(false, false, ptExtrap);
211  for(int i =0; i < 4; ++i) {
212  exptThis->SetSystCorrelations(i+4, notfornumurhc);
213  exptThis_numu_only->SetSystCorrelations(i+4, notfornumurhc);
214  }
215  }
216 
217  ////////////////////////////////////////////////////////////
218  // Fit
219  ////////////////////////////////////////////////////////////
220  std::cout << "Starting the fit" << std::endl;
221 
223 
224  SystShifts auxShifts = SystShifts::Nominal();
225 
226  std::vector <SystShifts> seedShifts = {};
227  if (corrSysts) {
228  for (double systshift:{-2, +2}){
229  SystShifts tempShifts (&kAnaLightlevelNDSyst, systshift); // attempt to fix flip between positive and negative pulls
230  seedShifts.push_back(tempShifts);
231  }
232  }
233  //////////////////////////////////////////////////////////////////////
234  /////////////////////////// Seed controller ////////////////////////////
235  ////////////////////////////////////////////////////////////////////////
236 
237 
238  cout<<"------------------- Start prestage seeds --------------------------"<<endl;
239 
240  double minchi_numu = 1E20;
241  double pre_seed_th23;
242  double pre_seed_dmsq;
243  ResetOscCalcToDefault(calc);
244  auxShifts.ResetToNominal();
245 
246  double maxmix = 0.514; // from the numu results
247  double numu_pre_seedLONH, numu_pre_seedUONH, numu_pre_seedLOIH, numu_pre_seedUOIH, dmsq_numu_pre_seedNH, dmsq_numu_pre_seedIH;
248 
249  for(int hie:{1}){
250  std::cout << "\n\nFinding test best fit " << (hie>0? "NH " : "IH ") << "\n\n";
251  MinuitFitter fitnumu_only(exptThis_numu_only, {&kFitSinSqTheta23, &kFitDmSq32Scaled}, {});
252 
253  auto thisminchi = fitnumu_only.Fit(calc, auxShifts ,
254  SeedList({{&kFitDmSq32Scaled,{hie*2.5}},
255  {&kFitSinSqTheta23, {0.4} }}), {},// seedShifts
256  IFitter::kVerbose)->EvalMetricVal();
257 
258  if(thisminchi < minchi_numu) minchi_numu = thisminchi;
259  }
260  pre_seed_th23 = kFitSinSqTheta23.GetValue(calc);
261  pre_seed_dmsq = kFitDmSq32Scaled.GetValue(calc);
262 
263  numu_pre_seedLONH = ((pre_seed_th23>maxmix)?(2*maxmix-pre_seed_th23):pre_seed_th23);
264  numu_pre_seedUONH = ((pre_seed_th23>maxmix)?pre_seed_th23:(2*maxmix-pre_seed_th23));
265 
266  ResetOscCalcToDefault(calc);
267  auxShifts.ResetToNominal();
268 
269  cout<<"------------------- End prestage seeds --------------------------"<<endl;
270 
271  struct th23helper{
272  std::vector<double> seeds;
273  const IFitVar * var;
274  TString label;
275  };
276 
277  std::vector <th23helper> th23seeds;
278 
279  th23helper temp;
280  temp.seeds = {0.3};
281  temp.var = &kFitSinSqTheta23LowerOctant;
282  temp.label = "LO";
283 
284  //for NH:
285  th23seeds.push_back( { {0.499, numu_pre_seedLONH}, &kFitSinSqTheta23LowerOctant, "LO"});
286  th23seeds.push_back( { {0.501, numu_pre_seedUONH}, &kFitSinSqTheta23UpperOctant, "UO"});
287  std::vector<double> th23_all_seeds_NH = {numu_pre_seedLONH, 0.5, numu_pre_seedUONH};
288 
289  std::vector<double> delta_seeds = {0, 0.5, 1., 1.5};
290  std::vector<double> th23_old_seeds = {0.45, 0.5, 0.55};
291 
292  /////////////////////////////////////////////////////////////////////////
293  //////////////////////////// Different best fit searches //////////////////
294  ///////////////////////////////////////////////////////////////////////////
295 
296  double minchi23 = 1E20;
297  for(int hie:{-1,1}){
298  for (auto & thseed: th23seeds){
299  std::cout << "\n\nFinding best fit " << thseed.label
300  << (hie>0? " NH " : " IH ") <<"\n"<<endl;
301  for (auto const & s:thseed.seeds) std::cout << s << ", ";
302  std::cout << std::endl;
303  cout<<"pre seed from numu is "<<pre_seed_dmsq<<endl;
304  std::vector <const IFitVar*> fitvars = {&kFitDeltaInPiUnits,
305  thseed.var,
308 
309  //if (th13Surf) fitvars = {&kFitDeltaInPiUnits,thseed.var,&kFitDmSq32Scaled};
310 
311  MinuitFitter fit23(exptThis, fitvars, systs);
312  auto thisminchi = fit23.Fit(calc, auxShifts, SeedList({
313  {&kFitDmSq32Scaled,{hie*pre_seed_dmsq}},
314  {thseed.var, thseed.seeds},
315  {&kFitDeltaInPiUnits, delta_seeds}
316  }),
317  {}, IFitter::kVerbose)->EvalMetricVal();
318  minchi23= min(minchi23, thisminchi);
319  ResetOscCalcToDefault(calc);
320  auxShifts.ResetToNominal();
321  }//end th23
322  }//end hie
323  std::cout << "\nFound overall minchi " << minchi23 << std::endl;
324 
325  cout<<"Check with oldstyle seeds when we didn't split into octant"<<endl;
326  double minchi23test = 1E20;
327  for(int hie:{-1,1}){
328  std::cout << "\n\nFinding test best fit " << (hie>0? "NH " : "IH ") << "\n\n";
329 
330  std::vector <const IFitVar*> fitvars = {&kFitDeltaInPiUnits,
334 
335  //if (th13Surf) fitvars = {&kFitDeltaInPiUnits, &kFitSinSqTheta23, &kFitDmSq32Scaled};
336 
337  MinuitFitter fit23(exptThis, fitvars, systs);
338  auto thisminchi = fit23.Fit(calc,auxShifts , SeedList({
340  {&kFitSinSqTheta23, th23_old_seeds},
341  {&kFitDeltaInPiUnits, delta_seeds}
342  }),seedShifts)->EvalMetricVal();
343  minchi23test= min(minchi23test, thisminchi);
344  ResetOscCalcToDefault(calc);
345  auxShifts.ResetToNominal();
346  }//end hie
347  std::cout << "\nFound overall test minchi " << minchi23test << std::endl;
348 
349  TFile * outfile = new TFile(outfilename+".root","recreate");
350  TFile * outFCfile = new TFile(outFCfilename+".root","recreate");
351 
352  outfile->cd();
353  TVectorD v(1);
354  v[0] = minchi23;
355  cout<<"minchi wrote into the file "<<minchi23<<endl;
356  v.Write("overall_minchi");
357 
358  int steps = 30;//10;// 5;
359  if(dmsqSurf){
360  std::cerr << "\n WARNING Using 20 bins for dmsq surface\n\n";
361  steps = 20;
362  }
363  //Now create all the surfaces
364  for(int hie: {-1, +1}){
365 
366  if((onlyNH && hie<0) || (onlyIH && hie>0)) continue;
367 
368  std::cout << "Starting surface " << (hie>0? "NH ": "IH") << "\n\n";
369  cout<<"the delta seeds are ";
370  for (auto const & s:delta_seeds) std::cout << s << ", ";
371  std::string hieStr = hie>0 ? "NH" : "IH";
372 
373  if(!th13Surf && ! dmsqSurf){
374  ResetOscCalcToDefault(calc);
375  calc->SetDmsq32(hie*fabs(calc->GetDmsq32()));
376  double low = (nueOnly)?0:0.3;
377  double high = (nueOnly)?1:0.7;
378  cout<<"low "<<low<<" high "<<high<<endl;
379  FrequentistSurface surf23(exptThis, calc,
380  &kFitDeltaInPiUnits,steps, 0, 2,
381  &kFitSinSqTheta23, steps, low, high,
383  SeedList(), seedShifts
384  );
385 
386  auto surf1=surf23.ToTH2(minchi23);
387  outfile->cd();
388  surf1->Write((TString)"delta_th23_"+hieStr);
389  surf23.SaveTo(outfile, "surf_delta_th23_"+hieStr);
390 
391  outFCfile->cd();
392  std::vector<TH2*> profhists = surf23.GetProfiledHists();
393  //Osc parameters are special case
394  profhists[0]->Write((hieStr+"_DmSq32").c_str());
395  profhists[1]->Write((hieStr+"_SinSq2Theta13").c_str());
396  for (int i = 0; i < int(systs.size()); i++){
397  profhists[i+2]->Write((hieStr+"_"+systs[i]->ShortName()).c_str());
398  }
399  }
400  if(!th13Surf && dmsqSurf){
401  calc = DefaultOscCalc();
402  calc->SetDmsq32(hie*fabs(calc->GetDmsq32()));
403  double lowth23 = (RHCOnly)?0.2:0.35;
404  double highth23 = (RHCOnly)?1:0.7;
405  cout<<"lowth23 "<<lowth23<<" highth23 "<<highth23<<endl;
406  double lowdmsq = (hie>0?(RHCOnly?2.0:2.1):(RHCOnly?-3.0:-2.7));
407  double highdmsq = (hie>0?(RHCOnly?3.0:2.7):(RHCOnly?-2.0:-2.2));
408  cout<<"lowdmsq "<<lowdmsq<<" highdmsq "<<highdmsq<<endl;
409  FrequentistSurface surf23m(exptThis, calc,
410  &kFitSinSqTheta23, steps,lowth23, highth23,
411  &kFitDmSq32Scaled, steps, lowdmsq, highdmsq,
413  SeedList({{&kFitDeltaInPiUnits, delta_seeds}}));
414  auto surf6=surf23m.ToTH2(minchi23);
415  outfile->cd();
416  surf6->Write((TString)"th23_dm32_"+(hie>0?"NH":"IH"));
417  surf23m.SaveTo(outfile, std::string("surf_th23_dm32_")+(hie>0?"NH":"IH"));
418 
419  outFCfile->cd();
420  std::vector<TH2*> profhists = surf23m.GetProfiledHists();
421  //Osc parameters are special case
422  profhists[0]->Write((hieStr+"_SinSq2Theta13").c_str());
423  profhists[1]->Write((hieStr+"_DeltaCPpi").c_str());
424  for (int i = 0; i < int(systs.size()); i++){
425  profhists[i+2]->Write((hieStr+"_"+systs[i]->ShortName()).c_str());
426  }
427 
428  }
429  if(th13Surf){
430  calc = DefaultOscCalc();
431  calc->SetDmsq32(hie*fabs(calc->GetDmsq32()));
432 
433  FrequentistSurface surf13(exptThis, calc,
434  &kFitSinSq2Theta13, steps, 0, (RHCOnly?1:0.35),
435  &kFitDeltaInPiUnits,steps, 0, 2,
437  SeedList({{&kFitSinSqTheta23, th23_all_seeds_NH}}), seedShifts);
438  auto surf4 = surf13.ToTH2(minchi23);
439  outfile->cd();
440  surf4->Write((TString)"th13_delta_"+(hie>0?"NH":"IH"));
441  surf13.SaveTo(outfile, std::string("surf_th13_delta_")+(hie>0?"NH":"IH"));
442 
443  outFCfile->cd();
444  std::vector<TH2*> profhists = surf13.GetProfiledHists();
445  //Osc parameters are special case
446  profhists[0]->Write((hieStr+"_SinSqTheta23").c_str());
447  profhists[1]->Write((hieStr+"_DmSq32").c_str());
448  for (int i = 0; i < int(systs.size()); i++){
449  profhists[i+2]->Write((hieStr+"_"+systs[i]->ShortName()).c_str());
450  }
451 
452  }
453  } //end hie
454 
455  delete outfile;
456  std::cout << "\nSurfaces saved to " << outfilename << std::endl;
457  return;
458 
459 }
Spectrum * GetFakeData(const IPrediction *pred, osc::IOscCalc *calc, const double pot, TH1D *cosmics=0)
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void ResetOscCalcToDefault(osc::IOscCalcAdjustable *calc)
Reset calculator to default assumptions for all parameters.
Definition: Calcs.cxx:23
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
double GetValue(const osc::IOscCalcAdjustable *osc) const override
const Color_t kCosmicBackgroundColor
Definition: Style.h:41
void run_joint_fit_2020_contours(bool corrSysts=false, bool runOnGrid=false, TString options="joint_fake2019_both_onlyIH", bool dmsqSurf=false, bool th13Surf=false)
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
const FitSinSqTheta23UpperOctant kFitSinSqTheta23UpperOctant
Definition: FitVars.cxx:16
const Dmsq32Constraint kDmsq32ConstraintPDG2019(2.444e-3, 0.034e-3, 2.55e-3, 0.04e-3)
OStream cerr
Definition: OStream.cxx:7
std::vector< predictions > LoadPredictions(bool corrSysts=false, bool runOnGrid=false, std::string decomp="", bool nue=true, bool numu=true, bool fhc=true, bool rhc=true, bool NERSC=false)
static SystShifts Nominal()
Definition: SystShifts.h:34
osc::OscCalcDumb calc
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
virtual void SetDmsq32(const T &dmsq32)=0
const char * label
const XML_Char const XML_Char * data
Definition: expat.h:268
Log-likelihood scan across two parameters.
const XML_Char * s
Definition: expat.h:262
string outfilename
knobs that need extra care
std::vector< TH2 * > GetProfiledHists()
Maps of the values taken on by the profiled parameters.
virtual std::unique_ptr< IFitSummary > Fit(osc::IOscCalcAdjustable *seed, SystShifts &bestSysts=junkShifts, const SeedList &seedPts=SeedList(), const std::vector< SystShifts > &systSeedPts={}, Verbosity verb=kVerbose) const
Master fitting method. Depends on FitHelper and FitHelperSeeded.
Definition: IFitter.cxx:64
virtual T GetDmsq32() const
Definition: IOscCalc.h:86
const ConstrainedFitVarWithPrior fitDmSq32Scaled_UniformPrior & kFitDmSq32Scaled
void SetFakeCalc(osc::IOscCalcAdjustable *calc, double ssth23=-5, double dmsq32=-5, double dCP_Pi=-5)
OStream cout
Definition: OStream.cxx:6
std::vector< double > POT
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
TH2 * ToTH2(double minchi=-1) const
Definition: ISurface.cxx:161
std::vector< Spectrum * > LoadRealData(bool runOnGrid=false, bool nue=true, bool numu=true, bool fhc=true, bool rhc=true)
Combine multiple component experiments.
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
double livetime
Definition: saveFDMCHists.C:21
void SaveTo(TDirectory *dir, const std::string &name) const
const FitSinSqTheta23LowerOctant kFitSinSqTheta23LowerOctant
Definition: FitVars.cxx:17
void ResetToNominal()
Definition: SystShifts.cxx:141
const ConstrainedFitVarWithPrior fitSsqTh23_UniformPriorSsqTh23 & kFitSinSqTheta23
exit(0)
T cos(T number)
Definition: d0nt_math.hpp:78
assert(nhit_max >=nhit_nbins)
Interface definition for fittable variables.
Definition: IFitVar.h:16
std::vector< std::pair< const ISyst *, const ISyst * > > GetCorrelations(bool isNue, bool isFHC, bool ptExtrap)
const ReactorExperiment * WorldReactorConstraint2019()
Reactor constraint from PDG 2019.
const FitSinSq2Theta13 kFitSinSq2Theta13
Definition: FitVars.cxx:13
TH1 * DataMCComparison(const Spectrum &data, const Spectrum &mc, EBinType bintype)
Definition: Plots.cxx:35
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
const DummyAnaSyst kAnaLightlevelNDSyst("Light_Level_ND","Light_Level_ND")
Float_t e
Definition: plot.C:35
const FitVarWithPrior fitDeltaInPiUnits_UniformPriordCP & kFitDeltaInPiUnits
std::vector< const ISyst * > GetJointFitSystematicList(bool corrSysts, bool nueExclusive=false, bool numuExclusive=false, bool isFHC=true, bool isRHC=true, bool intersection=true, bool ptExtrap=true)
const std::string outdir
FILE * outfile
Definition: dump_event.C:13
Compare a single data spectrum to the MC + cosmics expectation.
Perform MINUIT fits in one or two dimensions.
Definition: MinuitFitter.h:17