Update alpha/beta fitting with regional fitting
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
+7
-4
@@ -72,23 +72,26 @@ def parameterization():
|
||||
c.SetTopMargin(0.05)
|
||||
c.SetRightMargin(0.05)
|
||||
|
||||
### using regional fitting from 0.2 to arr_t[0] - 0.2
|
||||
### 0.2 is to avoid the too sharp rise edge at the beginning for low-energy X-rays, where the statistics is low and the fitting is not stable. (Low propability given the shorter attenuation length for low-energy X-rays.)
|
||||
### arr_t[0] - 0.2 is to avoid the drop at the end for high-energy X-rays due to the absorption of holes by the anode for the intial strong repuslsion effect. (Low propability given the longer attenuation length for high-energy X-rays.)
|
||||
global gr_AlphaT, gr_BetaT
|
||||
pad2 = c.cd(1)
|
||||
gr_AlphaT = TGraphErrors(len(arr_z0), arr_t, arr_alpha, array('d', np.zeros(len(arr_z0))), arr_alphaUncert)
|
||||
gr_AlphaT.SetTitle(';Approximated Drift Time [ns];#alpha')
|
||||
func_alpha = TF1('func_alpha', '[0] + [1] * sqrt((x)) + [2] * x + [3] * x^2')
|
||||
func_alpha = TF1('func_alpha', '[0] + [1] * sqrt((x)) + [2] * x + [3] * x^2', 0.2, arr_t[0] - 0.2)
|
||||
func_alpha.SetLineColor(kRed+1)
|
||||
gr_AlphaT.Fit(func_alpha, '')
|
||||
gr_AlphaT.Fit(func_alpha, 'R')
|
||||
# set fit line color
|
||||
gr_AlphaT.Draw()
|
||||
print(f'Alpha fitting chi2/NDF = {func_alpha.GetChisquare()/func_alpha.GetNDF()}')
|
||||
|
||||
c.cd(2)
|
||||
gr_BetaT = TGraphErrors(len(arr_z0), arr_t, arr_beta, array('d', np.zeros(len(arr_z0))), arr_betaUncert)
|
||||
func_betaT = TF1('func_betaT', '[0]*(x-[1])^[2]+ [3]*exp([4]*x) + 2')
|
||||
func_betaT = TF1('func_betaT', '[0]*(x-[1])^[2]+ [3]*exp([4]*x) + 2', 0.2, arr_t[0] - 0.2)
|
||||
func_betaT.SetParameters(1.3, -4, -0.4, -0.6, -4.)
|
||||
func_betaT.SetLineColor(kRed+1)
|
||||
gr_BetaT.Fit(func_betaT, '')
|
||||
gr_BetaT.Fit(func_betaT, 'R')
|
||||
gr_BetaT.SetTitle(';Approximated Drift Time [ns];#beta')
|
||||
gr_BetaT.Draw()
|
||||
print(f'Beta fitting chi2/NDF = {func_betaT.GetChisquare()/func_betaT.GetNDF()}')
|
||||
|
||||
Reference in New Issue
Block a user