16filename = ROOT.gROOT.GetTutorialDir().Data() +
"/dataframe/df017_vecOpsHEP.root"
18RDF = ROOT.ROOT.RDataFrame
21 f = ROOT.TFile(filename)
22 h = ROOT.TH1F(
"pt",
"pt", 16, 0, 4)
23 for event
in f.myDataset:
24 for E, px, py
in zip(event.E, event.px, event.py):
26 h.Fill(
sqrt(px*px + py*py))
29def WithRDataFrameVecOpsJit():
30 f = RDF(treename, filename)
31 h = f.Define(
"good_pt",
"sqrt(px*px + py*py)[E>100]")\
32 .Histo1D((
"pt",
"pt", 16, 0, 4),
"good_pt")
42WithRDataFrameVecOpsJit()