Trees in Root - Python


import ROOT

f=ROOT.TFile.Open("http://www.etp.physik.uni-muenchen.de/kurs/comp10/uebungen/Z0-Versuch/data/ntz0mhmc.root")
mytree = ROOT.gROOT.FindObject("h5000") # get access to tree
mytree.Print()
mytree.Scan() #  zeigt Variablen 
mytree.Draw("Ncharged")   # fuellt 1D Histogramm mit Variable Ncharged (automatische Histo Erzeugung)
mytree.Draw("N_ecal:Ncharged")   # fuellt 2D Histogramm mit Variable Ncharged vs N_ecal
h1 = ROOT.TH1F("nc","N Tracks", 50, 0, 50) #  Buche 1d Histo
mytree.Draw("Ncharged>>nc")  # fuellt 1D Histogramm mit Variable Ncharged in gebuchtes Histo
mytree.Draw("Ncharged","E_ecal>10") #  fuellt 1D Histogramm mit Variable Ncharged wenn Cut erfuellt ist




GDuckeck 2018-04-10