OpenGATE / opengate

Gate 10 (beta)
http://www.opengatecollaboration.org
GNU Lesser General Public License v3.0
42 stars 38 forks source link

Change G4 version. Now use version 11.2.1 #366

Closed tbaudier closed 3 months ago

tbaudier commented 5 months ago

With G4 version 11.2.1, these tests are false:

tbaudier commented 5 months ago

Error for test061_user_event_info_mt.py

Importing opengate (thread 308971) ... done
Dispatching simulation to subprocess ...
Importing opengate (thread 309044) ... done
Importing opengate (thread 309116) ... done
Simulation: create RunManager (single thread)
Simulation: initialize Geometry
Simulation: initialize Physics
Simulation: initialize Source
Simulation: initialize Actors
Simulation: initialize G4RunManager
Simulation: check volumes overlap
--------------------------------------------------------------------------------
Simulation: START (in a new process)
Simulation: STOP. Run: 1. Time: 1.0 seconds.
--------------------------------------------------------------------------------
Runs      1
Events    50
Tracks    1289
Step      3133
Init      1.005359  1.00536 s  
Duration  0.022506  22.506 ms 
PPS       2222
TPS       57274
SPS       139207
Start     Fri Mar  8 11:49:56 2024
Stop      Fri Mar  8 11:49:57 2024
Sim start 0 ps 
Sim end   1 s  
Threads   1
Arch      Darwin
Python    3.9.7
Track types: {'Ac225': 50, 'At217': 50, 'At217[218.120]': 9, 'Bi209': 50, 'Bi213': 50, 'Fr221': 50, 'Fr221[100.890]': 1, 'Fr221[108.410]': 3, 'Fr221[145.910]': 1, 'Fr221[195.770]': 2, 'Fr221[224.640]': 1, 'Fr221[26.000]': 2, 'Fr221[36.640]': 17, 'Fr221[38.540]': 3, 'Fr221[99.620]': 5, 'Fr221[99.850]': 1, 'Pb209': 50, 'Po213': 50, 'Po213[1100.167]': 1, 'Po213[292.800]': 1, 'Po213[440.450]': 16, 'alpha': 200, 'anti_nu_e': 100, 'e-': 531, 'gamma': 45}
Parent particle i=0 track=3 name=alpha  ptrack=1        ref = Ac225 vs = Ac225 --> OK? True
Parent particle i=3 track=7 name=gamma  ptrack=4        ref = Ac225 vs = At217[218.120] --> OK? False
Parent particle i=4 track=6 name=At217  ptrack=4        ref = Ac225 vs = At217[218.120] --> OK? False
Parent particle i=63 track=7 name=gamma  ptrack=4        ref = Ac225 vs = At217[218.120] --> OK? False
Parent particle i=64 track=6 name=At217  ptrack=4        ref = Ac225 vs = At217[218.120] --> OK? False
Parent particle i=100 track=25 name=Po213[1100.167]  ptrack=23        ref = Bi213 vs = Bi213 --> OK? True
Parent particle i=176 track=13 name=e-  ptrack=2        ref = Ac225 vs = Fr221[99.620] --> OK? False
Parent particle i=177 track=12 name=e-  ptrack=2        ref = Ac225 vs = Fr221[99.620] --> OK? False
[...]
Parent particle i=2375 track=7 name=e-  ptrack=2        ref = Ac225 vs = Fr221[38.540] --> OK? False
Parent particle i=2376 track=6 name=e-  ptrack=2        ref = Ac225 vs = Fr221[38.540] --> OK? False
Parent particle i=2377 track=5 name=e-  ptrack=2        ref = Ac225 vs = Fr221[38.540] --> OK? False
Parent particle i=2378 track=4 name=Fr221  ptrack=2        ref = Ac225 vs = Fr221[38.540] --> OK? False

Compared 2435 elements --> OK? False

Error during the tests !
tbaudier commented 5 months ago

Error for the test test050_let_actor_letd_mt.py

