I tried to use MakeClass for some data analysis but I had some problem with the vectors lorentz which can’t be generated automatically so I m trying to do it in pyroot that I used only when I was summer student, so I am not very comfortable with.
For instance here is my little pyroot script:
#!/usr/bin/python import ROOT from math import * from ROOT import* from glob import glob from ROOT import gROOT, TCanvas, TF2 gROOT.Reset() f=ROOT.TFile("run8TeV.0.txt.root") f1 = ROOT.TFile("myclass.root", "recreate") #c1 = TCanvas( 'c1', 'Example with Formula', 200, 10, 700, 500 ) h = TProfile("eOpinHisto","eOpin vs eta 1RG",60,-0.441,0.,0.,1.2) #h = TH1D("eOpinHisto","eOpin vs eta 1RG",60,0,1.2) for e in f.redTree: # h.Fill(e.electron0_p4.eta()) A =e.electron0_p4.e()/sqrt(pow(e.electron0_p4In.px(),2)+pow(e.electron0_p4In.py(),2)+pow(e.electron0_p4In.pz(),2)) B =e.electron0_p4.eta() h.Fill(A,B) # print e.electron0_p4.eta() h.Draw() h.Write() f1.Close() #c1.Update()
With this script I get the plot pyroot.pdf I attached where I expected the root.pdf attached obtained by doing:
So I would really appreciate if someone could tell me why I get this numbers of entries reduced please, it seems that the negatif part of the plot obtained with the pyroot script is empty and I don’t know why.
Thanks in advance.
pyroot.pdf (13.9 KB)
root.pdf (16.3 KB)