6 #include "CAFAna/Core/Binning.h" 7 #include "CAFAna/Core/HistAxis.h" 30 #include "TGraphAsymmErrors.h" 33 #include "TPaveText.h" 82 double alpha=1., TString titley=
"Shift / Nom")
84 auto htemp =
reinterpret_cast<TH1*
>(nom->Clone(
ana::UniqueName().c_str()));
85 htemp->Divide(shi,nom);
86 htemp->SetMarkerColorAlpha(color,alpha);
87 htemp->SetLineColorAlpha(color,alpha);
88 htemp->SetMarkerStyle(34);
89 htemp->SetMarkerSize(1.4);
90 htemp->GetYaxis()->SetTitle(titley);
96 double FindLimitY (std::vector<TH1*> histos,
bool doMax =
true)
98 double max = histos[0]->GetMaximum();
99 double min = histos[0]->GetMinimum();
101 for(
unsigned int i=0;
i<histos.size();
i++){
103 if ( histos[
i]->GetMinimum() <
min ) min = histos[
i]->GetMinimum();
106 if ( doMax )
return max;
112 bool signal=
false,
bool fixbins=
false)
117 hplus ->SetLineColor(mccolor);
118 hminus->SetLineColor(mccolor);
119 hplus ->SetFillColor(mccolor);
120 hminus->SetFillColor(10);
121 hplus ->SetMarkerColor(
kRed-7);
122 hminus->SetMarkerColor(
kBlue-7);
126 for(
int i=1;
i <= hplus->GetNbinsX();
i++)
128 double tplus = hplus->GetBinContent(
i);
129 double tminus = hminus->GetBinContent(
i);
130 hplus->SetBinContent(
i,
max(tplus, tminus));
131 hminus->SetBinContent(
i,
min(tplus,tminus));
139 ret->Scale(0.1,
"width");
140 ret->GetYaxis()->SetTitle(
"Events / 0.1 GeV");
141 ret->SetBit(kCanDelete);
142 ret->SetDirectory(gROOT);
151 TLatex*
tag =
new TLatex(xndc, yndc, pid);
152 tag->SetTextColor(color);
154 tag->SetTextSize(0.04);
155 tag->SetTextFont(42);
156 tag->SetTextAlign(22);
158 tag->SetBit(kCanDelete);
174 std::vector<TH1*>
h, std::vector<TString> titles, std::vector<TString> option,
179 leg->SetFillStyle(0);
180 for (
unsigned int v = 0;
v < h.size(); ++
v)
181 leg->AddEntry(h[
v], titles[v], option[v]);
182 leg->SetBit(kCanDelete);
190 leg->SetFillStyle(0);
198 leg->SetX1(0.355); leg->SetX2(0.515);
199 leg->SetY1(0.65); leg->SetY2(0.82);
200 leg->SetBorderSize(0);
201 leg->SetTextSize(0.03);
203 if(
opt==
"ExPIDNearDet")
205 leg->SetX1(0.695); leg->SetX2(0.855);
206 leg->SetY1(0.65); leg->SetY2(0.82);
207 leg->SetBorderSize(0);
208 leg->SetTextSize(0.03);
212 leg->SetX1(0.55); leg->SetX2(0.89);
213 leg->SetY1(0.75); leg->SetY2(0.89);
214 leg->SetTextSize(0.045);
219 TGraph *
DummyGraph(
int color=kBlack,
int style =1,
int linewidth=2,
int markerstyle = kFullCircle)
221 auto gr =
new TGraph();
222 gr->SetLineColor(
color);
223 gr->SetLineStyle(style);
224 gr->SetLineWidth(linewidth);
225 gr->SetMarkerStyle(markerstyle);
226 gr->SetMarkerColor(
color);
232 bool sig=
true,
bool tot=
true,
bool data=
false,
237 leg->SetFillStyle(0);
244 leg->SetBit(kCanDelete);
251 bool sig=
true,
bool tot=
true,
bool data=
false,
256 leg->SetFillStyle(0);
260 leg->AddEntry(
DummyGraph(),
"ND Data",
"epl");
270 leg->SetBit(kCanDelete);
276 const std::vector <TString> exts = {
"pdf",
"png",
"root"} )
278 for(
auto const &
ext:exts){
279 gSystem -> MakeDirectory(
outdir );
280 gSystem -> MakeDirectory(
outdir+
"rootfiles/" );
281 if(
ext==
"png") c->SaveAs(
outdir+
"png_"+outname +
"." +
ext);
282 else if(
ext==
"root") c->SaveAs(
outdir+
"rootfiles/"+outname +
"." +
ext);
283 else c->SaveAs(
outdir+outname +
"." +
ext);
320 TH1*
h,
bool coreOnlyND=
false,
bool binLabels=
true,
321 const double textSize=0.04,
const int textColor=kGray+3,
322 const int lineColor=kBlack,
const int lineStyle=3,
const double yNDC=0.96)
325 Info(
"NuePID3bin",
"specified core only/ND.");
334 if (textSize != 0.04)
335 Warning(
"NuePID3bin",
336 "binLabels == false --> specified text size has no effect");
337 if (textColor != kGray+3)
338 Warning(
"NuePID3bin",
339 "binLabels == false --> specified text color has no effect");
341 Warning(
"NuePID3bin",
342 "binLabels == false --> specified yNDC has no effect");
411 std::vector<TH1*> topHistos, std::vector<TString> topOption,
412 std::vector<TH1*> bottomHistos, std::vector<TString> bottomOption,
415 gStyle->SetTitleStyle(0);
416 TCanvas *c =
new TCanvas(
"c",
"canvas", 600, 700);
419 TPad*
p1 =
new TPad(
"",
"", 0, 0, 1, 1);
420 TPad*
p2 =
new TPad(
"",
"", 0, 0, 1, 1);
421 p1->SetBottomMargin(.3);
422 p2->SetTopMargin(.7);
430 auto h1 = (TH1*) topHistos[0]->
Clone();
431 auto h3 = (TH1*) bottomHistos[0]->
Clone();
433 for(
auto &
h:{
h1,
h3}){
436 h->GetYaxis()->SetTitleSize(26);
437 h->GetYaxis()->SetTitleFont(43);
438 h->GetYaxis()->SetTitleOffset(1.3);
439 h->GetYaxis()->SetLabelFont(43);
441 h->GetXaxis()->SetTitleOffset(1.2);
442 h->GetXaxis()->SetTitleSize(28);
443 h->GetXaxis()->SetTitleFont(43);
444 h->GetXaxis()->SetLabelFont(43);
448 h1->GetYaxis()->SetRangeUser(
451 h1->GetYaxis()->SetRangeUser(
453 h1->GetYaxis()->SetLabelSize(18);
455 h1->GetXaxis()->SetLabelSize(0);
456 h1->GetXaxis()->SetTitleSize(0);
461 h3->GetYaxis()->SetLabelSize(15);
462 h3->GetYaxis()->SetDecimals();
464 h3->GetXaxis()->SetTitle(
h1->GetXaxis()->GetTitle());
465 h3->GetXaxis()->SetLabelSize(18);
466 h3->GetXaxis()->SetLabelOffset(0.005);
470 h1->Draw(topOption[0]);
472 for(
unsigned int ii = 1; ii < topHistos.size(); ++ii) {
473 topHistos[ii]->Draw(
"same "+topOption[ii]);}
474 h1->Draw(
"same "+topOption[0]);
482 h3->Draw(bottomOption[0]);
483 for(
unsigned int ii = 1; ii < bottomHistos.size(); ++ii){
484 bottomHistos[ii]->Draw(
"same " + bottomOption[ii]);}
485 h3->Draw(
"same " + bottomOption[0]);
487 auto lone =
new TLine();
488 lone->SetLineStyle(3);
489 lone->SetLineColor(kGray+3);
491 lone->DrawLine(p2->GetUxmin(),1.0,p2->GetUxmax(),1.0);
492 lone->DrawLine(p2->GetUxmin(),1.2,p2->GetUxmax(),1.2);
493 lone->DrawLine(p2->GetUxmin(),0.8,p2->GetUxmax(),0.8);
494 float p2Y = p2->GetUymax()-p2->GetUymin();
495 h3->GetYaxis()->SetRangeUser(p2->GetUymin()-(0.01*p2Y),p2->GetUymax()+(0.01*p2Y));
590 TH1* hdata, std::vector<TH1*> htots, TLegend *
leg,
591 TString pidtag=
"", TString
out_name=
"plot_nd",
594 Info(
"PlotNDDataTotalMCComparison",
599 std::vector<TString> h_opt;
600 for(
auto const &
h:htots) h_opt.push_back(
"hist");
601 h_opt.push_back(
"p");
605 auto c1 =
new TCanvas (
"c1",
"c1");
606 htots[0]->SetMaximum(1.3*htots[0]->
GetMaximum());
607 for(
auto const &
h:htots)
h->Draw(
"hist same");
608 htots[0]->Draw(
"hist same");
609 hdata->Draw(
"p same");
619 std::vector<TH1*> ratios;
620 std::vector<TString> r_opt;
622 for(
auto const &
h:htots)
625 idx>0 ? 0.4:1.,
"Data / MC");
626 ratio->GetYaxis()->SetRangeUser(0.5,1.5);
627 ratios.push_back(
ratio);
628 r_opt.push_back(
"e");
631 htots.push_back(hdata);
632 auto cratio1 =
RatioPlot(htots, h_opt, ratios,
633 r_opt, pidtag, pidaxis,
true);
644 std::vector<TH1*>vnom, std::vector<TH1*>vshi,
645 TLegend *
leg, TString pidtag=
"",
646 TString
out_name=
"plot_nd",
bool ratioplot=
false,
650 Info(
"PlotMCComponentsErrorBand",
"out_name = " +
out_name);
651 const auto isNearDet =
out_name.Contains(
"ND", TString::kIgnoreCase);
653 Info(
"PlotMCComponentsErrorBand",
"isNearDet = true");
655 Info(
"PlotMCComponentsErrorBand",
"isNearDet = false");
669 for(
auto const &
v:vnom)
670 v->Draw(
"hist same");
671 for(
auto const &
v:vshi)
672 v->Draw(
"hist same");
683 std::vector<TH1*> vratio;
684 for(
unsigned int ii=0; ii<vshi.size();ii++)
687 vnom[ii]->GetLineColor(), ii>0 ? 0.4:1.);
688 htemp->GetYaxis()->SetRangeUser(0.5, 1.5);
689 vratio.push_back (htemp);
691 vnom.insert(vnom.end(), vshi.begin(), vshi.end());
692 std::vector<TString>topOption(vnom.size(),
"hist");
693 std::vector<TString>bottomOption(vratio.size(),
694 ratioerrors ?
"p":
"hist p");
696 vnom, topOption, vratio, bottomOption, pidtag, pidaxis, isNearDet);
708 std::vector<TH1*>vnom, std::vector<TH1*>vshi,
709 TLegend *
leg, TString pidtag=
"", TString
out_name=
"plot_nd",
713 Info(
"PlotMCComponentsErrorBand",
"out_name = " +
out_name);
714 const auto isNearDet =
out_name.Contains(
"ND", TString::kIgnoreCase);
716 Info(
"PlotMCComponentsErrorBand",
"isNearDet = true");
718 Info(
"PlotMCComponentsErrorBand",
"isNearDet = false");
720 auto hplu_plot =
reinterpret_cast<TH1*
>(vshi[0]->Clone());
721 auto hmin_plot =
reinterpret_cast<TH1*
>(vshi[1]->Clone());
724 std::vector<TH1*>vshi_plot={hplu_plot,hmin_plot};
736 auto c2 =
new TCanvas (
"c2",
"c2");
737 vnom[0]->SetMaximum(1.2*vnom[0]->
GetMaximum());
738 vnom[0]->Draw(
"hist");
739 for(
auto v:vshi_plot)
v->Draw(
"hist same");
740 for(
auto v:vnom)
v->Draw(
"hist same");
751 std::vector<TH1*> vratio;
752 for(
unsigned int ii=0; ii<vshi.size(); ii++)
754 auto htemp =
PrettyRatio(vshi[ii], vnom[0], vshi[ii]->GetMarkerColor());
755 vratio.push_back(htemp);
757 vratio[0]->GetYaxis()->SetRangeUser(0.5,1.5);
758 vnom.insert(vnom.begin()+1,vshi_plot.begin(),vshi_plot.end());
759 std::vector<TString> topOption (vnom.size(),
"hist");
760 std::vector<TString> bottomOption (vratio.size(),ratioerrors ?
"p":
"hist p");
762 vnom, topOption, vratio, bottomOption, pidtag, pidaxis, isNearDet);
791 std::vector <std::pair <TH1*, int>> pairs = {
804 for (
auto const & mypair:pairs)
806 if(mypair.first == 0)
808 Info(
"DefaultFormatNue",
"Skipping formatting for component...");
811 mypair.first->SetLineColor(mypair.second);
812 mypair.first->SetLineStyle(linestyle);
815 if(comp.
data) comp.
data->SetMarkerStyle(kFullCircle);
824 Info(
"GetNDComponents",
"Loaded NueComponent...");
826 Info(
"GetNDComponents",
"Loaded AnitNueComponent...");
828 Info(
"GetNDComponents",
"Loaded NumuComponent...");
830 Info(
"GetNDComponents",
"Loaded AntiNumuComponent...");
832 Info(
"GetNDComponents",
"Loaded NCTotalComponent...");
834 Info(
"GetNDComponents",
"Loaded Data_Component...");
836 auto beam = nueComp + antinueComp;
837 auto numu = numuComp + antinumuComp;
851 ret.
mcTotal =
reinterpret_cast<TH1*
>(ret.
beam->Clone());
858 ret.
nc = ncTotComp.
ToTH1(ndPOT);
859 std::cout <<
"nc component: " << ret.
nc->Integral()
860 <<
", in " << ret.
nc->GetNbinsX() <<
" bins" <<
std::endl;
869 ret.
bkg =
reinterpret_cast<TH1*
>(ret.
nc->Clone());
934 ret.sig = pred_no->PredictComponent(
936 ret.wrongSign = pred_no->PredictComponent(
938 ret.beam = pred_no->PredictComponent(
940 ret.numu = pred_no->PredictComponent(
942 ret.nc = pred_no->PredictComponent(
944 ret.tau = pred_no->PredictComponent(
947 ret.bkg = (pred_no->Predict(
calc) - pred_no->PredictComponent(
950 ret.mcTotal =
reinterpret_cast<TH1*
>(ret.bkg->Clone());
951 ret.mcTotal->Add(ret.sig);
955 ret.nuetonumu = pred_no->PredictComponent(
957 ret.numutonumu = pred_no->PredictComponent(
959 ret.nuetonutau = pred_no->PredictComponent(
961 ret.numutonutau = pred_no->PredictComponent(
966 ret.nuetonumu = 0; ret.numutonumu = 0;
967 ret.nuetonutau = 0; ret.numutonutau = 0;
981 TString plottitle, TString
out_name, TString pidtag,
982 AxisType pidaxis,
bool printtable=
true)
985 h_sh.
bkg->SetLineStyle(1);
988 h_no.
bkg->SetTitle(plottitle);
990 TGaxis::SetMaxDigits(3);
991 h_no.
bkg->GetXaxis()->SetDecimals();
995 {
"ND Data",
"Nominal",
"Shift"},{
"epl",
"l",
"l"});
999 TH1* mydata = h_no.
data;
1001 std::vector <TH1*> vnom_plot = {
1003 std::vector <TH1*> vshi_plot = {h_sh.
mcTotal};
1007 std::vector<TString>
labels = {
1008 "Total MC",
"Beam $\\nu_{e}$",
"NC",
"$\\nu_{\\mu}$ CC"};
1011 h_sh.
mcTotal->SetLineStyle(2);
1027 labels = {
"Total MC",
"$\\nu_{\\mu}$ CC",
"NC",
"$\\nu_{e}$ CC"};
1033 leg2->AddEntry(h_sh.
mcTotal,
"Shifted",
"l");
1036 vnom_plot, vshi_plot, leg2, pidtag,
1053 TString plottitle, TString
out_name, TString pidtag,
1054 AxisType pidaxis,
bool printtable=
true)
1056 Info(
"CompareNDDataTwoMC",
1078 hnom.
mcTotal->SetTitle(plottitle);
1080 TGaxis::SetMaxDigits(3);
1081 hnom.
mcTotal->GetXaxis()->SetDecimals();
1085 {
"ND Data",
"Nominal MC",
"Syst."}, {
"epl",
"l",
"f"});
1088 TH1 * mydata = hnom.
data;
1090 std::vector <TH1*> vnom_plot = {
1097 std::vector<TString>
labels = {
1098 "Total MC",
"Beam $\\nu_{e}$",
"NC",
"$\\nu_{\\mu}$ CC"};
1123 labels = {
"Total MC",
"$\\nu_{\\mu}$ CC",
"NC",
"$\\nu_{e}$ CC"};
1129 out_name.Contains(
"_sig"),
true);
1132 mydata, comp_plot,
leg1, pidtag,
1135 leg2->AddEntry(hplu.
mcTotal,
"Syst.",
"f");
1138 vnom_plot, vshi_plot, leg2, pidtag,
1181 std::cout << abi::__cxa_demangle(
typeid(*prediction).name(), 0, 0, 0) << std::endl;
1187 std::cout << abi::__cxa_demangle(
typeid(*prediction).name(), 0, 0, 0) << std::endl;
1190 std::cout << abi::__cxa_demangle(
typeid(*predExtend).name(), 0, 0, 0) << std::endl;
1202 std::cout << abi::__cxa_demangle(
typeid(*predCore).name(), 0, 0, 0) << std::endl;
1205 std::cout << abi::__cxa_demangle(
typeid(*predExtrap).name(), 0, 0, 0) << std::endl;
1216 std::vector<ModularExtrapComponent*> modExtrapComps =
1222 std::cout <<
"Getting modular extrap component: " 1225 const IDecomp*
decomp = modExtrapComps[modExtrapComp]->GetDecomp();
1236 TString
tag,
AxisType pidaxis,
bool printtable=
true)
1238 Info(
"CompareNDDataMCFromVector",
1245 std::cout <<
"In ComparePredictionsFromVector -- pred_no is " << pred_no <<
std::endl;
1259 int numSh = shiftedPred.
preds.size();
1263 std::vector<IPrediction*> pred_sh = shiftedPred.
preds;
1266 std::vector<DataMCComponents>
comps;
1267 for (
auto pred:pred_sh)
1275 comps.push_back(shiftedComps);
1287 nomNDComps, comps[2], comps[0], plottitle,
1288 out_name+
"_1sigma",
"#pm1#sigma", pidaxis, printtable);
1290 else if (numSh == 5)
1297 nomNDComps, comps[3], comps[1], plottitle,
1298 out_name+
"_1sigma",
"#pm1#sigma", pidaxis, printtable);
1300 else if (numSh == 2)
1306 nomNDComps, comps[1], plottitle, out_name+
"_1sigma",
1307 "#plus1#sigma", pidaxis, printtable);
1316 TString plottitle, TString
out_name, TString pidtag,
1317 bool printtable=
true,
AxisType pidaxis =
kNue1bin,
bool PrintParams=
false){
1323 h_no.sig->SetMaximum(
FindLimitY({h_no.sig,h_sh.sig}));
1324 h_no.bkg->SetMaximum(
FindLimitY({h_no.bkg,h_sh.bkg}));
1325 h_no.sig->SetTitle(plottitle);
1326 h_no.bkg->SetTitle(plottitle);
1327 TGaxis::SetMaxDigits(3);
1333 std::vector<TString> legnames = {
"#nu_{e} Signal",
"Shifted"};
1334 if (
isNumuAna) legnames = {
"#nu_{#mu} Signal",
"Shifted"};
1335 auto leg2 =
CustomLegend({h_no.sig, h_sh.sig},legnames,{
"l",
"l"});
1350 { h_sh.bkg, h_sh.beam, h_sh.nc, h_sh.numu },
1360 std::vector<TString>
labels = {
"$\\nu_e$ signal",
"Tot beam bkg",
"Beam $\\nu_{e}$ CC",
"NC",
"$\\nu_{\\mu}$ CC",
"$\\nu_{\\tau}$ CC"};
1363 labels = {
"$\\nu_{\\mu}$ signal",
"Tot beam bkg",
"$\\nu_{e}$ CC",
"NC",
"$\\nu_{\\mu} $App",
"$\\nu_{\\tau}$ CC"};
1366 {h_sh.sig, h_sh.bkg, h_sh.beam, h_sh.nc, h_sh.numu, h_sh.tau},
1373 {h_sh.sig, h_sh.bkg, h_sh.beam,h_sh.nc,h_sh.numu,h_sh.tau},
1383 TString plottitle, TString out_name, TString pidtag,
1394 hnom.bkg->SetMaximum(
FindLimitY({hnom.bkg, hplu.bkg, hmin.bkg}));
1395 hnom.bkg->SetTitle(plottitle);
1398 hnom.sig->SetMaximum(
FindLimitY({hnom.sig, hplu.sig, hmin.sig}));
1399 hnom.sig->SetTitle(plottitle);
1401 TGaxis::SetMaxDigits(3);
1403 TLegend *
leg, *leg2;
1408 {
"#nu_{#mu} Signal",
"Shifted"},
1415 {
"#nu_{e} Signal",
"Shifted"},
1418 leg->AddEntry(hplu.bkg,
"Syst.",
"f");
1420 std::vector <TH1*> nom_bkg_plot = {hnom.bkg, hnom.beam, hnom.nc, hnom.numu, hnom.tau};
1421 std::vector <TH1*> shi_bkg_plot = {hplu.bkg, hmin.bkg};
1422 std::vector <TH1*> nom_sig_plot = {hnom.sig};
1423 std::vector <TH1*> shi_sig_plot = {hplu.sig, hmin.sig};
1425 std::vector <TH1*> vnom = {
1426 hnom.sig, hnom.bkg, hnom.beam, hnom.nc, hnom.numu, hnom.tau};
1427 std::vector <TH1*> vplu = {
1428 hplu.sig, hplu.bkg, hplu.beam, hplu.nc, hplu.numu, hplu.tau};
1429 std::vector <TH1*> vmin = {
1430 hmin.sig, hmin.bkg, hmin.beam, hmin.nc, hmin.numu, hmin.tau};
1432 std::vector <TString>
labels = {
1433 "$\\nu_e$ signal",
"Tot beam bkg",
"Beam $\\nu_{e}$ CC",
1434 "NC",
"$\\nu_{\\mu}$ CC",
"$\\nu_{\\tau}$ CC"};
1437 labels = {
"$\\nu_{\\mu}$ signal",
"Tot beam bkg",
"NC",
1438 "$\\nu_{\\mu}$ App",
"$\\nu_{e}$ CC",
"$\\nu_{\\tau}$ CC"};
1439 vnom = {hnom.sig, hnom.bkg, hnom.nc, hnom.numu, hnom.beam, hnom.tau};
1440 vplu = {hplu.sig, hplu.bkg, hplu.nc, hplu.numu, hnom.beam, hplu.tau};
1441 vmin = {hmin.sig, hmin.bkg, hmin.nc, hmin.numu, hnom.beam, hmin.tau};
1472 TString plottitle, TString out_name,
1485 int numSh = shiftedPred.
preds.size();
1489 std::vector<IPrediction*> pred_sh = shiftedPred.
preds;
1498 pred_no, pred_sh[0], pred_sh[2], plottitle,
1499 out_name+
"_1sigma",
"#pm1#sigma", printtable, pidaxis);
1501 else if (numSh == 5)
1508 pred_no, pred_sh[1], pred_sh[3], plottitle,
1509 out_name+
"_1sigma",
"#pm1#sigma", printtable, pidaxis);
1511 else if (numSh == 2)
1517 pred_no, pred_sh[1], plottitle, out_name+
"_1sigma",
1518 "#plus1#sigma", printtable, pidaxis);
struct DataMCComponets GetFDMCComponents(osc::IOscCalc *calc, IPrediction *pred_no, TString output_name="nue", int linestyle=1, bool bkgdetails=false)
const double kLegendDefaultY2
const double kLegendDefaultY1
string output_name
Pickle.
Cuts and Vars for the 2020 FD DiF Study.
void ComparisonTableOneNbins(const std::vector< TH1 * > &mcnom, const std::vector< TH1 * > &mcshift, const std::vector< TString > &labels, TString ltxcommand, int N=3)
const IDecomp * GetDecomp(IPrediction *prediction, EModExtrapComps modExtrapComp)
osc::IOscCalc * GetCalculator(bool usingdumb)
std::string systName
What systematic we're interpolating.
Float_t y1[n_points_granero]
void CompareOneShiftPred(IPrediction *pred_no, IPrediction *pred_sh, TString plottitle, TString out_name, TString pidtag, bool printtable=true, AxisType pidaxis=kNue1bin, bool PrintParams=false)
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
Loads shifted spectra from files.
const FitDmSq32 kFitDmSq32
const double kLegendDefaultX2
Float_t x1[n_points_granero]
void PlotMCComponentsComparison(std::vector< TH1 * >vnom, std::vector< TH1 * >vshi, TLegend *leg, TString pidtag="", TString out_name="plot_nd", bool ratioplot=false, bool ratioerrors=false, bool pidaxis=0)
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
const Color_t kNueSignalWSColor
General interface to oscillation calculators.
virtual Spectrum Data_Component() const
TLegend * CustomLegend(std::vector< TH1 * >h, std::vector< TString > title, std::vector< TString > option, double x1=kLegendDefaultX1, double y1=kLegendDefaultY1, double x2=kLegendDefaultX2, double y2=kLegendDefaultY2)
void ComparisonTableOne(const std::vector< TH1 * > &mcnom, const std::vector< TH1 * > &mcshift, const std::vector< TString > &labels, const TString ltxcommand="")
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
Forward to wrapped Var's SetValue()
void CompareTwoShiftPred(IPrediction *pred_no, IPrediction *pred_pl, IPrediction *pred_mi, TString plottitle, TString out_name, TString pidtag, bool printtable=true, AxisType pidaxis=kNue1bin, bool PrintParams=false)
void CenterTitles(TH1 *histo)
def ratio(spec1, spec2, nbins, pot, binrange=(0, 1))
const Color_t kTotalMCErrorBandColor
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
void PrettyTag(TString pid, int color, double xndc, double yndc)
Encapsulate code to systematically shift a caf::SRProxy.
const Color_t kNumuBackgroundColor
void PlotMCComponentsErrorBand(std::vector< TH1 * >vnom, std::vector< TH1 * >vshi, TLegend *leg, TString pidtag="", TString out_name="plot_nd", bool ratioplot=false, bool ratioerrors=false, bool pidaxis=0)
const ShiftedPreds & GetShiftedPrediction(const ISyst *syst)
_IOscCalc< double > IOscCalc
virtual Spectrum MC_NumuComponent() const
double FindLimitY(std::vector< TH1 * > histos, bool doMax=true)
Representation of a spectrum in any variable, with associated POT.
const double kAna2018RHCPOT
const Color_t kNueSignalColor
void PlotNDDataTotalMCComparison(TH1 *hdata, std::vector< TH1 * > htots, TLegend *leg, TString pidtag="", TString out_name="plot_nd", bool ratioplot=false, bool pidaxis=false)
TLegend * DefaultNueLegend(bool sig=true, bool tot=true, bool data=false, double x1=kLegendDefaultX1, double y1=kLegendDefaultY1, double x2=kLegendDefaultX2, double y2=kLegendDefaultY2)
void PlotMCComponentsErrorBand(std::vector< TH1 * >vnom, std::vector< TH1 * >vshi, TLegend *leg, TString pidtag="", TString out_name="plot_nd", bool ratioplot=false, bool ratioerrors=false, AxisType pidaxis=kNue1bin)
const XML_Char const XML_Char * data
const Color_t kNuTauBackgroundColor
Charged-current interactions.
TLegend * DefaultNumuLegend(bool sig=true, bool tot=true, bool data=false, double x1=kLegendDefaultX1, double y1=kLegendDefaultY1, double x2=kLegendDefaultX2, double y2=kLegendDefaultY2)
void CompareNDDataMCFromVector(TDirectory *d_no, std::vector< TDirectory * > d_sh, TString plottitle, TString out_name, TString tag, bool printtable=true, AxisType pidaxis=kNue1bin)
const bool printratioplots
IPrediction * GetNominalPrediction()
void Nue2018ThreeBinDivisions(bool coreOnly, const int color, const int style)
void ComparisonTable(const std::vector< TH1 * > &mcnom, const std::vector< TH1 * > &mcplus, const std::vector< TH1 * > &mcminus, std::vector< TString > labels, TString ltxcommand="")
void FormatErrorBand(TH1 *hplus, TH1 *hminus, bool signal=false, bool fixbins=false)
void SetValue(osc::IOscCalcAdjustable *osc, double val) const override
const DataMCComponents GetNDCompsFromDecomp(const IDecomp *decomp)
void NuePID3bin(TH1 *h, TString pidtag, bool binlabels=true)
virtual Spectrum MC_AntiNumuComponent() const
const Color_t kBeamNueBackgroundColor
TGraph * DummyGraph(int color=kBlack, int style=1, int linewidth=2, int markerstyle=kFullCircle)
Simple oscillation probability calculator that has no solar term or mass hierarchy or delta so it's s...
const double kLegendDefaultX1
std::vector< IPrediction * > preds
std::vector< std::string > comps
void FormatErrorBand(TH1 *hplus, TH1 *hminus, bool signal=false, bool fixbins=false)
void ComparePredictionsFromVector(TDirectory *dpred_no, std::vector< TDirectory * > dpred_sh, TString plottitle, TString out_name, bool printtable=true, AxisType pidaxis=kNue1bin)
void CompareNDDataOneMC(TDirectory *d_no, TDirectory *d_sh, TString plottitle, TString out_name, TString pidtag, bool printtable=true, AxisType pidaxis=kNue1bin)
void PrintLatexFigure(TString name, TString plotdir="plots/")
virtual _IOscCalc * Copy() const =0
void CompareNDDataTwoMC(TDirectory *d_no, TDirectory *d_pl, TDirectory *d_mi, TString plottitle, TString out_name, TString pidtag, bool printtable=true, AxisType pidaxis=kNue1bin)
static float min(const float a, const float b, const float c)
virtual Spectrum MC_AntiNueComponent() const
TLegend * CustomLegend(std::vector< TH1 * >h, std::vector< bool >isdata, std::vector< TString >title, double x1=kLegendDefaultX1, double y1=kLegendDefaultY1, double x2=kLegendDefaultX2, double y2=kLegendDefaultY2)
TH1 * PrettyRatio(TH1 *shi, TH1 *nom, int color, double alpha=1., TString titley="Shift / Nom")
virtual Spectrum MC_NueComponent() const
void PrintOscilationParameters(osc::IOscCalc *calc, bool usingdumb)
TH1 * HistNumuOpt(TH1 *orig)
void ComparisonTableNbins(const std::vector< TH1 * > &mcnom, const std::vector< TH1 * > &mcplus, const std::vector< TH1 * > &mcminus, std::vector< TString > labels, TString ltxcommand="", int N=3)
const ConstrainedFitVarWithPrior fitSsqTh23_UniformPriorSsqTh23 & kFitSinSqTheta23
Standard interface to all decomposition techniques.
void Nue2018ThreeBinLabels(const double yNDC, const double textsize, const int color, const bool nd)
Neutral-current interactions.
void PlotNDDataTotalMCComparison(TH1 *hdata, std::vector< TH1 * > htots, TLegend *leg, TString pidtag="", TString out_name="plot_nd", bool ratioplot=false, AxisType pidaxis=kNue1bin)
Both neutrinos and antineutrinos.
Standard interface to all prediction techniques.
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
const Color_t kTotalMCColor
void DefaultFormatNue(DataMCComponets &comp, int linestyle=1)
const double kAna2018FHCPOT
virtual Spectrum MC_NCTotalComponent() const
All neutrinos, any flavor.
TLegend * DefaultNueLegend(bool sig=true, bool tot=true, bool data=false, double x1=kLegendDefaultX1, double y1=kLegendDefaultY1, double x2=kLegendDefaultX2, double y2=kLegendDefaultY2)
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
const FitVarWithPrior fitDeltaInPiUnits_UniformPriordCP & kFitDeltaInPiUnits
const Color_t kNCBackgroundColor
virtual IOscCalc * Copy() const override
void PlotMCComponentsComparison(std::vector< TH1 * >vnom, std::vector< TH1 * >vshi, TLegend *leg, TString pidtag="", TString out_name="plot_nd", bool ratioplot=false, bool ratioerrors=false, AxisType pidaxis=kNue1bin)
std::string UniqueName()
Return a different string each time, for creating histograms.
TCanvas * RatioPlot(std::vector< TH1 * > topHistos, std::vector< TString > topOption, std::vector< TH1 * > bottomHistos, std::vector< TString > bottomOption, TString pidtag, AxisType pidaxis=kNue1bin)
void FixLegend(TLegend *leg, TString opt="default")
void PrintCanvasAll(TCanvas *c, const TString outname, const TString outdir="plots/", const std::vector< TString > exts={"pdf","png","root"})