Importing opengate (thread 308291) ... done
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_name', 'element_type', 'name', 'particle', 'policy', 'type_name']
{'current': PosixPath('/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src'), 'data': PosixPath('/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../data'), 'gate': PosixPath('/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../data/gate/test050_let_actor_letd'), 'gate_output': PosixPath('/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../data/gate/test050_let_actor_letd/output'), 'gate_data': PosixPath('/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../data/gate/test050_let_actor_letd/data'), 'output': PosixPath('/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output'), 'output_ref': PosixPath('/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../data/output_ref')}
Filters:  f (1)
Simulation: create MTRunManager with 2 threads
Simulation: initialize Geometry
Simulation: initialize Physics
Simulation: initialize Source
Simulation: initialize Actors
Simulation: initialize G4RunManager
Simulation: check volumes overlap
--------------------------------------------------------------------------------
Simulation: START 
/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-IDD_d.mhd

/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-IDD_d.mhd
edep
/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-IDD_d-edep.mhd
/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-IDD_d-edep.mhd
uncertainty
/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-IDD_d-edep-uncertainty.mhd
/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-LETActorOG_d_letd.mhd
numerator
/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-LETActorOG_d_letd-numerator.mhd
/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-LETActorOG_d_letd.mhd
denominator
/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-LETActorOG_d_letd-denominator.mhd
Simulation: STOP. Run: 1. Time: 24.3 seconds.
--------------------------------------------------------------------------------
     Cr_sctns:  Glauber-Gribov Nucl-nucl: 0 eV  ---> 25.6 PeV
     Cr_sctns:  Glauber-Gribov Nucl-nucl: 0 eV  ---> 25.6 PeV
Runs      2
Events    40000
Tracks    72263
Step      1761634
Init      0.000674  674 us 
Duration  26.693331     26.6933 s  
PPS       1499
TPS       2707
SPS       65995
Start     Fri Mar  8 11:48:49 2024
Stop      Fri Mar  8 11:49:15 2024
Sim start 0 ps 
Sim end   1 s  
Threads   2
Arch      Darwin
Python    3.9.7
Track types: {'B10': 35, 'B10[718.380]': 21, 'B11': 59, 'B8': 4, 'Be7': 41, 'Be9': 6, 'C10': 6, 'C11': 107, 'C12': 653, 'C13': 82, 'C14': 18, 'F17': 9, 'He3': 81, 'Li6': 64, 'Li7': 9, 'N12': 1, 'N13': 14, 'N14': 327, 'N15': 225, 'N16[120.420]': 1, 'O14': 11, 'O15': 456, 'O16': 4969, 'O17': 4, 'O18': 9, 'alpha': 1817, 'deuteron': 373, 'e+': 27, 'e-': 14866, 'gamma': 2086, 'neutron': 992, 'proton': 44879, 'triton': 11}

Images with same size/spacing/origin/dir ? True --> OK? True
Image1: [50  1  1] [ 2. 60. 60.] [-49.   0.   0.] 
Image2: [50  1  1] [ 2. 60. 60.] [-49.   0.   0.] 
Evaluate only data from entry up to peak position of reference filter image
Going to evaluate 25 elements out of 50
Img sums 145.67437744140625 vs 108.94138031398597 : 25.22 %  (tol 5.00 %) --> OK? False
Image diff computed on 50/50 
SAD (per event/total): 33.72 %  (tolerance is 20.00 %) --> OK? False
Save image test figure : /Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-LETActorOG_d_letd_test.png
Images with same size/spacing/origin/dir ? True --> OK? True
Image1: [50  1  1] [ 2. 60. 60.] [-49.   0.   0.] 
Image2: [50  1  1] [ 2. 60. 60.] [-49.   0.   0.] 
Evaluate only data from entry up to peak position of reference filter image
Going to evaluate 25 elements out of 50
Img sums 34.476295471191406 vs 32.932576898489856 : 4.48 %  (tol 5.00 %) --> OK? True
Image diff computed on 50/50 
SAD (per event/total): 4.69 %  (tolerance is 8.00 %) --> OK? True
Save image test figure : /Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-LETActorOG_t_lett_test.png
Images with same size/spacing/origin/dir ? True --> OK? True
Image1: [50  1  1] [ 2. 60. 60.] [-49.   0.   0.] 
Image2: [50  1  1] [ 2. 60. 60.] [-49.   0.   0.] 
Evaluate only data from entry up to peak position of reference filter image
Going to evaluate 25 elements out of 50
Img sums 39.867431640625 vs 38.86617839790054 : 2.51 %  (tol 5.00 %) --> OK? True
Image diff computed on 50/50 
SAD (per event/total): 2.59 %  (tolerance is 8.00 %) --> OK? True
Save image test figure : /Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test050-LETprimaries_letd_test.png

