import ROOT ROOT.gROOT.ProcessLine(".x rootlogon.C") ROOT.gROOT.ProcessLine('gROOT->SetStyle("Plain")') #set_palette() rfile=ROOT.TFile("outfiles/tmpana/Cosmics_FopiMC_86ar85_1.raw.root","read") tree=rfile.Get("cbmsim") tree.SetBranchStatus("*",0) tree.SetBranchStatus("TpcPrimaryCluster.*",1) tree.SetBranchStatus('TpcDriftedElectron.*',1) hdiffX=ROOT.TH1D("hdiffX","elec - prim X",200,-0.2,0.2) for e in tree: for elec in e.TpcDriftedElectron: primID=elec.primClustId() prim=e.TpcPrimaryCluster.At(primID) diff=elec.x()-prim.x() hdiffX.Fill(diff) hdiffX.Draw() u=raw_input("done?")