8 #include "3FlavorAna/Cuts/NueCutsSecondAna.h" 18 #include "Math/ProbFunc.h" 29 const double pot = 8.09e20;
49 {1, 20,
"Data",
"data"},
50 {632+2, 1,
"Total",
"mc"},
51 {600+2, 1,
"#nu_{e} CC",
"nuecc"},
52 {616, 1,
"#bar{#nu}_{e} CC",
"nuebarcc"},
53 {416-3, 1,
"#nu_{#mu} CC",
"numucc"},
54 {416+3, 1,
"#bar{#nu}_{#mu} CC",
"numubarcc"},
56 {400-3, 1,
"Other",
"other"},
57 {416-3, 1,
"Non-Fiducial Signal",
"nonfidnue"},
67 double pivotbincenter = 0;
69 std::sort(events.begin(), events.end());
71 for(
unsigned int i = 0;
i < events.size()-1;
i++)
72 if(pivot >= events[
i] && pivot < events[
i+1]){
76 pivotbincenter = pivotbin+0.5;
78 double count_fraction =
82 int lastbinindex = (
int)events.size() - 1;
84 if (nsigmas >= 0) nsideevents = lastbinindex - pivotbin;
85 else nsideevents = pivotbin;
87 int boundIdx = pivotbincenter + count_fraction*(double)nsideevents;
90 if(nsigmas >= 0) index =
min(boundIdx, (
int)events.size()-1);
91 else index =
max(boundIdx, 0);
93 return events.at(index);
101 std::vector<TH3F*> vHist)
103 TH3F* hResultUpSigma = (TH3F*)nominal->Clone(
ana::UniqueName().c_str());
104 TH3F* hResultDownSigma = (TH3F*)nominal->Clone(
ana::UniqueName().c_str());
106 for(
int xbin= 1; xbin <= hResultUpSigma->GetXaxis()->GetNbins(); xbin++){
107 for(
int ybin= 1; ybin <= hResultUpSigma->GetYaxis()->GetNbins(); ybin++){
108 for(
int zbin = 1; zbin <= hResultUpSigma->GetZaxis()->GetNbins(); zbin++){
110 double cv_value = nominal->GetBinContent(xbin,ybin,zbin);
111 std::vector<double> multiverse_vals;
113 for(
uint iUniv = 0; iUniv < vHist.size(); iUniv++){
114 multiverse_vals.push_back(vHist[iUniv]->GetBinContent
118 std::sort(multiverse_vals.begin(),multiverse_vals.end(),
122 float one_sigma_up =
BinSigma(multiverse_vals,1,cv_value);
123 float one_sigma_down =
BinSigma(multiverse_vals,-1,cv_value);
125 hResultUpSigma->SetBinContent(xbin,ybin,zbin,one_sigma_up);
126 hResultDownSigma->SetBinContent(xbin,ybin,zbin,one_sigma_down);
137 std::vector<TH2F*> vHist)
139 TH2F* hResultUpSigma = (TH2F*)nominal->Clone(
ana::UniqueName().c_str());
140 TH2F* hResultDownSigma = (TH2F*)nominal->Clone(
ana::UniqueName().c_str());
142 for(
int xbin= 1; xbin <= hResultUpSigma->GetXaxis()->GetNbins(); xbin++){
143 for(
int ybin= 1; ybin <= hResultUpSigma->GetYaxis()->GetNbins(); ybin++){
144 double cv_value = nominal->GetBinContent(xbin,ybin);
145 std::vector<double> multiverse_vals;
147 for(
uint iUniv = 0; iUniv < vHist.size(); iUniv++){
148 multiverse_vals.push_back(vHist[iUniv]->GetBinContent
152 std::sort(multiverse_vals.begin(),multiverse_vals.end(),
156 float one_sigma_up =
BinSigma(multiverse_vals,1,cv_value);
157 float one_sigma_down =
BinSigma(multiverse_vals,-1,cv_value);
159 hResultUpSigma->SetBinContent(xbin,ybin,one_sigma_up);
160 hResultDownSigma->SetBinContent(xbin,ybin,one_sigma_down);
171 std::vector<TH1F*> hTemplates,
172 std::vector<TH1F*> vUp,std::vector<TH1F*> vDown,
177 hData->SetMarkerStyle(kChnsInfo[0].marker_style);
178 hData->SetLineColor(kChnsInfo[0].
color);
179 hData->SetMarkerColor(kChnsInfo[0].color);
181 for(
int i = 0;
i < (
int)hTemplates.size();
i++){
182 hTemplates[
i]->SetLineColor(kChnsInfo[
i+1].color);
186 hTemplates.front()->GetXaxis()->SetTitle(xTitle.c_str());
187 hTemplates.front()->GetYaxis()->SetTitle(
"Events/8.09 #times 10^{20} (POT)");
188 hTemplates.front()->GetXaxis()->CenterTitle();
189 hTemplates.front()->GetYaxis()->CenterTitle();
192 hData->GetXaxis()->SetTitle(xTitle.c_str());
193 hData->GetYaxis()->SetTitle(
"Events/8.09 #times 10^{20} (POT)");
194 hData->GetXaxis()->CenterTitle();
195 hData->GetYaxis()->CenterTitle();
200 vUp, vDown,-1,-1,1.3,
false);
208 hRatio->Divide(hTemplates[0]);
209 hRatio->SetMarkerStyle(20);
210 hRatio->SetLineColor(kBlack);
211 hRatio->GetYaxis()->SetTitle(
"Data/MC");
214 std::vector<TH1F*> vUpRatio;
215 std::vector<TH1F*> vDownRatio;
217 nominal_clone_2->Divide(nominal_clone);
218 for(
uint i = 0;
i < vUp.size();
i++){
222 vUpRatio[
i]->Divide(nominal_clone);
223 vDownRatio[
i]->Divide(nominal_clone);
227 vUpRatio, vDownRatio,
230 hTemplates[1]->Add(hTemplates[2]);
231 hTemplates[1]->Add(hTemplates[7]);
234 hTemplates[3]->Add(hTemplates[4]);
238 c1->SetLeftMargin(0.10);
239 c1->SetRightMargin(0.10);
242 pad1->SetFillStyle(0);
243 pad2->SetFillStyle(0);
244 pad1->SetBottomMargin(0.30);
245 pad2->SetTopMargin(1-0.30);
251 hTemplates[0]->GetXaxis()->SetLabelColor(kWhite);
252 hTemplates[0]->GetYaxis()->SetLabelSize(0.03);
253 hTemplates[0]->GetYaxis()->SetTitleSize(0.035);
254 hTemplates[0]->Draw(
"hist");
256 hTemplates[0]->Draw(
"hist same");
257 hTemplates[1]->Draw(
"hist same");
258 hTemplates[3]->Draw(
"hist same");
259 hTemplates[5]->Draw(
"hist same");
260 hTemplates[6]->Draw(
"hist same");
263 if(isFitted)leg->SetHeader(
"Template Weights Applied");
264 leg->AddEntry(hData,
"Fake Data",
"p");
265 leg->AddEntry(hTemplates[0],
"Nominal MC",
"l");
266 leg->AddEntry(hTemplates[1],
"Signal-Like Template",
"l");
267 leg->AddEntry(hTemplates[3],
"#nu_{#mu} CC-Like Template",
"l");
268 leg->AddEntry(hTemplates[5],
"NC Template",
"l");
269 leg->AddEntry(hTemplates[6],
"Other Template",
"l");
276 hRatio->GetYaxis()->SetLabelSize(0.03);
277 hRatio->GetYaxis()->SetTitleSize(0.035);
278 hRatio->GetYaxis()->SetRangeUser(0.4,1.5);
279 hRatio->Draw(
"same");
280 g_ratio->Draw(
"e2 same");
281 hRatio->Draw(
"same");
287 if(isFitted)fitted_string =
"template_fit_prediction";
289 sprintf(outname,
"%s%s_%s_%s_%i_%i.png",
"Plots/", dataName.c_str(),
290 plotType.c_str(), fitted_string.c_str(), xbin,ybin);
297 std::vector<TH2F*> hFitResults2D,
298 std::vector<TH2F*> hSystsUp2D,
299 std::vector<TH2F*> hSystsDown2D,
303 for(
int xbin = 1; xbin <= hData2D->GetXaxis()->GetNbins(); xbin++){
307 if(hData->Integral() == 0)
continue;
311 std::vector<TH1F*> hFitResults1D;
312 for(
uint i = 0;
i < hFitResults2D.size();
i++){
315 std::vector<TH1F*> hSystsUp1D;
316 std::vector<TH1F*> hSystsDown1D;
317 for(
uint i = 0;
i < hSystsUp2D.size();
i++){
322 hData->SetMarkerStyle(kChnsInfo[0].marker_style);
323 hData->SetLineColor(kChnsInfo[0].
color);
324 hData->SetMarkerColor(kChnsInfo[0].color);
326 hFitResults1D.front()->SetLineColor(
kBlue);
327 hFitResults1D.front()->SetMarkerColor(
kBlue);
329 hNominal->SetLineColor(
kRed);
330 hNominal->SetMarkerColor(
kRed);
332 hFitResults1D.front()->GetXaxis()->SetTitle(xTitle.c_str());
333 hFitResults1D.front()->GetYaxis()->SetTitle(
"Events/8.09 #times 10^{20} (POT)");
334 hFitResults1D.front()->GetXaxis()->CenterTitle();
335 hFitResults1D.front()->GetYaxis()->CenterTitle();
338 hData->GetXaxis()->SetTitle(xTitle.c_str());
339 hData->GetYaxis()->SetTitle(
"Events/8.09 #times 10^{20} (POT)");
340 hData->GetXaxis()->CenterTitle();
341 hData->GetYaxis()->CenterTitle();
343 TH1F* nominal_clone = (TH1F*)hNominal->Clone(
ana::UniqueName().c_str());
346 hSystsUp1D, hSystsDown1D,
350 hRatio->Divide(hNominal);
351 hRatio->SetMarkerStyle(20);
352 hRatio->SetLineColor(
kRed);
353 hRatio->GetYaxis()->SetTitle(
"Data/MC");
356 hRatio->Divide(hFitResults1D[0]);
357 hRatio->SetMarkerStyle(20);
358 hRatio->SetLineColor(
kBlue);
359 hRatio->GetYaxis()->SetTitle(
"Data/MC");
363 c1->SetLeftMargin(0.10);
364 c1->SetRightMargin(0.10);
367 pad1->SetFillStyle(0);
368 pad2->SetFillStyle(0);
369 pad1->SetBottomMargin(0.30);
370 pad2->SetTopMargin(1-0.30);
376 hData->GetXaxis()->SetLabelColor(kWhite);
377 hData->GetYaxis()->SetLabelSize(0.03);
378 hData->GetYaxis()->SetTitleSize(0.035);
379 hData->GetXaxis()->SetRangeUser(1.0,10.0);
381 hNominal->Draw(
"hist same");
383 hNominal->Draw(
"hist same");
384 hFitResults1D.front()->Draw(
"same");
386 hFitResults1D.front()->Draw(
"same");
388 leg->AddEntry(hData,
"Fake Data",
"p");
389 leg->AddEntry(hNominal,
"Nominal MC",
"l");
390 leg->AddEntry(hFitResults1D[0],
"Weighted MC",
"pl");
397 hRatio->GetXaxis()->SetRangeUser(1.0,10.0);
398 hRatio->GetYaxis()->SetLabelSize(0.03);
399 hRatio->GetYaxis()->SetTitleSize(0.035);
400 hRatio->GetYaxis()->SetRangeUser(0.4,1.5);
401 hRatio->Draw(
"same");
402 hRatio2->Draw(
"same");
408 sprintf(outname,
"%s%s_%s_%i.png",
"Plots/", dataName.c_str(),
409 plotType.c_str(), xbin);
427 for(
int xbin = 1; xbin <= hResultA->GetXaxis()->GetNbins(); xbin++){
436 if(hTruth->Integral() == 0)
continue;
438 std::stringstream low_X;
439 low_X << std::fixed << std::setprecision(2) <<
440 hResultA->GetXaxis()->GetBinLowEdge(xbin);
441 std::stringstream hi_X;
442 hi_X << std::fixed << std::setprecision(2) <<
443 hResultA->GetXaxis()->GetBinUpEdge(xbin);
449 hResult->GetYaxis()->SetTitle(ytitle.c_str());
450 hResult->GetXaxis()->SetTitle(xtitle.c_str());
451 hResult->SetTitle(caption.c_str());
452 hResult->GetYaxis()->CenterTitle();
453 hResult->GetXaxis()->CenterTitle();
454 hResult->GetYaxis()->SetTitleOffset(1.15);
455 hResult->SetMarkerStyle(20);
456 hResult->SetMarkerColor(kBlack);
457 hTruth->SetLineColor(
kRed);
458 hTruth->SetMarkerColor(
kRed);
460 hNominal->SetLineColor(
kBlue);
461 hNominal->SetMarkerColor(
kBlue);
464 TH1F* hNominalClone = (TH1F*)hNominal->Clone(
ana::UniqueName().c_str());
465 hResultClone->SetTitle(
"");
466 hResultClone->Divide(hTruth);
467 hNominalClone->Divide(hTruth);
469 hResult->GetXaxis()->SetRangeUser(xmin,xmax);
470 hResultClone->GetXaxis()->SetRangeUser(xmin,xmax);
474 double ymax = hResult->GetMaximum();
477 hResult->GetYaxis()->SetRangeUser(0,hTruth->GetMaximum()*1.3);
479 hResult->GetYaxis()->SetRangeUser(0,ymax*1.3);
484 c1->SetLeftMargin(0.10);
485 c1->SetRightMargin(0.10);
486 c1->SetBottomMargin(0.10);
489 pad1->SetFillStyle(0);
490 pad2->SetFillStyle(0);
491 pad1->SetBottomMargin(0.30);
492 pad2->SetTopMargin(1-0.30);
498 hResult->GetXaxis()->SetLabelColor(kWhite);
499 hResult->GetYaxis()->SetLabelSize(0.03);
500 hResult->GetYaxis()->SetTitleSize(0.035);
503 hResult->Draw(
"same");
504 hTruth->Draw(
"hist same");
505 hNominal->Draw(
"same");
507 leg->AddEntry(hResult, legend_results.c_str(),
"p");
508 leg->AddEntry(hTruth, legend_truth.c_str(),
"l");
509 leg->AddEntry(hNominal, legend_nominal.c_str(),
"p");
516 hResultClone->GetYaxis()->SetTitle(
"Ratio to Truth");
517 hResultClone->GetYaxis()->SetLabelSize(0.03);
518 hResultClone->GetYaxis()->SetTitleSize(0.035);
519 hResultClone->GetYaxis()->SetRangeUser(0.4,1.5);
520 hResultClone->Draw(
"same");
521 hNominalClone->Draw(
"same");
527 sprintf(outname,
"%s%s_%s_%s_%s_%i.png",
"Plots/", dataName.c_str(),
528 plotType.c_str(), plotName.c_str(), varName.c_str(),xbin);
546 hCov->GetXaxis()->CenterTitle();
547 hCov->GetYaxis()->CenterTitle();
548 hCov->GetZaxis()->CenterTitle();
550 hCorr->GetXaxis()->CenterTitle();
551 hCorr->GetYaxis()->CenterTitle();
552 hCorr->GetZaxis()->CenterTitle();
555 c1->SetLeftMargin(0.15);
556 c1->SetRightMargin(0.15);
557 c1->SetBottomMargin(0.15);
558 gStyle->SetTitleAlign(33);
562 sprintf(outname,
"%s%s_%s_%i_%i.png",
"Plots/",
563 "covariance",
"template_bins", xbin,ybin);
569 c2->SetLeftMargin(0.15);
570 c2->SetRightMargin(0.15);
571 c2->SetBottomMargin(0.15);
572 gStyle->SetTitleAlign(33);
575 sprintf(outname,
"%s%s_%s_%i_%i.png",
"Plots/",
576 "correlation",
"template_bins", xbin,ybin);
586 bool shouldSave =
true)
594 NueCCIncCrossSectionAnalysis nominal_ana =
596 NueCCIncCrossSectionAnalysis light_dwn_ana =
598 NueCCIncCrossSectionAnalysis light_up_ana =
600 NueCCIncCrossSectionAnalysis calib_dwn_ana =
602 NueCCIncCrossSectionAnalysis calib_up_ana =
604 NueCCIncCrossSectionAnalysis calib_shape_ana =
606 NueCCIncCrossSectionAnalysis ckv_ana =
609 std::vector<std::unique_ptr<NueCCIncCrossSectionAnalysis>> genie_ana;
610 std::vector<std::unique_ptr<NueCCIncCrossSectionAnalysis>> ppfx_ana;
612 for(
int i = 0;
i < 100;
i++){
617 TH3F* nominal_template = nominal_ana.getTemplate3D(
costhetabins,
621 TH3F* light_dwn_template = light_dwn_ana.getTemplate3D(
costhetabins,
625 TH3F* light_up_template = light_up_ana.getTemplate3D(
costhetabins,
629 TH3F* calib_dwn_template = calib_dwn_ana.getTemplate3D(
costhetabins,
633 TH3F* calib_up_template = calib_up_ana.getTemplate3D(
costhetabins,
637 TH3F* calib_shape_template = calib_shape_ana.getTemplate3D(
costhetabins,
641 TH3F* ckv_template = ckv_ana.getTemplate3D(
costhetabins,
645 std::vector<TH3F*> genie_templates;
646 std::vector<TH3F*> ppfx_templates;
648 for(
int i = 0;
i < 100;
i++){
649 genie_templates.push_back(genie_ana[
i]->getTemplate3D(
costhetabins,
652 ppfx_templates.push_back(ppfx_ana[
i]->getTemplate3D(
costhetabins,
657 std::vector<TH3F*> vMultiverse;
658 for(
int i = 0;
i < 100;
i++){
659 vMultiverse.push_back((TH3F*)genie_templates[
i]->
Clone 662 for(
int i = 0;
i < 100;
i++){
663 vMultiverse.push_back((TH3F*)ppfx_templates[
i]->
Clone 671 NueCCIncCrossSectionTemplates fit_templates =
674 std::vector<TH3F*>nominal_fit_templates =
679 std::vector<TH3F*>nominal_fit_analysis =
684 std::vector<TH3F*>nominal_analysis_comparison;
685 for(
uint i = 0;
i < nominal_fit_analysis.size();
i++){
686 nominal_analysis_comparison.push_back((TH3F*)
687 nominal_fit_analysis[
i]->
Clone 692 NueCCIncTemplateFitter
694 nominal_fit_templates,
695 nominal_fit_analysis,
706 std::vector<TH3F*> hFitResults = fitter.doFullFit();
714 std::vector<TH3F*> hGenieSysts3D =
718 std::vector<TH3F*> hPPFXSysts3D =
723 for(
int xbin = 1; xbin <= hFitResults[0]->GetXaxis()->GetNbins(); xbin++){
724 for(
int ybin = 1; ybin <= hFitResults[0]->GetYaxis()->GetNbins(); ybin++){
726 std::vector<TH1F*> hPID_Nominal = fitter.getPIDTemplates(xbin,ybin);
727 std::vector<TH1F*> hPID_Fitted = fitter.getPIDFitTemplates(xbin,ybin);
728 TH2F* hCovariance = fitter.getCovarianceMatrixTemplateBins(xbin,ybin);
729 TH2F* hCorrelation = fitter.getCorrelationMatrixTemplateBins(xbin,ybin);
731 if(hPID_Nominal[0]->
Integral() == 0)
continue;
733 std::vector<TH1F*> hSystUpHolder1D = {
735 xbin,xbin,ybin,ybin),
737 xbin,xbin,ybin,ybin),
739 xbin,xbin,ybin,ybin),
741 xbin,xbin,ybin,ybin),
743 xbin,xbin,ybin,ybin),
748 std::vector<TH1F*> hSystDownHolder1D = {
750 xbin,xbin,ybin,ybin),
752 xbin,xbin,ybin,ybin),
754 xbin,xbin,ybin,ybin),
756 xbin,xbin,ybin,ybin),
758 xbin,xbin,ybin,ybin),
769 "templates",
"CVNe 2017",
"Nominal",
777 "templates",
"CVNe 2017",
"Nominal",
802 std::vector<TH2F*> hFitResults2D;
803 for(
uint i = 0;
i < hFitResults.size();
i++){
804 TH2F* hHolder = (TH2F*)hFitResults[
i]->Project3D(
"yx");
806 hFitResults2D.push_back((TH2F*)hHolder->Clone(
ana::UniqueName().c_str()));
809 TH2F* data_analysis_2D = nominal_ana.getAnalysis2D(
costhetabins,
814 TH2F* nominal_analysis_2D = nominal_ana.getAnalysis2D(
costhetabins,
818 TH2F* light_dwn_analysis_2D = light_dwn_ana.getAnalysis2D(
costhetabins,
822 TH2F* light_up_analysis_2D = light_up_ana.getAnalysis2D(
costhetabins,
826 TH2F* calib_dwn_analysis_2D = calib_dwn_ana.getAnalysis2D(
costhetabins,
830 TH2F* calib_up_analysis_2D = calib_up_ana.getAnalysis2D(
costhetabins,
834 TH2F* calib_shape_analysis_2D = calib_shape_ana.getAnalysis2D(
costhetabins,
838 TH2F* ckv_analysis_2D = ckv_ana.getAnalysis2D(
costhetabins,
842 std::vector<TH2F*> genie_analysis_2D;
843 std::vector<TH2F*> ppfx_analysis_2D;
845 for(
int i = 0;
i < 100;
i++){
846 genie_analysis_2D.push_back(genie_ana[
i]->getAnalysis2D(
costhetabins,
849 ppfx_analysis_2D.push_back(ppfx_ana[
i]->getAnalysis2D(
costhetabins,
855 std::vector<TH2F*> hGenieSysts2D =
859 std::vector<TH2F*> hPPFXSysts2D =
864 std::vector<TH2F*> hSystUpHolder2D = {
873 std::vector<TH2F*> hSystDownHolder2D = {
889 "Reconstructed Electron Energy, E_{e} (GeV)",
897 TH2F* hSignalEst = (TH2F*)hFitResults2D[1]->
Clone(
"hSignalEst");
899 TH2F* hUnfoldedSignalEst = nominal_ana.doUnfolding2D(hSignalEst, 6);
902 TH2F* hTrueRecoSignal =
903 (TH2F*)nominal_ana.getSelectedSignalPrediction2D(
costhetabins,
906 TH2F* hTrueRecoSignal_nominal =
907 (TH2F*)nominal_ana.getSelectedSignalPrediction2D(
costhetabins,
913 PlotWithRatio2D(hUnfoldedSignalEst, hTrueRecoSignal,hTrueRecoSignal_nominal,
914 "Signal Events/8.09 #times 10^{20} POT",
915 "True Electron Energy, E_{e} (GeV)",
918 "reco_signal",
"comparison",
919 "double",
"Weighted MC - Signal Prediction",
920 "True Signal from Fake Data",
921 "Nominal MC - Signal Prediction");
927 TH2F* nominal_efficiency_2D =
929 TH2F* light_dwn_efficiency_2D =
932 TH2F* light_up_efficiency_2D =
935 TH2F* calib_dwn_efficiency_2D =
938 TH2F* calib_up_efficiency_2D =
941 TH2F* calib_shape_efficiency_2D =
946 std::vector<TH2F*> genie_efficiency_2D;
947 std::vector<TH2F*> ppfx_efficiency_2D;
949 for(
int i = 0;
i < 100;
i++){
950 genie_efficiency_2D.push_back(genie_ana[
i]->getEfficiency2D(
costhetabins,
952 ppfx_efficiency_2D.push_back(ppfx_ana[
i]->getEfficiency2D(
costhetabins,
void doTemplateFit(std::string dataName="nominal", bool shouldSave=true)
const bool plotFitAnalysisResults
Cuts and Vars for the 2020 FD DiF Study.
std::map< std::string, double > xmax
void PlotFrom2D(TH2F *hData2D, TH2F *hNominal2D, std::vector< TH2F * > hFitResults2D, std::vector< TH2F * > hSystsUp2D, std::vector< TH2F * > hSystsDown2D, std::string plotType, std::string xTitle, std::string dataName)
const ana::Binning eelecbins
double Integral(const Spectrum &s, const double pot, int cvnregion)
bool sort_in_ascending_order(int i, int j)
const ana::Binning costhetabins
void PlotWithRatio2D(TH2F *hResultA, TH2F *hTruthA, TH2F *hNominalA, std::string ytitle, std::string xtitle, float xmin, float xmax, std::string dataName, std::string plotType, std::string plotName, std::string varName, std::string legend_results="Fake Data", std::string legend_truth="Fake Data Truth", std::string legend_nominal="Nominal MC")
std::vector< TH3F * > CalculateOneSigmaBandFromMultiverse(TH3F *nominal, std::vector< TH3F * > vHist)
std::unique_ptr< T > LoadFrom(TDirectory *dir, const std::string &label)
const ana::Binning pidbins
const std::string sTemplates
void MakeTemplatePlotsSyst(TH1F *hData, std::vector< TH1F * > hTemplates, std::vector< TH1F * > vUp, std::vector< TH1F * > vDown, std::string plotType, std::string xTitle, std::string dataName, bool isFitted, int xbin, int ybin)
void MakeCovarianceCorrelationPlots(TH2F *hCov, TH2F *hCorr, int xbin, int ybin)
static float min(const float a, const float b, const float c)
const bool plotFitTemplateResults
double BinSigma(std::vector< double > events, double nsigma, double pivot)
Eigen::ArrayXd ProjectionY(const Eigen::MatrixXd &mat)
Helper for WeightingVariable.
const bool plotSignalPrediction
TLegend * AutoPlaceLegend(double dx, double dy, double yPin)
Create a legend, maximizing distance from all histograms.
const axis_info kChnsInfo[kcNumChns+1]
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
return_type< T_y, T_loc, T_scale >::type normal_cdf(const T_y &y, const T_loc &mu, const T_scale &sigma)
std::string UniqueName()
Return a different string each time, for creating histograms.
TGraphAsymmErrors * PlotSystErrorBand(TH1F *&nom, std::vector< TH1F * > &ups, std::vector< TH1F * > &dns, int col, int errCol, float headroom, bool newaxis)