from java.lang import * from proto import FileMC # import FileMC from jhplot import * # import DatMelt graphics from hephysics.particle import LParticle EventToLook=10 # event to look at h1= H2D("PT(stable)", 20,0.0,6.5,20,-4.0,4.0) # create a 2D histogram flist=["pythia100qcd_001.promc"] # list with files file=FileMC(flist[0]) header = file.getHeader() un=float(header.getMomentumUnit()) # conversion units lunit=float(header.getLengthUnit()) eve = file.read(EventToLook) pa = eve.getParticles() # particle information pi2=2*3.14 for j in range(pa.getPxCount()): if (pa.getStatus(j)==1): p=LParticle(pa.getPx(j)/un,pa.getPy(j)/un,pa.getPz(j)/un,pa.getEnergy(j)/un,pa.getMass(j)/un) pt=p.perp() phi=p.phi() eta=p.getEta() e=p.e() if (phi<0): phi=pi2+phi if (pt>0.4 and abs(eta)<4): h1.fill(phi,eta,e) c1 = HPlot3D("HepSim",600,600) # plot histogram c1.setColorMode(1) c1.visible(1) c1.setBars() c1.setBoxed(0) c1.setNameX("φ [rad]") c1.setNameY("η") c1.setNameZ("E") c1.draw(h1)