00001
00002 from PhysicsTools.PythonAnalysis import *
00003 from ROOT import *
00004
00005
00006 events = EventTree("simevent.root")
00007
00008
00009 histo = TH1F("tofhits", "Tof of hits", 100, -0.5, 50)
00010
00011
00012 for event in events:
00013 simHits = event.getProduct("PSimHit_r_TrackerHitsTIBLowTof.obj")
00014 for hit in simHits:
00015 histo.Fill(hit.timeOfFlight())
00016
00017 hFile = TFile("histo.root", "RECREATE")
00018 histo.Write()
00019
00020 gROOT.SetBatch()
00021 gROOT.SetStyle("Plain")
00022
00023 c = TCanvas()
00024 histo.Draw()
00025 c.SaveAs("tofhits.jpg")