Functions | Variables
plot_BEN.C File Reference
#include "3FlavorAna/Plotting/NuePlotStyle.h"
#include "CAFAna/Analysis/Style.h"
#include "CAFAna/Analysis/Exposures.h"
#include "CAFAna/Core/LoadFromFile.h"
#include "3FlavorAna/Decomp/BENDecomp.h"
#include "CAFAna/Cuts/NueCutsSecondAna.h"
#include "CAFAna/Cuts/SpillCuts.h"
#include "CAFAna/Vars/GenieWeights.h"
#include "CAFAna/Vars/PPFXWeights.h"
#include "CAFAna/Vars/HistAxes.h"
#include "Utilities/rootlogon.C"
#include "TFile.h"
#include "TLine.h"
#include "TStyle.h"
#include "TCanvas.h"
#include "TLegend.h"
#include "TObject.h"
#include "THStack.h"
#include "TH3.h"
#include "TH2.h"
#include "TH1.h"
#include "TROOT.h"
#include <iomanip>

Go to the source code of this file.

Functions

void SetPaletteS ()
 
void PlotPionPlots (BENDecomp *dcmp, std::string ananame)
 
void CompareDecompDataMC (BENDecomp *ben, std::string ana)
 
void plot_BEN (const std::string file)
 

Variables

const double pot =9.47964e20/12
 
std::string fname = "FHCBEN.root"
 
const std::string path = "plots"
 

Function Documentation

void CompareDecompDataMC ( BENDecomp ben,
std::string  ana 
)

Definition at line 205 of file plot_BEN.C.

References ana::BENDecomp::AntiNueComponent(), ana::BENDecomp::AntiNumuComponent(), cc(), ana::CenterTitles(), om::cout, ana::BENDecomp::Data_Component(), APDHVSetting::dummy, allTimeWatchdog::endl, ana::kBeamNueBackgroundColor, ana::kBeamNueBarBackgroundColor, ana::kNCBackgroundColor, ana::kNumuBackgroundColor, ana::kNumuBarBackgroundColor, MECModelEnuComparisons::leg, ana::BENDecomp::MC_AntiNueComponent(), ana::BENDecomp::MC_AntiNumuComponent(), ana::BENDecomp::MC_NCTotalComponent(), ana::BENDecomp::MC_NueComponent(), ana::BENDecomp::MC_NumuComponent(), make_root_from_grid_output::nc, ana::BENDecomp::NCTotalComponent(), ana::BENDecomp::NueComponent(), ana::BENDecomp::NumuComponent(), path, pot, Preliminary(), rootlogon(), Simulation(), and ana::Spectrum::ToTH1().

Referenced by plot_BEN().

