import numpy as np from matplotlib import pyplot as plt import sys import lhe_reader_mod #arr=np.loadtxt("test3_events3.txt") arr = lhe_reader_mod.read("run5_events.lhe") arr = arr.reshape(arr.shape[0]/4, 4, arr.shape[1]) #particles - decay with PT_H, one line too much in file h = arr[:,0,:] b = arr[:,2,:] bb = arr[:,3,:] #transverse momentum (beam axis : z) PT_H = np.sqrt((h[:,0:2]**2).sum(axis=1)) PT_b = np.sqrt((b[:,0:2]**2).sum(axis=1)) PT_bb = np.sqrt((bb[:,0:2]**2).sum(axis=1)) #Theta TH_H = np.arccos(h[:,2]/np.sqrt((h[:,0:3]**2).sum(axis=1))) TH_b = np.arccos(b[:,2]/np.sqrt((b[:,0:3]**2).sum(axis=1))) TH_bb = np.arccos(bb[:,2]/np.sqrt((bb[:,0:3]**2).sum(axis=1))) #Eta Et_H = -np.log(np.tan(TH_H/2)) Et_b = -np.log(np.tan(TH_b/2)) Et_bb = -np.log(np.tan(TH_bb/2)) #Phi Phi_H = np.arcsin(h[:,1]/(np.sqrt((h[:,0:3]**2).sum(axis=1))*np.sin(TH_H)))
import numpy as np from matplotlib import pyplot as plt import sys #import lhe_reader_mod_yotam import lhe_reader_mod from matplotlib.font_manager import FontProperties #arr = lhe_reader_mod.read("unweighted_events_LHC.lhe") arr = lhe_reader_mod.read("events_10E4.lhe") #arr = lhe_reader_mod_yotam.read("pythia_events_yotam.lhe") arr = arr.reshape(arr.shape[0]/4, 4, arr.shape[1]) #particles - decay with PT_H, one line too much in file h = arr[:,0,:] b = arr[:,2,:] bb = arr[:,3,:] print h.shape #select events that have been selected by fastjet #event = np.loadtxt('eventnb.txt', dtype=(int)) #event = np.loadtxt('eventnb10t.txt', dtype=(int)) #h=h[event,:] #b=b[event,:] #bb=bb[event,:] #select only first events h=h[:1000,:] b=b[:1000,:] bb=bb[:1000,:] #h=h[:250,:] #b=b[:250,:]
import numpy as np from matplotlib import pyplot as plt import sys import lhe_reader_mod from matplotlib.font_manager import FontProperties # arr = lhe_reader_mod.read("unweighted_events_LHC.lhe") arr = lhe_reader_mod.read("unweighted_events.lhe") arr = arr.reshape(arr.shape[0] / 4, 4, arr.shape[1]) # particles - decay with PT_H, one line too much in file h = arr[:, 0, :] b = arr[:, 2, :] bb = arr[:, 3, :] P_H = h[:, 0:3] P_Hx = P_H[:, 0] P_Hy = P_H[:, 1] P_Hz = P_H[:, 2] P_b = b[:, 0:3] P_bx = P_b[:, 0] P_by = P_b[:, 1] P_bz = P_b[:, 2] P_bb = bb[:, 0:3] P_bbx = P_bb[:, 0] P_bby = P_bb[:, 1] P_bbz = P_bb[:, 2] # transverse momentum (beam axis : z)