TDCRPy 1.2.0__py3-none-any.whl → 1.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.
Potentially problematic release.
This version of TDCRPy might be problematic. Click here for more details.
- {TDCRPy-1.2.0.dist-info → TDCRPy-1.4.0.dist-info}/METADATA +2 -1
- {TDCRPy-1.2.0.dist-info → TDCRPy-1.4.0.dist-info}/RECORD +8 -7
- tdcrpy/TDCRPy.py +221 -89
- tdcrpy/TDCRPy1.py +946 -0
- tdcrpy/TDCR_model_lib.py +71 -31
- {TDCRPy-1.2.0.dist-info → TDCRPy-1.4.0.dist-info}/LICENCE.md +0 -0
- {TDCRPy-1.2.0.dist-info → TDCRPy-1.4.0.dist-info}/WHEEL +0 -0
- {TDCRPy-1.2.0.dist-info → TDCRPy-1.4.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TDCRPy
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: TDCR model
|
|
5
5
|
Home-page: https://github.com/RomainCoulon/TDCRPy
|
|
6
6
|
Author: RomainCoulon (Romain Coulon)
|
|
@@ -25,6 +25,7 @@ Requires-Dist: setuptools
|
|
|
25
25
|
Requires-Dist: scipy
|
|
26
26
|
Requires-Dist: configparser
|
|
27
27
|
Requires-Dist: importlib.resources
|
|
28
|
+
Requires-Dist: matplotlib
|
|
28
29
|
|
|
29
30
|
# TDCRPy
|
|
30
31
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
tdcrpy/TDCRPy.py,sha256=
|
|
2
|
-
tdcrpy/
|
|
1
|
+
tdcrpy/TDCRPy.py,sha256=quadaBgbdES_TJIm5nwkurXlu0cWAEVaxpoEpTCXTJI,57594
|
|
2
|
+
tdcrpy/TDCRPy1.py,sha256=jtY1CUZ2eaFjTVjU5IBzL3yixq5BoAIw2YJZhfvO0jA,57562
|
|
3
|
+
tdcrpy/TDCR_model_lib.py,sha256=eWD4jp8Bh1ytRJmzCNkJlbco4aQOIN1ZB3iWYlutxo8,67711
|
|
3
4
|
tdcrpy/TDCRoptimize.py,sha256=ab1EzTNm2HALwKopitwX0BAS8v0pEgAXnye4NOUBazc,3132
|
|
4
5
|
tdcrpy/__init__.py,sha256=pxZ5gMTFSEzeGQLzeRjy-Imu7bZIfhg9eqloOq5FTM4,130
|
|
5
6
|
tdcrpy/config.toml,sha256=P46cM2uvxD5NgcVK0J6zE2kFnh5AmAww5CMgxgtWCKE,1541
|
|
@@ -60,8 +61,8 @@ tdcrpy/docs/_build/html/source/modules.html,sha256=gJrhuEaMQHkYGewGHPWGmgVsPgVV6
|
|
|
60
61
|
tdcrpy/docs/_build/html/source/tdcrpy.html,sha256=VZV_LFdrCCIvYBXzsZE9mZx8iGa7ZjhEsXtE8BqqU9g,90373
|
|
61
62
|
tdcrpy/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
63
|
tdcrpy/test/test_tdcrpy.py,sha256=dWZpfvarkr8lr_K_zUakt2AOcF0FfCOjBOQPl4vnTWc,4116
|
|
63
|
-
TDCRPy-1.
|
|
64
|
-
TDCRPy-1.
|
|
65
|
-
TDCRPy-1.
|
|
66
|
-
TDCRPy-1.
|
|
67
|
-
TDCRPy-1.
|
|
64
|
+
TDCRPy-1.4.0.dist-info/LICENCE.md,sha256=fuYzrZRiOAjJBzA1tsGQwojCgGROArb2Ec48GDTjlWM,1086
|
|
65
|
+
TDCRPy-1.4.0.dist-info/METADATA,sha256=mOrS7wJUGlmoWmHB4sczPRD2i31mtNvW_V8yy3KjBkg,15929
|
|
66
|
+
TDCRPy-1.4.0.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
67
|
+
TDCRPy-1.4.0.dist-info/top_level.txt,sha256=VgPJa9YJ7fi8wrr9qDJPLhu3tK1BcFRIP6Ib4r3BEfs,7
|
|
68
|
+
TDCRPy-1.4.0.dist-info/RECORD,,
|
tdcrpy/TDCRPy.py
CHANGED
|
@@ -12,11 +12,12 @@ Bureau International des Poids et Mesures
|
|
|
12
12
|
# import tdcrpy.TDCR_model_lib as tl
|
|
13
13
|
import TDCR_model_lib as tl
|
|
14
14
|
import importlib.resources
|
|
15
|
+
from importlib.resources import files
|
|
15
16
|
import configparser
|
|
16
17
|
import numpy as np
|
|
17
18
|
from tqdm import tqdm
|
|
18
19
|
|
|
19
|
-
def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=False, barp=False):
|
|
20
|
+
def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=False, barp=False,uncData=False):
|
|
20
21
|
"""
|
|
21
22
|
This is the main function of the TDCRPy package running the Monte-Carlo Triple-to-Double Coincidence Ratio model.
|
|
22
23
|
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.
|
|
@@ -95,7 +96,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
95
96
|
"""
|
|
96
97
|
if barp: tl.display_header()
|
|
97
98
|
config = configparser.ConfigParser()
|
|
98
|
-
with importlib.resources.
|
|
99
|
+
with importlib.resources.as_file(files('tdcrpy').joinpath('config.toml')) as data_path:
|
|
99
100
|
file_conf = data_path
|
|
100
101
|
config.read(file_conf)
|
|
101
102
|
tau=config["Inputs"].getfloat("tau")
|
|
@@ -174,9 +175,15 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
174
175
|
efficiency_S = []
|
|
175
176
|
efficiency_D = []
|
|
176
177
|
efficiency_T = []
|
|
178
|
+
efficiency_S2 = []
|
|
179
|
+
efficiency_D2 = []
|
|
180
|
+
efficiency_T2 = []
|
|
177
181
|
efficiency_AB = []
|
|
178
182
|
efficiency_BC = []
|
|
179
183
|
efficiency_AC = []
|
|
184
|
+
efficiency_AB2 = []
|
|
185
|
+
efficiency_BC2 = []
|
|
186
|
+
efficiency_AC2 = []
|
|
180
187
|
|
|
181
188
|
if barp and not Display: NN = tqdm(range(N), desc="Processing", unit=" decays")
|
|
182
189
|
else: NN = range(N)
|
|
@@ -223,8 +230,9 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
223
230
|
print("\t Sampled decay branch:")
|
|
224
231
|
if particle_branch[:4]=="Atom":
|
|
225
232
|
if particle_branch=="Atom_K": print("\t\t Electron capture on K shell")
|
|
226
|
-
if particle_branch=="Atom_L": print("\t\t Electron capture on L shell")
|
|
233
|
+
if particle_branch=="Atom_L" or particle_branch=="Atom_L1" or particle_branch=="Atom_L2" or particle_branch=="Atom_L3": print("\t\t Electron capture on L shell")
|
|
227
234
|
if particle_branch=="Atom_M": print("\t\t Electron capture on M shell")
|
|
235
|
+
if particle_branch=="Atom_O": print("\t\t Electron capture on O shell")
|
|
228
236
|
else:
|
|
229
237
|
print("\t\t Particle: ", particle_branch)
|
|
230
238
|
print("\t\t Energy of the particle = ", energy_branch, " keV")
|
|
@@ -251,18 +259,34 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
251
259
|
==============
|
|
252
260
|
'''
|
|
253
261
|
if Display: print("\t Subsequent isomeric transition(s)") # finish with the mother / now with the daughter
|
|
262
|
+
evenement = 1
|
|
263
|
+
e_sum2 = 0
|
|
264
|
+
particle_vec2 = []
|
|
265
|
+
energy_vec2 = []
|
|
254
266
|
while levelOftheDaughter > 0: # Go on the loop while the daughter nucleus is a its fundamental level (energy 0)
|
|
255
267
|
i_level = levelNumber[index_rad][iDaughter].index([levelOftheDaughter]) # Find the position in the daughter level vector
|
|
256
268
|
|
|
269
|
+
t1 = np.random.exponential(trans_halfLife[index_rad][iDaughter][i_level][0], size=1)[0]
|
|
270
|
+
|
|
257
271
|
# test whether the decay occurs within the coincidence resolving time or not
|
|
258
|
-
if
|
|
259
|
-
|
|
272
|
+
if t1 > tau*1e-9:
|
|
273
|
+
#splitEvent = True
|
|
274
|
+
evenement = evenement + 1
|
|
260
275
|
|
|
261
276
|
if transitionType[index_rad][iDaughter][i_level] != []:
|
|
262
277
|
#====================================================================
|
|
263
278
|
# Sampling of the transition in energy levels of the daughter nucleus
|
|
264
279
|
#====================================================================
|
|
265
|
-
|
|
280
|
+
|
|
281
|
+
if uncData:
|
|
282
|
+
prob_trans_s=[]
|
|
283
|
+
for ipt, xpt in enumerate(prob_trans[index_rad][iDaughter][i_level]):
|
|
284
|
+
prob_trans_s.append(np.random.normal(xpt, u_prob_trans[index_rad][iDaughter][i_level][ipt], 1)[0])
|
|
285
|
+
|
|
286
|
+
probability_tran = tl.normalise(prob_trans_s) # normaliser la proba de transition
|
|
287
|
+
else:
|
|
288
|
+
probability_tran = tl.normalise(prob_trans[index_rad][iDaughter][i_level]) # normaliser la proba de transition
|
|
289
|
+
#probability_tran = tl.normalise(prob_trans[index_rad][iDaughter][i_level]) # normaliser la proba de transition
|
|
266
290
|
index_t = tl.sampling(probability_tran) # indice de la transition
|
|
267
291
|
if Display:
|
|
268
292
|
print("\t\t Energy of the level = ", levelEnergy[index_rad][iDaughter][i_level][0], " keV")
|
|
@@ -279,62 +303,111 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
279
303
|
#========
|
|
280
304
|
# Scoring
|
|
281
305
|
#========
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
306
|
+
|
|
307
|
+
## evenement retardé
|
|
308
|
+
if evenement != 1:
|
|
309
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "GA": # if it is a gamma that has been emitted
|
|
310
|
+
particle_vec2.append("gamma") # Update of the particle vector
|
|
311
|
+
energy_vec2.append(e_trans[index_rad][iDaughter][i_level][index_t]) # Update the energy vector
|
|
312
|
+
else: # if not, it is a internal conversion, so an electron
|
|
313
|
+
particle_vec2.append("electron") # !!!!!!!!! it is OK for our model? Does the electron leave with the kinetic enegy of the transition
|
|
314
|
+
energy_vec2.append(e_trans[index_rad][iDaughter][i_level][index_t]) # Update the energy vector
|
|
315
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EK": # record that an electron is missing on the K shell of the dughter nucleus
|
|
316
|
+
particle_vec2.append("Atom_K")
|
|
317
|
+
energy_vec2.append(0)
|
|
318
|
+
|
|
319
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EL": # record that an electron is missing on the L1 shell of the dughter nucleus
|
|
320
|
+
particle_vec2.append("Atom_L")
|
|
321
|
+
energy_vec2.append(0)
|
|
322
|
+
|
|
323
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EL1": # record that an electron is missing on the L1 shell of the dughter nucleus
|
|
324
|
+
particle_vec2.append("Atom_L1")
|
|
325
|
+
energy_vec2.append(0)
|
|
326
|
+
|
|
327
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EL2": # record that an electron is missing on the L2 shell of the dughter nucleus
|
|
328
|
+
particle_vec2.append("Atom_L2")
|
|
329
|
+
energy_vec2.append(0)
|
|
330
|
+
|
|
331
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EL3": # record that an electron is missing on the L3 shell of the dughter nucleus
|
|
332
|
+
particle_vec2.append("Atom_L3")
|
|
333
|
+
energy_vec2.append(0)
|
|
334
|
+
|
|
335
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EM": # record that an electron is missing on the M shell of the dughter nucleus
|
|
336
|
+
particle_vec2.append("Atom_M")
|
|
337
|
+
energy_vec2.append(0)
|
|
338
|
+
|
|
339
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EN": # record that an electron is missing on the N shell of the dughter nucleus
|
|
340
|
+
particle_vec2.append("Atom_N")
|
|
341
|
+
energy_vec2.append(0)
|
|
342
|
+
e_sum2 += e_trans[index_rad][iDaughter][i_level][index_t] # Energy summary
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
## evenement normal
|
|
346
|
+
else:
|
|
347
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "GA": # if it is a gamma that has been emitted
|
|
348
|
+
particle_vec.append("gamma") # Update of the particle vector
|
|
349
|
+
energy_vec.append(e_trans[index_rad][iDaughter][i_level][index_t]) # Update the energy vector
|
|
350
|
+
else: # if not, it is a internal conversion, so an electron
|
|
351
|
+
particle_vec.append("electron") # !!!!!!!!! it is OK for our model? Does the electron leave with the kinetic enegy of the transition
|
|
352
|
+
energy_vec.append(e_trans[index_rad][iDaughter][i_level][index_t]) # Update the energy vector
|
|
353
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EK": # record that an electron is missing on the K shell of the dughter nucleus
|
|
354
|
+
particle_vec.append("Atom_K")
|
|
355
|
+
energy_vec.append(0)
|
|
356
|
+
|
|
357
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EL": # record that an electron is missing on the L1 shell of the dughter nucleus
|
|
358
|
+
particle_vec.append("Atom_L")
|
|
359
|
+
energy_vec.append(0)
|
|
360
|
+
|
|
361
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EL1": # record that an electron is missing on the L1 shell of the dughter nucleus
|
|
362
|
+
particle_vec.append("Atom_L1")
|
|
363
|
+
energy_vec.append(0)
|
|
364
|
+
|
|
365
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EL2": # record that an electron is missing on the L2 shell of the dughter nucleus
|
|
366
|
+
particle_vec.append("Atom_L2")
|
|
367
|
+
energy_vec.append(0)
|
|
368
|
+
|
|
369
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EL3": # record that an electron is missing on the L3 shell of the dughter nucleus
|
|
370
|
+
particle_vec.append("Atom_L3")
|
|
371
|
+
energy_vec.append(0)
|
|
372
|
+
|
|
373
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EM": # record that an electron is missing on the M shell of the dughter nucleus
|
|
374
|
+
particle_vec.append("Atom_M")
|
|
375
|
+
energy_vec.append(0)
|
|
376
|
+
|
|
377
|
+
if transitionType[index_rad][iDaughter][i_level][index_t] == "EN": # record that an electron is missing on the N shell of the dughter nucleus
|
|
378
|
+
particle_vec.append("Atom_N")
|
|
379
|
+
energy_vec.append(0)
|
|
380
|
+
e_sum += e_trans[index_rad][iDaughter][i_level][index_t] # Energy summary
|
|
315
381
|
|
|
316
|
-
|
|
382
|
+
|
|
383
|
+
|
|
317
384
|
levelOftheDaughter = next_level[index_rad][iDaughter][i_level][index_t] # set the next level
|
|
385
|
+
|
|
318
386
|
else:
|
|
319
387
|
i_level = levelNumber[index_rad][iDaughter].index([levelOftheDaughter])
|
|
320
388
|
print("warning:pas de données de transition:daughter,niveau,niveau d'énergie",DaughterVec[index_rad][iDaughter],levelOftheDaughter,levelEnergy[index_rad][iDaughter][i_level] )
|
|
321
389
|
levelOftheDaughter = 0 # set the next level
|
|
322
390
|
|
|
323
391
|
if Display:
|
|
324
|
-
print("\t Summary of the nuclear decay")
|
|
392
|
+
print("\t Summary of the nuclear promt decay")
|
|
325
393
|
for i, p in enumerate(particle_vec):
|
|
326
394
|
if p[:4] != "Atom":
|
|
395
|
+
print('particle :',p)
|
|
327
396
|
print(f"\t\t energy of {p} = ", energy_vec[i]," keV")
|
|
397
|
+
if evenement != 1:
|
|
398
|
+
print("\t Summary of the nuclear delayed decay")
|
|
399
|
+
for i, p in enumerate(particle_vec2):
|
|
400
|
+
if p[:4] != "Atom":
|
|
401
|
+
print('particle :',p)
|
|
402
|
+
print(f"\t\t energy of {p} = ", energy_vec2[i]," keV")
|
|
328
403
|
|
|
329
404
|
'''
|
|
330
405
|
==========================
|
|
331
406
|
II. LA RELAXATION ATOMIQUE
|
|
332
407
|
==========================
|
|
333
408
|
'''
|
|
334
|
-
|
|
335
|
-
if
|
|
336
|
-
particle_vec2=[]
|
|
337
|
-
energy_vec2=[]
|
|
409
|
+
## evenement retarde
|
|
410
|
+
if evenement != 1:
|
|
338
411
|
|
|
339
412
|
daughter_relax = DaughterVec[index_rad][iDaughter]
|
|
340
413
|
for i_part in range(len(particle_vec)):
|
|
@@ -345,35 +418,77 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
345
418
|
tf,ef = tl.relaxation_atom(daughter_relax,Rad[index_rad],particle_vec[i_part])
|
|
346
419
|
if tf == "XKA":
|
|
347
420
|
particle_vec[i_part] = "Atom_L"
|
|
421
|
+
particle_vec.append(tf)
|
|
422
|
+
energy_vec.append(ef)
|
|
423
|
+
relaxation = True
|
|
424
|
+
elif tf == "XKB":
|
|
425
|
+
particle_vec[i_part] = "Atom_M"
|
|
426
|
+
particle_vec.append(tf)
|
|
427
|
+
energy_vec.append(ef)
|
|
428
|
+
relaxation = False
|
|
429
|
+
elif tf == "XL":
|
|
430
|
+
particle_vec[i_part] = "Atom_M"
|
|
431
|
+
particle_vec.append(tf)
|
|
432
|
+
energy_vec.append(ef)
|
|
433
|
+
relaxation = False
|
|
434
|
+
elif tf == "Auger K":
|
|
435
|
+
particle_vec[i_part] = "Atom_L"
|
|
436
|
+
particle_vec.append(tf)
|
|
437
|
+
energy_vec.append(ef)
|
|
438
|
+
relaxation = True
|
|
439
|
+
elif tf == "Auger L":
|
|
440
|
+
particle_vec[i_part] = "Atom_M"
|
|
441
|
+
particle_vec.append(tf)
|
|
442
|
+
energy_vec.append(ef)
|
|
443
|
+
relaxation = False
|
|
444
|
+
else:
|
|
445
|
+
if Display: print("untermined x or Auger")
|
|
446
|
+
relaxation = False
|
|
447
|
+
e_sum += ef
|
|
448
|
+
if Display:
|
|
449
|
+
print("\t Summary of the atomic relaxation (promt emission)")
|
|
450
|
+
for i, p in enumerate(particle_vec):
|
|
451
|
+
if p[:4] != "Atom":
|
|
452
|
+
print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
453
|
+
|
|
454
|
+
for i_part in range(len(particle_vec2)):
|
|
455
|
+
relaxation = False
|
|
456
|
+
if "Atom_K" in particle_vec2[i_part] or "Atom_L" in particle_vec2[i_part] or "Atom_M" in particle_vec2[i_part]:
|
|
457
|
+
relaxation = True
|
|
458
|
+
while relaxation:
|
|
459
|
+
tf,ef = tl.relaxation_atom(daughter_relax,Rad[index_rad],particle_vec2[i_part])
|
|
460
|
+
if tf == "XKA":
|
|
461
|
+
particle_vec2[i_part] = "Atom_L"
|
|
348
462
|
particle_vec2.append(tf)
|
|
349
463
|
energy_vec2.append(ef)
|
|
350
464
|
relaxation = True
|
|
351
465
|
elif tf == "XKB":
|
|
352
|
-
|
|
466
|
+
particle_vec2[i_part] = "Atom_M"
|
|
353
467
|
particle_vec2.append(tf)
|
|
354
468
|
energy_vec2.append(ef)
|
|
355
469
|
relaxation = False
|
|
356
470
|
elif tf == "XL":
|
|
357
|
-
|
|
471
|
+
particle_vec2[i_part] = "Atom_M"
|
|
358
472
|
particle_vec2.append(tf)
|
|
359
473
|
energy_vec2.append(ef)
|
|
360
474
|
relaxation = False
|
|
361
475
|
elif tf == "Auger K":
|
|
362
|
-
|
|
476
|
+
particle_vec2[i_part] = "Atom_L"
|
|
363
477
|
particle_vec2.append(tf)
|
|
364
478
|
energy_vec2.append(ef)
|
|
365
479
|
relaxation = True
|
|
366
480
|
elif tf == "Auger L":
|
|
367
|
-
|
|
481
|
+
particle_vec2[i_part] = "Atom_M"
|
|
368
482
|
particle_vec2.append(tf)
|
|
369
483
|
energy_vec2.append(ef)
|
|
370
484
|
relaxation = False
|
|
371
485
|
else:
|
|
372
486
|
if Display: print("untermined x or Auger")
|
|
373
487
|
relaxation = False
|
|
374
|
-
|
|
488
|
+
e_sum2 += ef
|
|
489
|
+
|
|
375
490
|
if Display:
|
|
376
|
-
print("\t Summary of the atomic relaxation (
|
|
491
|
+
print("\t Summary of the atomic relaxation (delayed emission)")
|
|
377
492
|
for i, p in enumerate(particle_vec2):
|
|
378
493
|
if p[:4] != "Atom":
|
|
379
494
|
print(f"\t\t energy of {p} = ", round(energy_vec2[i],3), "keV")
|
|
@@ -395,14 +510,14 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
395
510
|
e_b,p_b = tl.readBetaShape(rad_i,"beta+",level_before_trans)
|
|
396
511
|
index_beta_energy = tl.sampling(p_b)
|
|
397
512
|
particle_vec2[i] = "positron"
|
|
398
|
-
|
|
513
|
+
energy_vec2[i] = e_b[index_beta_energy]
|
|
399
514
|
particle_vec2.append("gamma")
|
|
400
515
|
particle_vec2.append("gamma")
|
|
401
516
|
energy_vec2.append(511)
|
|
402
517
|
energy_vec2.append(511)
|
|
403
518
|
energy_vec_initial2 = energy_vec2
|
|
404
519
|
if Display:
|
|
405
|
-
print("\t Summary of emitted particles from the
|
|
520
|
+
print("\t Summary of emitted particles from the delayed atomic relaxation")
|
|
406
521
|
for i, p in enumerate(particle_vec2):
|
|
407
522
|
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec2[i],3), "keV")
|
|
408
523
|
|
|
@@ -425,7 +540,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
425
540
|
energy_vec.append(511)
|
|
426
541
|
energy_vec_initial = energy_vec
|
|
427
542
|
if Display:
|
|
428
|
-
print("\t Summary of emitted particles from the
|
|
543
|
+
print("\t Summary of emitted particles from the promt nuclear relaxation")
|
|
429
544
|
for i, p in enumerate(particle_vec):
|
|
430
545
|
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
431
546
|
|
|
@@ -452,7 +567,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
452
567
|
energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
|
|
453
568
|
|
|
454
569
|
if Display:
|
|
455
|
-
print("\t Summary of the energy deposited by charged particles by the
|
|
570
|
+
print("\t Summary of the energy deposited by charged particles by the delayed atomic relaxation")
|
|
456
571
|
for i, p in enumerate(particle_vec2):
|
|
457
572
|
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec2[i],3), "keV")
|
|
458
573
|
|
|
@@ -473,7 +588,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
473
588
|
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
474
589
|
|
|
475
590
|
if Display:
|
|
476
|
-
print("\t Summary of the energy deposited by charged particles from the
|
|
591
|
+
print("\t Summary of the energy deposited by charged particles from the prompt nuclear relaxation")
|
|
477
592
|
for i, p in enumerate(particle_vec):
|
|
478
593
|
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
479
594
|
|
|
@@ -483,7 +598,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
483
598
|
Calculation of the scintillation quenching with the Birks Model
|
|
484
599
|
====================
|
|
485
600
|
'''
|
|
486
|
-
if Display: print("\t Summary of the estimation of quenched energies by the
|
|
601
|
+
if Display: print("\t Summary of the estimation of quenched energies by the delayed atomic relaxation")
|
|
487
602
|
e_quenching2=[]
|
|
488
603
|
for i, p in enumerate(particle_vec2):
|
|
489
604
|
if p == "alpha":
|
|
@@ -501,7 +616,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
501
616
|
|
|
502
617
|
|
|
503
618
|
# changer l'intégration E_i - E_d à E_i
|
|
504
|
-
if Display: print("\t Summary of the estimation of quenched energies from the
|
|
619
|
+
if Display: print("\t Summary of the estimation of quenched energies from the prompt nuclear relaxation")
|
|
505
620
|
e_quenching=[]
|
|
506
621
|
for i, p in enumerate(particle_vec):
|
|
507
622
|
if p == "alpha":
|
|
@@ -524,7 +639,18 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
524
639
|
'''
|
|
525
640
|
|
|
526
641
|
if mode2=="sym":
|
|
527
|
-
|
|
642
|
+
p_nosingle2 = np.exp(-L*np.sum(np.asarray(e_quenching2))/3) # probability to have 0 electrons in a PMT
|
|
643
|
+
p_single2 = 1-p_nosingle2 # probability to have at least 1 electrons in a PMT
|
|
644
|
+
efficiency_S2.append(p_single2)
|
|
645
|
+
efficiency_T2.append(p_single2**3)
|
|
646
|
+
efficiency_D2.append(3*(p_single2)**2-2*efficiency_T2[-1])
|
|
647
|
+
if Display: print("\t Summary of TDCR measurement (delayed)")
|
|
648
|
+
if Display: print("\t\t Free parameter = ", L, "keV-1")
|
|
649
|
+
if Display: print("\t\t Efficiency of single events = ", round(efficiency_S2[-1],5))
|
|
650
|
+
if Display: print("\t\t Efficiency of double events = ", round(efficiency_D2[-1],5))
|
|
651
|
+
if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T2[-1],5))
|
|
652
|
+
|
|
653
|
+
p_nosingle = np.exp(-L*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
528
654
|
p_single = 1-p_nosingle # probability to have at least 1 electrons in a PMT
|
|
529
655
|
efficiency_S.append(p_single)
|
|
530
656
|
efficiency_T.append(p_single**3)
|
|
@@ -534,41 +660,30 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
534
660
|
if Display: print("\t\t Efficiency of single events = ", round(efficiency_S[-1],5))
|
|
535
661
|
if Display: print("\t\t Efficiency of double events = ", round(efficiency_D[-1],5))
|
|
536
662
|
if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T[-1],5))
|
|
663
|
+
|
|
537
664
|
elif mode2=="asym":
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
665
|
+
pA_nosingle2 = np.exp(-L[0]*np.sum(np.asarray(e_quenching2))/3) # probability to have 0 electrons in a PMT
|
|
666
|
+
pA_single2 = 1-pA_nosingle2 # probability to have at least 1 electrons in a PMT
|
|
667
|
+
pB_nosingle2 = np.exp(-L[1]*np.sum(np.asarray(e_quenching2))/3) # probability to have 0 electrons in a PMT
|
|
668
|
+
pB_single2 = 1-pB_nosingle2 # probability to have at least 1 electrons in a PMT
|
|
669
|
+
pC_nosingle2 = np.exp(-L[2]*np.sum(np.asarray(e_quenching2))/3) # probability to have 0 electrons in a PMT
|
|
670
|
+
pC_single2 = 1-pC_nosingle2 # probability to have at least 1 electrons in a PMT
|
|
544
671
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
if Display: print("\t Summary of TDCR measurement (
|
|
672
|
+
efficiency_AB2.append(pA_single2*pB_single2)
|
|
673
|
+
efficiency_BC2.append(pB_single2*pC_single2)
|
|
674
|
+
efficiency_AC2.append(pA_single2*pC_single2)
|
|
675
|
+
efficiency_T2.append(pA_single2*pB_single2*pC_single2)
|
|
676
|
+
efficiency_D2.append(efficiency_AB2[-1]+efficiency_BC2[-1]+efficiency_AC2[-1]-2*efficiency_T2[-1])
|
|
677
|
+
efficiency_S2.append(pA_single2+pB_single2+pC_single2-efficiency_D2[-1]-efficiency_T2[-1])
|
|
678
|
+
if Display: print("\t Summary of TDCR measurement (delayed)")
|
|
552
679
|
if Display: print("\t\t Free parameter PMT A: ", L[0], "keV-1")
|
|
553
680
|
if Display: print("\t\t Free parameter PMT B: ", L[1], "keV-1")
|
|
554
681
|
if Display: print("\t\t Free parameter PMT C: ", L[2], "keV-1")
|
|
555
|
-
if Display: print("\t\t Efficiency of single events: ", round(
|
|
556
|
-
if Display: print("\t\t Efficiency of double events: ", round(
|
|
557
|
-
if Display: print("\t\t Efficiency of triple events: ", round(
|
|
558
|
-
|
|
682
|
+
if Display: print("\t\t Efficiency of single events: ", round(efficiency_S2[-1],5))
|
|
683
|
+
if Display: print("\t\t Efficiency of double events: ", round(efficiency_D2[-1],5))
|
|
684
|
+
if Display: print("\t\t Efficiency of triple events: ", round(efficiency_T2[-1],5))
|
|
559
685
|
|
|
560
|
-
|
|
561
|
-
p_nosingle = np.exp(-L*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
562
|
-
p_single = 1-p_nosingle # probability to have at least 1 electrons in a PMT
|
|
563
|
-
efficiency_S.append(p_single)
|
|
564
|
-
efficiency_T.append(p_single**3)
|
|
565
|
-
efficiency_D.append(3*(p_single)**2-2*efficiency_T[-1])
|
|
566
|
-
if Display: print("\t Summary of TDCR measurement (delayed)")
|
|
567
|
-
if Display: print("\t\t Free parameter = ", L, "keV-1")
|
|
568
|
-
if Display: print("\t\t Efficiency of single events = ", round(efficiency_S[-1],5))
|
|
569
|
-
if Display: print("\t\t Efficiency of double events = ", round(efficiency_D[-1],5))
|
|
570
|
-
if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T[-1],5))
|
|
571
|
-
elif mode2=="asym":
|
|
686
|
+
|
|
572
687
|
pA_nosingle = np.exp(-L[0]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
573
688
|
pA_single = 1-pA_nosingle # probability to have at least 1 electrons in a PMT
|
|
574
689
|
pB_nosingle = np.exp(-L[1]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
@@ -582,7 +697,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
582
697
|
efficiency_T.append(pA_single*pB_single*pC_single)
|
|
583
698
|
efficiency_D.append(efficiency_AB[-1]+efficiency_BC[-1]+efficiency_AC[-1]-2*efficiency_T[-1])
|
|
584
699
|
efficiency_S.append(pA_single+pB_single+pC_single-efficiency_D[-1]-efficiency_T[-1])
|
|
585
|
-
if Display: print("\t Summary of TDCR measurement (
|
|
700
|
+
if Display: print("\t Summary of TDCR measurement (prompt)")
|
|
586
701
|
if Display: print("\t\t Free parameter PMT A: ", L[0], "keV-1")
|
|
587
702
|
if Display: print("\t\t Free parameter PMT B: ", L[1], "keV-1")
|
|
588
703
|
if Display: print("\t\t Free parameter PMT C: ", L[2], "keV-1")
|
|
@@ -811,4 +926,21 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
811
926
|
return mean_efficiency_S, 1, mean_efficiency_D, 1, mean_efficiency_T, 1
|
|
812
927
|
else:
|
|
813
928
|
return mean_efficiency_S, std_efficiency_S, mean_efficiency_D, std_efficiency_D, mean_efficiency_T, std_efficiency_T
|
|
929
|
+
if mode =="dis":
|
|
930
|
+
return efficiency_S, efficiency_D, efficiency_T
|
|
931
|
+
|
|
932
|
+
# L = (1, 1, 1)
|
|
933
|
+
# TD = 0.977667386529166
|
|
934
|
+
# TAB = 0.992232838598821
|
|
935
|
+
# TBC = 0.992343419459002
|
|
936
|
+
# TAC = 0.99275350064608
|
|
937
|
+
# Rad="Cd-109"
|
|
938
|
+
# pmf_1="1"
|
|
939
|
+
# N = 1000
|
|
940
|
+
# kB =1.0e-5
|
|
941
|
+
# V = 10
|
|
942
|
+
# mode = "dis"
|
|
943
|
+
# mode2 = "asym"
|
|
944
|
+
|
|
814
945
|
|
|
946
|
+
# S,D,T = TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=False, barp=True,uncData=True)
|