TDCRPy 1.4.0__py3-none-any.whl → 1.5.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/TDCRPy.py CHANGED
@@ -197,7 +197,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
197
197
  '''
198
198
  index_rad = tl.sampling(pmf_1)
199
199
  rad_i = Rad[index_rad]
200
- if Display: print("\n Trial ",str(i+1),"- Sampled radionuclide: ", rad_i)
200
+ if Display: print("\n\n Trial ",str(i+1),"- Sampled radionuclide: ", rad_i)
201
201
 
202
202
 
203
203
  '''
@@ -230,7 +230,10 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
230
230
  print("\t Sampled decay branch:")
231
231
  if particle_branch[:4]=="Atom":
232
232
  if particle_branch=="Atom_K": print("\t\t Electron capture on K 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")
233
+ if particle_branch=="Atom_L": print("\t\t Electron capture on L shell")
234
+ if particle_branch=="Atom_L1": print("\t\t Electron capture on L1 shell")
235
+ if particle_branch=="Atom_L2": print("\t\t Electron capture on L2 shell")
236
+ if particle_branch=="Atom_L3": print("\t\t Electron capture on L3 shell")
234
237
  if particle_branch=="Atom_M": print("\t\t Electron capture on M shell")
235
238
  if particle_branch=="Atom_O": print("\t\t Electron capture on O shell")
236
239
  else:
@@ -389,17 +392,26 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
389
392
  levelOftheDaughter = 0 # set the next level
390
393
 
391
394
  if Display:
392
- print("\t Summary of the nuclear promt decay")
395
+ print("\n\t NUCLEAR DECAY")
396
+ print("\t Summary of the prompt nuclear decay")
393
397
  for i, p in enumerate(particle_vec):
394
398
  if p[:4] != "Atom":
395
- print('particle :',p)
396
- print(f"\t\t energy of {p} = ", energy_vec[i]," keV")
399
+ if p=="beta" or p=="beta+":
400
+ print(f'\t\t {p} transition of energy = {energy_vec[i]}, keV')
401
+ else:
402
+ print(f'\t\t emitted {p} of energy = {energy_vec[i]}, keV')
403
+ else:
404
+ print(f'\t\t capture of an electron from the {p[5:]} shell')
397
405
  if evenement != 1:
398
- print("\t Summary of the nuclear delayed decay")
406
+ print("\t Summary of the delayed nuclear decay")
399
407
  for i, p in enumerate(particle_vec2):
400
408
  if p[:4] != "Atom":
401
- print('particle :',p)
402
- print(f"\t\t energy of {p} = ", energy_vec2[i]," keV")
409
+ if p=="beta" or p=="beta+":
410
+ print(f'\t\t {p} transition of energy = {energy_vec2[i]}, keV')
411
+ else:
412
+ print(f'\t\t emitted {p} of energy = {energy_vec2[i]}, keV')
413
+ else:
414
+ print(f'\t\t capture of an electron from the {p[5:]} shell')
403
415
 
404
416
  '''
405
417
  ==========================
@@ -442,14 +454,16 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
442
454
  energy_vec.append(ef)
443
455
  relaxation = False
444
456
  else:
445
- if Display: print("untermined x or Auger")
457
+ if Display: print("\t\t x ray or Auger electron from X shell")
446
458
  relaxation = False
447
459
  e_sum += ef
448
460
  if Display:
449
- print("\t Summary of the atomic relaxation (promt emission)")
461
+ print("\n\t ATOMIC RECOMBINATION\n\t Summary of the prompt atomic relaxation")
450
462
  for i, p in enumerate(particle_vec):
451
463
  if p[:4] != "Atom":
452
- print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
464
+ print(f"\t\t emitted {p} of energy = {round(energy_vec[i],3)} keV")
465
+ else:
466
+ print(f'\t\t an electron left the {p[5:]} shell')
453
467
 
454
468
  for i_part in range(len(particle_vec2)):
455
469
  relaxation = False
@@ -483,15 +497,17 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
483
497
  energy_vec2.append(ef)
484
498
  relaxation = False
485
499
  else:
486
- if Display: print("untermined x or Auger")
500
+ if Display: print("\t\t x ray or Auger electron from X shell")
487
501
  relaxation = False
488
502
  e_sum2 += ef
489
503
 
490
504
  if Display:
491
- print("\t Summary of the atomic relaxation (delayed emission)")
505
+ print("\t Summary of the delayed atomic relaxation")
492
506
  for i, p in enumerate(particle_vec2):
493
507
  if p[:4] != "Atom":
494
- print(f"\t\t energy of {p} = ", round(energy_vec2[i],3), "keV")
508
+ print(f"\t\t emitted {p} of energy = {round(energy_vec2[i],3)} keV")
509
+ else:
510
+ print(f'\t\t an electron left the {p[5:]} shell')
495
511
 
496
512
  '''