Error during the tests !
tbaudier commented 5 months ago

Error with test test049_pet_digit_blurring_v3.py

Importing opengate (thread 377684) ... done
Yield for F18 (nb of e+ per decay) :  0.968600992766
Simulation: create RunManager (single thread)
Simulation: initialize Geometry
Simulation: initialize Physics
Simulation: initialize Source
Simulation: initialize Actors
Simulation: initialize G4RunManager
Simulation: check volumes overlap
Simulation: initialize user fct
Entered hook
Known regions are:
*****
DefaultRegionForTheWorld
Cuts in this region:
gamma: 1000.0
electron: 1000.0
proton: 1000.0
positron: 1000.0
*****
DefaultRegionForParallelWorld
Cuts in this region:
gamma: 1000.0
electron: 1000.0
proton: 1000.0
positron: 1000.0
*****
phantom_region
Cuts in this region:
gamma: 10.0
electron: 10.0
proton: 10.0
positron: 10.0
*****
pet_crystal_region
Cuts in this region:
gamma: 0.1
electron: 0.1
proton: 0.1
positron: 0.1
--------------------------------------------------------------------------------
Simulation: START 
Simulation: STOP. Run: 1. Time: 13.4 seconds.
--------------------------------------------------------------------------------
Runs      1
Events    86365
Tracks    298808
Step      3705940
Init      2.267932  2.26793 s  
Duration  11.17546  11.1755 s  
PPS       7728
TPS       26738
SPS       331614
Start     Fri Mar  8 14:44:52 2024
Stop      Fri Mar  8 14:45:06 2024
Sim start 0 ps 
Sim end   50 us 
Threads   1
Arch      Darwin
Python    3.9.7
Track types: {'e+': 86365, 'e-': 14684, 'gamma': 197759}

Nb of ignored hits : 216

Check stats
Runs:         1 1 --> OK? True
Events:       86365 86257 : +0.13 %  (tol = 2.50 %) --> OK? True
Tracks:       298808 298287 : +0.17 %  (tol = 2.50 %) --> OK? True
Steps:        3705940 3775173 : -1.83 %  (tol = 2.50 %) --> OK? True
PPS:          7728.1 2361.8 : +227.2%    speedup = x3.3 --> OK? True
TPS:          26737.9 8167.4 : +227.4%    speedup = x3.3 --> OK? True
SPS:          331614.1 103367.7 : +220.8%    speedup = x3.2 --> OK? True
Tracks      : {'e+': 86365, 'e-': 14684, 'gamma': 197759} --> OK? True
Tracks (ref): {} --> OK? True
Tracks vs track_types : 298808 298808 --> OK? True

