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