205  {
206  const std::string path = "plots";
207 rootlogon();
208 std::cout<<ananame<<": "<< pot<<std::endl;
209 auto data = dcmp->Data_Component().ToTH1(pot);
210 data->SetMarkerStyle(kFullCircle);
211 
212 //uncorrected first
213 auto ccmc = dcmp->MC_NumuComponent().ToTH1(pot);
214 ccmc->SetLineColor(kNumuBackgroundColor);
215 ccmc->SetLineStyle(7);
216 auto ccbarmc=dcmp->MC_AntiNumuComponent().ToTH1(pot);
217 ccbarmc->SetLineColor(kNumuBarBackgroundColor);
218 ccbarmc->SetLineStyle(7);
219 auto nemc = dcmp->MC_NueComponent().ToTH1(pot);
220 nemc->SetLineColor(kBeamNueBackgroundColor);
221 nemc->SetLineStyle(7);
222 auto nebarmc = dcmp->MC_AntiNueComponent().ToTH1(pot);
223 nebarmc->SetLineColor(kBeamNueBarBackgroundColor);
224 nebarmc->SetLineStyle(7);
225 auto ncmc = (dcmp->MC_NCTotalComponent()).ToTH1(pot);
226 ncmc->SetLineColor(kNCBackgroundColor);
227 ncmc->SetLineStyle(7);
228 
229 auto totalmc = ( dcmp->MC_NumuComponent()+dcmp->MC_AntiNumuComponent()+dcmp->MC_NueComponent() +dcmp->MC_AntiNueComponent()+dcmp->MC_NCTotalComponent()).ToTH1(pot,kRed,2);
230 
231 
232 THStack * hsmc = new THStack ("hsmc","");
233 hsmc->Add(nemc, "hist");
234 hsmc->Add(nebarmc,"hist");
235 hsmc->Add(ncmc,"hist");
236 hsmc->Add(ccmc, "hist");
237 hsmc->Add(ccbarmc, "hist");
238 
239 char leg_data[50], leg_tot[50], leg_nemc[50],leg_nebarmc[50],leg_ccmc[50],leg_ccbarmc[50],leg_nc[50];
240 
241 sprintf(leg_data, "Data: Bin1= %.1f, Bin2= %.1f", data->Integral(0,9), data->Integral(10, 18));
242 // sprintf(leg_tot, "Tot MC: Bin1= %.1f, Bin2= %.1f", totalmc->Integral(0,9), totalmc->Integral(10, 18));
243 sprintf(leg_nemc, "#{nu}_{e}: Bin1= %.1f, Bin2= %.1f", nemc->Integral(0,9), nemc->Integral(10, 18));
244 sprintf(leg_nebarmc, "#bar{#nu}_{e}: Bin1= %.1f, Bin2= %.1f", nebarmc->Integral(0,9), nebarmc->Integral(10, 18));
245 sprintf(leg_ccmc, "#{nu}_{#mu}: Bin1= %.1f, Bin2= %.1f", ccmc->Integral(0,9), ccmc->Integral(10, 18));
246 sprintf(leg_ccbarmc, "#bar{#nu}_{#mu}: Bin1= %.1f, Bin2= %.1f", ccbarmc->Integral(0,9), ccbarmc->Integral(10, 18));
247 sprintf(leg_nc, "NC: Bin1= %.1f, Bin2= %.1f", ncmc->Integral(0,9), ncmc->Integral(10, 18));
248 
249 // corrected
250 
251 auto cc = dcmp->NumuComponent().ToTH1(pot);
252 cc->SetLineColor(kNumuBackgroundColor);
253 auto ccbar = dcmp->AntiNumuComponent().ToTH1(pot);
254 ccbar->SetLineColor(kNumuBarBackgroundColor);
255 
256 auto ne = dcmp->NueComponent(). ToTH1(pot);
257 ne->SetLineColor(kBeamNueBackgroundColor );
258 auto nebar = dcmp->AntiNueComponent(). ToTH1(pot);
259 nebar->SetLineColor(kBeamNueBarBackgroundColor );
260 
261 auto nc = (dcmp->NCTotalComponent()).ToTH1(pot);
262 nc->SetLineColor(kNCBackgroundColor);
263 auto totalmcc = ( dcmp->NumuComponent()+dcmp->AntiNumuComponent()+dcmp->NueComponent() +dcmp->AntiNueComponent()+dcmp->NCTotalComponent()).ToTH1(pot,kRed);
264 
265 THStack * hs = new THStack ("hs","");
266 /*
267 ne->SetFillColorAlpha(0, 0);
268 nebar->SetFillColorAlpha(0, 100);
269 nc->SetFillColorAlpha(0, 0);
270 cc->SetFillColorAlpha(0, 100);
271 ccbar->SetFillColorAlpha(0, 100);
272 */
273 hs->Add(ne, "hist");
274 hs->Add(nebar, "hist");
275 hs->Add(nc,"hist");
276 hs->Add(cc, "hist");
277 hs->Add(ccbar, "hist");
278 
279 char leg_totc[50], leg_ne[50],leg_nebar[50],leg_cc[50],leg_ccbar[50],leg_ncc[50];
280 
281 sprintf(leg_totc, "MC: Bin1= %.1f, Bin2= %.1f", totalmcc->Integral(0,9), totalmcc->Integral(10, 18));
282 sprintf(leg_ne, "#{nu}_{e}: Bin1= %.1f, Bin2= %.1f", ne->Integral(0,9), ne->Integral(10, 18));
283 sprintf(leg_nebar, "#bar{#nu}_{e}: Bin1= %.1f, Bin2= %.1f", nebar->Integral(0,9), nebar->Integral(10, 18));
284 sprintf(leg_cc, "#{nu}_{#mu}: Bin1= %.1f, Bin2= %.1f", cc->Integral(0,9), cc->Integral(10, 18));
285 sprintf(leg_ccbar, "#bar{#nu}_{#mu}: Bin1= %.1f, Bin2= %.1f", ccbar->Integral(0,9), ccbar->Integral(10, 18));
286 sprintf(leg_ncc, "NC: Bin1= %.1f, Bin2= %.1f", nc->Integral(0,9), nc->Integral(10, 18));
287 
288 std::cout<<"\\multirow{2}*{$\\nu_e$} & Uncorrected & "<< nemc->Integral(0,9) <<" & "<< nemc->Integral(10, 18)<<" \\\\"<<std::endl;
289 std::cout<<" & Corrected & "<< ne->Integral(0,9) <<" & "<< ne->Integral(10, 18)<<" \\\\"<<std::endl;
290 std::cout<<"\\multirow{2}*{$\\bar{\\nu}_e$} & Uncorrected & "<< nebarmc->Integral(0,9) <<" & "<< nebarmc->Integral(10, 18)<<" \\\\"<<std::endl;
291 std::cout<<" & Corrected & "<< nebar->Integral(0,9) <<" & "<< nebar->Integral(10, 18)<<" \\\\"<<std::endl;
292 
293 std::cout<<"\\multirow{2}*{$\\nu_\\mu$} & Uncorrected & "<< ccmc->Integral(0,9) <<" & "<< ccmc->Integral(10, 18)<<" \\\\"<<std::endl;
294 std::cout<<" & Corrected & "<< cc->Integral(0,9) <<" & "<< cc->Integral(10, 18)<<" \\\\"<<std::endl;
295 std::cout<<"\\multirow{2}*{$\\bar{\\nu}_\\mu$} & Uncorrected & "<< ccbarmc->Integral(0,9) <<" & "<< ccbarmc->Integral(10, 18)<<" \\\\"<<std::endl;
296 std::cout<<" & Corrected & "<< ccbar->Integral(0,9) <<" & "<< ccbar->Integral(10, 18)<<" \\\\"<<std::endl;
297 
298 std::cout<<"\\multirow{2}*{nc} & Uncorrected & "<< ncmc->Integral(0,9) <<" & "<< ncmc->Integral(10, 18)<<" \\\\"<<std::endl;
299 std::cout<<" & Corrected & "<< nc->Integral(0,9) <<" & "<< nc->Integral(10, 18)<<" \\\\"<<std::endl;
300 
301 // leg->AddEntry(totalmcc,leg_totc,"l");
302 
303  new TCanvas;
304  data->Draw();
305  hsmc->Draw("hist same");
306  hs->Draw("hist same");
307  data->Draw("same");
309  Preliminary();
310 
311  TLegend * leg = new TLegend(0.7,0.5,0.89,0.89);
312  leg->AddEntry(data,"ND Data","lep");
313  leg->AddEntry(ne, "Beam #nu_{e}","l");
314  leg->AddEntry(nebar, "Beam #bar{#nu}_{e}","l");
315  leg->AddEntry(cc, "#nu_{#mu} CC","l");
316  leg->AddEntry(ccbar, "#bar{#nu}_{#mu} CC","l");
317  leg->AddEntry(nc, "NC","l");
318 
319  auto dummy = (TH1*) nemc->Clone();
320  dummy->SetLineColor(kBlack);
321  leg->AddEntry(dummy, "Uncorr. MC","l");
322 
323 /*
324  TLegend * leg = new TLegend(0.6,0.15,1,1);
325 
326  leg->AddEntry(data,leg_data,"lep");
327  leg->AddEntry(nemc, leg_nemc,"l");
328  leg->AddEntry(nebarmc, leg_nebarmc,"l");
329  leg->AddEntry(ccmc, leg_ccmc,"l");
330  leg->AddEntry(ccbarmc, leg_ccbarmc,"l");
331  leg->AddEntry(ncmc, leg_nc,"l");
332 
333  leg->AddEntry(ne, leg_ne,"l");
334  leg->AddEntry(nebar, leg_nebar,"l");
335  leg->AddEntry(cc, leg_cc,"l");
336  leg->AddEntry(ccbar, leg_ccbar,"l");
337  leg->AddEntry(nc, leg_ncc,"l");
338 */
339  leg->SetLineColor(4000);
340  leg->SetTextSize(0.03);
341  leg->SetTextFont(42);
342  leg->Draw("same");
343  gPad->Update();
344  gPad->SaveAs((TString)"plots/"+ ananame + "_Data_MC_corrected_uncorrected_stack.pdf");
345 
346 
347  ne->Draw("hist");
348  cc->Draw("hist same");
349  nc->Draw("hist same");
350  ccmc->Draw("hist same");
351  nemc->Draw("hist same");
352  ncmc->Draw("hist same");
353  nebar->Draw("hist same");
354  ccbar->Draw("hist same");
355  ccbarmc->Draw("hist same");
356  nebarmc->Draw("hist same");
357  leg->Draw();
358  rootlogon();
359  ne->SetTitleSize(0);
360  Simulation();
361  gPad->Update();
362  gPad->SaveAs((TString)"plots/"+ ananame + "_Data_MC_corrected_uncorrected.pdf");
363 
364 }
const Color_t kBeamNueBarBackgroundColor
Definition: Style.h:25
void Simulation()
Definition: tools.h:16
const Color_t kNumuBackgroundColor
Definition: Style.h:30
const XML_Char const XML_Char * data
Definition: expat.h:268
void CenterTitles(TH1 *h)
const Color_t kBeamNueBackgroundColor
Definition: Style.h:24
void Preliminary()
OStream cout
Definition: OStream.cxx:6
const std::string path
Definition: plot_BEN.C:43
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const double pot
Definition: plot_BEN.C:40
void cc()
Definition: test_ana.C:28
void rootlogon()
Definition: rootlogon.C:7
const Color_t kNumuBarBackgroundColor
Definition: Style.h:31
const Color_t kNCBackgroundColor
Definition: Style.h:22
void plot_BEN ( const std::string  file)