Check root (singles)
Reference tree: pet_blur.root n=33310
Current tree:   test049_pet.root n=33268.0
Difference: 33310 33268.0 -0.13% --> OK? True
Reference tree: dict_keys(['runID', 'eventID', 'sourceID', 'sourcePosX', 'sourcePosY', 'sourcePosZ', 'time', 'energy', 'globalPosX', 'globalPosY', 'globalPosZ', 'gantryID', 'blockID', 'crystalID', 'unused3ID', 'unused4ID', 'unused5ID', 'comptonPhantom', 'comptonCrystal', 'RayleighPhantom', 'RayleighCrystal', 'axialPos', 'rotationAngle', 'comptVolName', 'RayleighVolName', 'volumeID'])
Current tree:   dict_keys(['PostPosition_X', 'PostPosition_Y', 'PostPosition_Z', 'TotalEnergyDeposit', 'PreStepUniqueVolumeID', 'GlobalTime'])
Compare branches with Wasserstein distance
N:   33310 vs   33268 -> means  -0.91 vs  -3.59 -> sums -30404.76 vs -119367.41  -> ranges: 877.31 vs 877.31  -> w:2.949 vs 8.000    globalPosX           PostPosition_X        -> pass (tol 8) --> OK? True
N:   33310 vs   33268 -> means -79.82 vs -78.16 -> sums -2658853.00 vs -2600131.12  -> ranges: 877.31 vs 877.31  -> w:2.024 vs 5.000     globalPosY           PostPosition_Y        -> pass (tol 5) --> OK? True
N:   33310 vs   33268 -> means   0.22 vs   0.01 -> sums 7168.00 vs 432.00  -> ranges: 216.00 vs 216.00  -> w:0.406 vs 1.200      globalPosZ           PostPosition_Z        -> pass (tol 1.2) --> OK? True
N:   33279 vs   33268 -> means   0.28 vs   0.28 -> sums 9242.12 vs 9195.97  -> ranges:   1.17 vs   0.93  -> w:0.001 vs 0.004     energy               TotalEnergyDeposit    -> pass (tol 0.0045) --> OK? True
N:   33310 vs   33268 -> means 24872.55 vs 24984.65 -> sums 828504682.65 vs 831189224.10  -> ranges: 50158.54 vs 50175.80  -> w:140.690 vs 351.000       time                 GlobalTime            -> pass (tol 351) --> OK? True
Figure in /Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/../output/test049_singles_wb.png

Hits timing ref:
Min: 1.98(ref) 2.80(this) 0.00% (rel. diff.), tolerance: 1.00%    Mean: 24899.71(ref) 25176.34(this) 1.11% (rel. diff.), tolerance: 1.00%     Max: 50000.89(ref) 50001.64(this) 0.00% (rel. diff.), tolerance: 1.00%, Passed? False --> OK? False

Singles timing ref:
 Min: -54.03(ref) -99.58(this) 0.18% (rel. diff.), tolerance: 1.00%    Mean: 24872.55(ref) 24984.65(this) 0.45% (rel. diff.), tolerance: 1.00%     Max: 50104.51(ref) 50076.22(this) 0.11% (rel. diff.), tolerance: 1.00%, Passed? True --> OK? True

Compare time min values: Ref: -54.03079032472637 vs this: -99.57795836932075, Must be smaller than -10, Passed? True --> OK? True

Error during the tests !
andiresch commented 4 months ago

test050_let_actor_letd_mt.py output looks like a pass (the dose sum which "fails" should be ignored); I will cross-check while refactoring of LET actor , but I don't believe it is a G4 version problem.

tbaudier commented 4 months ago

Error for test053_phid_03_fr221.py

