TDCRPy 2.1.0__py3-none-any.whl → 2.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tdcrpy/TDCRPy.py +88 -22
- tdcrpy/TDCR_model_lib.py +159 -2
- {TDCRPy-2.1.0.dist-info → tdcrpy-2.4.0.dist-info}/METADATA +14 -2
- {TDCRPy-2.1.0.dist-info → tdcrpy-2.4.0.dist-info}/RECORD +7 -7
- {TDCRPy-2.1.0.dist-info → tdcrpy-2.4.0.dist-info}/WHEEL +1 -1
- {TDCRPy-2.1.0.dist-info → tdcrpy-2.4.0.dist-info/licenses}/LICENCE.md +0 -0
- {TDCRPy-2.1.0.dist-info → tdcrpy-2.4.0.dist-info}/top_level.txt +0 -0
tdcrpy/TDCRPy.py
CHANGED
|
@@ -84,7 +84,7 @@ def relaxAtom(daughter_relax,particle_vec,energy_vec,rad,Display=False,uncData=F
|
|
|
84
84
|
relaxation = False
|
|
85
85
|
return particle_vec, energy_vec
|
|
86
86
|
|
|
87
|
-
def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smodel=True, record = False, readRecHist = False, uncData=False):
|
|
87
|
+
def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smodel=True, record = False, readRecHist = False, uncData = False, fullMC = False):
|
|
88
88
|
"""
|
|
89
89
|
This is the main function of the TDCRPy package.
|
|
90
90
|
The computation is made for a given solution containing a radionuclide (or a mixture of radionuclides), a given volume of scintillator V and a given Birks constant kB.
|
|
@@ -254,7 +254,10 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
254
254
|
if decay != decaym:
|
|
255
255
|
if decay>0:
|
|
256
256
|
# print(decay-1,e_quenching,e_quenching2, evenement)
|
|
257
|
-
|
|
257
|
+
if fullMC:
|
|
258
|
+
efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2 = tl.detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime)
|
|
259
|
+
else:
|
|
260
|
+
efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2 = tl.detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime)
|
|
258
261
|
efficiency_S.append(efficiency0_S)
|
|
259
262
|
efficiency_T.append(efficiency0_T)
|
|
260
263
|
efficiency_D.append(efficiency0_D)
|
|
@@ -281,8 +284,11 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
281
284
|
e_quenching2.append(energy)
|
|
282
285
|
else:
|
|
283
286
|
e_quenching.append(energy)
|
|
284
|
-
|
|
285
|
-
|
|
287
|
+
|
|
288
|
+
if fullMC:
|
|
289
|
+
efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2 = tl.detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime)
|
|
290
|
+
else:
|
|
291
|
+
efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2 = tl.detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime)
|
|
286
292
|
efficiency_S.append(efficiency0_S)
|
|
287
293
|
efficiency_T.append(efficiency0_T)
|
|
288
294
|
efficiency_D.append(efficiency0_D)
|
|
@@ -691,7 +697,7 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
691
697
|
|
|
692
698
|
if p == "electron" or ("Auger" in p): col1 = "1"
|
|
693
699
|
elif p == "gamma" or ("X" in p): col1 = "2"
|
|
694
|
-
elif p == "
|
|
700
|
+
elif p == "positron": col1 = "3"
|
|
695
701
|
elif p == "alpha": col1 = "4"
|
|
696
702
|
else: writeOn = False
|
|
697
703
|
|
|
@@ -709,7 +715,7 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
709
715
|
|
|
710
716
|
if p == "electron" or ("Auger" in p): col1 = "1"
|
|
711
717
|
elif p == "gamma" or ("X" in p): col1 = "2"
|
|
712
|
-
elif p == "
|
|
718
|
+
elif p == "positron": col1 = "3"
|
|
713
719
|
elif p == "alpha": col1 = "4"
|
|
714
720
|
else: writeOn = False
|
|
715
721
|
|
|
@@ -825,7 +831,7 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
825
831
|
|
|
826
832
|
if p == "electron" or ("Auger" in p): col1 = "1"
|
|
827
833
|
elif p == "gamma" or ("X" in p): col1 = "2"
|
|
828
|
-
elif p == "
|
|
834
|
+
elif p == "positron": col1 = "3"
|
|
829
835
|
elif p == "alpha": col1 = "4"
|
|
830
836
|
else: writeOn = False
|
|
831
837
|
|
|
@@ -843,7 +849,7 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
843
849
|
|
|
844
850
|
if p == "electron" or ("Auger" in p): col1 = "1"
|
|
845
851
|
elif p == "gamma" or ("X" in p): col1 = "2"
|
|
846
|
-
elif p == "
|
|
852
|
+
elif p == "positron": col1 = "3"
|
|
847
853
|
elif p == "alpha": col1 = "4"
|
|
848
854
|
else: writeOn = False
|
|
849
855
|
|
|
@@ -911,7 +917,7 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
911
917
|
|
|
912
918
|
if p == "electron" or ("Auger" in p): col1 = "1"
|
|
913
919
|
elif p == "gamma" or ("X" in p): col1 = "2"
|
|
914
|
-
elif p == "
|
|
920
|
+
elif p == "positron": col1 = "3"
|
|
915
921
|
elif p == "alpha": col1 = "4"
|
|
916
922
|
else: writeOn = False
|
|
917
923
|
|
|
@@ -929,7 +935,7 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
929
935
|
|
|
930
936
|
if p == "electron" or ("Auger" in p): col1 = "1"
|
|
931
937
|
elif p == "gamma" or ("X" in p): col1 = "2"
|
|
932
|
-
elif p == "
|
|
938
|
+
elif p == "positron": col1 = "3"
|
|
933
939
|
elif p == "alpha": col1 = "4"
|
|
934
940
|
else: writeOn = False
|
|
935
941
|
|
|
@@ -949,7 +955,10 @@ def TDCRPy(L, Rad, pmf_1, N, kB, V, mode="eff", Display=False, barp=False, Smode
|
|
|
949
955
|
====================
|
|
950
956
|
'''
|
|
951
957
|
if evenement == 1: e_quenching2 = 0; t1=0
|
|
952
|
-
|
|
958
|
+
if fullMC:
|
|
959
|
+
efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2 = tl.detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime)
|
|
960
|
+
else:
|
|
961
|
+
efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2 = tl.detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime)
|
|
953
962
|
efficiency_S.append(efficiency0_S)
|
|
954
963
|
efficiency_T.append(efficiency0_T)
|
|
955
964
|
efficiency_D.append(efficiency0_D)
|
|
@@ -1137,7 +1146,7 @@ def effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7, disp=False):
|
|
|
1137
1146
|
Parameters
|
|
1138
1147
|
----------
|
|
1139
1148
|
TD : float or tuple
|
|
1140
|
-
measurements. If TD is float, then TD is the measured TDCR parameter. If TD is tuple, then TD must contain the global TDCR parameter followed by specific ones (T/
|
|
1149
|
+
measurements. If TD is float, then TD is the measured TDCR parameter. If TD is tuple, then TD must contain the global TDCR parameter followed by specific ones (T/D, T/AB, T/BC, T/AC)
|
|
1141
1150
|
Rad : string
|
|
1142
1151
|
List of radionuclides (eg. "H-3, Co-60").
|
|
1143
1152
|
pmf_1 : string
|
|
@@ -1226,18 +1235,74 @@ def effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7, disp=False):
|
|
|
1226
1235
|
|
|
1227
1236
|
|
|
1228
1237
|
|
|
1238
|
+
# mode = "eff" # ask for efficiency calculation
|
|
1239
|
+
# Rad="Na-22" # radionuclides
|
|
1240
|
+
# pmf_1="1" # relatives fractions of the radionulides
|
|
1241
|
+
# N = 1000 # number of Monte Carlo trials
|
|
1242
|
+
# kB =1.0e-5 # Birks constant in cm keV-1
|
|
1243
|
+
# V = 10 # volume of scintillator in mL
|
|
1244
|
+
# L=np.logspace(-3,2,num=100) # free parameter in keV-1
|
|
1245
|
+
|
|
1246
|
+
# # TDCRPy(1, Rad, pmf_1, 10, kB, V, mode, Display= True, barp=False, record=True)
|
|
1247
|
+
# # Record decay histories in temporary files
|
|
1248
|
+
# TDCRPy(L[0], Rad, pmf_1, N, kB, V, mode, barp=False, record=True)
|
|
1249
|
+
|
|
1250
|
+
# effS, u_effS, effD, u_effD, effT, u_effT, effD2, u_effD2 = [], [],[], [],[], [], [], []
|
|
1251
|
+
# for l in tqdm(L, desc="free parameters ", unit=" iterations"):
|
|
1252
|
+
# out = TDCRPy(l, Rad, pmf_1, N, kB, V, mode, readRecHist=True)
|
|
1253
|
+
# effS.append(out[2])
|
|
1254
|
+
# u_effS.append(out[3])
|
|
1255
|
+
# effD.append(out[2])
|
|
1256
|
+
# u_effD.append(out[3])
|
|
1257
|
+
# effT.append(out[4])
|
|
1258
|
+
# u_effT.append(out[5])
|
|
1259
|
+
# effD2.append(out[12])
|
|
1260
|
+
# u_effD2.append(out[13])
|
|
1261
|
+
|
|
1262
|
+
# effS=np.asarray(effS)
|
|
1263
|
+
# effT=np.asarray(effT)
|
|
1264
|
+
# effD=np.asarray(effD)
|
|
1265
|
+
# effD2=np.asarray(effD2)
|
|
1266
|
+
# u_effS=np.asarray(u_effS)
|
|
1267
|
+
# u_effT=np.asarray(u_effT)
|
|
1268
|
+
# u_effD=np.asarray(u_effD)
|
|
1269
|
+
# u_effD2=np.asarray(u_effD2)
|
|
1270
|
+
|
|
1271
|
+
# tdcr=effT/effD
|
|
1272
|
+
# u_tdcr=np.sqrt(u_effD**2*effT**2/effD**4+u_effT**2/effD**2)
|
|
1273
|
+
|
|
1274
|
+
# import matplotlib.pyplot as plt
|
|
1275
|
+
# plt.figure("efficiency vs free parameter")
|
|
1276
|
+
# plt.clf()
|
|
1277
|
+
# plt.errorbar(L,effD,yerr=u_effD,fmt="-k",label="double coincidences")
|
|
1278
|
+
# plt.errorbar(L,effT,yerr=u_effT,fmt="-r",label="triple coincidences")
|
|
1279
|
+
# plt.errorbar(L,effD2,yerr=u_effD2,fmt="-g",label="double coincidences (CIEMAT/NIST)")
|
|
1280
|
+
# plt.xscale('log')
|
|
1281
|
+
# plt.xlabel(r'$L$ /keV$^{-1}$', fontsize=14)
|
|
1282
|
+
# plt.ylabel(r'$\epsilon$', fontsize=14)
|
|
1283
|
+
# plt.legend()
|
|
1284
|
+
|
|
1285
|
+
# plt.figure("efficiency vs TDCR")
|
|
1286
|
+
# plt.clf()
|
|
1287
|
+
# plt.errorbar(tdcr,effD,xerr=u_tdcr,yerr=u_effD,fmt="-k")
|
|
1288
|
+
# #plt.xscale('log')
|
|
1289
|
+
# plt.xlabel(r'$R_T/R_D$', fontsize=14)
|
|
1290
|
+
# plt.ylabel(r'$\epsilon_{D}$', fontsize=14)
|
|
1291
|
+
# plt.show()
|
|
1229
1292
|
|
|
1230
1293
|
|
|
1231
1294
|
# L = 1
|
|
1232
1295
|
# # L = (1.1, 1.05, 1.15)
|
|
1233
|
-
# TD = 0.977667386529166
|
|
1234
|
-
# # TD = (0.
|
|
1235
|
-
# #
|
|
1236
|
-
#
|
|
1296
|
+
# # TD = 0.977667386529166
|
|
1297
|
+
# # TD = (0.9767359812638453, 0.9925429293804757, 0.991829757077315, 0.9919970813639295) # source 1
|
|
1298
|
+
# # TD = (0.9768862920127371, 0.9928478299182348, 0.9912531441227223, 0.9924249578285456) # source 2
|
|
1299
|
+
# # TD = (0.9769014488454436, 0.9918130431206161, 0.9920156754198314, 0.9927119011073454) # source 3
|
|
1300
|
+
# TD = (0.9764032345164899, 0.9928417189012709, 0.9911455450383777, 0.9920402844839974) # source 4
|
|
1301
|
+
# Rad="Tc-99"
|
|
1237
1302
|
# pmf_1="1"
|
|
1238
|
-
# N =
|
|
1239
|
-
# kB =1.
|
|
1240
|
-
# V =
|
|
1303
|
+
# N = 10000
|
|
1304
|
+
# kB =1.4e-5
|
|
1305
|
+
# V = 16
|
|
1241
1306
|
# mode = "eff"
|
|
1242
1307
|
|
|
1243
1308
|
|
|
@@ -1246,6 +1311,7 @@ def effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7, disp=False):
|
|
|
1246
1311
|
# # # out = TDCRPy(L, Rad, pmf_1, N, kB, V, Display = False, record = False, readRecHist = True)
|
|
1247
1312
|
# # # print("result", out)
|
|
1248
1313
|
|
|
1249
|
-
#
|
|
1250
|
-
#
|
|
1251
|
-
# print(
|
|
1314
|
+
# outS = eff(TD, Rad, pmf_1, kB, V, N=10000, L=1, maxiter=20, xatol=1e-7)
|
|
1315
|
+
# outA = effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7)
|
|
1316
|
+
# print(outS)
|
|
1317
|
+
# print(outA)
|
tdcrpy/TDCR_model_lib.py
CHANGED
|
@@ -2894,6 +2894,7 @@ def detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, meas
|
|
|
2894
2894
|
symm = False
|
|
2895
2895
|
else:
|
|
2896
2896
|
symm = True
|
|
2897
|
+
|
|
2897
2898
|
|
|
2898
2899
|
if symm:
|
|
2899
2900
|
# print(evenement !=1, t1 > extDT*1e-6, t1 < measTime*60)
|
|
@@ -2935,8 +2936,6 @@ def detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, meas
|
|
|
2935
2936
|
efficiency0_A2 = p_single
|
|
2936
2937
|
efficiency0_B2 = efficiency0_A2
|
|
2937
2938
|
efficiency0_D2 = p_single**2
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
2939
|
else:
|
|
2941
2940
|
if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
|
|
2942
2941
|
# TDCR
|
|
@@ -3005,6 +3004,164 @@ def detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, meas
|
|
|
3005
3004
|
return efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2
|
|
3006
3005
|
|
|
3007
3006
|
|
|
3007
|
+
def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime):
|
|
3008
|
+
"""
|
|
3009
|
+
Calculate detection probabilities for LS counting systems - see Broda, R., Cassette, P., Kossert, K., 2007. Radionuclide metrology using liquid scintillation counting. Metrologia 44. https://doi.org/10.1088/0026-1394/44/4/S06
|
|
3010
|
+
|
|
3011
|
+
Parameters
|
|
3012
|
+
----------
|
|
3013
|
+
L : float or tuple
|
|
3014
|
+
If L is float, then L is the global free parameter. If L is tuple, then L is a triplet of free parameters. unit keV-1
|
|
3015
|
+
e_quenching : list
|
|
3016
|
+
List of quenched deposited energies from prompt particles in keV.
|
|
3017
|
+
e_quenching2 : list
|
|
3018
|
+
List of quenched deposited energies from delayed particles in keV.
|
|
3019
|
+
t1 : float
|
|
3020
|
+
decay time of the delayed transitions in s.
|
|
3021
|
+
evenement : interger
|
|
3022
|
+
number of pulses per decay (prompt (1), prompt + delayed (2)).
|
|
3023
|
+
extDT : float
|
|
3024
|
+
extended dead time of the system in ns.
|
|
3025
|
+
measTime : float
|
|
3026
|
+
measurement time in minutes.
|
|
3027
|
+
|
|
3028
|
+
Returns
|
|
3029
|
+
-------
|
|
3030
|
+
efficiency0_S : float
|
|
3031
|
+
detection probability of single event.
|
|
3032
|
+
efficiency0_D : float
|
|
3033
|
+
detection probability of double coincidences.
|
|
3034
|
+
efficiency0_T : float
|
|
3035
|
+
detection probability of triple coincidences.
|
|
3036
|
+
efficiency0_AB : float
|
|
3037
|
+
detection probability of coincidences between channels A and B.
|
|
3038
|
+
efficiency0_BC : float
|
|
3039
|
+
detection probability of coincidences between channels B and C.
|
|
3040
|
+
efficiency0_AC : float
|
|
3041
|
+
detection probability of coincidences between channels A and C.
|
|
3042
|
+
efficiency0_D2 : float
|
|
3043
|
+
detection probability of coincidences in a C/N system.
|
|
3044
|
+
|
|
3045
|
+
"""
|
|
3046
|
+
if isinstance(L, (tuple, list)):
|
|
3047
|
+
symm = False
|
|
3048
|
+
else:
|
|
3049
|
+
symm = True
|
|
3050
|
+
|
|
3051
|
+
if symm:
|
|
3052
|
+
if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
|
|
3053
|
+
m = len(e_quenching)
|
|
3054
|
+
n_ph = np.random.poisson(np.asarray((e_quenching+e_quenching2)*L))
|
|
3055
|
+
n_S = 0; n_D = 0; n_T = 0; n_AB = 0; n_BC = 0; n_AC = 0; n_D2 = 0; n_A2 = 0; n_B2 = 0;
|
|
3056
|
+
for j in n_ph:
|
|
3057
|
+
n_phPMT = np.random.multinomial(j, [1/3, 1/3, 1/3])
|
|
3058
|
+
if sum(n_phPMT>1)>0: n_S +=1
|
|
3059
|
+
if sum(n_phPMT>1)>1: n_D +=1
|
|
3060
|
+
if sum(n_phPMT>1)>2: n_T +=1
|
|
3061
|
+
if n_phPMT[0]>1 and n_phPMT[1]>1: n_AB +=1
|
|
3062
|
+
if n_phPMT[1]>1 and n_phPMT[2]>1: n_BC +=1
|
|
3063
|
+
if n_phPMT[0]>1 and n_phPMT[2]>1: n_AC +=1
|
|
3064
|
+
efficiency0_S = n_S/m
|
|
3065
|
+
efficiency0_T = n_T/m
|
|
3066
|
+
efficiency0_D = n_D/m
|
|
3067
|
+
efficiency0_AB = n_AB/m
|
|
3068
|
+
efficiency0_BC = n_BC/m
|
|
3069
|
+
efficiency0_AC = n_AC/m
|
|
3070
|
+
for j in n_ph:
|
|
3071
|
+
n_phPMT = np.random.multinomial(j, [1/2, 1/2])
|
|
3072
|
+
if sum(n_phPMT>1)>1: n_D2 +=1
|
|
3073
|
+
if n_phPMT[0]>1: n_A2 +=1
|
|
3074
|
+
if n_phPMT[1]>1: n_B2 +=1
|
|
3075
|
+
# efficiency0_A2 = n_A2/m
|
|
3076
|
+
# efficiency0_B2 = n_B2/m
|
|
3077
|
+
efficiency0_D2 = n_D2/m
|
|
3078
|
+
else: # symm and no deleayed event sum
|
|
3079
|
+
m = len(e_quenching)
|
|
3080
|
+
n_ph = np.random.poisson(np.asarray(e_quenching*L))
|
|
3081
|
+
n_S = 0; n_D = 0; n_T = 0; n_AB = 0; n_BC = 0; n_AC = 0; n_D2 = 0; n_A2 = 0; n_B2 = 0;
|
|
3082
|
+
for j in n_ph:
|
|
3083
|
+
n_phPMT = np.random.multinomial(j, [1/3, 1/3, 1/3])
|
|
3084
|
+
if sum(n_phPMT>1)>0: n_S +=1
|
|
3085
|
+
if sum(n_phPMT>1)>1: n_D +=1
|
|
3086
|
+
if sum(n_phPMT>1)>2: n_T +=1
|
|
3087
|
+
if n_phPMT[0]>1 and n_phPMT[1]>1: n_AB +=1
|
|
3088
|
+
if n_phPMT[1]>1 and n_phPMT[2]>1: n_BC +=1
|
|
3089
|
+
if n_phPMT[0]>1 and n_phPMT[2]>1: n_AC +=1
|
|
3090
|
+
efficiency0_S = n_S/m
|
|
3091
|
+
efficiency0_T = n_T/m
|
|
3092
|
+
efficiency0_D = n_D/m
|
|
3093
|
+
efficiency0_AB = n_AB/m
|
|
3094
|
+
efficiency0_BC = n_BC/m
|
|
3095
|
+
efficiency0_AC = n_AC/m
|
|
3096
|
+
for j in n_ph:
|
|
3097
|
+
n_phPMT = np.random.multinomial(j, [1/2, 1/2])
|
|
3098
|
+
if sum(n_phPMT>1)>1: n_D2 +=1
|
|
3099
|
+
if n_phPMT[0]>1: n_A2 +=1
|
|
3100
|
+
if n_phPMT[1]>1: n_B2 +=1
|
|
3101
|
+
# efficiency0_A2 = n_A2/m
|
|
3102
|
+
# efficiency0_B2 = n_B2/m
|
|
3103
|
+
efficiency0_D2 = n_D2/m
|
|
3104
|
+
else: # asym
|
|
3105
|
+
if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60: # sum of delayed event
|
|
3106
|
+
m = len(e_quenching)
|
|
3107
|
+
Lm = np.mean(L)
|
|
3108
|
+
n_ph = np.random.poisson(np.asarray(e_quenching+e_quenching2)*Lm)
|
|
3109
|
+
n_S = 0; n_D = 0; n_T = 0; n_AB = 0; n_BC = 0; n_AC = 0; n_D2 = 0; n_A2 = 0; n_B2 = 0;
|
|
3110
|
+
for j in n_ph:
|
|
3111
|
+
n_phPMT = np.random.multinomial(j, [L[0]/(3*Lm), L[1]/(3*Lm), L[2]/(3*Lm)])
|
|
3112
|
+
if sum(n_phPMT>1)>0: n_S +=1
|
|
3113
|
+
if sum(n_phPMT>1)>1: n_D +=1
|
|
3114
|
+
if sum(n_phPMT>1)>2: n_T +=1
|
|
3115
|
+
if n_phPMT[0]>1 and n_phPMT[1]>1: n_AB +=1
|
|
3116
|
+
if n_phPMT[1]>1 and n_phPMT[2]>1: n_BC +=1
|
|
3117
|
+
if n_phPMT[0]>1 and n_phPMT[2]>1: n_AC +=1
|
|
3118
|
+
efficiency0_S = n_S/m
|
|
3119
|
+
efficiency0_T = n_T/m
|
|
3120
|
+
efficiency0_D = n_D/m
|
|
3121
|
+
efficiency0_AB = n_AB/m
|
|
3122
|
+
efficiency0_BC = n_BC/m
|
|
3123
|
+
efficiency0_AC = n_AC/m
|
|
3124
|
+
for j in n_ph:
|
|
3125
|
+
n_phPMT = np.random.multinomial(j, [L[0]/(2*Lm), L[1]/(2*Lm)])
|
|
3126
|
+
if sum(n_phPMT>1)>1: n_D2 +=1
|
|
3127
|
+
if n_phPMT[0]>1: n_A2 +=1
|
|
3128
|
+
if n_phPMT[1]>1: n_B2 +=1
|
|
3129
|
+
# efficiency0_A2 = n_A2/m
|
|
3130
|
+
# efficiency0_B2 = n_B2/m
|
|
3131
|
+
efficiency0_D2 = n_D2/m
|
|
3132
|
+
else: # asym and no sum of delayed events
|
|
3133
|
+
m = len(e_quenching)
|
|
3134
|
+
Lm = np.mean(L)
|
|
3135
|
+
n_ph = np.random.poisson(np.asarray((e_quenching+e_quenching2)*Lm))
|
|
3136
|
+
n_S = 0; n_D = 0; n_T = 0; n_AB = 0; n_BC = 0; n_AC = 0; n_D2 = 0; n_A2 = 0; n_B2 = 0;
|
|
3137
|
+
for j in n_ph:
|
|
3138
|
+
n_phPMT = np.random.multinomial(j, [L[0]/(3*Lm), L[1]/(3*Lm), L[2]/(3*Lm)])
|
|
3139
|
+
if sum(n_phPMT>1)>0: n_S +=1
|
|
3140
|
+
if sum(n_phPMT>1)>1: n_D +=1
|
|
3141
|
+
if sum(n_phPMT>1)>2: n_T +=1
|
|
3142
|
+
if n_phPMT[0]>1 and n_phPMT[1]>1: n_AB +=1
|
|
3143
|
+
if n_phPMT[1]>1 and n_phPMT[2]>1: n_BC +=1
|
|
3144
|
+
if n_phPMT[0]>1 and n_phPMT[2]>1: n_AC +=1
|
|
3145
|
+
efficiency0_S = n_S/m
|
|
3146
|
+
efficiency0_T = n_T/m
|
|
3147
|
+
efficiency0_D = n_D/m
|
|
3148
|
+
efficiency0_AB = n_AB/m
|
|
3149
|
+
efficiency0_BC = n_BC/m
|
|
3150
|
+
efficiency0_AC = n_AC/m
|
|
3151
|
+
for j in n_ph:
|
|
3152
|
+
n_phPMT = np.random.multinomial(j, [L[0]/(2*Lm), L[1]/(2*Lm)])
|
|
3153
|
+
if sum(n_phPMT>1)>1: n_D2 +=1
|
|
3154
|
+
if n_phPMT[0]>1: n_A2 +=1
|
|
3155
|
+
if n_phPMT[1]>1: n_B2 +=1
|
|
3156
|
+
# efficiency0_A2 = n_A2/m
|
|
3157
|
+
# efficiency0_B2 = n_B2/m
|
|
3158
|
+
efficiency0_D2 = n_D2/m
|
|
3159
|
+
return efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2
|
|
3160
|
+
|
|
3161
|
+
|
|
3162
|
+
|
|
3163
|
+
|
|
3164
|
+
|
|
3008
3165
|
def efficienciesEstimates(efficiency_S, efficiency_D, efficiency_T, efficiency_AB, efficiency_BC, efficiency_AC, efficiency_D2, N):
|
|
3009
3166
|
"""
|
|
3010
3167
|
Calculate detection efficiencies from list of detection probabilities per decays.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: TDCRPy
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: TDCR model
|
|
5
5
|
Home-page: https://pypi.org/project/TDCRPy/
|
|
6
6
|
Author: RomainCoulon (Romain Coulon)
|
|
@@ -27,6 +27,18 @@ Requires-Dist: scipy
|
|
|
27
27
|
Requires-Dist: configparser
|
|
28
28
|
Requires-Dist: importlib.resources
|
|
29
29
|
Requires-Dist: matplotlib
|
|
30
|
+
Dynamic: author
|
|
31
|
+
Dynamic: author-email
|
|
32
|
+
Dynamic: classifier
|
|
33
|
+
Dynamic: description
|
|
34
|
+
Dynamic: description-content-type
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: keywords
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
Dynamic: project-url
|
|
39
|
+
Dynamic: requires-dist
|
|
40
|
+
Dynamic: requires-python
|
|
41
|
+
Dynamic: summary
|
|
30
42
|
|
|
31
43
|
# 1. About TDCRPy
|
|
32
44
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
tdcrpy/TDCRPy.py,sha256=
|
|
1
|
+
tdcrpy/TDCRPy.py,sha256=of9b8U2-Zl1pHj4YqoWLJ6Ibjpb8xFgdE7_-9gO-hEg,67823
|
|
2
2
|
tdcrpy/TDCRPy1.py,sha256=QTBZh5B5JWnGB0BQfD-cFmwA9W080OD4sG-aj50-ejo,38106
|
|
3
|
-
tdcrpy/TDCR_model_lib.py,sha256=
|
|
3
|
+
tdcrpy/TDCR_model_lib.py,sha256=yGvth6Fu1a6tWRu6Uajnpv604qyUMCviBXeifQ6-4Xg,133469
|
|
4
4
|
tdcrpy/TDCRoptimize.py,sha256=c2XIGveeLdVYYek4Rg6dygMvVA2xIrIkMb3L-_jUucM,6496
|
|
5
5
|
tdcrpy/__init__.py,sha256=9Djir8dPNchcJVQvhl-oRHEOsoDkiZlkOhWT-eHR7wQ,95
|
|
6
6
|
tdcrpy/config.toml,sha256=d_olKEgxfobBHkZ2wEj9EgKE7I8Wbpim9ZAsi5ImFxk,1470
|
|
@@ -74,8 +74,8 @@ tdcrpy/docs/_build/html/source/modules.html,sha256=Jf-qxVBId0UgpwyvYuyjtMNG-ezPO
|
|
|
74
74
|
tdcrpy/docs/_build/html/source/tdcrpy.html,sha256=-38lHMNFB22p1tWJEeN3yDqfDiCYE304vxDamO1-iRc,3779
|
|
75
75
|
tdcrpy/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
76
|
tdcrpy/test/test_tdcrpy.py,sha256=JINqSEMFoNpptE4f3h6ZzTYW1rBx90KkaoQzltSg-No,4692
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
tdcrpy-2.4.0.dist-info/licenses/LICENCE.md,sha256=ZTpWyGU3qv_iwEpgvCijoCuCYpOPpyzJCgOk46WpUKU,1066
|
|
78
|
+
tdcrpy-2.4.0.dist-info/METADATA,sha256=gjwfho2j7db0Q52y3Lg79Y9q1r2sg82zl9vS31004m8,45298
|
|
79
|
+
tdcrpy-2.4.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
80
|
+
tdcrpy-2.4.0.dist-info/top_level.txt,sha256=f4vzFFcKSEnonAACs0ZXuRczmroLLqtPTqXFymU_VU0,14
|
|
81
|
+
tdcrpy-2.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|