497
513
  ==========================================================
@@ -499,98 +515,99 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
499
515
  ==========================================================
500
516
  '''
501
517
 
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")
518
+ if ("beta" in particle_vec2) or ("beta+" in particle_vec2):
519
+ if Display: print("\t Summary of sampling of beta particles")
521
520
  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")
521
+ if p == "beta":
522
+ e_b,p_b = tl.readBetaShape(rad_i,"beta-",level_before_trans) # read the data of BetaShape
523
+ index_beta_energy = tl.sampling(p_b) # sampling energy of beta
524
+ particle_vec2[i] = "electron"
525
+ energy_vec2[i] = e_b[index_beta_energy]
526
+ if Display: print(f"\t\t emitted {p} of energy = {round(energy_vec2[i],3)} keV")
527
+
528
+ if p == "beta+":
529
+ e_b,p_b = tl.readBetaShape(rad_i,"beta+",level_before_trans)
530
+ index_beta_energy = tl.sampling(p_b)
531
+ particle_vec2[i] = "positron"
532
+ energy_vec2[i] = e_b[index_beta_energy]
533
+ particle_vec2.append("gamma")
534
+ particle_vec2.append("gamma")
535
+ energy_vec2.append(511)
536
+ energy_vec2.append(511)
537
+ if Display: print(f"\t\t emitted {p} of energy = {round(energy_vec2[i],3)} keV")
538
+ energy_vec_initial2 = energy_vec2
539
+
523
540
 
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")
541
+ if ("beta" in particle_vec) or ("beta+" in particle_vec):
542
+ if Display: print("\t Summary of sampling of beta particles")
544
543
  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
-
544
+ if p == "beta":
545
+ e_b,p_b = tl.readBetaShape(rad_i,"beta-",level_before_trans) # read the data of BetaShape
546
+ index_beta_energy = tl.sampling(p_b) # sampling energy of beta
547
+ particle_vec[i] = "electron"
548
+ energy_vec[i] = e_b[index_beta_energy]
549
+ if Display: print(f"\t\t emitted {p} of energy = {round(energy_vec[i],3)} keV")
550
+
551
+ if p == "beta+":
552
+ e_b,p_b = tl.readBetaShape(rad_i,"beta+",level_before_trans)
553
+ index_beta_energy = tl.sampling(p_b)
554
+ particle_vec[i] = "positron"
555
+ energy_vec[i] = e_b[index_beta_energy]
556
+ particle_vec.append("gamma")
557
+ particle_vec.append("gamma")
558
+ energy_vec.append(511)
559
+ energy_vec.append(511)
560
+ if Display: print(f"\t\t emitted {p} of energy = {round(energy_vec[i],3)} keV")
561
+ energy_vec_initial = energy_vec
562
+
548
563
  '''
549
564
  ==========================================================
550
565
  III.b INTERACTION RAYONNEMENT/MATIERE
551
566
  ==========================================================
