Problem 2447

Summary: Inconsistent results with >1 scorer, binned detector, and coupled transportation
Product: Geant4 Reporter: cvpztw
Component: processes/scoringAssignee: asai
Status: ASSIGNED ---    
Severity: major CC: cvpztw, perl
Priority: P4    
Version: 10.7   
Hardware: All   
OS: All   
Attachments: Minimum working example. Run with run2.mac macro. Adjust DetectorConstruction/PhyscisList as described above.

Description cvpztw 2021-11-26 15:38:03 CET
Created attachment 739 [details]
Minimum working example. Run with run2.mac macro. Adjust DetectorConstruction/PhyscisList as described above.

Scoring system returns inconsistent results when using more than one scorer and enabling coupled transportation.

The significance of this is that coupled transportation is unavoidable when using parallel worlds. This example demonstrates the issue without using parallel worlds.


Simulation Setup (derived from example B1/B3):

Geometry: Parameterised, radially binned G4Sphere (G4_WATER) at center of world (G4_AIR)

Scoring: Sphere set to be detector with one or two primitive scorers (EnergyDeposit and e.g. DoseDeposit or CEllFlux).

Physics: EM + Transportation (Coupled: true/false)


Expected Behaviour: Energy deposit scorer returns, within statistical fluctuations, the same results when setting UseCoupledTransportation(true/false) and when using one or two primitive scorers assigned to the detector.

Observed Behaviour:
1. nScorers = 1, CoupledTransportation = false: as expected
1. nScorers = 2, CoupledTransportation = false: as expected
3. nScorers = 1, CoupledTransportation = true: as expected
4. nScorers = 2, CoupledTransportation = true: *NOT* as epxected, energy deposit fluctuates by roughly 50% in alternating bins compared to (1-3)


Steps to replicate: Compile attached source code, run using run2.mac macro.
Comment in or out "Sphere->RegisterPrimitive(Sphere_Dose);" in MyDetectorConstruction.cc to set 1 or 2 scorers.
Set "UseCoupledTransportation(true)" or "UseCoupledTransportation(false)" in MyPhysicsList.cc to turn coupled transportation on or off.

Observed on: macOS and Linux with both, Geant4 10.06.p03 and 10.07.p03.


Case (3):
UseCoupledTransportation(true):
1 Scorer:
G4WT0 >   edep0: 2602.13 keV
G4WT0 >   edep1: 2565.2 keV
G4WT0 >   edep2: 2418.99 keV
G4WT0 >   edep3: 2812.9 keV
G4WT0 >   edep4: 1936.95 keV
G4WT0 >   edep5: 2420.61 keV
G4WT0 >   edep6: 2351.85 keV
G4WT0 >   edep7: 2242.26 keV
G4WT0 >   edep8: 2209.84 keV
G4WT0 >   edep9: 2706.27 keV

Case (4):
2 Scorers (must be different type, e.g. Edep + Dose):
G4WT0 >   edep0: 2602.13 keV
G4WT0 >   edep1: 1251.43 keV
G4WT0 >   edep2: 2491.56 keV
G4WT0 >   edep3: 1602.76 keV
G4WT0 >   edep4: 2059.12 keV
G4WT0 >   edep5: 1196.46 keV
G4WT0 >   edep6: 2407.28 keV
G4WT0 >   edep7: 1256.96 keV
G4WT0 >   edep8: 2120.12 keV
G4WT0 >   edep9: 1066.8 keV

Case (1) + (2):
UseCoupledTransportation(false):
1 or 2 Scorers:
G4WT0 >   edep0: 2602.13 keV
G4WT0 >   edep1: 2565.2 keV
G4WT0 >   edep2: 2418.99 keV
G4WT0 >   edep3: 2812.9 keV
G4WT0 >   edep4: 1936.95 keV
G4WT0 >   edep5: 2420.61 keV
G4WT0 >   edep6: 2351.85 keV
G4WT0 >   edep7: 2242.26 keV
G4WT0 >   edep8: 2209.84 keV
G4WT0 >   edep9: 2706.27 keV
Comment 1 perl 2021-11-27 23:11:11 CET
I have duplicated the bug report from this user, Christian.
I did so running his example on Geant4.10.06.p03 on macOS.

His example is a pure Geant4 presentation of an issue that TOPAS users have
been seeing on and off for at least two years.
My attempts to track it there did not get a clear picture, because I did not
figure out the detail that Christian noticed:
There is no issue if there is only one scorer on the given volume.
The issue only shows up if you have two scorers on the volume.

The issue was first reported in TOPAS forums regarding a TOPAS version built against Geant4.10.05.p01, though it may have also existed in earlier Geant4 versions.
Comment 2 asai 2021-11-29 19:18:37 CET
Hi Christian,
Thank you for reporting this issue. I believe this problem was spotted and fixed with the recent Geant4 patch release (version 10.7.p03). Could you please give it a try? 
Kind regards,
Makoto
Comment 3 cvpztw 2021-12-01 12:44:48 CET
Hi Makoto,
This is still observable in version 10.7.p03.
Thanks!

(In reply to asai from comment #2)
> Hi Christian,
> Thank you for reporting this issue. I believe this problem was spotted and
> fixed with the recent Geant4 patch release (version 10.7.p03). Could you
> please give it a try? 
> Kind regards,
> Makoto
Comment 4 cvpztw 2021-12-01 13:19:12 CET
I also just tested it with the Geant4 11 beta and it is still observable.