Problem 2557

Summary: Mesh treated as geometry boundary
Product: Geant4 Reporter: Yongke Zhao <yongke.zhao>
Component: processes/scoringAssignee: Makoto.Asai
Status: ASSIGNED ---    
Severity: normal CC: asai, asai
Priority: P4    
Version: 11.1   
Hardware: All   
OS: Linux   

Description Yongke Zhao 2023-08-01 17:30:30 CEST
Not sure if it's a bug.

I’m using Geant4 11.1.1 and it seems that there is a problem with the /score/mesh which are treated as geometry boundaries.

I want to save the particles at the boundary of my material. Then I used something like “point2->GetStepStatus() == fGeomBoundary” in the SteppingAction to select the tracks.

When I turn off the scoring, it seems OK. But if I turn on the scoring, all the particles that not only at the boundary but also in the material are recorded.
Comment 1 asai 2023-08-01 21:16:46 CEST
Hi,

Is your "point2" pre-step point or post-step point?
How do you get the "point2" pointer?

In general, a step is limited by all the volume boundaries not only in the mass world but also in a parallel world. And the mesh volume is created in a dedicated parallel world.
Comment 2 Yongke Zhao 2023-08-21 11:19:19 CEST
Dear expert,

Thanks very much for your reply! I replied directly in the email. I'm not sure if you received my reply. Here it is:

I'm using post-step point. For example in the stepping action:

  // Collect particles at target exit

  bool is_amor_leave = 0;

  if (l_amor>0 && statusP2==fGeomBoundary && VolNameP2=="TargetDetector" && pzP2>0){
    //if (zP2 == z_amor_leave)
      is_amor_leave = 1;
  }

where electrons hit a target and I collect positrons with a detector placed 0.001 mm after the target.

The meshes are overlapped with the target.

The number of positrons I obtained with meshes on is more than the number with meshes off, even when the detector is 1 mm downstream the meshes, which I can not understand.

And when I wanted to save the particles that enter the boundary of my target, it is also a problem.

Best,
Yongke
Comment 3 Yongke Zhao 2023-09-05 11:11:36 CEST
Dear experts,

May I ask if there is any update on this topic?

Thanks very much!

Best,
Yongke
Comment 4 Makoto Asai 2023-09-12 01:52:24 CEST
Hi,
I could not reproduce the issue. The code you are referring has not been changed since version 10.6. Meanwhile, there are some changes in electromagnetic physics in the treatment of range cut near the volume boundary. Could you please provide us a simple test code that generates this problem?
Comment 5 Makoto Asai 2023-09-12 01:54:28 CEST
Also, please specify which physics list (EM physics option in particular) you are using.
Comment 6 Makoto Asai 2023-09-12 02:06:16 CEST
Sorry but one more question. You wrote in the discussion forum
> The problem is that when I updated Geant4 from 10 to 11, the positron 
> yield at the target exit gets higher. 
Could you be more specific which exact version in 10 series you used before?
Comment 7 Yongke Zhao 2023-09-12 09:45:27 CEST
Dear expert,

It's version 10.7, if I remember correctly, that worked well. Though I remember there was also a difference in the positron yield (ratio of positrons to electrons) when using or not using scoring mesh, the difference was not so large.

But now when I use version 11.1, the difference in the yield of using or not using scoring mesh is much larger. I don't know which yield is correct. This is the main problem.

Another problem (maybe the same problem) is that, as I said earlier, when I use scoring mesh and when I try to count particles at the target boundary (from World to target), the meshes contribute to this boundary and the counting is totally wrong.

Thanks very much in advance!

Let me know if you need more information.

Best,
Yongke
Comment 8 Makoto Asai 2023-09-13 20:29:53 CEST
As I wrote earlier, please inform us which physics (in particular which EM physics option) you use.
Also, we appreciate it if you could provide us a sample code that reproduce the issue.
Comment 9 Yongke Zhao 2023-09-14 10:07:27 CEST
Sorry I didn't notice the other comments. 

Sure! I will prepare a test code for you.