552
567
  '''
553
568
 
554
- for i, p in enumerate(particle_vec2):
569
+ for i, p in enumerate(particle_vec):
555
570
  if p == "electron":
556
- energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
571
+ energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
557
572
 
558
573
  if p == "beta+":
559
- energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
574
+ energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
560
575
 
561
576
  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"
577
+ energy_vec[i] = tl.energie_dep_gamma(energy_vec[i],v=V) # sampling energy free from photon
578
+ particle_vec[i] = "electron"
564
579
 
565
580
  if p == "Auger K" or p == "Auger L":
566
- particle_vec2[i] = "electron"
567
- energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
581
+ particle_vec[i] = "electron"
582
+ energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
568
583
 
569
584
  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
-
585
+ print("\n\t INTERACTION \n\t Summary of the energy deposited by charged particles from the prompt transitions")
586
+ for i, p in enumerate(particle_vec):
587
+ if p[:4] != "Atom" and energy_vec[i]!=0: print(f"\t\t {p} of energy = {round(energy_vec[i],3)} keV")
574
588
 
575
- for i, p in enumerate(particle_vec):
589
+ for i, p in enumerate(particle_vec2):
576
590
  if p == "electron":
577
- energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
591
+ energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
578
592
 
579
593
  if p == "beta+":
580
- energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
594
+ energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
581
595
 
582
596
  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"
597
+ energy_vec2[i] = tl.energie_dep_gamma(energy_vec2[i],v=V) # sampling energy free from photon
598
+ particle_vec2[i] = "electron"
585
599
 
586
600
  if p == "Auger K" or p == "Auger L":
587
- particle_vec[i] = "electron"
588
- energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
601
+ particle_vec2[i] = "electron"
602
+ energy_vec2[i] = tl.energie_dep_beta(energy_vec2[i])
589
603
 
590
604
  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")
605
+ print("\t Summary of the energy deposited by charged particles from the delayed transitions")
606
+ for i, p in enumerate(particle_vec2):
607
+ if p[:4] != "Atom" and energy_vec2[i]!=0: print(f"\t\t {p} of energy = {round(energy_vec2[i],3)} keV")
608
+
609
+
610
+
594
611
 
595
612
  '''
596
613
  ====================
@@ -598,25 +615,9 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
598
615
  Calculation of the scintillation quenching with the Birks Model
599
616
  ====================
600
617
  '''
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
-
617
618
 
618
619
  # 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
+ if Display: print(f"\n\t SCINTILLATION \n\t\t Birks constant = {kB} cm/keV\n\t Summary of the estimation of quenched energies from the prompt transitions")
620
621
  e_quenching=[]
621
622
  for i, p in enumerate(particle_vec):
622
623
  if p == "alpha":
@@ -627,11 +628,25 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
627
628
  e_quenching.append(energy_vec[i])
628
629
  else:
629
630
  e_quenching.append(0)
630
- if Display: print("\t\t Birks constant = ", kB, ' cm/keV')
631
631
  if Display:
632
632
  for i, p in enumerate(particle_vec):
633
633
  if p[:4] != "Atom": print(f"\t\t quenched energy of {p} = ", round(e_quenching[i],3), "keV")
634
-
634
+
635
+ if Display: print("\t Summary of the estimation of quenched energies by the delayed atomic relaxation")
636
+ e_quenching2=[]
637
+ for i, p in enumerate(particle_vec2):
638
+ if p == "alpha":
639
+ energy_vec2[i] = tl.Em_a(energy_vec2[i],kB,nE_alpha)
640
+ e_quenching2.append(energy_vec2[i])
641
+ elif p == "electron" or p == "positron":
642
+ energy_vec2[i] = tl.Em_e(energy_vec_initial2[i]*1e3,energy_vec2[i]*1e3,kB*1e3,nE_electron)*1e-3
643
+ e_quenching2.append(energy_vec2[i])
644
+ else:
645
+ e_quenching2.append(0)
646
+ if Display:
647
+ for i, p in enumerate(particle_vec2):
648
+ if p[:4] != "Atom": print(f"\t\t quenched energy of {p} = ", round(e_quenching2[i],3), "keV")
649
+
635
650
  '''
636
651
  ====================
637
652
  V. LE MESURE TDCR
