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