Data from MC, normalized by nb events
Root tree ['phsp;1'] n=144925.0
Keys:['KineticEnergy', 'EventID', 'TrackID', 'ParentID', 'TrackCreatorProcess', 'TrackCreatorModelIndex', 'ParticleName']
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/opengate/tests/../tests/src/test053_phid_03_fr221.py", line 23, in <module>
    is_ok = analyse(
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/opengate/tests/src/test053_phid_helpers1.py", line 221, in analyse
    g2_ene, g2_w = analyse_ion_gamma_from_root(
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/opengate/tests/src/test053_phid_helpers1.py", line 158, in analyse_ion_gamma_from_root
    ion = track[e["ParentID"]]["ParticleName"]
KeyError: 2
   140.7 s     /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-
tbaudier commented 4 months ago

Error for test053_phid_05_it_ref_mt.py and test053_phid_06 based on it

Simulation: START 
G4WT3 >  G4VParticleChange::CheckSecondary : 
G4WT3 >  Ekin(MeV)=-1.91352e-06 is negative !!  anti_nu_e created by model_RDM_BetaMinus
G4WT3 >       -----------------------------------------------
G4WT3 >         G4VParticleChange Information 
G4WT3 >         TrackID             : 40
G4WT3 >         ParentID            : 38
G4WT3 >         Particle            : Pb209
G4WT3 >         Kinetic energy (MeV): 0
G4WT3 >         Position (mm)       : (-3.3177934e-05,-8.4672076e-05,-6.8338679e-05)
G4WT3 >         Direction           : (0.10680651,-0.57561813,-0.81071335)
G4WT3 >         PhysicsVolume       : world
G4WT3 >         Material            : G4_WATER
G4WT3 >       -----------------------------------------------
G4WT3 >         # of secondaries    :                    1
G4WT3 >       -----------------------------------------------
G4WT3 >         Energy Deposit (MeV):                    0
G4WT3 >    NIEL Energy Deposit (MeV):                    0
G4WT3 >         Track Status        :         StopButAlive
G4WT3 >         TruePathLength (mm) :                    0
G4WT3 >         Stepping Control    :                    0
G4WT3 >        First step in volume
G4WT3 >       -----------------------------------------------
G4WT3 >     G4ParticleChangeForDecay proposes: 
G4WT3 >     Proposed local Time (ns):        0.00015895671
G4WT3 >     Initial local Time (ns) :        0.00015895671
G4WT3 >     Initial global Time (ns):        7.4442804e+12
G4WT3 >     Current global Time (ns):        7.4442804e+12
G4WT3 > 
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : TRACK001
      issued by : G4VParticleChange::CheckSecondary()
Secondary with illegal time and/or energy and/or momentum
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
tbaudier commented 4 months ago

Error for test053_phid_02_bi213.py and test053_phid_03_fr221.py

Track types: {'At217': 9950, 'At217[100.250]': 151, 'At217[218.120]': 1566, 'At217[272.070]': 20, 'At217[310.300]': 1, 'At217[368.230]': 50, 'At217[382.340]': 10, 'At217[410.640]': 19, 'At217[424.350]': 1, 'At217[577.000]': 6, 'Bi209': 9962, 'Bi213': 9949, 'Bi213[257.870]': 7, 'Bi213[593.180]': 4, 'Fr221': 9962, 'Ne20': 4, 'Pb209': 9962, 'Pb209[1567.090]': 210, 'Pb209[2032.220]': 210, 'Pb209[2149.430]': 209, 'Pb209[2524.920]': 2, 'Pb209[2904.000]': 2, 'Pb209[3069.920]': 1, 'Pb209[778.800]': 4, 'Po213': 9748, 'Po213[1003.553]': 7, 'Po213[1045.670]': 2, 'Po213[1100.167]': 43, 'Po213[1119.291]': 8, 'Po213[1328.200]': 1, 'Po213[292.800]': 47, 'Po213[440.450]': 3169, 'Po213[600.730]': 1, 'Po213[867.980]': 1, 'Ra221': 12, 'Rn217': 13, 'Rn217[149.180]': 6, 'Rn217[184.000]': 1, 'Rn217[93.020]': 3, 'Tl209': 214, 'Tl209[323.810]': 12, 'alpha': 29886, 'anti_nu_e': 19924, 'e+': 2, 'e-': 35311, 'gamma': 6057, 'proton': 5}
Data from MC, normalized by nb events
Root tree ['phsp;1'] n=144925.0
Keys:['KineticEnergy', 'EventID', 'TrackID', 'ParentID', 'TrackCreatorProcess', 'TrackCreatorModelIndex', 'ParticleName']
Traceback (most recent call last):
  File "/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/test053_phid_03_fr221.py", line 23, in <module>
    is_ok = analyse(
  File "/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/test053_phid_helpers1.py", line 221, in analyse
    g2_ene, g2_w = analyse_ion_gamma_from_root(
  File "/Users/tbaudier/Software/GatePython/opengate_other/opengate/tests/src/test053_phid_helpers1.py", line 158, in analyse_ion_gamma_from_root
    ion = track[e["ParentID"]]["ParticleName"]
KeyError: 2
dsarrut commented 3 months ago

PhotonIonDecayIsomericTransitionExtractor does not work anymore, but not needed. The tests test053_phid_01 02 03 are disabled. Corrected process name.