| Summary: | Incorrect G4OpBoundaryProcess operation when G4ParallelWorldProcess enabled | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Wouter Deconinck <wdconinc> |
| Component: | processes/optical | Assignee: | asai |
| Status: | CLOSED FIXED | ||
| Severity: | normal | CC: | asai, daren.sawkey, wdconinc |
| Priority: | P4 | ||
| Version: | 10.5 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://bugzilla-geant4.kek.jp/show_bug.cgi?id=1953 https://github.com/JeffersonLab/remoll/issues/158 |
||
| Attachments: |
patch to create ParallelWorld.hh and modify OpNovice2.cc
diff of parallel disabled and enabled with /tracking/verbose 3 (first 1k lines only) |
||
|
Description
Wouter Deconinck
2019-01-05 22:23:36 CET
Created attachment 531 [details]
diff of parallel disabled and enabled with /tracking/verbose 3 (first 1k lines only)
Detailed diff output with /tracking/verbose 3 in our application code (I suspect similar in OpNovice2 code) is attached. The difference start with:
G4WT0 > ++List of secondaries generated (x,y,z,kE,t,PID): G4WT0 > ++List of secondaries generated (x,y,z,kE,t,PID):
G4WT0 > Photon at Boundary! | G4WT0 > *** NotAtBoundary ***
G4WT0 > thePrePV: logicMotherVol_5open_PV <
G4WT0 > thePostPV: quartzRec_50001 <
G4WT0 > Old Momentum Direction: (-0.01808152687973002,-0.020 <
G4WT0 > Old Polarization: (-0.6678976456559221,-0.7437 <
G4WT0 > New Momentum Direction: (-0.01121623129885978,-0.021 <
G4WT0 > New Polarization: (0.258481474387094,-0.965845 <
G4WT0 > *** FresnelRefraction *** <
G4WT0 > G4WT0 >
G4WT0 > **PostStepDoIt (after all invocations): G4WT0 > **PostStepDoIt (after all invocations):
G4WT0 > ++List of invoked processes G4WT0 > ++List of invoked processes
G4WT0 > 1) CoupledTransportation G4WT0 > 1) CoupledTransportation
G4WT0 > 2) OpBoundary G4WT0 > 2) OpBoundary
G4WT0 > G4WT0 >
This indeed indicates divergence due to G4OpBoundaryProcess.cc near lines 179-181.
Hi Wouter, Regardless of tracking world or parallel world, there must not be any daughter volume that is touching to the boundary of the world volume. This is a special restriction that is applied only to the world volume. Could you please make your box smaller than the size of the world volume and try to see the results? Thanks, Makoto The same problem occurs when the parallel world is empty (no placement at all). I will check with a smaller G4Box in the next two hours and report back. I can confirm that the same issue occurs when choosing a smaller G4Box size, but there are differences depending on the size. This may help in debugging the problem:
- G4Box of 2.0*m cubed (larger than the 1.0*m cubed tank in OpNovice2 material geometry):
Run Summary
---------------------------------
Primary particle was: opticalphoton with energy 3 eV .
Material of world: G4_AIR
Material of tank: G4_WATER
Average number of OpRayleigh per event: 0
Average number of OpAbsorption per event: 0
Surface events (on +X surface, maximum one per photon) this run:
# of primary particles: 100000
OpAbsorption before surface: 74
Total # of surface events: 99926
Unaccounted for: 0
Surface events by process:
Not at boundary: 99926
Sum: 99926
Unaccounted for: 0
---------------------------------
- G4Box of 0.5*m cubed (smaller than the 1.0*m cubed tank in OpNovice2 material geometry):
Run Summary
---------------------------------
Primary particle was: opticalphoton with energy 3 eV .
Material of world: G4_AIR
Material of tank: G4_WATER
Average number of OpRayleigh per event: 0
Average number of OpAbsorption per event: 0
Surface events (on +X surface, maximum one per photon) this run:
# of primary particles: 100000
OpAbsorption before surface: 74
Total # of surface events: 99926
Unaccounted for: 0
Surface events by process:
Same material: 99926
Sum: 99926
Unaccounted for: 0
---------------------------------
Note the difference between surface events by process, which went from "Not at boundary" to "Same material".
Thanks. Your results are very informative. I will look into it. Makoto Hi Wouter,
Could you please try to modify
source/physics_lists/constructors/electromagnetic/src/G4OpticalPhysics.cc
as below.
It *seems* to work for OpNovice2. I'd be grateful for any feedback in applying this to your application code.
Thanks -- Daren.
248 if( fScintillationProcess->IsApplicable(*particle) &&
249 fProcessUse[kScintillation] ) {
250 pManager->AddProcess(fScintillationProcess);
251 pManager->SetProcessOrderingToLast(fScintillationProcess,idxAtRest);
252 pManager->SetProcessOrderingToLast(fScintillationProcess,idxPostStep);
253 }
/////////////// add these lines ////////////////////////
254 if (fBoundaryProcess->IsApplicable(*particle) && fProcessUse[kBoundary]) {
255 pManager->SetProcessOrderingToLast(fBoundaryProcess,idxPostStep);
256 }
257 }
Against which version should I apply that? 4.10.04.p02, 4.10.05 or 4.10.05.p01? Maybe it doesn't matter... Maybe it doesn't matter. I was testing against the development version. Whatever you try, please let me know the result. Your suggested change is confirmed working in my application code with 4.10.05.p01. Great. I will update the code. Thanks for your patience. The patch is released along version 10.6. Thank you once again for your contribution. Makoto |