Definition at line 49 of file plot_BEN.C.

References om::cout, d, allTimeWatchdog::endl, fname, genie::utils::style::Format(), ana::BENDecomp::GetKaonScale(), MECModelEnuComparisons::i, outfile, PlotPionPlots(), pot, runNovaSAM::release, ana::BENDecomp::SavePlots(), ana::BENDecomp::SavePlotsKa(), and ana::BENDecomp::SavePlotsPi().

49  {
50  if (std::strstr(file.c_str(),"official")) {fname = "/nova/ana/nu_e_ana/Ana2018/Predictions/provisional_singles/NueProd4SystematicsOnRealNDData_2018-05-03/pred_allxp_Nue2018Axis_full_FHCAllSyst_nueconcat_realNDData_2018-05-11.root";}
51  BENDecomp* ben2018 = LoadFromFile<BENDecomp>(fname, TString::Format("pred_xp_combo_Nominal/noShift/nue_pred_Nue2018Axis/extrap/EEextrap/Decomp/NueEstimate").Data()).release();
52 
53  std::cout << "2018 kaon scale" << ben2018->GetKaonScale() << std::endl;
54  //Plot Decomposed data vs MC
55 
56  BENDecomp* ben[1] = {ben2018};
57  const std::string bennames[1] = {"pred_xp_combo_Nominal/noShift/nue_pred_Nue2018Axis/extrap/EEextrap/Decomp/NueEstimate"};
58 
59  TFile * outfile = new TFile((TString)file + "BEN_plots.root","recreate");
60 
61  for (int i = 0; i< 1; ++i){
62  TDirectory* d = outfile->mkdir((TString)bennames[i]);
63 
64  const double pot = 2.34*ben[i] -> Data_Component().POT();
65 
66 // CompareDecompDataMC(ben[i], bennames[i]);
67  PlotPionPlots(ben[i], bennames[i]);
68 
69  ben[i]->SavePlotsPi(d);
70  ben[i]->SavePlotsKa(d);
71  ben[i]->SavePlots(d);
72 
73  }
74 }
void SavePlotsPi(TDirectory *dir)
Definition: BENDecomp.cxx:540
std::string fname
Definition: plot_BEN.C:42
double GetKaonScale() const
Definition: BENDecomp.h:113
void PlotPionPlots(BENDecomp *dcmp, std::string ananame)
Definition: plot_BEN.C:75
Float_t d
Definition: plot.C:236
OStream cout
Definition: OStream.cxx:6
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void SavePlots(TDirectory *dir)
Definition: BENDecomp.cxx:647
void SavePlotsKa(TDirectory *dir)
Definition: BENDecomp.cxx:483
const double pot
Definition: plot_BEN.C:40
TFile * file
Definition: cellShifts.C:17
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
FILE * outfile
Definition: dump_event.C:13
void PlotPionPlots ( BENDecomp dcmp,
std::string  ananame 
)

