2 from array
import array
4 ROOT.TGaxis.SetMaxDigits(3)
7 canvas = ROOT.TCanvas(
"canvas",
"canvas");
9 f_1 = ROOT.TFile(
"/pnfs/dune/persistent/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017/neutrino/flux/dk2nu/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_neutrino_00250.dk2nu.root");
11 tree = f_1.Get(
"dk2nuTree");
15 ROOT.gStyle.SetOptStat(0)
17 myhist = ROOT.TH1D(
"",
"myhist",20,0,10);
18 tree.Draw(
"360/(2*pi)*acos(ancestor.startpz[1]/sqrt(ancestor.startpx[1]*ancestor.startpx[1]+ancestor.startpy[1]*ancestor[1].startpy[1]+ancestor.startpz[1]*ancestor.startpz[1]))>>myhist",
"decay.nimpwt*nuray.wgt[1]");
21 myhist.GetXaxis().SetTitle(
"Angle WRT Beam Axis (Degrees)")
22 myhist.GetYaxis().SetTitle(
"Number of Particles / 0.5 Degree")
26 myhist2 = ROOT.TH2D(
"myhist2",
"",500,-1000,1000,500,-1000,1000);
28 tree.Draw(
"ancestor.startx+(2100-ancestor.startz)*ancestor.startpx/ancestor.startpz:ancestor.starty+(2100-ancestor.startz)*ancestor.startpy/ancestor.startpz>>myhist2",
"decay.nimpwt*nuray.wgt[1]*ancestor.startz<2100")
30 myhist2.GetXaxis().SetTitle(
"X position (cm) at z = 21 cm")
31 myhist2.GetYaxis().SetTitle(
"Y position (cm) at z = 21 cm")
36 myhist3 = ROOT.TH1D(
"myhist3",
"",50,-100,100);
37 tree.Draw(
"ancestor.startx+(2100-ancestor.startz)*ancestor.startpx/ancestor.startpz>>myhist3",
"decay.nimpwt*nuray.wgt[1]*ancestor.startz<21000")
39 myhist3.GetXaxis().SetTitle(
"X position (cm) at z = 21 cm")
41 canvas.Print(
"test.eps");
42 canvas.Print(
"test.png");