# Reading Delphes file in the ProMC format using ScaVis http://jwork.org/scavis # S.Chekanov (ANL) from java.io import * from java.awt import * from promc.io import * from proto import * # import FileMC from jhplot import * # import ScaVis graphics file = FileMC("herwigpp_ttbar_mu0.promc") version=file.getVersion() print "ProMC version=",version header = file.getHeader() unit=float(header.getMomentumUnit()) lunit=float(header.getLengthUnit()) print "Momentum unit=",unit print "Length unit=",lunit h1= H1D("PT (ele)",50,0,1000) # create a histogram print "File size=",file.size() for i in range(file.size()): if (i%1000==0): print "Event=",i entry = file.read(i) jets = entry.getJets() # get jets for j in range(jets.getPTCount()): h1.fill(jets.getPT(j)/unit) c1 = HPlot("Canvas",600,400) # plot histogram c1.visible() c1.setAutoRange() c1.draw(h1) c1.export("jetpt.pdf") # create PDF file