Definition at line 75 of file plot_BEN.C.

References ana::CenterTitles(), om::cout, ana::BENDecomp::Data_Component(), allTimeWatchdog::endl, fname, genie::utils::style::Format(), MECModelEnuComparisons::leg, make_syst_table_plots::line, ana::BENDecomp::MC_NueComponent(), ana::Nue2018ThreeBinAxis(), ana::Nue2018ThreeBinDivisions(), ana::Nue2018ThreeBinLabels(), ana::BENDecomp::NueComponent(), path, pot, runNovaSAM::release, rootlogon(), Simulation(), and ana::Spectrum::ToTH1().

Referenced by plot_BEN().

75  {
76  new TCanvas;
77  rootlogon();
78  gStyle->SetTitleOffset(.82, "xyz");
79  gStyle->SetLabelSize(0.035, "xy");
80  gStyle->SetLabelSize(.035, "z");
81  gStyle->SetTitleSize(0.05, "xyz");
82  const std::string path = "plots";
83 
84  auto data = dcmp->Data_Component().ToTH1(pot);
85 
86  data->SetMarkerStyle(kFullCircle);
87 /*
88  auto nueptpz = LoadFromFile<Spectrum>(fname, TString::Format("%s/nueCC_from_pi_pt_pz",ananame.c_str()).Data()).release();
89  TH3* hnue3D = nueptpz -> ToTH3(pot);
90  TH1* hnueXY = hnue3D -> Project3D("yx");
91  hnueXY -> Draw("colz");
92 // hnueXY ->SetTitle("Original #nu_{e} from Pi ;pz (GeV/c);pT (GeV/c); Events");
93  hnueXY ->SetTitle(" ;Ancestor forward momentum p_{z} (GeV/c);Ancestor trans. momentum p_{T} (GeV/c); Events");
94  Simulation();
95  CenterTitles(hnueXY);
96  SetPaletteS();
97  gPad->Update();
98  gPad->SaveAs((TString)"plots/"+ ananame + "_nueCC_from_Pi.pdf");
99 
100  auto numuptpz = LoadFromFile<Spectrum>(fname, TString::Format("%s/numuCC_from_pi_pt_pz",ananame.c_str()).Data()).release();
101  TH3* hnumu3D = numuptpz -> ToTH3(pot/100);
102  TH1* hnumuXY = hnumu3D -> Project3D("yx");
103  hnumuXY -> Draw("colz");
104 // hnumuXY ->SetTitle("Original #nu_{#mu} from Pi ;pz (GeV/c);pT (GeV/c); Events");
105  hnumuXY ->SetTitle(" ;Ancestor forward momentum p_{z} (GeV/c);Ancestor trans. momentum p_{T} (GeV/c); Events");
106  Simulation();
107  CenterTitles(hnumuXY);
108  SetPaletteS();
109  gPad->Update();
110  gPad->SaveAs((TString)"plots/"+ ananame + "_numuCC_from_Pi.pdf");
111 */
112  auto nemc = dcmp->MC_NueComponent().ToTH1(pot);
113  nemc->SetLineStyle(7);
114  nemc->Draw("hist");
115  nemc->GetXaxis()->SetTitle("Reconstructed Neutrino Energy (GeV)");
116  nemc->GetYaxis()->SetRangeUser(0,1.2*nemc->GetMaximum());
117  TLine* line = new TLine();
118  line->SetLineStyle(3);
120  Nue2018ThreeBinLabels(0.98, 0.04, kGray+3, true);
121  Nue2018ThreeBinAxis(nemc,true, true, false);
122 
123  auto ne = dcmp->NueComponent(). ToTH1(pot);
124  ne->Draw("hist same");
125 
126 
127  auto nuepiunwei = LoadFromFile<Spectrum>(fname, TString::Format("%s/nueCC_from_pi",ananame.c_str()).Data()).release();
128  TH1* fnuepiunwei = nuepiunwei->ToTH1(pot,kAzure +6, 7);
129  auto nuekaunwei = LoadFromFile<Spectrum>(fname, TString::Format("%s/nueCC_from_ka",ananame.c_str()).Data()).release();
130  TH1* fnuekaunwei = nuekaunwei->ToTH1(pot,kMagenta -9, 7);
131  auto nueotherunwei = LoadFromFile<Spectrum>(fname, TString::Format("%s/nueCC_from_other",ananame.c_str()).Data()).release();
132 // TH1* fnueotherunwei = nueotherunwei->ToTH1(pot,kOrange+7, 7);
133  TH1* fnueotherunwei = nueotherunwei->ToTH1(pot,kGreen + 2, 7);
134  fnuepiunwei ->Draw("hist same");
135  fnuekaunwei ->Draw("hist same");
136  fnueotherunwei ->Draw("hist same");
137 
138  TH1* fnuepiweight = dcmp -> NuePiEstimate().ToTH1(pot,kAzure +6);
139  fnuepiweight->Draw("hist same");
140 
141  TH1* fnuekaweight = dcmp -> NueKaEstimate().ToTH1(pot, kMagenta -9);
142  fnuekaweight->Draw("hist same");
143 // TH1* fnueotherweight = dcmp ->NueComponent().ToTH1(pot, kOrange +7);
144  TH1* fnueotherweight = dcmp ->NueComponent().ToTH1(pot, kGreen+2);
145  fnueotherweight->Add(fnuekaweight, -1);
146  fnueotherweight->Add(fnuepiweight, -1);
147  fnueotherweight->Draw("hist same");
148 
149  Simulation();
150  CenterTitles(nemc);
151 
152  TLegend * leg = new TLegend(0.665,0.4,0.89,0.89);
153  gStyle->SetTextSize(0.047);
154  leg->AddEntry(ne, "Total #nu_{e} Corr.", "l");
155  leg->AddEntry(fnuepiweight,"#nu_{e} from #pi^{#pm} Corr.","l");
156  leg->AddEntry(fnuekaweight,"#nu_{e} from K^{#pm} Corr.","l");
157  leg->AddEntry(fnueotherweight,"#nu_{e} from Other Corr.", "l");
158  leg->AddEntry(nemc, "#nu_{e} Uncorr.", "l");
159  leg->Draw("same");
160 
161 // nue table tota/pi/ka/other
162 //
163 std::cout<<"\\multirow{2}*{Total $\\nu_e$} & Uncorrected &"<< nemc->Integral(0,9) <<" & "<< nemc->Integral(10, 18)<<" & "<< nemc->Integral(19, 27)<<" & "<< nemc->Integral()<<" \\\\"<<std::endl;
164 
165 std::cout<<setprecision(4)<<" & Corrected & "<< ne->Integral(0,9) <<"("<<100*(ne->Integral(0,9)-nemc->Integral(0,9))/nemc->Integral(0,9)<<"\\%)" <<" & "<< ne->Integral(10, 18)<<"("<<100*(ne->Integral(10,18)-nemc->Integral(10,18))/nemc->Integral(10,18)<<"\\%)" << " & "<< ne->Integral(19,27) <<"("<<100*(ne->Integral(19,27)-nemc->Integral(19,27))/nemc->Integral(19,27)<<"\\%)" << " & "<< ne->Integral() <<"("<<100*(ne->Integral()-nemc->Integral())/nemc->Integral()<<"\\%)" << " \\\\"<<std::endl;
166 std::cout<<"\\hline"<<std::endl;
167 
168 
169 std::cout<<"\\multirow{2}*{$\\nu_e$ From Pion} & Uncorrected &"<< fnuepiunwei->Integral(0,9) <<" & "<< fnuepiunwei->Integral(10, 18)<<" & "<< fnuepiunwei->Integral(19,27)<<" & "<< fnuepiunwei->Integral()<<" \\\\"<<std::endl;
170 
171 std::cout<<" & Corrected & "<< fnuepiweight->Integral(0,9) <<"("<<100*(fnuepiweight->Integral(0,9)-fnuepiunwei->Integral(0,9))/fnuepiunwei->Integral(0,9)<<"\\%)" <<" & "<< fnuepiweight->Integral(10, 18)<<"("<<100*(fnuepiweight->Integral(10,18)-fnuepiunwei->Integral(10,18))/fnuepiunwei->Integral(10,18)<<"\\%)" << " & "<< fnuepiweight->Integral(19,27)<<"("<<100*(fnuepiweight->Integral(19,27)-fnuepiunwei->Integral(19,27))/fnuepiunwei->Integral(19,27)<<"\\%)" <<" & "<< fnuepiweight->Integral()<<"("<<100*(fnuepiweight->Integral()-fnuepiunwei->Integral())/fnuepiunwei->Integral()<<"\\%)" <<" \\\\"<<std::endl;
172 std::cout<<"\\hline"<<std::endl;
173 
174 std::cout<<"\\multirow{2}*{$\\nu_e$ From Kaon} & Uncorrected &"<< fnuekaunwei->Integral(0,9) <<" & "<< fnuekaunwei->Integral(10, 18)<<" & "<< fnuekaunwei->Integral(19,27)<<" & "<< fnuekaunwei->Integral()<<" \\\\"<<std::endl;
175 std::cout<<" & Corrected & "<< fnuekaweight->Integral(0,9) <<"("<<100*(fnuekaweight->Integral(0,9)-fnuekaunwei->Integral(0,9))/fnuekaunwei->Integral(0,9)<<"\\%)" <<" & "<< fnuekaweight->Integral(10, 18)<<"("<<100*(fnuekaweight->Integral(10,18)-fnuekaunwei->Integral(10,18))/fnuekaunwei->Integral(10,18)<<"\\%)" <<" & "<< fnuekaweight->Integral(19,27)<<"("<<100*(fnuekaweight->Integral(19,27)-fnuekaunwei->Integral(19,27))/fnuekaunwei->Integral(19,27)<<"\\%)" <<" & "<< fnuekaweight->Integral()<<"("<<100*(fnuekaweight->Integral()-fnuekaunwei->Integral())/fnuekaunwei->Integral()<<"\\%)" <<" \\\\"<<std::endl;
176 
177 std::cout<<"\\hline"<<std::endl;
178 
179 std::cout<<"\\multirow{2}*{$\\nu_e$ From Other} & Uncorrected &"<< fnueotherunwei->Integral(0,9) <<" & "<< fnueotherunwei->Integral(10, 18)<<" & "<< fnueotherunwei->Integral(19,27)<<" & "<< fnueotherunwei->Integral()<<" \\\\"<<std::endl;
180 
181 std::cout<<" & Corrected & "<< fnueotherweight->Integral(0,9) <<"("<<100*(fnueotherweight->Integral(0,9)-fnueotherunwei->Integral(0,9))/fnueotherunwei->Integral(0,9)<<"\\%)" <<" & "<< fnueotherweight->Integral(10, 18)<<"("<<100*(fnueotherweight->Integral(10,18)-fnueotherunwei->Integral(10,18))/fnueotherunwei->Integral(10,18)<<"\\%)" <<" & "<< fnueotherweight->Integral(19,27)<<"("<<100*(fnueotherweight->Integral(19,27)-fnueotherunwei->Integral(19,27))/fnueotherunwei->Integral(19,27)<<"\\%)" <<" & "<< fnueotherweight->Integral()<<"("<<100*(fnueotherweight->Integral()-fnueotherunwei->Integral())/fnueotherunwei->Integral()<<"\\%)" <<" \\\\"<<std::endl;
182 
183 std::cout<<"\\hline"<<std::endl;
184 
185  gPad->SaveAs((TString)"plots/"+ ananame + "_nueCC_from_All.pdf");
186 
187 // TH1* fnuepiweight = dcmp -> NuePiEstimate().ToTH1(pot);
188 // fnuepiweight->Draw("hist");
189 // gPad->SaveAs((TString)"plots/"+ ananame + "_nueCC_from_Pi_weighted.pdf");
190 
191 // auto nuekaunwei = LoadFromFile<Spectrum>(fname, TString::Format("%s/nueCC_from_ka",ananame.c_str()).Data()).release();
192 // TH1* fnuekaunwei = nuekaunwei->ToTH1(pot);
193  // fnuekaunwei ->Draw("hist");
194 // std::cout<<"nueCC before kaonweight:"<<fnuekaunwei->Integral(0,9)<<" "<< fnuekaunwei->Integral(10,18)<<" total "<< std::endl;
195 // gPad->SaveAs((TString)"plots/"+ ananame + "_nueCC_from_Ka_unweighted.pdf");
196 
197 // TH1* fnuekaweight = dcmp -> NueKaEstimate().ToTH1(pot);
198 // fnuekaweight->Draw("hist");
199 // std::cout<<"nueCC after kaonweight:"<<fnuekaweight->Integral(0,9)<<" "<< fnuekaweight->Integral(10,18)<<std::endl;
200 // gPad->SaveAs((TString)"plots/"+ ananame + "_nueCC_from_Ka_weighted.pdf");
201 
202 }
void Simulation()
Definition: tools.h:16
void Nue2018ThreeBinAxis(THStack *axes, bool drawLabels, bool merged, bool coreOnly)
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.
Definition: Spectrum.cxx:148
std::string fname
Definition: plot_BEN.C:42
const XML_Char const XML_Char * data
Definition: expat.h:268
Spectrum NueComponent() const override
Definition: BENDecomp.cxx:370
void Nue2018ThreeBinDivisions(bool coreOnly, const int color, const int style)
void CenterTitles(TH1 *h)
Spectrum MC_NueComponent() const override
Definition: BENDecomp.cxx:727
OStream cout
Definition: OStream.cxx:6
const std::string path
Definition: plot_BEN.C:43
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const double pot
Definition: plot_BEN.C:40
void rootlogon()
Definition: rootlogon.C:7
void Nue2018ThreeBinLabels(const double yNDC, const double textsize, const int color, const bool nd)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
Spectrum Data_Component() const override
Definition: BENDecomp.cxx:742
void SetPaletteS ( )