@@ -639,28 +654,28 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
639
654
  '''
640
655
 
641
656
  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
657
 
653
658
  p_nosingle = np.exp(-L*np.sum(np.asarray(e_quenching))/3) # probability to have 0 electrons in a PMT
654
659
  p_single = 1-p_nosingle # probability to have at least 1 electrons in a PMT
655
660
  efficiency_S.append(p_single)
656
661
  efficiency_T.append(p_single**3)
657
662
  efficiency_D.append(3*(p_single)**2-2*efficiency_T[-1])
658
- if Display: print("\t Summary of TDCR measurement (prompt)")
663
+ if Display: print(f"\n\t COUNTING \n\t\t Free parameter = {L} keV-1 \n\t Summary of TDCR measurement (prompt)")
659
664
  if Display: print("\t\t Free parameter = ", L, "keV-1")
660
665
  if Display: print("\t\t Efficiency of single events = ", round(efficiency_S[-1],5))
661
666
  if Display: print("\t\t Efficiency of double events = ", round(efficiency_D[-1],5))
662
667
  if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T[-1],5))
663
668
 
669
+ p_nosingle2 = np.exp(-L*np.sum(np.asarray(e_quenching2))/3) # probability to have 0 electrons in a PMT
670
+ p_single2 = 1-p_nosingle2 # probability to have at least 1 electrons in a PMT
671
+ efficiency_S2.append(p_single2)
672
+ efficiency_T2.append(p_single2**3)
673
+ efficiency_D2.append(3*(p_single2)**2-2*efficiency_T2[-1])
674
+ if Display: print("\t Summary of TDCR measurement (delayed)")
675
+ if Display: print("\t\t Efficiency of single events = ", round(efficiency_S2[-1],5))
676
+ if Display: print("\t\t Efficiency of double events = ", round(efficiency_D2[-1],5))
677
+ if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T2[-1],5))
678
+
664
679
  elif mode2=="asym":
665
680
  pA_nosingle2 = np.exp(-L[0]*np.sum(np.asarray(e_quenching2))/3) # probability to have 0 electrons in a PMT
666
681
  pA_single2 = 1-pA_nosingle2 # probability to have at least 1 electrons in a PMT
@@ -675,6 +690,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
675
690
  efficiency_T2.append(pA_single2*pB_single2*pC_single2)
676
691
  efficiency_D2.append(efficiency_AB2[-1]+efficiency_BC2[-1]+efficiency_AC2[-1]-2*efficiency_T2[-1])
677
692
  efficiency_S2.append(pA_single2+pB_single2+pC_single2-efficiency_D2[-1]-efficiency_T2[-1])
693
+ if Display: print(f"\n\t COUNTING \n\t\t Free parameter = {L} keV-1 \n\t Summary of TDCR measurement (prompt)")
678
694
  if Display: print("\t Summary of TDCR measurement (delayed)")
679
695
  if Display: print("\t\t Free parameter PMT A: ", L[0], "keV-1")
680
696
  if Display: print("\t\t Free parameter PMT B: ", L[1], "keV-1")
@@ -744,24 +760,31 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
744
760
  relaxation = False
745
761
  e_sum += ef
746
762
  if Display:
747
- print("\t Summary of the atomic relaxation")
763
+ print("\n\t ATOMIC RECOMBINATION\n\t Summary of the atomic relaxation")
748
764
  for i, p in enumerate(particle_vec):
749
765
  if p[:4] != "Atom":
750
- print(f"\t\t energy of {p} = ", round(energy_vec[i],3), "keV")
766
+ if p=="beta" or p=="beta+":
767
+ print(f'\t\t {p} transition of energy = {energy_vec[i]}, keV')
768
+ else:
769
+ print(f"\t\t emitted {p} of energy = {round(energy_vec[i],3)} keV")
770
+ else:
771
+ print(f'\t\t an electron left the {p[5:]} shell')
751
772
 
752
773
  '''
753
774
  ==========================================================
754
775
  III.a SPECTRES D'EMISSION
755
776
  ==========================================================
