First import the ROOT Python module.
Welcome to JupyROOT 6.07/07
Open a file which is located on the web. No type is to be specified for "f".
f = ROOT.TFile.Open("https://root.cern.ch/files/summer_student_tutorial_tracks.root");
Loop over the TTree called "events" in the file. It is accessed with the dot operator. Same holds for the access to the branches: no need to set them up - they are just accessed by name, again with the dot operator.
h = ROOT.TH1F("TracksPt","Tracks;Pt [GeV/c];#",128,0,64) for event in f.events: for track in event.tracks: h.Fill(track.Pt()) c = ROOT.TCanvas() h.Draw() c.Draw()