TDCRPy 2.2.0__tar.gz → 2.5.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.5.0}/PKG-INFO +1 -1
  2. {tdcrpy-2.2.0 → tdcrpy-2.5.0/TDCRPy.egg-info}/PKG-INFO +1 -1
  3. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/setup.py +1 -1
  4. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/TDCRPy.py +19 -10
  5. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/TDCR_model_lib.py +131 -4
  6. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/config.toml +4 -0
  7. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/LICENCE.md +0 -0
  8. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/MANIFEST.in +0 -0
  9. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/README.md +0 -0
  10. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/TDCRPy.egg-info/SOURCES.txt +0 -0
  11. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/TDCRPy.egg-info/dependency_links.txt +0 -0
  12. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/TDCRPy.egg-info/requires.txt +0 -0
  13. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/TDCRPy.egg-info/top_level.txt +0 -0
  14. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/setup.cfg +0 -0
  15. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_C-14.txt +0 -0
  16. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ca-45.txt +0 -0
  17. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Co-60.txt +0 -0
  18. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_H-3.txt +0 -0
  19. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Ni-63.txt +0 -0
  20. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Pm-147.txt +0 -0
  21. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Pu-241.txt +0 -0
  22. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_S-35.txt +0 -0
  23. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Sr-89.txt +0 -0
  24. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Sr-90.txt +0 -0
  25. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/Spectra_for_analytical_model/dep_spectrum_Tc-99.txt +0 -0
  26. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/E_depose.txt +0 -0
  27. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_1_200k.txt +0 -0
  28. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_2000_10000k.txt +0 -0
  29. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-beta-_200_2000k.txt +0 -0
  30. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_1_200k.txt +0 -0
  31. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_2000_10000k.txt +0 -0
  32. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_10ml-photon_200_2000k.txt +0 -0
  33. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_1_200k.txt +0 -0
  34. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_2000_10000k.txt +0 -0
  35. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-beta-_200_2000k.txt +0 -0
  36. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_1_200k.txt +0 -0
  37. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_2000_10000k.txt +0 -0
  38. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_13ml-photon_200_2000k.txt +0 -0
  39. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_1_200k.txt +0 -0
  40. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_2000_10000k.txt +0 -0
  41. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_200_2000k.txt +0 -0
  42. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_1_200k.txt +0 -0
  43. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_2000_10000k.txt +0 -0
  44. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-photon_200_2000k.txt +0 -0
  45. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Micelle/2nmfaq01.csv +0 -0
  46. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Micelle/faq01.csv +0 -0
  47. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_0.015.txt +0 -0
  48. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.1e-05.txt +0 -0
  49. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.2e-05.txt +0 -0
  50. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.3e-05.txt +0 -0
  51. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.4e-05.txt +0 -0
  52. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1.5e-05.txt +0 -0
  53. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_1e-05.txt +0 -0
  54. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_6e-06.txt +0 -0
  55. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_7e-06.txt +0 -0
  56. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_8e-06.txt +0 -0
  57. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyAlpha_9e-06.txt +0 -0
  58. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.006.txt +0 -0
  59. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.007.txt +0 -0
  60. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.008.txt +0 -0
  61. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.009.txt +0 -0
  62. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.01.txt +0 -0
  63. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.011.txt +0 -0
  64. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.012.txt +0 -0
  65. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.013.txt +0 -0
  66. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.014.txt +0 -0
  67. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/QuenchEnergyElectron_0.015.txt +0 -0
  68. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/TandataUG.txt +0 -0
  69. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/alpha_toulene.txt +0 -0
  70. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/inputVecteurAlpha.txt +0 -0
  71. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/Quenching/inputVecteurElectron.txt +0 -0
  72. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/TDCRPy1.py +0 -0
  73. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/TDCRoptimize.py +0 -0
  74. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/__init__.py +0 -0
  75. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/decayData/All-nuclides_BetaShape.zip +0 -0
  76. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/decayData/All-nuclides_Ensdf.zip +0 -0
  77. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/decayData/All-nuclides_PenNuc.zip +0 -0
  78. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/decayData/atom-ENDF-VII0.zip +0 -0
  79. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/decayData/photo-ENDF.zip +0 -0
  80. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/docs/_build/html/genindex.html +0 -0
  81. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/docs/_build/html/index.html +0 -0
  82. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/docs/_build/html/search.html +0 -0
  83. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/docs/_build/html/source/modules.html +0 -0
  84. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/docs/_build/html/source/tdcrpy.html +0 -0
  85. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/test/__init__.py +0 -0
  86. {tdcrpy-2.2.0 → tdcrpy-2.5.0}/tdcrpy/test/test_tdcrpy.py +0 -0
  87. {tdcrpy-2.2.0 → tdcrpy-2.5.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.5.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.5.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.5.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)
@@ -1227,20 +1236,20 @@ def effA(TD, Rad, pmf_1, kB, V, L=1, maxiter=20, xatol=1e-7, disp=False):
1227
1236
 
1228
1237
 
1229
1238
  # mode = "eff" # ask for efficiency calculation
1230
- # Rad="Na-22" # radionuclides
1239
+ # Rad="Fe-55" # radionuclides
1231
1240
  # pmf_1="1" # relatives fractions of the radionulides
1232
1241
  # N = 1000 # number of Monte Carlo trials
1233
1242
  # kB =1.0e-5 # Birks constant in cm keV-1
1234
1243
  # V = 10 # volume of scintillator in mL
1235
- # L=np.logspace(-3,2,num=100) # free parameter in keV-1
1244
+ # L=np.logspace(-1,2,num=100) # free parameter in keV-1
1236
1245
 
1237
- # # TDCRPy(1, Rad, pmf_1, 10, kB, V, mode, Display= True, barp=False, record=True)
1238
1246
  # # Record decay histories in temporary files
1239
- # TDCRPy(L[0], Rad, pmf_1, N, kB, V, mode, barp=True, record=True)
1247
+ # TDCRPy(L[0], Rad, pmf_1, N, kB, V, mode, barp=False, record=True, fullMC=False)
1248
+ # # TDCRPy(100, Rad, pmf_1, N, kB, V, mode, barp=False, record=True, fullMC=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"):
1243
- # out = TDCRPy(l, Rad, pmf_1, N, kB, V, mode, readRecHist=True)
1252
+ # out = TDCRPy(l, Rad, pmf_1, N, kB, V, mode, readRecHist=True, fullMC=False)
1244
1253
  # effS.append(out[2])
1245
1254
  # u_effS.append(out[3])
1246
1255
  # effD.append(out[2])
@@ -60,6 +60,7 @@ def readParameters(disp=False):
60
60
  diam_micelle = config["Inputs"].getfloat("diam_micelle")
61
61
  fAq = config["Inputs"].getfloat("fAq")
62
62
  micCorr = config["Inputs"].getboolean("micCorr")
63
+ alphaDir = config["Inputs"].getfloat("alphaDir")
63
64
 
64
65
  if disp:
65
66
  print(f"number of integration bins for electrons = {nE_electron}")
@@ -76,13 +77,14 @@ def readParameters(disp=False):
76
77
  print(f"activation of the micelle correction = {micCorr}")
77
78
  print(f"diameter of micelle = {diam_micelle} nm")
78
79
  print(f"acqueous fraction = {fAq}")
80
+ print(f"alpha parameter of the hidden Dirichlet process = {alphaDir}")
79
81
  print(f"coincidence resolving time = {tau} ns")
80
82
  print(f"extended dead time = {extDT} µs")
81
83
  print(f"measurement time = {measTime} min")
82
84
 
83
- return nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, pH,pC,pN,pO,pP,pCl
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
84
86
 
85
- nE_electron, nE_alpha, RHO, Z, A, depthSpline, Einterp_a, Einterp_e, diam_micelle, fAq, tau, extDT, measTime, micCorr, pH,pC,pN,pO,pP,pCl = readParameters()
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()
86
88
 
87
89
  p_atom = np.array([pH,pC,pN,pO,pP,pCl]) # atom abondance in the scintillator
88
90
  p_atom /= sum(p_atom)
@@ -192,6 +194,12 @@ def modifyMicCorr(x):
192
194
  x0 = readParameters()[13]
193
195
  data1 = data0.replace(f"micCorr = {x0}",f"micCorr= {x}")
194
196
  writeConfifAsstr(data1)
197
+
198
+ def modifyAlphaDir(x):
199
+ data0 = readConfigAsstr()
200
+ x0 = readParameters()[14]
201
+ data1 = data0.replace(f"alphaDir = {x0}",f"alphaDir = {x}")
202
+ writeConfifAsstr(data1)
195
203
 
196
204
  def read_temp_files(copy=False, path="C:"):
197
205
 
@@ -2894,6 +2902,7 @@ def detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, meas
2894
2902
  symm = False
2895
2903
  else:
2896
2904
  symm = True
2905
+
2897
2906
 
2898
2907
  if symm:
2899
2908
  # print(evenement !=1, t1 > extDT*1e-6, t1 < measTime*60)
@@ -2935,8 +2944,6 @@ def detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, meas
2935
2944
  efficiency0_A2 = p_single
2936
2945
  efficiency0_B2 = efficiency0_A2
2937
2946
  efficiency0_D2 = p_single**2
2938
-
2939
-
2940
2947
  else:
2941
2948
  if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
2942
2949
  # TDCR
@@ -3005,6 +3012,126 @@ def detectProbabilities(L, e_quenching, e_quenching2, t1, evenement, extDT, meas
3005
3012
  return efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2
3006
3013
 
3007
3014
 
3015
+ def detectProbabilitiesMC(L, e_quenching, e_quenching2, t1, evenement, extDT, measTime, dir_param = alphaDir):
3016
+ """
3017
+ 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
+
3019
+ Parameters
3020
+ ----------
3021
+ L : float or tuple
3022
+ 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
3023
+ e_quenching : list
3024
+ List of quenched deposited energies from prompt particles in keV.
3025
+ e_quenching2 : list
3026
+ List of quenched deposited energies from delayed particles in keV.
3027
+ t1 : float
3028
+ decay time of the delayed transitions in s.
3029
+ evenement : interger
3030
+ number of pulses per decay (prompt (1), prompt + delayed (2)).
3031
+ extDT : float
3032
+ extended dead time of the system in ns.
3033
+ measTime : float
3034
+ measurement time in minutes.
3035
+
3036
+ Returns
3037
+ -------
3038
+ efficiency0_S : float
3039
+ detection probability of single event.
3040
+ efficiency0_D : float
3041
+ detection probability of double coincidences.
3042
+ efficiency0_T : float
3043
+ detection probability of triple coincidences.
3044
+ efficiency0_AB : float
3045
+ detection probability of coincidences between channels A and B.
3046
+ efficiency0_BC : float
3047
+ detection probability of coincidences between channels B and C.
3048
+ efficiency0_AC : float
3049
+ detection probability of coincidences between channels A and C.
3050
+ efficiency0_D2 : float
3051
+ detection probability of coincidences in a C/N system.
3052
+
3053
+ """
3054
+ if isinstance(L, (tuple, list)):
3055
+ symm = False
3056
+ else:
3057
+ symm = True
3058
+
3059
+ alpha = 1
3060
+
3061
+ if alpha < 1000:
3062
+ dirichTD = np.random.dirichlet([alpha, alpha, alpha])
3063
+ dirichCN = np.random.dirichlet([alpha, alpha])
3064
+ else:
3065
+ dirichTD = [1/3, 1/3, 1/3]
3066
+ dirichCN = [1/2, 1/2]
3067
+
3068
+ efficiency0_S = 0; efficiency0_T = 0; efficiency0_D = 0
3069
+ efficiency0_AB = 0; efficiency0_BC = 0; efficiency0_AC = 0
3070
+ efficiency0_D2 = 0;
3071
+
3072
+ if symm:
3073
+ n_ph = np.random.poisson(sum(np.asarray(e_quenching))*L)
3074
+ # TDCR
3075
+ n_phPMT = np.random.multinomial(n_ph, dirichTD)
3076
+ if sum(n_phPMT>1)>0: efficiency0_S =1
3077
+ if sum(n_phPMT>1)>1: efficiency0_D =1
3078
+ if sum(n_phPMT>1)>2: efficiency0_T =1
3079
+ if n_phPMT[0]>1 and n_phPMT[1]>1: efficiency0_AB =1
3080
+ if n_phPMT[1]>1 and n_phPMT[2]>1: efficiency0_BC =1
3081
+ if n_phPMT[0]>1 and n_phPMT[2]>1: efficiency0_AC =1
3082
+ # C/N
3083
+ n_phPMT = np.random.multinomial(n_ph, dirichCN)
3084
+ if sum(n_phPMT>1)>1: efficiency0_D2 =1
3085
+
3086
+ if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
3087
+ n_ph2 = np.random.poisson(sum(np.asarray(e_quenching2))*L)
3088
+ # TDCR
3089
+ n_phPMT2 = np.random.multinomial(n_ph2, dirichTD)
3090
+ if sum(n_phPMT2>1)>0: efficiency0_S +=1
3091
+ if sum(n_phPMT2>1)>1: efficiency0_D +=1
3092
+ if sum(n_phPMT2>1)>2: efficiency0_T +=1
3093
+ if n_phPMT2[0]>1 and n_phPMT2[1]>1: efficiency0_AB +=1
3094
+ if n_phPMT2[1]>1 and n_phPMT2[2]>1: efficiency0_BC +=1
3095
+ if n_phPMT2[0]>1 and n_phPMT2[2]>1: efficiency0_AC +=1
3096
+ # C/N
3097
+ n_phPMT2 = np.random.multinomial(n_ph2, dirichCN)
3098
+ if sum(n_phPMT2>1)>1: efficiency0_D2 +=1
3099
+
3100
+ else: # asym
3101
+ Lm = np.mean(L)
3102
+ n_ph = np.random.poisson(sum(np.asarray((e_quenching))*Lm))
3103
+ # TDCR
3104
+ n_phPMT = np.random.multinomial(n_ph, [L[0]*dirichTD[0]/Lm, L[1]*dirichTD[1]/Lm, L[2]*dirichTD[2]/Lm])
3105
+ if sum(n_phPMT>1)>0: efficiency0_S =1
3106
+ if sum(n_phPMT>1)>1: efficiency0_D =1
3107
+ if sum(n_phPMT>1)>2: efficiency0_T =1
3108
+ if n_phPMT[0]>1 and n_phPMT[1]>1: efficiency0_AB =1
3109
+ if n_phPMT[1]>1 and n_phPMT[2]>1: efficiency0_BC =1
3110
+ if n_phPMT[0]>1 and n_phPMT[2]>1: efficiency0_AC =1
3111
+ # C/N
3112
+ n_phPMT = np.random.multinomial(n_ph, [L[0]/(2*Lm), L[1]/(2*Lm)])
3113
+ if sum(n_phPMT>1)>1: efficiency0_D2 =1
3114
+
3115
+ if evenement !=1 and t1 > extDT*1e-6 and t1 < measTime*60:
3116
+ n_ph2 = np.random.poisson(sum(np.asarray(e_quenching2))*Lm)
3117
+ # TDCR
3118
+ n_phPMT2 = np.random.multinomial(n_ph2, [L[0]*dirichCN[0]/Lm, L[1]*dirichCN[1]/Lm, L[2]*dirichCN[2]/Lm])
3119
+ if sum(n_phPMT2>1)>0: efficiency0_S +=1
3120
+ if sum(n_phPMT2>1)>1: efficiency0_D +=1
3121
+ if sum(n_phPMT2>1)>2: efficiency0_T +=1
3122
+ if n_phPMT2[0]>1 and n_phPMT2[1]>1: efficiency0_AB +=1
3123
+ if n_phPMT2[1]>1 and n_phPMT2[2]>1: efficiency0_BC +=1
3124
+ if n_phPMT2[0]>1 and n_phPMT2[2]>1: efficiency0_AC +=1
3125
+ # C/N
3126
+ n_phPMT2 = np.random.multinomial(n_ph2, [L[0]/(2*Lm), L[1]/(2*Lm)])
3127
+ if sum(n_phPMT2>1)>1: efficiency0_D2 +=1
3128
+
3129
+ return efficiency0_S, efficiency0_D, efficiency0_T, efficiency0_AB, efficiency0_BC, efficiency0_AC, efficiency0_D2
3130
+
3131
+
3132
+
3133
+
3134
+
3008
3135
  def efficienciesEstimates(efficiency_S, efficiency_D, efficiency_T, efficiency_AB, efficiency_BC, efficiency_AC, efficiency_D2, N):
3009
3136
  """
3010
3137
  Calculate detection efficiencies from list of detection probabilities per decays.
@@ -31,6 +31,10 @@ diam_micelle = 2
31
31
  # acqueous fraction of the scintillator
32
32
  fAq = 0.1
33
33
 
34
+ ## OPTICAL PROPERTIES
35
+ # Dirichlet parameter
36
+ alphaDir = 100000
37
+
34
38
  ## PROPERTIES OF THE COUNTER
35
39
  # Coincidence resolving time (ns)
36
40
  tau = 50
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