756
777
  '''
757
-
778
+ if ("beta" in particle_vec) or ("beta+" in particle_vec):
779
+ if Display: print("\n\t EMISSION OF BETA PARTICLES")
758
780
  for i, p in enumerate(particle_vec):
759
781
  if p == "beta":
760
782
  e_b,p_b = tl.readBetaShape(rad_i,"beta-",level_before_trans) # read the data of BetaShape
761
783
  index_beta_energy = tl.sampling(p_b) # sampling energy of beta
762
784
  particle_vec[i] = "electron"
763
785
  energy_vec[i] = e_b[index_beta_energy]
764
-
786
+ if Display: print(f"\t\t emitted {p} of energy = {round(energy_vec[i],3)} keV")
787
+
765
788
  if p == "beta+":
766
789
  e_b,p_b = tl.readBetaShape(rad_i,"beta+",level_before_trans)
767
790
  index_beta_energy = tl.sampling(p_b)
@@ -771,18 +794,15 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
771
794
  particle_vec.append("gamma")
772
795
  energy_vec.append(511)
773
796
  energy_vec.append(511)
797
+ if Display: print(f"\t\t emitted {p} of energy = {round(energy_vec[i],3)} keV")
774
798
  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
799
 
781
800
  '''
782
801
  ==========================================================
783
802
  III.b INTERACTION RAYONNEMENT/MATIERE
784
803
  ==========================================================
785
804
  '''
805
+
786
806
  for i, p in enumerate(particle_vec):
787
807
  if p == "electron":
788
808
  energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
@@ -797,20 +817,19 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
797
817
  if p == "Auger K" or p == "Auger L":
798
818
  particle_vec[i] = "electron"
799
819
  energy_vec[i] = tl.energie_dep_beta(energy_vec[i])
800
-
820
+
801
821
  if Display:
802
- print("\t Summary of the energy deposited by charged particles")
822
+ print("\n\t INTERACTION \n\t Summary of the energy deposited by charged particles")
803
823
  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
-
824
+ if p[:4] != "Atom" and energy_vec[i]!=0: print(f"\t\t {p} of energy = {round(energy_vec[i],3)} keV")
825
+
806
826
  '''
807
827
  ====================
808
828
  IV. LA SCINTILLATION
809
829
  Calculation of the scintillation quenching with the Birks Model
810
830
  ====================
811
831
  '''
812
- # changer l'intégration E_i - E_d à E_i
813
- if Display: print("\t Summary of the estimation of quenched energies")
832
+ if Display: print(f"\n\t SCINTILLATION \n\t\t Birks constant = {kB} cm/keV\n\t Summary of the estimation of quenched energies")
814
833
  e_quenching=[]
815
834
  for i, p in enumerate(particle_vec):
816
835
  if p == "alpha":
@@ -837,8 +856,7 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
837
856
  efficiency_S.append(p_single)
838
857
  efficiency_T.append(p_single**3)
839
858
  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")
859
+ if Display: print(f"\n\t COUNTING \n\t\t Free parameter = {L} keV-1 \n\t Summary of TDCR measurement")
842
860
  if Display: print("\t\t Efficiency of single events = ", round(efficiency_S[-1],5))
843
861
  if Display: print("\t\t Efficiency of double events = ", round(efficiency_D[-1],5))
844
862
  if Display: print("\t\t Efficiency of triple events = ", round(efficiency_T[-1],5))
@@ -929,18 +947,19 @@ def TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=Fals
929
947
  if mode =="dis":
930
948
  return efficiency_S, efficiency_D, efficiency_T
931
949
 
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"
950
+ L = 1.2
951
+ TD = 0.977667386529166
952
+ TAB = 0.992232838598821
953
+ TBC = 0.992343419459002
954
+ TAC = 0.99275350064608
955
+ Rad="Co-60"
956
+ pmf_1="1"
957
+ N = 10
958
+ kB =1.0e-5
959
+ V = 10
960
+ mode = "dis"
961
+ mode2 = "sym"
944
962
 
945
963
 
946
- # S,D,T = TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=False, barp=True,uncData=True)
964
+ S,D,T = TDCRPy(L, TD, TAB, TBC, TAC, Rad, pmf_1, N, kB, V, mode, mode2, Display=True, barp=False,uncData=False)
965
+ # tl.display_distrib(S, D, T)