Definition at line 26 of file plot_BEN.C.

References rootlogon::blue, rootlogon::green, rootlogon::NCont, rootlogon::NRGBs, and rootlogon::stops.

27 {
28 const Int_t NRGBs = 3;
29 const Int_t NCont = 255;
30 Double_t stops[NRGBs] = { 0.0 , 0.5, 1};
31 Double_t red[NRGBs] = { 1 , 0.6, .2};
32 Double_t green[NRGBs] = { 0.8 , 0.2, .0};
33 Double_t blue[NRGBs] = { 0.8 , 0.2, .0};
34 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
35 gStyle->SetNumberContours(NCont);
36 }
tuple blue
Definition: rootlogon.py:65
int NRGBs
Definition: rootlogon.py:77
int NCont
Definition: rootlogon.py:78

Variable Documentation

std::string fname = "FHCBEN.root"

Definition at line 42 of file plot_BEN.C.

Referenced by plot_BEN(), and PlotPionPlots().

const std::string path = "plots"

Definition at line 43 of file plot_BEN.C.

Referenced by novadaq::LocationUtils::_findFile(), calib::DetRespDrift::beginJob(), calib::MuonTrackHits::beginJob(), BestFit(), slid::ParticleIDAlg::CalcCellPlaneTransverseDedx(), CompareDecompDataMC(), bpfit::dEdxCalculator::computeDEDX(), create_test_file(), geo::GeometryBase::CurrentCellId(), art::Schedule::doForAllEnabledPaths_(), red::MatterProbe::ECalc(), mcmc::ExptPtrs(), calib::CosmicCalib::FillPathLengthInfo(), calib::MakeAttenuationProfiles::FillPathLengthInfo(), trk::CosmicTrackAna::FillRecoInfo(), calib::MuondEdx::filter(), calib::DetRespDrift::filter(), calib::MuonTrackHits::filter(), om::Icons::Find(), TMVA::TMVAGlob::findImage(), bpfit::BreakPoint::FitTracks(), art::RPManager::for_each_RPWorker(), get_file_name(), genie::utils::system::GetAllFilesInPath(), GetAllInputFiles(), jmshower::RecoJMShower::GetCellTransDedx(), GetCosmics(), calib::getCSVFilenameByParsingDirectory(), art::detail::getFilePath(), GetMatrices(), GetNuePredictionFuture(), jmshower::RecoJMShower::GetPlaneDedx(), GetSystsFromFile(), ana::GetMuonID::InitTMVA(), ana::nueccinc::GetElectronID::InitTMVA(), ana::GetBPFMuonID::InitTMVA(), ana::GetBestTrack::InitTMVA(), ana::nueccinc::GetBestProng::InitTMVA(), ana::GetBestBPFTrack::InitTMVA(), ana::nueccinc::GetElectronIDForProng::InitTMVA(), ana::GetPionID::InitTMVAGamma(), ana::GetPionTrack::InitTMVAGamma(), ana::GetGammaIDVal::InitTMVAGamma(), ana::GetPionID::InitTMVAPion(), ana::GetPionTrack::InitTMVAPion(), ana::GetBestPionID::InitTMVAPion(), ana::GetBestPionTrack::InitTMVAPion(), ana::GetPionIDVal::InitTMVAPion(), ana::GetPionID::InitTMVAProton(), ana::GetPionTrack::InitTMVAProton(), ana::GetProtonIDVal::InitTMVAProton(), art::RPManager::invoke(), is_parsable_folder(), load_dk2nu(), LoadCosmic(), LoadCosmicHist(), LoadCovMx(), LoadData(), genie::PDGLibrary::LoadDBase(), LoadExtrapPrediction(), LoadFakeData(), ana::FixGibuuWeight::LoadFluxes(), dbutils::gui::DCSConfigEditorDisplay::loadHVAndTemps(), LoadISysts(), LoadPPFX(), LoadPrediction(), ana::LoadSystematics(), dbutils::gui::DAQConfigEditorDisplay::loadThresholdsAndMasks(), nl::timing::LogFile::LogFile(), main(), make_cm_pullterm_pdf(), make_fc_nus_surfs_nersc_2019(), make_fc_surfaces_2020(), make_fc_surfaces_2020_validation(), make_fc_surfaces_nersc_2018(), make_fc_surfaces_nersc_2019(), make_nue_xsec_pred(), lem::MakePID::MakePID(), MakeSurfaceBinningStudy(), bpfit::ScatteringSurfaces::MakeSurfaces(), red::MatterProbe::mattersum(), MergePredictions(), ana::MuonLLR(), evgen::CORSIKAGen::openDBs(), ana::FixGibuuWeight::operator()(), evdb::PicturePool(), plot_abstree(), PlotPionPlots(), art::TimeTracker::postEndJob(), calib::PCHitsList::ProcessTrack(), calib::PCHitsList::ProcessTrackForBelowThresholdHits(), calib::PCHitsList::ProcessTrackForFLSHits(), calib::PCHitsList::ProcessTrackTrajectory(), bsim::readWeightLocations(), art::HLTGlobalStatus::reset(), RunCalibration(), calib::AttenCache::SetCSVSource(), calib::DriftCache::SetCSVSource(), ana::Loaders::SetLoaderPath(), genie::geometry::PathSegment::SetPath(), setPathsFNALP123b(), setPathsFNALP3c(), ana::TargetCount::SetupGeoManager(), test_pg(), test_pg_count(), GeneralTests::testFindFile(), red::OverburdenCalculator::trace(), and validation_numu_nd().

const double pot =9.47964e20/12

Definition at line 40 of file plot_BEN.C.

Referenced by CompareDecompDataMC(), plot_BEN(), and PlotPionPlots().