TDCRPy 2.2.0__tar.gz → 2.4.0__tar.gz

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.

Potentially problematic release.


This version of TDCRPy might be problematic. Click here for more details.

Files changed (87) hide show
  1. {tdcrpy-2.2.0/TDCRPy.egg-info → tdcrpy-2.4.0}/PKG-INFO +1 -1
  2. {tdcrpy-2.2.0 → tdcrpy-2.4.0/TDCRPy.egg-info}/PKG-INFO +1 -1
  3. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/setup.py +1 -1
  4. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/TDCRPy.py +15 -6
  5. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/TDCR_model_lib.py +159 -2
  6. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/LICENCE.md +0 -0
  7. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/MANIFEST.in +0 -0
  8. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/README.md +0 -0
  9. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/TDCRPy.egg-info/SOURCES.txt +0 -0
  10. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/TDCRPy.egg-info/dependency_links.txt +0 -0
  11. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/TDCRPy.egg-info/requires.txt +0 -0
  12. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/TDCRPy.egg-info/top_level.txt +0 -0
  13. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/setup.cfg +0 -0
  14. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_C-14.txt +0 -0
  15. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ca-45.txt +0 -0
  16. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Co-60.txt +0 -0
  17. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_H-3.txt +0 -0
  18. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ni-63.txt +0 -0
  19. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Pm-147.txt +0 -0
  20. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Pu-241.txt +0 -0
  21. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_S-35.txt +0 -0
  22. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Sr-89.txt +0 -0
  23. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Sr-90.txt +0 -0
  24. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Tc-99.txt +0 -0
  25. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/E_depose.txt +0 -0
  26. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_1_200k.txt +0 -0
  27. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_2000_10000k.txt +0 -0
  28. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_200_2000k.txt +0 -0
  29. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_1_200k.txt +0 -0
  30. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_2000_10000k.txt +0 -0
  31. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_200_2000k.txt +0 -0
  32. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_1_200k.txt +0 -0
  33. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_2000_10000k.txt +0 -0
  34. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_200_2000k.txt +0 -0
  35. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_1_200k.txt +0 -0
  36. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_2000_10000k.txt +0 -0
  37. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_200_2000k.txt +0 -0
  38. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_1_200k.txt +0 -0
  39. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_2000_10000k.txt +0 -0
  40. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_200_2000k.txt +0 -0
  41. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_1_200k.txt +0 -0
  42. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_2000_10000k.txt +0 -0
  43. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_200_2000k.txt +0 -0
  44. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Micelle/2nmfaq01.csv +0 -0
  45. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Micelle/faq01.csv +0 -0
  46. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_0.015.txt +0 -0
  47. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.1e-05.txt +0 -0
  48. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.2e-05.txt +0 -0
  49. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.3e-05.txt +0 -0
  50. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.4e-05.txt +0 -0
  51. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.5e-05.txt +0 -0
  52. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1e-05.txt +0 -0
  53. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_6e-06.txt +0 -0
  54. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_7e-06.txt +0 -0
  55. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_8e-06.txt +0 -0
  56. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyAlpha_9e-06.txt +0 -0
  57. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.006.txt +0 -0
  58. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.007.txt +0 -0
  59. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.008.txt +0 -0
  60. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.009.txt +0 -0
  61. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.01.txt +0 -0
  62. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.011.txt +0 -0
  63. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.012.txt +0 -0
  64. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.013.txt +0 -0
  65. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.014.txt +0 -0
  66. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.015.txt +0 -0
  67. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/TandataUG.txt +0 -0
  68. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/alpha_toulene.txt +0 -0
  69. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/inputVecteurAlpha.txt +0 -0
  70. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/Quenching/inputVecteurElectron.txt +0 -0
  71. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/TDCRPy1.py +0 -0
  72. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/TDCRoptimize.py +0 -0
  73. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/__init__.py +0 -0
  74. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/config.toml +0 -0
  75. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/decayData/All-nuclides_BetaShape.zip +0 -0
  76. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/decayData/All-nuclides_Ensdf.zip +0 -0
  77. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/decayData/All-nuclides_PenNuc.zip +0 -0
  78. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/decayData/atom-ENDF-VII0.zip +0 -0
  79. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/decayData/photo-ENDF.zip +0 -0
  80. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/docs/_build/html/genindex.html +0 -0
  81. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/docs/_build/html/index.html +0 -0
  82. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/docs/_build/html/search.html +0 -0
  83. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/docs/_build/html/source/modules.html +0 -0
  84. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/docs/_build/html/source/tdcrpy.html +0 -0
  85. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/test/__init__.py +0 -0
  86. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/test/test_tdcrpy.py +0 -0
  87. {tdcrpy-2.2.0 → tdcrpy-2.4.0}/tdcrpy/test2.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TDCRPy
3
- Version: 2.2.0
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TDCRPy
3
- Version: 2.2.0
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)
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
  import codecs
3
3
  import os
4
4
 
5
- VERSION = "2.2.0"
5
+ VERSION = "2.4.0"
6
6
 
7
7
  DESCRIPTION = "TDCR model"
8
8
 
@@ -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
- 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)
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
- 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)
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)
@@ -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
- 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)
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)
@@ -1236,7 +1245,7 @@ def effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7, disp=False):
1236
1245
 
1237
1246
  # # TDCRPy(1, Rad, pmf_1, 10, kB, V, mode, Display= True, barp=False, record=True)
1238
1247
  # # Record decay histories in temporary files
1239
- # TDCRPy(L[0], Rad, pmf_1, N, kB, V, mode, barp=True, record=True)
1248
+ # TDCRPy(L[0], Rad, pmf_1, N, kB, V, mode, barp=False, record=True)
1240
1249
 
1241
1250
  # effS, u_effS, effD, u_effD, effT, u_effT, effD2, u_effD2 = [], [],[], [],[], [], [], []
1242
1251
  # for l in tqdm(L, desc="free parameters ", unit=" iterations"):
@@ -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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes