TDCRPy 2.6.0__tar.gz → 2.8.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.6.0/TDCRPy.egg-info → tdcrpy-2.8.0}/PKG-INFO +1 -1
  2. {tdcrpy-2.6.0 → tdcrpy-2.8.0/TDCRPy.egg-info}/PKG-INFO +1 -1
  3. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/setup.py +1 -1
  4. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/TDCR_model_lib.py +104 -46
  5. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/config.toml +4 -0
  6. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/LICENCE.md +0 -0
  7. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/MANIFEST.in +0 -0
  8. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/README.md +0 -0
  9. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/TDCRPy.egg-info/SOURCES.txt +0 -0
  10. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/TDCRPy.egg-info/dependency_links.txt +0 -0
  11. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/TDCRPy.egg-info/requires.txt +0 -0
  12. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/TDCRPy.egg-info/top_level.txt +0 -0
  13. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/setup.cfg +0 -0
  14. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_C-14.txt +0 -0
  15. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ca-45.txt +0 -0
  16. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Co-60.txt +0 -0
  17. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_H-3.txt +0 -0
  18. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ni-63.txt +0 -0
  19. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Pm-147.txt +0 -0
  20. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Pu-241.txt +0 -0
  21. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_S-35.txt +0 -0
  22. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Sr-89.txt +0 -0
  23. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Sr-90.txt +0 -0
  24. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Tc-99.txt +0 -0
  25. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/E_depose.txt +0 -0
  26. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_1_200k.txt +0 -0
  27. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_2000_10000k.txt +0 -0
  28. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_200_2000k.txt +0 -0
  29. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_1_200k.txt +0 -0
  30. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_2000_10000k.txt +0 -0
  31. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_200_2000k.txt +0 -0
  32. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_1_200k.txt +0 -0
  33. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_2000_10000k.txt +0 -0
  34. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_200_2000k.txt +0 -0
  35. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_1_200k.txt +0 -0
  36. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_2000_10000k.txt +0 -0
  37. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_200_2000k.txt +0 -0
  38. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_1_200k.txt +0 -0
  39. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_2000_10000k.txt +0 -0
  40. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_200_2000k.txt +0 -0
  41. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_1_200k.txt +0 -0
  42. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_2000_10000k.txt +0 -0
  43. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_200_2000k.txt +0 -0
  44. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Micelle/2nmfaq01.csv +0 -0
  45. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Micelle/faq01.csv +0 -0
  46. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_0.015.txt +0 -0
  47. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.1e-05.txt +0 -0
  48. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.2e-05.txt +0 -0
  49. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.3e-05.txt +0 -0
  50. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.4e-05.txt +0 -0
  51. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.5e-05.txt +0 -0
  52. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1e-05.txt +0 -0
  53. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_6e-06.txt +0 -0
  54. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_7e-06.txt +0 -0
  55. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_8e-06.txt +0 -0
  56. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyAlpha_9e-06.txt +0 -0
  57. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.006.txt +0 -0
  58. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.007.txt +0 -0
  59. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.008.txt +0 -0
  60. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.009.txt +0 -0
  61. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.01.txt +0 -0
  62. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.011.txt +0 -0
  63. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.012.txt +0 -0
  64. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.013.txt +0 -0
  65. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.014.txt +0 -0
  66. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.015.txt +0 -0
  67. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/TandataUG.txt +0 -0
  68. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/alpha_toulene.txt +0 -0
  69. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/inputVecteurAlpha.txt +0 -0
  70. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/Quenching/inputVecteurElectron.txt +0 -0
  71. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/TDCRPy.py +0 -0
  72. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/TDCRPy1.py +0 -0
  73. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/TDCRoptimize.py +0 -0
  74. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/__init__.py +0 -0
  75. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/decayData/All-nuclides_BetaShape.zip +0 -0
  76. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/decayData/All-nuclides_Ensdf.zip +0 -0
  77. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/decayData/All-nuclides_PenNuc.zip +0 -0
  78. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/decayData/atom-ENDF-VII0.zip +0 -0
  79. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/decayData/photo-ENDF.zip +0 -0
  80. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/docs/_build/html/genindex.html +0 -0
  81. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/docs/_build/html/index.html +0 -0
  82. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/docs/_build/html/search.html +0 -0
  83. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/docs/_build/html/source/modules.html +0 -0
  84. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/docs/_build/html/source/tdcrpy.html +0 -0
  85. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/test/__init__.py +0 -0
  86. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/test/test_tdcrpy.py +0 -0
  87. {tdcrpy-2.6.0 → tdcrpy-2.8.0}/tdcrpy/test2.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TDCRPy
3
- Version: 2.6.0
3
+ Version: 2.8.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.6.0
3
+ Version: 2.8.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.6.0"
5
+ VERSION = "2.8.0"
6
6
 
7
7
  DESCRIPTION = "TDCR model"
8
8
 
@@ -61,6 +61,8 @@ def readParameters(disp=False):
61
61
  fAq = config["Inputs"].getfloat("fAq")
62
62
  micCorr = config["Inputs"].getboolean("micCorr")
63
63
  alphaDir = config["Inputs"].getfloat("alphaDir")
64
+ effQuantic = config["Inputs"].getfloat("effQuantum")
65
+ optionModel = config["Inputs"].getfloat("optionModel")
64
66
 
65
67
  if disp:
66
68
  print(f"number of integration bins for electrons = {nE_electron}")
@@ -78,13 +80,15 @@ def readParameters(disp=False):
78
80
  print(f"diameter of micelle = {diam_micelle} nm")
79
81
  print(f"acqueous fraction = {fAq}")
80
82
  print(f"alpha parameter of the hidden Dirichlet process = {alphaDir}")
83
+ print(f"quantum efficiency of the photocathodes = {effQuantic}")
84
+ print(f"Monte Carlo model of the optics = {optionModel}")
81
85
  print(f"coincidence resolving time = {tau} ns")
82
86
  print(f"extended dead time = {extDT} µs")
83
87
  print(f"measurement time = {measTime} min")
84
88
 
85
- return nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, alphaDir, pH,pC,pN,pO,pP,pCl
89
+ return nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, alphaDir, effQuantic, optionModel, pH,pC,pN,pO,pP,pCl
86
90
 
87
- nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, alphaDir, pH,pC,pN,pO,pP,pCl = readParameters()
91
+ nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, alphaDir, effQuantic, optionModel, pH,pC,pN,pO,pP,pCl = readParameters()
88
92
 
89
93
  p_atom = np.array([pH,pC,pN,pO,pP,pCl]) # atom abondance in the scintillator
90
94
  p_atom /= sum(p_atom)
@@ -200,6 +204,18 @@ def modifyAlphaDir(x):
200
204
  x0 = readParameters()[14]
201
205
  data1 = data0.replace(f"alphaDir = {x0}",f"alphaDir = {x}")
202
206
  writeConfifAsstr(data1)
207
+
208
+ def modifyEffQ(x):
209
+ data0 = readConfigAsstr()
210
+ x0 = readParameters()[15]
211
+ data1 = data0.replace(f"effQuantum = {x0}",f"effQuantum = {x}")
212
+ writeConfifAsstr(data1)
213
+
214
+ def modifyOptModel(x):
215
+ data0 = readConfigAsstr()
216
+ x0 = readParameters()[16]
217
+ data1 = data0.replace(f"optionModel = {x0}",f"optionModel = {x}")
218
+ writeConfifAsstr(data1)
203
219
 
204
220
  def read_temp_files(copy=False, path="C:"):
205
221
 
@@ -3012,7 +3028,7 @@ def detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, meas
3012
3028
  return efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2
3013
3029
 
3014
3030
 
3015
- def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime, dir_param = alphaDir):
3031
+ def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime, dir_param = alphaDir, effQuantic = effQuantic, optionModel=optionModel):
3016
3032
  """
3017
3033
  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
3018
3034
 
@@ -3056,7 +3072,7 @@ def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, me
3056
3072
  else:
3057
3073
  symm = True
3058
3074
 
3059
- mu = 0.2
3075
+ mu = effQuantic
3060
3076
 
3061
3077
  if dir_param < 1000:
3062
3078
  dirichTD = np.random.dirichlet([dir_param, dir_param, dir_param])
@@ -3071,79 +3087,121 @@ def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, me
3071
3087
  n_e = np.zeros(3); n_eCN = np.zeros(2); n_e2 = np.zeros(3); n_e2CN = np.zeros(2)
3072
3088
 
3073
3089
  if symm:
3074
- n_ph = np.random.poisson(sum(np.asarray(e_quenching))*L/mu)
3075
- # TDCR
3076
- n_phPMT = np.random.multinomial(n_ph, dirichTD)
3077
- n_e[0]=np.random.binomial(n_phPMT[0],mu)
3078
- n_e[1]=np.random.binomial(n_phPMT[1],mu)
3079
- n_e[2]=np.random.binomial(n_phPMT[2],mu)
3090
+ if optionModel == "poisson-multinomial-binomial":
3091
+ n_ph = np.random.poisson(sum(np.asarray(e_quenching))*L/mu)
3092
+ # TDCR
3093
+ n_phPMT = np.random.multinomial(n_ph, dirichTD)
3094
+ n_e[0]=np.random.binomial(n_phPMT[0],mu)
3095
+ n_e[1]=np.random.binomial(n_phPMT[1],mu)
3096
+ n_e[2]=np.random.binomial(n_phPMT[2],mu)
3097
+ # C/N
3098
+ n_phPMTCN = np.random.multinomial(n_ph, dirichCN)
3099
+ n_eCN[0]=np.random.binomial(n_phPMTCN[0],mu)
3100
+ n_eCN[1]=np.random.binomial(n_phPMTCN[1],mu)
3101
+ elif optionModel == "poisson":
3102
+ n_e[0] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichTD[0])
3103
+ n_e[1] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichTD[1])
3104
+ n_e[2] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichTD[2])
3105
+ n_eCN[0] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichCN[0])
3106
+ n_eCN[1] = np.random.poisson(sum(np.asarray(e_quenching))*L*mu*dirichCN[1])
3107
+ else:
3108
+ print("unknown model")
3109
+
3080
3110
  if sum(n_e>1)>0: efficiency0_S =1
3081
3111
  if sum(n_e>1)>1: efficiency0_D =1
3082
3112
  if sum(n_e>1)>2: efficiency0_T =1
3083
3113
  if n_e[0]>1 and n_e[1]>1: efficiency0_AB =1
3084
3114
  if n_e[1]>1 and n_e[2]>1: efficiency0_BC =1
3085
3115
  if n_e[0]>1 and n_e[2]>1: efficiency0_AC =1
3086
- # C/N
3087
- n_phPMT = np.random.multinomial(n_ph, dirichCN)
3088
- n_eCN[0]=np.random.binomial(n_phPMT[0],mu)
3089
- n_eCN[1]=np.random.binomial(n_phPMT[1],mu)
3090
- if sum(n_e>1)>1: efficiency0_D2 =1
3116
+ if sum(n_eCN>1)>1: efficiency0_D2 =1
3091
3117
 
3092
- if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
3093
- n_ph2 = np.random.poisson(sum(np.asarray(e_quenching2))*L/mu)
3094
- # TDCR
3095
- n_phPMT2 = np.random.multinomial(n_ph2, dirichTD)
3096
- n_e2[0]=np.random.binomial(n_phPMT2[0],mu)
3097
- n_e2[1]=np.random.binomial(n_phPMT2[1],mu)
3098
- n_e2[2]=np.random.binomial(n_phPMT2[2],mu)
3118
+ if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
3119
+ if optionModel == "poisson-multinomial-binomial":
3120
+ n_ph2 = np.random.poisson(sum(np.asarray(e_quenching2))*L/mu)
3121
+ # TDCR
3122
+ n_phPMT2 = np.random.multinomial(n_ph2, dirichTD)
3123
+ n_e2[0]=np.random.binomial(n_phPMT2[0],mu)
3124
+ n_e2[1]=np.random.binomial(n_phPMT2[1],mu)
3125
+ n_e2[2]=np.random.binomial(n_phPMT2[2],mu)
3126
+ # C/N
3127
+ n_phPMT2CN = np.random.multinomial(n_ph2, dirichCN)
3128
+ n_e2CN[0]=np.random.binomial(n_phPMT2CN[0],mu)
3129
+ n_e2CN[1]=np.random.binomial(n_phPMT2CN[1],mu)
3130
+ elif optionModel == "poisson":
3131
+ n_e2[0] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichTD[0])
3132
+ n_e2[1] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichTD[1])
3133
+ n_e2[2] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichTD[2])
3134
+ n_e2CN[0] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichCN[0])
3135
+ n_e2CN[1] = np.random.poisson(sum(np.asarray(e_quenching2))*L*mu*dirichCN[1])
3136
+ else:
3137
+ print("unknown model")
3138
+
3139
+
3099
3140
  if sum(n_e2>1)>0: efficiency0_S +=1
3100
3141
  if sum(n_e2>1)>1: efficiency0_D +=1
3101
3142
  if sum(n_e2>1)>2: efficiency0_T +=1
3102
3143
  if n_e2[0]>1 and n_e2[1]>1: efficiency0_AB +=1
3103
3144
  if n_e2[1]>1 and n_e2[2]>1: efficiency0_BC +=1
3104
3145
  if n_e2[0]>1 and n_e2[2]>1: efficiency0_AC +=1
3105
- # C/N
3106
- n_phPMT2 = np.random.multinomial(n_ph2, dirichCN)
3107
- n_e2CN[0]=np.random.binomial(n_phPMT2[0],mu)
3108
- n_e2CN[1]=np.random.binomial(n_phPMT2[1],mu)
3109
3146
  if sum(n_e2CN>1)>1: efficiency0_D2 +=1
3110
3147
 
3111
3148
  else: # asym
3112
- Lm = np.mean(L)
3113
- n_ph = np.random.poisson(sum(np.asarray((e_quenching))*Lm/mu))
3114
- # TDCR
3115
- n_phPMT = np.random.multinomial(n_ph, [L[0]*dirichTD[0]/Lm, L[1]*dirichTD[1]/Lm, L[2]*dirichTD[2]/Lm])
3116
- n_e[0]=np.random.binomial(n_phPMT[0],mu)
3117
- n_e[1]=np.random.binomial(n_phPMT[1],mu)
3118
- n_e[2]=np.random.binomial(n_phPMT[2],mu)
3149
+ if optionModel == "poisson-multinomial-binomial":
3150
+ Lm = np.mean(L)
3151
+ n_ph = np.random.poisson(sum(np.asarray((e_quenching))*Lm/mu))
3152
+ # TDCR
3153
+ n_phPMT = np.random.multinomial(n_ph, [L[0]*dirichTD[0]/Lm, L[1]*dirichTD[1]/Lm, L[2]*dirichTD[2]/Lm])
3154
+ n_e[0]=np.random.binomial(n_phPMT[0],mu)
3155
+ n_e[1]=np.random.binomial(n_phPMT[1],mu)
3156
+ n_e[2]=np.random.binomial(n_phPMT[2],mu)
3157
+ # C/N
3158
+ n_phPMTCN = np.random.multinomial(n_ph, [L[0]/(2*Lm), L[1]/(2*Lm)])
3159
+ n_eCN[0]=np.random.binomial(n_phPMTCN[0],mu)
3160
+ n_eCN[1]=np.random.binomial(n_phPMTCN[1],mu)
3161
+ elif optionModel == "poisson":
3162
+ n_e[0] = np.random.poisson(sum(np.asarray(e_quenching))*L[0]*mu*dirichTD[0])
3163
+ n_e[1] = np.random.poisson(sum(np.asarray(e_quenching))*L[1]*mu*dirichTD[1])
3164
+ n_e[2] = np.random.poisson(sum(np.asarray(e_quenching))*L[2]*mu*dirichTD[2])
3165
+ n_eCN[0] = np.random.poisson(sum(np.asarray(e_quenching))*L[0]*mu*dirichCN[0])
3166
+ n_eCN[1] = np.random.poisson(sum(np.asarray(e_quenching))*L[1]*mu*dirichCN[1])
3167
+ else:
3168
+ print("unknown model")
3169
+
3119
3170
  if sum(n_e>1)>0: efficiency0_S =1
3120
3171
  if sum(n_e>1)>1: efficiency0_D =1
3121
3172
  if sum(n_e>1)>2: efficiency0_T =1
3122
3173
  if n_e[0]>1 and n_e[1]>1: efficiency0_AB =1
3123
3174
  if n_e[1]>1 and n_e[2]>1: efficiency0_BC =1
3124
3175
  if n_e[0]>1 and n_e[2]>1: efficiency0_AC =1
3125
- # C/N
3126
- n_phPMT = np.random.multinomial(n_ph, [L[0]/(2*Lm), L[1]/(2*Lm)])
3127
- n_eCN[0]=np.random.binomial(n_phPMT[0],mu)
3128
- n_eCN[1]=np.random.binomial(n_phPMT[1],mu)
3129
3176
  if sum(n_eCN>1)>1: efficiency0_D2 =1
3130
3177
 
3131
3178
  if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
3132
- n_ph2 = np.random.poisson(sum(np.asarray(e_quenching2))*Lm/mu)
3133
- # TDCR
3134
- n_phPMT2 = np.random.multinomial(n_ph2, [L[0]*dirichCN[0]/Lm, L[1]*dirichCN[1]/Lm, L[2]*dirichCN[2]/Lm])
3135
- n_e2[0]=np.random.binomial(n_phPMT2[0],mu)
3136
- n_e2[1]=np.random.binomial(n_phPMT2[1],mu)
3137
- n_e2[2]=np.random.binomial(n_phPMT2[2],mu)
3179
+ if optionModel == "poisson-multinomial-binomial":
3180
+ n_ph2 = np.random.poisson(sum(np.asarray(e_quenching2))*Lm/mu)
3181
+ # TDCR
3182
+ n_phPMT2 = np.random.multinomial(n_ph2, [L[0]*dirichCN[0]/Lm, L[1]*dirichCN[1]/Lm, L[2]*dirichCN[2]/Lm])
3183
+ n_e2[0]=np.random.binomial(n_phPMT2[0],mu)
3184
+ n_e2[1]=np.random.binomial(n_phPMT2[1],mu)
3185
+ n_e2[2]=np.random.binomial(n_phPMT2[2],mu)
3186
+ # C/N
3187
+ n_phPMT2CN = np.random.multinomial(n_ph2, [L[0]/(2*Lm), L[1]/(2*Lm)])
3188
+ n_e2CN[0]=np.random.binomial(n_phPMT2CN[0],mu)
3189
+ n_e2CN[1]=np.random.binomial(n_phPMT2CN[1],mu)
3190
+ elif optionModel == "poisson":
3191
+ n_e2[0] = np.random.poisson(sum(np.asarray(e_quenching2))*L[0]*mu*dirichTD[0])
3192
+ n_e2[1] = np.random.poisson(sum(np.asarray(e_quenching2))*L[1]*mu*dirichTD[1])
3193
+ n_e2[2] = np.random.poisson(sum(np.asarray(e_quenching2))*L[2]*mu*dirichTD[2])
3194
+ n_e2CN[0] = np.random.poisson(sum(np.asarray(e_quenching2))*L[0]*mu*dirichCN[0])
3195
+ n_e2CN[1] = np.random.poisson(sum(np.asarray(e_quenching2))*L[1]*mu*dirichCN[1])
3196
+ else:
3197
+ print("unknown model")
3198
+
3138
3199
  if sum(n_e2>1)>0: efficiency0_S +=1
3139
3200
  if sum(n_e2>1)>1: efficiency0_D +=1
3140
3201
  if sum(n_e2>1)>2: efficiency0_T +=1
3141
3202
  if n_e2[0]>1 and n_e2[1]>1: efficiency0_AB +=1
3142
3203
  if n_e2[1]>1 and n_e2[2]>1: efficiency0_BC +=1
3143
3204
  if n_e2[0]>1 and n_e2[2]>1: efficiency0_AC +=1
3144
- # C/N
3145
- n_e2CN[0]=np.random.binomial(n_phPMT2[0],mu)
3146
- n_e2CN[1]=np.random.binomial(n_phPMT2[1],mu)
3147
3205
  if sum(n_e2CN>1)>1: efficiency0_D2 +=1
3148
3206
 
3149
3207
  return efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2
@@ -34,6 +34,10 @@ fAq = 0.1
34
34
  ## OPTICAL PROPERTIES
35
35
  # Dirichlet parameter
36
36
  alphaDir = 100000
37
+ # Quantum efficiency
38
+ effQuantum = 0.25
39
+ # Optical MC model
40
+ optionModel = poisson-multinomial-binomial
37
41
 
38
42
  ## PROPERTIES OF THE COUNTER
39
43
  # Coincidence resolving time (ns)
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