t = [] c1 = [] c2 = [] for i in range(0, 3): #filename=u'/home/amcvea/Documents/ketek_data/BGOxLYSO_10_03_2017/20171003-bgo-ketek-lyso-hamamatsu-29.0mV-55.5mV-20uCi-120mV-trigger-side-setup-amplifier-%d.root' %(i) #filename=u'/home/amcvea/Documents/ketek_data/BGO_Energy_Res/20170925-bgo-ketek-33.5V-20uCi-150ns-delay-5mV-trigger-side-setup-%d.root' %(i) #filename=u'/home/amcvea/Documents/ketek_data/BGO_Energy_Res/20171002-15mm-bgo-ketek-29.0mV-20uCi-5mV-trigger-side-setup-amplifier-%d.root' %(i) #filename=u'/home/amcvea/Documents/ketek_data/BGO_Hamamatsu_Energy_Res/20171005-bgo-hamamatsu-29.0mV-57.5mV-20uCi-5mV-trigger-side-setup-amplifier-%d.root' %(i) #filename=u'/home/amcvea/Documents/ketek_data/BGO_Hamamatsu_Energy_Res/20171005-bgo-hamamatsu-29.0mV-57.75mV-20uCi-5mV-trigger-side-setup-amplifier-%d.root' %(i) #filename=u'/home/amcvea/Documents/ketek_data/BGO_Hamamatsu_Energy_Res/20171005-bgo-hamamatsu-29.0mV-58.0mV-20uCi-5mV-trigger-side-setup-amplifier-%d.root' %(i) filename = u'/home/amcvea/Documents/ketek_data/BGO_Hamamatsu_Energy_Res/20171009-bgo-hamamatsu-58.5mV-20uCi-5mV-trigger-inverted-amplifier-%d.root' % ( i) t_1, c1_1, c2_1, c3_1, c4_1 = readROOT(filename, '2.5G') t.extend(t_1) #c1.extend(c1_1) c2.extend(c1_1) #c1 = scipy.signal.medfilt(c1,kernel_size=9) c2 = scipy.signal.medfilt(c2, kernel_size=9) #base1 = baseline(c1) base2 = baseline(c2) #amp1 = [] amp2 = [] #y1 = [] y2 = [] timing = []
time.append(t[i][j]) break return time def fitfunc(p, x): return p[0] / (np.sqrt(2 * np.pi)) * np.exp(-((x - p[1])**2) / (2 * p[2]**2)) def residual(p, x, y, dy): return (fitfunc(p, x) - y) / dy filename = u'/home/amcvea/Documents/ketek_data/20170721-b2210-30.0V-73.5V-coin-ketex-0.root' t, c1, c2, c3, c4 = readROOT(filename, '2.5G') #t1 = cfd(t,c1,0.1) #t2 = cfd(t,c2,0.1) t1 = led(t, c1, -5) t2 = led(t, c2, -5) t_diff = np.subtract(t1, t2) y = [] for k in range(0, 1000): if np.abs(t_diff[k]) < 3: y.append(t_diff[k]) largest = np.ceil(np.max(y))