Commit 4ac0bd19 authored by Nicolas Nunez Barreto's avatar Nicolas Nunez Barreto
parents 908f4b59 a9499f0b
......@@ -6,7 +6,7 @@ import re
import ast
from scipy.optimize import curve_fit
import os
asdsad
# Solo levanto algunos experimentos
SP_files = [8445, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469]
......@@ -132,6 +132,11 @@ plt.xlim(-0.2, 3)
#%%
"""
Esto mira las curvas SP y les hace ajustes exponenciales a la ultima parte para plotear
el tiempo caracteristico
"""
bkgrvec = Calib_Bins[3][:-1]
Taus = []
......@@ -170,57 +175,51 @@ plt.plot(UVampVec, Offsets,'o')
#%%
"""
Ploteo calibraciones largas
Defino los vectores de las mediciones largas para obtener branching fractions, 25 M de mediciones
"""
plt.figure()
for j in [2,3]:
plt.plot([t*1e6 for t in Calib_Bins[j][:-1]], Calib_Heigths[j])
plt.xlim(-0.2, 2)
Bins_long = [t*1e6 for t in Long_Bins[0][:-1]]
DP_long_raw = Long_Heigths[3] #la 0 y la 2 salieron mal pero las dejo por las dudas. uso la 3
SP_long_raw = Long_Heigths[1]
DP_bkg_long_raw = Calib_Heigths[2] #calibracion del DP, esta al final ni la uso
SP_bkg_long_raw = Calib_Heigths[3] #calibracion del SP
#%%
"""
Ploteo las mediciones largas
"""
Bins_long = [t*1e6 for t in Long_Bins[0][:-1]]
DP_long_raw = Long_Heigths[2] #la 0 salio mal
SP_long_raw = Long_Heigths[1]
DP_bkg_long_raw = Calib_Heigths[2]
SP_bkg_long_raw = Calib_Heigths[3]
#%%
plt.figure()
#plt.plot(Bins_long, SP_long_raw)
plt.plot(Bins_long, DP_long_raw)
plt.plot(Bins_long, SP_long_raw)
plt.plot(Bins_long[0:475], DP_long_raw)
plt.xlim(-1, 2)
#%%
"""
aca se plotea la SP con su curva de calibracion sin ion para restar
"""
plt.figure()
plt.plot(Bins_long, SP_long_raw)
plt.plot(Bins_long, SP_bkg_long_raw)
plt.xlim(-1, 2)
#%%
#Raw
plt.figure()
plt.plot(Bins_long, DP_long_raw)
plt.plot(Bins_long, SP_long_raw)
plt.xlim(-0.2, 2)
"""
Restamos el fondo a ambas curvas. A la DP le restamos un promedio de la curva con el ion
apagado porque en ningun momento esta prendido el UV
"""
#Pruebo restar background directamente
DP_long_subs = [DP_long_raw[j]-DP_bkg_long_raw[j] for j in range(len(DP_long_raw))]
#DP_long_subs = [DP_long_raw[j]-DP_bkg_long_raw[j] for j in range(len(DP_long_raw))]
DP_long_subs = [d-np.mean(DP_long_raw[-100:]) for d in DP_long_raw]
SP_long_subs = [SP_long_raw[j]-SP_bkg_long_raw[j] for j in range(len(SP_long_raw))]
#%%
plt.figure()
plt.plot(Bins_long, DP_long_subs)
plt.plot(Bins_long, SP_long_subs)
plt.xlim(-0.2, 2)
plt.plot([b+0.25 for b in Bins_long[0:475]], DP_long_subs)
#plt.plot(Bins_long, SP_long_subs)
#plt.xlim(-0.2, 2)
plt.grid()
......
......@@ -8,7 +8,7 @@ from scipy.optimize import curve_fit
import os
import scipy.stats as sts
# Solo levanto algunos experimentos
Stat_files = [8731]
Stat_files = [8731, 8738, 8745]
def expo(T, tau, N0, C):
global T0
......@@ -53,11 +53,19 @@ for i, fname in enumerate(Stat_files):
#plt.figure()
#plt.plot(Stat_Bins[0][:-1], Stat_Heigths[0])
bins = np.arange(100,350, 1)
bins1 = np.arange(100,350, 1)
bins2 = np.arange(10,50,1)
bins3 = np.arange(30,100,1)
plt.figure()
plt.hist(Stat_Heigths[0], bins=bins, histtype='step',density = True)
plt.hist(Stat_Heigths[0], bins=bins1, histtype='step',density = True)
#plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True)
plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True)
#plt.hist(Stat_Heigths[3], bins=bins2, histtype='step',density = True)
#plt.hist(Stat_Heigths[4], bins=bins2, histtype='step',density = True)
plt.hist(Stat_Heigths[2], bins=bins3, histtype='step',density = True)
#%%
poisson = sts.poisson.pmf(bins,np.mean(Stat_Heigths))
plt.plot(bins+0.5,poisson)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment