TDCRPy 1.4.0__py3-none-any.whl → 1.5.1__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.4.0.dist-info → TDCRPy-1.5.1.dist-info}/METADATA +1 -1
- {TDCRPy-1.4.0.dist-info → TDCRPy-1.5.1.dist-info}/RECORD +9 -8
- tdcrpy/MCNP-MATRIX/matrice/fichier/matrice_16ml-beta-_2000_10000k.txt +1003 -0
- tdcrpy/TDCRPy.py +157 -138
- tdcrpy/TDCRPy1.py +183 -457
- tdcrpy/TDCR_model_lib.py +35 -34
- {TDCRPy-1.4.0.dist-info → TDCRPy-1.5.1.dist-info}/LICENCE.md +0 -0
- {TDCRPy-1.4.0.dist-info → TDCRPy-1.5.1.dist-info}/WHEEL +0 -0
- {TDCRPy-1.4.0.dist-info → TDCRPy-1.5.1.dist-info}/top_level.txt +0 -0
tdcrpy/TDCRPy1.py
CHANGED
|
@@ -17,6 +17,173 @@ import configparser
|
|
|
17
17
|
import numpy as np
|
|
18
18
|
from tqdm import tqdm
|
|
19
19
|
|
|
20
|
+
|
|
21
|
+
def TDCR_relaxation(L, TD, TAB, TBC, TAC, daughter,Rad, kB, V,particle_vec, energy_vec,mode2,e_sum,level_before_trans,nE_alpha,nE_electron,uncData=False,Display=False,delay=False):
|
|
22
|
+
efficiency_S = []
|
|
23
|
+
efficiency_D = []
|
|
24
|
+
efficiency_T = []
|
|
25
|
+
efficiency_AB = []
|
|
26
|
+
efficiency_BC = []
|
|
27
|
+
efficiency_AC = []
|
|
28
|
+
for i_part in range(len(particle_vec)):
|
|
29
|
+
relaxation = False
|
|
30
|
+
if "Atom_K" in particle_vec[i_part] or "Atom_L" in particle_vec[i_part] or "Atom_M" in particle_vec[i_part]:
|
|
31
|
+
relaxation = True
|
|
32
|
+
while relaxation:
|
|
33
|
+
tf,ef = tl.relaxation_atom(daughter,Rad,particle_vec[i_part])
|
|
34
|
+
if tf == "XKA":
|
|
35
|
+
particle_vec[i_part] = "Atom_L"
|
|
36
|
+
particle_vec.append(tf)
|
|
37
|
+
energy_vec.append(ef)
|
|
38
|
+
relaxation = True
|
|
39
|
+
elif tf == "XKB":
|
|
40
|
+
particle_vec[i_part] = "Atom_M"
|
|
41
|
+
particle_vec.append(tf)
|
|
42
|
+
energy_vec.append(ef)
|
|
43
|
+
relaxation = False
|
|
44
|
+
elif tf == "XL":
|
|
45
|
+
particle_vec[i_part] = "Atom_M"
|
|
46
|
+
particle_vec.append(tf)
|
|
47
|
+
energy_vec.append(ef)
|
|
48
|
+
relaxation = False
|
|
49
|
+
elif tf == "Auger K":
|
|
50
|
+
particle_vec[i_part] = "Atom_L"
|
|
51
|
+
particle_vec.append(tf)
|
|
52
|
+
energy_vec.append(ef)
|
|
53
|
+
relaxation = True
|
|
54
|
+
elif tf == "Auger L":
|
|
55
|
+
particle_vec[i_part] = "Atom_M"
|
|
56
|
+
particle_vec.append(tf)
|
|
57
|
+
energy_vec.append(ef)
|
|
58
|
+
relaxation = False
|
|
59
|
+
else:
|
|
60
|
+
if Display: print("untermined x or Auger")
|
|
61
|
+
relaxation = False
|
|
62
|
+
e_sum += ef
|
|
63
|
+
if Display:
|
|
64
|
+
if delay:
|
|
65
|
+
print("\t Summary of the atomic relaxation(delayed emission)")
|
|
66
|
+
else:
|
|
67
|
+
print("\t Summary of the atomic relaxation(promt emission)")
|
|
68
|
+
for i, p in enumerate(particle_vec):
|
|
69
|
+
if p[:4] != "Atom":
|
|
70
|
+
print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
71
|
+
|
|
72
|
+
for i, p in enumerate(particle_vec):
|
|
73
|
+
if p == "beta":
|
|
74
|
+
e_b,p_b = tl.readBetaShape(Rad,"beta-",level_before_trans) # read the data of BetaShape
|
|
75
|
+
index_beta_energy = tl.sampling(p_b) # sampling energy of beta
|
|
76
|
+
particle_vec[i] = "electron"
|
|
77
|
+
energy_vec[i] = e_b[index_beta_energy]
|
|
78
|
+
|
|
79
|
+
if p == "beta+":
|
|
80
|
+
e_b,p_b = tl.readBetaShape(Rad,"beta+",level_before_trans)
|
|
81
|
+
index_beta_energy = tl.sampling(p_b)
|
|
82
|
+
particle_vec[i] = "positron"
|
|
83
|
+
energy_vec[i] = e_b[index_beta_energy]
|
|
84
|
+
particle_vec.append("gamma")
|
|
85
|
+
particle_vec.append("gamma")
|
|
86
|
+
energy_vec.append(511)
|
|
87
|
+
energy_vec.append(511)
|
|
88
|
+
energy_vec_initial = energy_vec
|
|
89
|
+
if Display:
|
|
90
|
+
if delay:
|
|
91
|
+
print("\t Summary of emitted particles (delayed emission)")
|
|
92
|
+
else:
|
|
93
|
+
print("\t Summary of emitted particles (promt emission)")
|
|
94
|
+
for i, p in enumerate(particle_vec):
|
|
95
|
+
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
96
|
+
|
|
97
|
+
for i, p in enumerate(particle_vec):
|
|
98
|
+
if p == "electron":
|
|
99
|
+
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
100
|
+
|
|
101
|
+
if p == "beta+":
|
|
102
|
+
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
103
|
+
|
|
104
|
+
if p == "gamma" or p == "XKA" or p == "XKB" or p == "XL":
|
|
105
|
+
energy_vec[i] = tl.energie_dep_gamma(energy_vec[i],v=V) # sampling energy free from photon
|
|
106
|
+
particle_vec[i] = "electron"
|
|
107
|
+
|
|
108
|
+
if p == "Auger K" or p == "Auger L":
|
|
109
|
+
particle_vec[i] = "electron"
|
|
110
|
+
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
111
|
+
|
|
112
|
+
if Display:
|
|
113
|
+
if delay:
|
|
114
|
+
print("\t Summary of the energy deposited by charged particles (delayed emission)")
|
|
115
|
+
else:print("\t Summary of the energy deposited by charged particles (promt emission)")
|
|
116
|
+
for i, p in enumerate(particle_vec):
|
|
117
|
+
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
118
|
+
|
|
119
|
+
if Display:
|
|
120
|
+
if delay:
|
|
121
|
+
print("\t Summary of the estimation of quenched energies (delayed emission)")
|
|
122
|
+
else:
|
|
123
|
+
print("\t Summary of the estimation of quenched energies (promt emission)")
|
|
124
|
+
e_quenching=[]
|
|
125
|
+
for i, p in enumerate(particle_vec):
|
|
126
|
+
if p == "alpha":
|
|
127
|
+
energy_vec[i] = tl.Em_a(energy_vec[i],kB,nE_alpha)
|
|
128
|
+
e_quenching.append(energy_vec[i])
|
|
129
|
+
elif p == "electron" or p == "positron":
|
|
130
|
+
energy_vec[i] = tl.Em_e(energy_vec_initial[i]*1e3,energy_vec[i]*1e3,kB*1e3,nE_electron)*1e-3
|
|
131
|
+
e_quenching.append(energy_vec[i])
|
|
132
|
+
else:
|
|
133
|
+
e_quenching.append(0)
|
|
134
|
+
if Display: print("\t\t Birks constant = ", kB, ' cm/keV')
|
|
135
|
+
if Display:
|
|
136
|
+
for i, p in enumerate(particle_vec):
|
|
137
|
+
if p[:4] != "Atom": print(f"\t\t quenched energy of {p} = ", round(e_quenching[i],3), "keV")
|
|
138
|
+
|
|
139
|
+
if mode2=="sym":
|
|
140
|
+
p_nosingle = np.exp(-L*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
141
|
+
p_single = 1-p_nosingle # probability to have at least 1 electrons in a PMT
|
|
142
|
+
efficiency_S.append(p_single)
|
|
143
|
+
efficiency_T.append(p_single**3)
|
|
144
|
+
efficiency_D.append(3*(p_single)**2-2*efficiency_T[-1])
|
|
145
|
+
if Display:
|
|
146
|
+
if delay:
|
|
147
|
+
print("\t Summary of TDCR measurement (delayed emission)")
|
|
148
|
+
else:
|
|
149
|
+
print("\t Summary of TDCR measurement (promt emission)")
|
|
150
|
+
if Display: print("\t\t Free parameter = ", L, "keV-1")
|
|
151
|
+
if Display: print("\t\t Efficiency of single events = ", round(efficiency_S[-1],5))
|
|
152
|
+
if Display: print("\t\t Efficiency of double events = ", round(efficiency_D[-1],5))
|
|
153
|
+
if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T[-1],5))
|
|
154
|
+
|
|
155
|
+
elif mode2=="asym":
|
|
156
|
+
pA_nosingle = np.exp(-L[0]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
157
|
+
pA_single = 1-pA_nosingle # probability to have at least 1 electrons in a PMT
|
|
158
|
+
pB_nosingle = np.exp(-L[1]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
159
|
+
pB_single = 1-pB_nosingle # probability to have at least 1 electrons in a PMT
|
|
160
|
+
pC_nosingle = np.exp(-L[2]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
161
|
+
pC_single = 1-pC_nosingle # probability to have at least 1 electrons in a PMT
|
|
162
|
+
|
|
163
|
+
efficiency_AB.append(pA_single*pB_single)
|
|
164
|
+
efficiency_BC.append(pB_single*pC_single)
|
|
165
|
+
efficiency_AC.append(pA_single*pC_single)
|
|
166
|
+
efficiency_T.append(pA_single*pB_single*pC_single)
|
|
167
|
+
efficiency_D.append(efficiency_AB[-1]+efficiency_BC[-1]+efficiency_AC[-1]-2*efficiency_T[-1])
|
|
168
|
+
efficiency_S.append(pA_single+pB_single+pC_single-efficiency_D[-1]-efficiency_T[-1])
|
|
169
|
+
if Display:
|
|
170
|
+
if delay:
|
|
171
|
+
print("\t Summary of TDCR measurement (delayed emission)")
|
|
172
|
+
else:
|
|
173
|
+
print("\t Summary of TDCR measurement (promt emission)")
|
|
174
|
+
if Display: print("\t\t Free parameter PMT A: ", L[0], "keV-1")
|
|
175
|
+
if Display: print("\t\t Free parameter PMT B: ", L[1], "keV-1")
|
|
176
|
+
if Display: print("\t\t Free parameter PMT C: ", L[2], "keV-1")
|
|
177
|
+
if Display: print("\t\t Efficiency of single events: ", round(efficiency_S[-1],5))
|
|
178
|
+
if Display: print("\t\t Efficiency of double events: ", round(efficiency_D[-1],5))
|
|
179
|
+
if Display: print("\t\t Efficiency of triple events: ", round(efficiency_T[-1],5))
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
return efficiency_T,efficiency_D,efficiency_S,efficiency_AB,efficiency_AC,efficiency_BC
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
20
187
|
def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=False, barp=False,uncData=False):
|
|
21
188
|
"""
|
|
22
189
|
This is the main function of the TDCRPy package running the Monte-Carlo Triple-to-Double Coincidence Ratio model.
|
|
@@ -269,7 +436,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
269
436
|
t1 = np.random.exponential(trans_halfLife[index_rad][iDaughter][i_level][0], size=1)[0]
|
|
270
437
|
|
|
271
438
|
# test whether the decay occurs within the coincidence resolving time or not
|
|
272
|
-
if t1 > tau:
|
|
439
|
+
if t1 > tau*1e-9:
|
|
273
440
|
#splitEvent = True
|
|
274
441
|
evenement = evenement + 1
|
|
275
442
|
|
|
@@ -394,11 +561,10 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
394
561
|
if p[:4] != "Atom":
|
|
395
562
|
print('particle :',p)
|
|
396
563
|
print(f"\t\t energy of {p} = ", energy_vec[i]," keV")
|
|
397
|
-
if evenement !=
|
|
564
|
+
if evenement != 0:
|
|
398
565
|
print("\t Summary of the nuclear delayed decay")
|
|
399
566
|
for i, p in enumerate(particle_vec2):
|
|
400
567
|
if p[:4] != "Atom":
|
|
401
|
-
print('particle :',p)
|
|
402
568
|
print(f"\t\t energy of {p} = ", energy_vec2[i]," keV")
|
|
403
569
|
|
|
404
570
|
'''
|
|
@@ -406,463 +572,21 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
406
572
|
II. LA RELAXATION ATOMIQUE
|
|
407
573
|
==========================
|
|
408
574
|
'''
|
|
575
|
+
|
|
576
|
+
daughter_relax = DaughterVec[index_rad][iDaughter]
|
|
577
|
+
efficiency_T,efficiency_D,efficiency_S,efficiency_AB,efficiency_AC,efficiency_BC = TDCR_relaxation(L,TD,TAB,TBC,TAC,daughter_relax,Rad[index_rad],kB,V,particle_vec,energy_vec,mode2,e_sum,level_before_trans,nE_alpha,nE_electron,uncData=uncData,Display=Display,delay=False)
|
|
578
|
+
|
|
579
|
+
|
|
409
580
|
## evenement retarde
|
|
581
|
+
|
|
410
582
|
if evenement != 1:
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
relaxation = False
|
|
415
|
-
if "Atom_K" in particle_vec[i_part] or "Atom_L" in particle_vec[i_part] or "Atom_M" in particle_vec[i_part]:
|
|
416
|
-
relaxation = True
|
|
417
|
-
while relaxation:
|
|
418
|
-
tf,ef = tl.relaxation_atom(daughter_relax,Rad[index_rad],particle_vec[i_part])
|
|
419
|
-
if tf == "XKA":
|
|
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"
|
|
462
|
-
particle_vec2.append(tf)
|
|
463
|
-
energy_vec2.append(ef)
|
|
464
|
-
relaxation = True
|
|
465
|
-
elif tf == "XKB":
|
|
466
|
-
particle_vec2[i_part] = "Atom_M"
|
|
467
|
-
particle_vec2.append(tf)
|
|
468
|
-
energy_vec2.append(ef)
|
|
469
|
-
relaxation = False
|
|
470
|
-
elif tf == "XL":
|
|
471
|
-
particle_vec2[i_part] = "Atom_M"
|
|
472
|
-
particle_vec2.append(tf)
|
|
473
|
-
energy_vec2.append(ef)
|
|
474
|
-
relaxation = False
|
|
475
|
-
elif tf == "Auger K":
|
|
476
|
-
particle_vec2[i_part] = "Atom_L"
|
|
477
|
-
particle_vec2.append(tf)
|
|
478
|
-
energy_vec2.append(ef)
|
|
479
|
-
relaxation = True
|
|
480
|
-
elif tf == "Auger L":
|
|
481
|
-
particle_vec2[i_part] = "Atom_M"
|
|
482
|
-
particle_vec2.append(tf)
|
|
483
|
-
energy_vec2.append(ef)
|
|
484
|
-
relaxation = False
|
|
485
|
-
else:
|
|
486
|
-
if Display: print("untermined x or Auger")
|
|
487
|
-
relaxation = False
|
|
488
|
-
e_sum2 += ef
|
|
489
|
-
|
|
490
|
-
if Display:
|
|
491
|
-
print("\t Summary of the atomic relaxation (delayed emission)")
|
|
492
|
-
for i, p in enumerate(particle_vec2):
|
|
493
|
-
if p[:4] != "Atom":
|
|
494
|
-
print(f"\t\t energy of {p} = ", round(energy_vec2[i],3), "keV")
|
|
495
|
-
|
|
496
|
-
'''
|
|
497
|
-
==========================================================
|
|
498
|
-
III.a SPECTRES D'EMISSION
|
|
499
|
-
==========================================================
|
|
500
|
-
'''
|
|
501
|
-
|
|
502
|
-
for i, p in enumerate(particle_vec2):
|
|
503
|
-
if p == "beta":
|
|
504
|
-
e_b,p_b = tl.readBetaShape(rad_i,"beta-",level_before_trans) # read the data of BetaShape
|
|
505
|
-
index_beta_energy = tl.sampling(p_b) # sampling energy of beta
|
|
506
|
-
particle_vec2[i] = "electron"
|
|
507
|
-
energy_vec2[i] = e_b[index_beta_energy]
|
|
508
|
-
|
|
509
|
-
if p == "beta+":
|
|
510
|
-
e_b,p_b = tl.readBetaShape(rad_i,"beta+",level_before_trans)
|
|
511
|
-
index_beta_energy = tl.sampling(p_b)
|
|
512
|
-
particle_vec2[i] = "positron"
|
|
513
|
-
energy_vec2[i] = e_b[index_beta_energy]
|
|
514
|
-
particle_vec2.append("gamma")
|
|
515
|
-
particle_vec2.append("gamma")
|
|
516
|
-
energy_vec2.append(511)
|
|
517
|
-
energy_vec2.append(511)
|
|
518
|
-
energy_vec_initial2 = energy_vec2
|
|
519
|
-
if Display:
|
|
520
|
-
print("\t Summary of emitted particles from the delayed atomic relaxation")
|
|
521
|
-
for i, p in enumerate(particle_vec2):
|
|
522
|
-
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec2[i],3), "keV")
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
for i, p in enumerate(particle_vec):
|
|
526
|
-
if p == "beta":
|
|
527
|
-
e_b,p_b = tl.readBetaShape(rad_i,"beta-",level_before_trans) # read the data of BetaShape
|
|
528
|
-
index_beta_energy = tl.sampling(p_b) # sampling energy of beta
|
|
529
|
-
particle_vec[i] = "electron"
|
|
530
|
-
energy_vec[i] = e_b[index_beta_energy]
|
|
531
|
-
|
|
532
|
-
if p == "beta+":
|
|
533
|
-
e_b,p_b = tl.readBetaShape(rad_i,"beta+",level_before_trans)
|
|
534
|
-
index_beta_energy = tl.sampling(p_b)
|
|
535
|
-
particle_vec[i] = "positron"
|
|
536
|
-
energy_vec[i] = e_b[index_beta_energy]
|
|
537
|
-
particle_vec.append("gamma")
|
|
538
|
-
particle_vec.append("gamma")
|
|
539
|
-
energy_vec.append(511)
|
|
540
|
-
energy_vec.append(511)
|
|
541
|
-
energy_vec_initial = energy_vec
|
|
542
|
-
if Display:
|
|
543
|
-
print("\t Summary of emitted particles from the promt nuclear relaxation")
|
|
544
|
-
for i, p in enumerate(particle_vec):
|
|
545
|
-
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
'''
|
|
549
|
-
==========================================================
|
|
550
|
-
III.b INTERACTION RAYONNEMENT/MATIERE
|
|
551
|
-
==========================================================
|
|
552
|
-
'''
|
|
553
|
-
|
|
554
|
-
for i, p in enumerate(particle_vec2):
|
|
555
|
-
if p == "electron":
|
|
556
|
-
energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
|
|
557
|
-
|
|
558
|
-
if p == "beta+":
|
|
559
|
-
energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
|
|
560
|
-
|
|
561
|
-
if p == "gamma" or p == "XKA" or p == "XKB" or p == "XL":
|
|
562
|
-
energy_vec2[i] = tl.energie_dep_gamma(energy_vec2[i],v=V) # sampling energy free from photon
|
|
563
|
-
particle_vec2[i] = "electron"
|
|
564
|
-
|
|
565
|
-
if p == "Auger K" or p == "Auger L":
|
|
566
|
-
particle_vec2[i] = "electron"
|
|
567
|
-
energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
|
|
568
|
-
|
|
569
|
-
if Display:
|
|
570
|
-
print("\t Summary of the energy deposited by charged particles by the delayed atomic relaxation")
|
|
571
|
-
for i, p in enumerate(particle_vec2):
|
|
572
|
-
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec2[i],3), "keV")
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
for i, p in enumerate(particle_vec):
|
|
576
|
-
if p == "electron":
|
|
577
|
-
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
583
|
+
delay = True
|
|
584
|
+
if Display:print(" taitement de delayed emission")
|
|
585
|
+
efficiency_T2,efficiency_D2,efficiency_S2,efficiency_AB2,efficiency_AC2,efficiency_BC2 = TDCR_relaxation(L,TD,TAB,TBC,TAC,daughter_relax,Rad[index_rad],kB,V,particle_vec2,energy_vec2,mode2,e_sum2,level_before_trans,nE_alpha,nE_electron,uncData=uncData,Display=Display,delay=delay)
|
|
578
586
|
|
|
579
|
-
if p == "beta+":
|
|
580
|
-
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
581
|
-
|
|
582
|
-
if p == "gamma" or p == "XKA" or p == "XKB" or p == "XL":
|
|
583
|
-
energy_vec[i] = tl.energie_dep_gamma(energy_vec[i],v=V) # sampling energy free from photon
|
|
584
|
-
particle_vec[i] = "electron"
|
|
585
|
-
|
|
586
|
-
if p == "Auger K" or p == "Auger L":
|
|
587
|
-
particle_vec[i] = "electron"
|
|
588
|
-
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
589
|
-
|
|
590
|
-
if Display:
|
|
591
|
-
print("\t Summary of the energy deposited by charged particles from the prompt nuclear relaxation")
|
|
592
|
-
for i, p in enumerate(particle_vec):
|
|
593
|
-
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
594
|
-
|
|
595
|
-
'''
|
|
596
|
-
====================
|
|
597
|
-
IV. LA SCINTILLATION
|
|
598
|
-
Calculation of the scintillation quenching with the Birks Model
|
|
599
|
-
====================
|
|
600
|
-
'''
|
|
601
|
-
if Display: print("\t Summary of the estimation of quenched energies by the delayed atomic relaxation")
|
|
602
|
-
e_quenching2=[]
|
|
603
|
-
for i, p in enumerate(particle_vec2):
|
|
604
|
-
if p == "alpha":
|
|
605
|
-
energy_vec2[i] = tl.Em_a(energy_vec2[i],kB,nE_alpha)
|
|
606
|
-
e_quenching2.append(energy_vec2[i])
|
|
607
|
-
elif p == "electron" or p == "positron":
|
|
608
|
-
energy_vec2[i] = tl.Em_e(energy_vec_initial2[i]*1e3,energy_vec2[i]*1e3,kB*1e3,nE_electron)*1e-3
|
|
609
|
-
e_quenching2.append(energy_vec2[i])
|
|
610
|
-
else:
|
|
611
|
-
e_quenching2.append(0)
|
|
612
|
-
if Display: print("\t\t Birks constant = ", kB, ' cm/keV')
|
|
613
|
-
if Display:
|
|
614
|
-
for i, p in enumerate(particle_vec2):
|
|
615
|
-
if p[:4] != "Atom": print(f"\t\t quenched energy of {p} = ", round(e_quenching2[i],3), "keV")
|
|
616
587
|
|
|
617
588
|
|
|
618
|
-
# changer l'intégration E_i - E_d à E_i
|
|
619
|
-
if Display: print("\t Summary of the estimation of quenched energies from the prompt nuclear relaxation")
|
|
620
|
-
e_quenching=[]
|
|
621
|
-
for i, p in enumerate(particle_vec):
|
|
622
|
-
if p == "alpha":
|
|
623
|
-
energy_vec[i] = tl.Em_a(energy_vec[i],kB,nE_alpha)
|
|
624
|
-
e_quenching.append(energy_vec[i])
|
|
625
|
-
elif p == "electron" or p == "positron":
|
|
626
|
-
energy_vec[i] = tl.Em_e(energy_vec_initial[i]*1e3,energy_vec[i]*1e3,kB*1e3,nE_electron)*1e-3
|
|
627
|
-
e_quenching.append(energy_vec[i])
|
|
628
|
-
else:
|
|
629
|
-
e_quenching.append(0)
|
|
630
|
-
if Display: print("\t\t Birks constant = ", kB, ' cm/keV')
|
|
631
|
-
if Display:
|
|
632
|
-
for i, p in enumerate(particle_vec):
|
|
633
|
-
if p[:4] != "Atom": print(f"\t\t quenched energy of {p} = ", round(e_quenching[i],3), "keV")
|
|
634
|
-
|
|
635
|
-
'''
|
|
636
|
-
====================
|
|
637
|
-
V. LE MESURE TDCR
|
|
638
|
-
====================
|
|
639
|
-
'''
|
|
640
589
|
|
|
641
|
-
if mode2=="sym":
|
|
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
|
|
654
|
-
p_single = 1-p_nosingle # probability to have at least 1 electrons in a PMT
|
|
655
|
-
efficiency_S.append(p_single)
|
|
656
|
-
efficiency_T.append(p_single**3)
|
|
657
|
-
efficiency_D.append(3*(p_single)**2-2*efficiency_T[-1])
|
|
658
|
-
if Display: print("\t Summary of TDCR measurement (prompt)")
|
|
659
|
-
if Display: print("\t\t Free parameter = ", L, "keV-1")
|
|
660
|
-
if Display: print("\t\t Efficiency of single events = ", round(efficiency_S[-1],5))
|
|
661
|
-
if Display: print("\t\t Efficiency of double events = ", round(efficiency_D[-1],5))
|
|
662
|
-
if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T[-1],5))
|
|
663
|
-
|
|
664
|
-
elif mode2=="asym":
|
|
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
|
|
671
|
-
|
|
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)")
|
|
679
|
-
if Display: print("\t\t Free parameter PMT A: ", L[0], "keV-1")
|
|
680
|
-
if Display: print("\t\t Free parameter PMT B: ", L[1], "keV-1")
|
|
681
|
-
if Display: print("\t\t Free parameter PMT C: ", L[2], "keV-1")
|
|
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))
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
pA_nosingle = np.exp(-L[0]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
688
|
-
pA_single = 1-pA_nosingle # probability to have at least 1 electrons in a PMT
|
|
689
|
-
pB_nosingle = np.exp(-L[1]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
690
|
-
pB_single = 1-pB_nosingle # probability to have at least 1 electrons in a PMT
|
|
691
|
-
pC_nosingle = np.exp(-L[2]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
692
|
-
pC_single = 1-pC_nosingle # probability to have at least 1 electrons in a PMT
|
|
693
|
-
|
|
694
|
-
efficiency_AB.append(pA_single*pB_single)
|
|
695
|
-
efficiency_BC.append(pB_single*pC_single)
|
|
696
|
-
efficiency_AC.append(pA_single*pC_single)
|
|
697
|
-
efficiency_T.append(pA_single*pB_single*pC_single)
|
|
698
|
-
efficiency_D.append(efficiency_AB[-1]+efficiency_BC[-1]+efficiency_AC[-1]-2*efficiency_T[-1])
|
|
699
|
-
efficiency_S.append(pA_single+pB_single+pC_single-efficiency_D[-1]-efficiency_T[-1])
|
|
700
|
-
if Display: print("\t Summary of TDCR measurement (prompt)")
|
|
701
|
-
if Display: print("\t\t Free parameter PMT A: ", L[0], "keV-1")
|
|
702
|
-
if Display: print("\t\t Free parameter PMT B: ", L[1], "keV-1")
|
|
703
|
-
if Display: print("\t\t Free parameter PMT C: ", L[2], "keV-1")
|
|
704
|
-
if Display: print("\t\t Efficiency of single events: ", round(efficiency_S[-1],5))
|
|
705
|
-
if Display: print("\t\t Efficiency of double events: ", round(efficiency_D[-1],5))
|
|
706
|
-
if Display: print("\t\t Efficiency of triple events: ", round(efficiency_T[-1],5))
|
|
707
|
-
|
|
708
|
-
else: # One decay event into the resolving time
|
|
709
|
-
|
|
710
|
-
daughter_relax = DaughterVec[index_rad][iDaughter]
|
|
711
|
-
for i_part in range(len(particle_vec)):
|
|
712
|
-
relaxation = False
|
|
713
|
-
if "Atom_K" in particle_vec[i_part] or "Atom_L" in particle_vec[i_part] or "Atom_M" in particle_vec[i_part]:
|
|
714
|
-
relaxation = True
|
|
715
|
-
while relaxation:
|
|
716
|
-
tf,ef = tl.relaxation_atom(daughter_relax,Rad[index_rad],particle_vec[i_part])
|
|
717
|
-
if tf == "XKA":
|
|
718
|
-
particle_vec[i_part] = "Atom_L"
|
|
719
|
-
particle_vec.append(tf)
|
|
720
|
-
energy_vec.append(ef)
|
|
721
|
-
relaxation = True
|
|
722
|
-
elif tf == "XKB":
|
|
723
|
-
particle_vec[i_part] = "Atom_M"
|
|
724
|
-
particle_vec.append(tf)
|
|
725
|
-
energy_vec.append(ef)
|
|
726
|
-
relaxation = False
|
|
727
|
-
elif tf == "XL":
|
|
728
|
-
particle_vec[i_part] = "Atom_M"
|
|
729
|
-
particle_vec.append(tf)
|
|
730
|
-
energy_vec.append(ef)
|
|
731
|
-
relaxation = False
|
|
732
|
-
elif tf == "Auger K":
|
|
733
|
-
particle_vec[i_part] = "Atom_L"
|
|
734
|
-
particle_vec.append(tf)
|
|
735
|
-
energy_vec.append(ef)
|
|
736
|
-
relaxation = True
|
|
737
|
-
elif tf == "Auger L":
|
|
738
|
-
particle_vec[i_part] = "Atom_M"
|
|
739
|
-
particle_vec.append(tf)
|
|
740
|
-
energy_vec.append(ef)
|
|
741
|
-
relaxation = False
|
|
742
|
-
else:
|
|
743
|
-
if Display: print("untermined x or Auger")
|
|
744
|
-
relaxation = False
|
|
745
|
-
e_sum += ef
|
|
746
|
-
if Display:
|
|
747
|
-
print("\t Summary of the atomic relaxation")
|
|
748
|
-
for i, p in enumerate(particle_vec):
|
|
749
|
-
if p[:4] != "Atom":
|
|
750
|
-
print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
751
|
-
|
|
752
|
-
'''
|
|
753
|
-
==========================================================
|
|
754
|
-
III.a SPECTRES D'EMISSION
|
|
755
|
-
==========================================================
|
|
756
|
-
'''
|
|
757
|
-
|
|
758
|
-
for i, p in enumerate(particle_vec):
|
|
759
|
-
if p == "beta":
|
|
760
|
-
e_b,p_b = tl.readBetaShape(rad_i,"beta-",level_before_trans) # read the data of BetaShape
|
|
761
|
-
index_beta_energy = tl.sampling(p_b) # sampling energy of beta
|
|
762
|
-
particle_vec[i] = "electron"
|
|
763
|
-
energy_vec[i] = e_b[index_beta_energy]
|
|
764
|
-
|
|
765
|
-
if p == "beta+":
|
|
766
|
-
e_b,p_b = tl.readBetaShape(rad_i,"beta+",level_before_trans)
|
|
767
|
-
index_beta_energy = tl.sampling(p_b)
|
|
768
|
-
particle_vec[i] = "positron"
|
|
769
|
-
energy_vec[i] = e_b[index_beta_energy]
|
|
770
|
-
particle_vec.append("gamma")
|
|
771
|
-
particle_vec.append("gamma")
|
|
772
|
-
energy_vec.append(511)
|
|
773
|
-
energy_vec.append(511)
|
|
774
|
-
energy_vec_initial = energy_vec
|
|
775
|
-
if Display:
|
|
776
|
-
print("\t Summary of emitted particles")
|
|
777
|
-
for i, p in enumerate(particle_vec):
|
|
778
|
-
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
'''
|
|
782
|
-
==========================================================
|
|
783
|
-
III.b INTERACTION RAYONNEMENT/MATIERE
|
|
784
|
-
==========================================================
|
|
785
|
-
'''
|
|
786
|
-
for i, p in enumerate(particle_vec):
|
|
787
|
-
if p == "electron":
|
|
788
|
-
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
789
|
-
|
|
790
|
-
if p == "beta+":
|
|
791
|
-
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
792
|
-
|
|
793
|
-
if p == "gamma" or p == "XKA" or p == "XKB" or p == "XL":
|
|
794
|
-
energy_vec[i] = tl.energie_dep_gamma(energy_vec[i],v=V) # sampling energy free from photon
|
|
795
|
-
particle_vec[i] = "electron"
|
|
796
|
-
|
|
797
|
-
if p == "Auger K" or p == "Auger L":
|
|
798
|
-
particle_vec[i] = "electron"
|
|
799
|
-
energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
|
|
800
|
-
|
|
801
|
-
if Display:
|
|
802
|
-
print("\t Summary of the energy deposited by charged particles")
|
|
803
|
-
for i, p in enumerate(particle_vec):
|
|
804
|
-
if p[:4] != "Atom": print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
|
|
805
|
-
|
|
806
|
-
'''
|
|
807
|
-
====================
|
|
808
|
-
IV. LA SCINTILLATION
|
|
809
|
-
Calculation of the scintillation quenching with the Birks Model
|
|
810
|
-
====================
|
|
811
|
-
'''
|
|
812
|
-
# changer l'intégration E_i - E_d à E_i
|
|
813
|
-
if Display: print("\t Summary of the estimation of quenched energies")
|
|
814
|
-
e_quenching=[]
|
|
815
|
-
for i, p in enumerate(particle_vec):
|
|
816
|
-
if p == "alpha":
|
|
817
|
-
energy_vec[i] = tl.Em_a(energy_vec[i],kB,nE_alpha)
|
|
818
|
-
e_quenching.append(energy_vec[i])
|
|
819
|
-
elif p == "electron" or p == "positron":
|
|
820
|
-
energy_vec[i] = tl.Em_e(energy_vec_initial[i]*1e3,energy_vec[i]*1e3,kB*1e3,nE_electron)*1e-3
|
|
821
|
-
e_quenching.append(energy_vec[i])
|
|
822
|
-
else:
|
|
823
|
-
e_quenching.append(0)
|
|
824
|
-
if Display: print("\t\t Birks constant = ", kB, ' cm/keV')
|
|
825
|
-
if Display:
|
|
826
|
-
for i, p in enumerate(particle_vec):
|
|
827
|
-
if p[:4] != "Atom": print(f"\t\t quenched energy of {p} = ", round(e_quenching[i],3), "keV")
|
|
828
|
-
|
|
829
|
-
'''
|
|
830
|
-
====================
|
|
831
|
-
V. LE MESURE TDCR
|
|
832
|
-
====================
|
|
833
|
-
'''
|
|
834
|
-
if mode2=="sym":
|
|
835
|
-
p_nosingle = np.exp(-L*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
836
|
-
p_single = 1-p_nosingle # probability to have at least 1 electrons in a PMT
|
|
837
|
-
efficiency_S.append(p_single)
|
|
838
|
-
efficiency_T.append(p_single**3)
|
|
839
|
-
efficiency_D.append(3*(p_single)**2-2*efficiency_T[-1])
|
|
840
|
-
if Display: print("\t Summary of TDCR measurement")
|
|
841
|
-
if Display: print("\t\t Free parameter = ", L, "keV-1")
|
|
842
|
-
if Display: print("\t\t Efficiency of single events = ", round(efficiency_S[-1],5))
|
|
843
|
-
if Display: print("\t\t Efficiency of double events = ", round(efficiency_D[-1],5))
|
|
844
|
-
if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T[-1],5))
|
|
845
|
-
elif mode2=="asym":
|
|
846
|
-
pA_nosingle = np.exp(-L[0]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
847
|
-
pA_single = 1-pA_nosingle # probability to have at least 1 electrons in a PMT
|
|
848
|
-
pB_nosingle = np.exp(-L[1]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
849
|
-
pB_single = 1-pB_nosingle # probability to have at least 1 electrons in a PMT
|
|
850
|
-
pC_nosingle = np.exp(-L[2]*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
|
|
851
|
-
pC_single = 1-pC_nosingle # probability to have at least 1 electrons in a PMT
|
|
852
|
-
|
|
853
|
-
efficiency_AB.append(pA_single*pB_single)
|
|
854
|
-
efficiency_BC.append(pB_single*pC_single)
|
|
855
|
-
efficiency_AC.append(pA_single*pC_single)
|
|
856
|
-
efficiency_T.append(pA_single*pB_single*pC_single)
|
|
857
|
-
efficiency_D.append(efficiency_AB[-1]+efficiency_BC[-1]+efficiency_AC[-1]-2*efficiency_T[-1])
|
|
858
|
-
efficiency_S.append(pA_single+pB_single+pC_single-efficiency_D[-1]-efficiency_T[-1])
|
|
859
|
-
if Display: print("\t Summary of TDCR measurement")
|
|
860
|
-
if Display: print("\t\t Free parameter PMT A: ", L[0], "keV-1")
|
|
861
|
-
if Display: print("\t\t Free parameter PMT B: ", L[1], "keV-1")
|
|
862
|
-
if Display: print("\t\t Free parameter PMT C: ", L[2], "keV-1")
|
|
863
|
-
if Display: print("\t\t Efficiency of single events: ", round(efficiency_S[-1],5))
|
|
864
|
-
if Display: print("\t\t Efficiency of double events: ", round(efficiency_D[-1],5))
|
|
865
|
-
if Display: print("\t\t Efficiency of triple events: ", round(efficiency_T[-1],5))
|
|
866
590
|
|
|
867
591
|
'''
|
|
868
592
|
====================
|
|
@@ -930,17 +654,19 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
|
|
|
930
654
|
return efficiency_S, efficiency_D, efficiency_T
|
|
931
655
|
|
|
932
656
|
L = (1, 1, 1)
|
|
657
|
+
#L = 1
|
|
933
658
|
TD = 0.977667386529166
|
|
934
659
|
TAB = 0.992232838598821
|
|
935
660
|
TBC = 0.992343419459002
|
|
936
661
|
TAC = 0.99275350064608
|
|
937
|
-
Rad="
|
|
662
|
+
Rad="Fe-55"
|
|
938
663
|
pmf_1="1"
|
|
939
664
|
N = 10
|
|
940
665
|
kB =1.0e-5
|
|
941
666
|
V = 10
|
|
942
|
-
mode = "
|
|
667
|
+
mode = "eff"
|
|
943
668
|
mode2 = "asym"
|
|
944
669
|
|
|
945
670
|
|
|
946
|
-
|
|
671
|
+
s,t,d,q,w,e = TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=True, barp=False,uncData=False)
|
|
672
|
+
#print(s,t,d,q,w,e)
|