126 std::vector<const ISyst*> absMuESyst;
129 std::vector<const ISyst*> relMuESyst;
132 std::vector<const ISyst*> absHadESyst;
133 absHadESyst.push_back(&kAna2017CalibrationSyst);
134 absHadESyst.push_back(&kAna2017CalibShapeSyst);
136 std::vector<const ISyst*> relHadESyst;
137 relHadESyst.push_back(&kAna2017RelativeCalibSyst);
139 std::vector<const ISyst*> normSyst;
142 std::vector<const ISyst*> xsecSysts;
145 std::vector<const ISyst*> fluxSysts;
149 std::vector<const ISyst*> scintSysts;
150 scintSysts.push_back(&kAna2017LightlevelSyst);
151 scintSysts.push_back(&kAna2017CherenkovSyst);
156 std::map< std::string, std::vector<const ISyst*> > mapSystVecs;
157 mapSystVecs[
"Absolute muon energy scale"] = absMuESyst;
158 mapSystVecs[
"Relative muon energy scale"] = relMuESyst;
159 mapSystVecs[
"Absolute hadronic energy scale"] = absHadESyst;
160 mapSystVecs[
"Relative hadronic energy scale"] = relHadESyst;
161 mapSystVecs[
"Normalisation"] = normSyst;
162 mapSystVecs[
"Cross sections and final-state interaction"] = xsecSysts;
163 mapSystVecs[
"Neutrino flux"] = fluxSysts;
164 mapSystVecs[
"Detector response"] = scintSysts;
170 float theta_real = 0.468;
172 std::cout<<
"\n++theta_real: " << theta_real
173 <<
"\n++msq: " << msq
180 const std::string fakeNDPredFileName =
"/pnfs/nova/persistent/users/lvinton1/numu/pd/numu/3A/newSystPreds/fakeNDData/pred_full_fakeNDData.root";
202 TFile* fCosmic =
new TFile((TString)
"/nova/app/users/bays/dev_xchecks/work/done5/cos_bkg_hists_double.root");
203 TH1D* hCos_Q1 = (TH1D*) fCosmic ->
Get(
"q1all");
204 TH1D* hCos_Q2 = (TH1D*) fCosmic ->
Get(
"q2all");
205 TH1D* hCos_Q3 = (TH1D*) fCosmic ->
Get(
"q3all");
206 TH1D* hCos_Q4 = (TH1D*) fCosmic ->
Get(
"q4all");
214 fakeQ1 += specCos_Q1;
216 fakeQ2 += specCos_Q2;
218 fakeQ3 += specCos_Q3;
220 fakeQ4 += specCos_Q4;
229 std::vector<const IExperiment*> exptsAllFake;
230 exptsAllFake.push_back(exptQ1);
231 exptsAllFake.push_back(exptQ2);
232 exptsAllFake.push_back(exptQ3);
233 exptsAllFake.push_back(exptQ4);
245 double xLowEdge = 0.3;
246 double xHiEdge = 0.7;
247 double yLowEdge = 2.1;
248 double yHiEdge = 2.8;
250 TH1F *xplot =
new TH1F(
"xplot",
"xplot",kXBins,xLowEdge,xHiEdge);
251 TH1F *yplot =
new TH1F(
"yplot",
"yplot",kYBins,yLowEdge,yHiEdge);
254 float stattheta = 0, statmsq = 0;
259 TFile*
fOut =
new TFile(
"systMagsHists_reducedTable_newPredsFakeNDData.root",
"RECREATE");
268 xplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
270 kXBins, xLowEdge, xHiEdge, 0,
273 xplot ->
Write(
"ssq_stat");
274 TH1F* hXStat = (TH1F*) xplot ->
Clone();
283 yplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
285 kYBins, yLowEdge, yHiEdge, 0,
288 yplot ->
Write(
"msq_stat");
289 TH1F* hYStat = (TH1F*) yplot ->
Clone();
294 float statthetaup = hi-theta_real;
295 float statthetadn = theta_real-low;
297 <<
"Raw. sin^2 low: " << low <<
", high: " << hi
298 <<
", updated bf: " << xplot->GetBinCenter(xplot->GetMinimumBin())
304 float statmsqup = hi-msq;
305 float statmsqdn = msq-low;
307 <<
"Raw. dm^2 low: " << low <<
", high: " << hi
308 <<
", updated bf: " << yplot->GetBinCenter(yplot->GetMinimumBin())
311 std::cout <<
"++stats only delta m^2 range is: " << range <<
" " << range/2.0 <<
" " << range/(2*msq) <<
" " << (hi-msq)/msq <<
" " << (msq-low)/msq <<
" " << (hi-msq) <<
" " << (msq-low) << std::endl;
315 <<
"LatexFormat stats only & +" << statthetaup *
pow(10,3) <<
" / -" 316 << statthetadn *
pow(10,3) <<
" & +" << statmsqup *
pow(10,3) <<
" / - " 317 << statmsqdn *
pow(10,3) <<
"\\\\" 322 <<
"LatexFormatFracSin stats only & $\\pm$ " << stattheta *
pow(10,3) / 2
323 <<
" & +" << statmsqup *
pow(10,3) <<
" / - " 324 << statmsqdn *
pow(10,3) <<
"\\\\" 329 if(!makeFullSystTable){
330 for(
auto const& thisSystVec: mapSystVecs){
339 xplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
341 kXBins, xLowEdge, xHiEdge, 0,
345 xplot ->
Write(
"ssq_" + TString(thisSystVec.first));
346 TH1F* hXDiff = (TH1F*) hXStat ->
Clone();
347 hXDiff -> Add(xplot, -1);
348 hXDiff ->
Write(
"ssqDiff_" + TString(thisSystVec.first));
357 yplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
359 kYBins, yLowEdge, yHiEdge, 0,
363 yplot ->
Write(
"msq_" + TString(thisSystVec.first));
364 TH1F* hYDiff = (TH1F*) hYStat ->
Clone();
365 hYDiff -> Add(yplot, -1);
366 hYDiff ->
Write(
"msqDiff_" + TString(thisSystVec.first));
373 <<
"LatexFormatFracSin Frac. uncer. " << thisSystVec.first <<
" & $\\pm$ " 374 <<
sqrt( (hix-lowx)*(hix-lowx) - (stattheta*stattheta) ) *
pow(10,3) / 2
376 <<
sqrt((hi-msq)*(hi-msq)-statmsqup*statmsqup) *
pow(10,3) <<
" / -" 377 <<
sqrt((msq-low)*(msq-low)-statmsqdn*statmsqdn) *
pow(10,3) <<
"\\\\" <<
std::endl;
381 <<
"Raw. sin^2 low: " << lowx
383 <<
", updated bf: " << xplot->GetBinCenter(xplot->GetMinimumBin())
386 <<
"Raw. dm^2 low: " << low
388 <<
", updated bf: " << yplot->GetBinCenter(yplot->GetMinimumBin())
395 if(makeFullSystTable){
396 for(
const ISyst* syst: totSysts) {
405 xplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
407 kXBins, xLowEdge, xHiEdge, 0,
411 xplot ->
Write(
"ssq_" + TString(syst->ShortName()));
412 TH1F* hXDiff = (TH1F*) hXStat ->
Clone();
413 hXDiff -> Add(xplot, -1);
414 hXDiff ->
Write(
"ssqDiff_" + TString(syst->ShortName()));
423 yplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
425 kYBins, yLowEdge, yHiEdge, 0,
429 yplot ->
Write(
"msq_" + TString(syst->ShortName()));
431 TH1F* hYDiff = (TH1F*) hYStat ->
Clone();
432 hYDiff -> Add(yplot, -1);
433 hYDiff ->
Write(
"msqDiff_" + TString(syst->ShortName()));
440 <<
"LatexFormatFracSin Frac. uncer. " << syst->ShortName() <<
" & $\\pm$ " 441 <<
sqrt( (hix-lowx)*(hix-lowx) - (stattheta*stattheta) ) *
pow(10,3) / 2
443 <<
sqrt((hi-msq)*(hi-msq)-statmsqup*statmsqup) *
pow(10,3) <<
" / -" 444 <<
sqrt((msq-low)*(msq-low)-statmsqdn*statmsqdn) *
pow(10,3) <<
"\\\\" <<
std::endl;
448 <<
"Raw. sin^2 low: " << lowx
450 <<
", updated bf: " << xplot->GetBinCenter(xplot->GetMinimumBin())
453 <<
"Raw. dm^2 low: " << low
455 <<
", updated bf: " << yplot->GetBinCenter(yplot->GetMinimumBin())
464 xplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
466 kXBins, xLowEdge, xHiEdge, 0,
468 xplot ->
Write(
"ssq_dcp");
470 yplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
472 kYBins, yLowEdge, yHiEdge, 0,
474 yplot ->
Write(
"msq_dcp");
480 <<
"\n\n\nrange: " << range
481 <<
", statrange: " << stattheta
488 double deltaCP_sinSq = (range-stattheta)*
pow(10,3)/2;
489 double deltaCP_dmSqUp = ( (hi-msq) - (statmsqup) )*
pow(10,3);
490 double deltaCP_dmSqDn = ( (msq-low) - (statmsqdn) )*
pow(10,3);
493 <<
"ssqth23: (range - statrange)*pow(10,3)/2: " << deltaCP_sinSq
494 <<
"\n" <<
"dmsq32 up: " << deltaCP_dmSqUp
495 <<
"\n" <<
"dmsq32 dn: " << deltaCP_dmSqDn
499 <<
"LatexFormatFracSin Frac. uncer. $\\delta_{CP}$ (0-$2\\pi$) & $\\pm$ " 510 <<
"Raw. sin^2 low: " << lowx <<
", high: " << hix
511 <<
", updated bf: " << xplot->GetBinCenter(xplot->GetMinimumBin())
513 std::cout<<
"Raw. dm^2 low: " << low <<
", high: " << hi
514 <<
", updated bf: " << yplot->GetBinCenter(yplot->GetMinimumBin())
528 xplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
530 kXBins, xLowEdge, xHiEdge, 0,
534 xplot ->
Write(
"ssq_totSysts");
535 TH1F* hXDiff = (TH1F*) hXStat ->
Clone();
536 hXDiff -> Add(xplot, -1);
537 hXDiff ->
Write(
"ssqDiff_totSysts");
546 yplot = (TH1F*)
Profile(&exptFakeCC, calcfake,
548 kYBins, yLowEdge, yHiEdge, 0,
552 yplot ->
Write(
"msq_totSysts");
553 TH1F* hYDiff = (TH1F*) hYStat ->
Clone();
554 hYDiff -> Add(yplot, -1);
555 hYDiff ->
Write(
"msqDiff_totSysts");
562 <<
"LatexFormatFracSin Frac. uncer. total syst uncertainty & $\\pm$ " 563 <<
sqrt( (hix-lowx)*(hix-lowx) - (stattheta*stattheta) ) *
pow(10,3) / 2
565 <<
sqrt((hi-msq)*(hi-msq)-statmsqup*statmsqup) *
pow(10,3) <<
" / -" 566 <<
sqrt((msq-low)*(msq-low)-statmsqdn*statmsqdn) *
pow(10,3) <<
"\\\\" <<
std::endl;
571 <<
"Raw. sin^2 low: " << lowx <<
", high: " << hix
572 <<
", updated bf: " << xplot->GetBinCenter(xplot->GetMinimumBin())
575 <<
"Raw. dm^2 low: " << low <<
", high: " << hi
576 <<
", updated bf: " << yplot->GetBinCenter(yplot->GetMinimumBin())
581 <<
"LatexFormatFracSin Frac. uncer. total syst uncertainty with dCP linear & $\\pm$ " 582 << (
sqrt( (hix-lowx)*(hix-lowx) - (stattheta*stattheta) ) *
pow(10,3) / 2) + deltaCP_sinSq
584 << (
sqrt((hi-msq)*(hi-msq)-statmsqup*statmsqup) *
pow(10,3)) + deltaCP_dmSqUp <<
" / -" 585 << (
sqrt((msq-low)*(msq-low)-statmsqdn*statmsqdn) *
pow(10,3)) + deltaCP_dmSqDn <<
"\\\\" 590 <<
"LatexFormatFracSin Total uncertainty & $\\pm$ " << ( (hix-lowx) *
pow(10,3) / 2)
591 <<
" & +" << ((hi-msq) *
pow(10,3)) <<
" / - " 592 << ((msq-low) *
pow(10,3)) <<
"\\\\" 596 <<
"LatexFormatFracSin Total uncertainty including dCP & $\\pm$ " << ( (hix-lowx) *
pow(10,3) / 2) + deltaCP_sinSq
597 <<
" & +" << ((hi-msq) *
pow(10,3)) + deltaCP_dmSqUp <<
" / - " 598 << ((msq-low) *
pow(10,3)) + deltaCP_dmSqDn <<
"\\\\"
double Integral(const Spectrum &s, const double pot, int cvnregion)
float GetLimits(TH1F *plot, float &hi, float &low)
TGraph * Profile(const IExperiment *expt, osc::IOscCalcAdjustable *calc, const IFitVar *v, int nbinsx, double minx, double maxx, double input_minchi, const std::vector< const IFitVar * > &profVars, const std::vector< const ISyst * > &profSysts, const SeedList &seedPts, const std::vector< SystShifts > &systSeedPts, std::map< const IFitVar *, TGraph * > &profVarsMap, std::map< const ISyst *, TGraph * > &profSystsMap, MinuitFitter::FitOpts opts)
scan in one variable, profiling over all others
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
Forward to wrapped Var's SetValue()
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Encapsulate code to systematically shift a caf::SRProxy.
Representation of a spectrum in any variable, with associated POT.
const MuEScaleSyst2017 kMuEScaleSyst2017(0.0074, 0.0012)
const std::vector< const DummyNumu2017Syst * > kNumu2017Systs
TSpline3 hi("hi", xhi, yhi, 18,"0")
const double kAna2017Livetime
const RelMuEScaleSyst2017 kRelMuEScaleSyst2017(0.0045, 10.5)
Spectrum FakeData(double pot) const
Synonymous with AsimovData(). Retained for compatibility.
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
Loads shifted spectra from files.
const ReactorExperiment * WorldReactorConstraint2017()
Reactor constraint from PDG 2017.
void AddJointAna2017XSecSysts(std::vector< const ISyst * > &systs, const EAnaType2017 ana, bool smallgenie)
const ConstrainedFitVarWithPrior fitDmSq32Scaled_UniformPrior & kFitDmSq32Scaled
Combine multiple component experiments.
const SolarConstraints kSolarConstraintsPDG2017(7.53e-5, 0.18e-5, 0.851, 0.020)
void AddJointAna2017BeamSysts(std::vector< const ISyst * > &systs, const EAnaType2017 ana)
const ConstrainedFitVarWithPrior fitSsqTh23_UniformPriorSsqTh23 & kFitSinSqTheta23
std::vector< const ISyst * > getAllAna2017Systs(const EAnaType2017 ana, const bool smallgenie)
Prevent histograms being added to the current directory.
const FitVarWithPrior fitDeltaInPiUnits_UniformPriordCP & kFitDeltaInPiUnits
const DummyAnaSyst kAna2017NormBoth("NormBoth","Sig+Bkg Norm.")
Compare a single data spectrum to the MC + cosmics expectation.
std::vector< const IFitVar * > getNumuMarginalisedOscParam()