2 from array
import array
4 ROOT.TGaxis.SetMaxDigits(3)
6 plotvars = [
"flux",
"wrongsign"]
9 canvas = ROOT.TCanvas(
"canvas",
"canvas");
16 f_1 = ROOT.TFile(
"/dune/data/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017/neutrino/flux//histos_g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_neutrino_LBNEFD_fastmc.root")
24 if plotvar=="wrongsign": 25 f_1 = ROOT.TFile("/dune/data/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/NuMI_Opt_2015CDR_80GeV/antineutrino/flux//histos_g4lbne_v3r5p4_QGSP_BERT_NuMI_Opt_2015CDR_80GeV_antineutrino_LBNEFD_fastmc.root") 26 f_2 = ROOT.TFile("/dune/data2/users/ljf26/fluxfiles/g4lbne/v3r3p7/QGSP_BERT/NuMI_Opt_2015CDR_Be_80GeV_WideDecayPipe/antineutrino/flux//histos_g4lbne_v3r3p7_QGSP_BERT_NuMI_Opt_2015CDR_Be_80GeV_WideDecayPipe_antineutrino_LBNEFD_fastmc.root") 27 f_3 = ROOT.TFile("/dune/data2/users/ljf26/fluxfiles/g4lbne/v3r3p7/QGSP_BERT/NuMI_Opt_2015CDR_Be_80GeV_LongDecayPipe/antineutrino/flux//histos_g4lbne_v3r3p7_QGSP_BERT_NuMI_Opt_2015CDR_Be_80GeV_LongDecayPipe_antineutrino_LBNEFD_fastmc.root") 28 f_4 = ROOT.TFile("/dune/data/users/ljf26/fluxfiles/g4lbne/v3r3p6/QGSP_BERT/CP_run5_9116_80GeV/antineutrino/flux//histos_g4lbne_v3r3p6_QGSP_BERT_CP_run5_9116_80GeV_antineutrino_LBNEFD_fastmc.root") 29 f_5 = ROOT.TFile("/dune/data/users/ljf26/fluxfiles/g4lbne/v3r3p6/QGSP_BERT/CP_run5_9116_80GeV_LongDecayPipe/antineutrino/flux//histos_g4lbne_v3r3p6_QGSP_BERT_CP_run5_9116_80GeV_LongDecayPipe_antineutrino_LBNEFD_fastmc.root") 30 f_6 = ROOT.TFile("/dune/data/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/Perfect_80GeV_LongDecayPipe/antineutrino/flux//histos_g4lbne_v3r3p6_QGSP_BERT_Perfect_80GeV_LongDecayPipe_antineutrino_LBNEFD_fastmc.root") 33 histo_title =
"numu_flux" 35 h_1 = f_1.Get(histo_title)
42 if(plotvar==
"flux" or plotvar==
"wrongsign"):
46 newbins.append((i+1)*0.125)
54 h_1 = h_1.Rebin(len(newbins)-1,
"1_flux",
array(
'd',newbins))
70 scale_factor_120GeV = 1.1e21
71 scale_factor_80GeV = 1.47e21
72 scale_factor_60GeV = 1.89e21
74 h_1.Scale(scale_factor_120GeV);
82 y_title =
"Unoscillated #nu_{#mu}s / GeV / m^{2} / Year" 83 h_1.GetYaxis().SetTitle(y_title);
90 h_1.GetXaxis().SetTitle(
"Neutrino Energy (GeV)")
101 a_title =
"#nu_{#mu} Flux, #nu Mode, Far Detector" 102 if(plotvar==
"wrongsign"):
103 a_title =
"#nu_{#mu} Flux, #bar{#nu} Mode" 104 ROOT.gStyle.SetTitleY(0.93);
105 ROOT.gStyle.SetTitleFont(42,
"t");
107 h_1.SetTitle(a_title);
115 plot_max = h_1.GetMaximum()*1.2
121 histo.GetXaxis().CenterTitle()
122 histo.GetYaxis().CenterTitle()
123 histo.SetMaximum(plot_max)
125 h_1.DrawCopy(
"hist");
128 ROOT.gStyle.SetOptTitle(1)
131 title = ROOT.gPad.GetPrimitive(
"title");
132 title.SetBorderSize(0);
140 h_1.DrawCopy(
"histsame");
145 leg = ROOT.TLegend(0.5,0.6,0.9,0.9);
151 leg.AddEntry(h_1,
"DUNE Flux (Nov 2017)",
"l");
156 ROOT.gPad.RedrawAxis()
160 if not plotvar=="flux": 161 latex = ROOT.TLatex() 162 latex.SetTextSize(0.07); 163 latex.SetTextColor(14) 165 latex.DrawLatex(.2,.3,"PLACEHOLDER PLOT"); 168 canvas.Print(
"DUNE_Numu_Flux_Nov2017.eps")
169 canvas.Print(
"DUNE_Numu_Flux_Nov2017.pdg")
170 canvas.Print(
"DUNE_Numu_Flux_Nov2017.png")
auto array(Array const &a)
Returns a manipulator which will print the specified array.