Scoring volumes appear to be in the wrong place

Hello, I must do a scoring mesh for my Geant simulation.

In my app I’m simulating a 45GeV positron beam hitting 2 circular beryllium targets. Both targets have diameter d=1.5cm and thickness 3.0mm. The first target is centered at x=0, y=0 z=0 and the second one is centered at x=0, y=0 z=2.3cm.
Notice that z is the beam direction.

@anna helped me to start to add the scoring mesh in my macro (run1.mac) moreover @allison fixed some visualization bugs (as you can read here https://geant4-forum.web.cern.ch/t/scoring-mesh-visualization-problem ) so that now

1.I can print the scoring mesh on files
2. I can visualize the scoring mesh

and this is the app fixed by @allison

Unfortunately @allison noticed that the scoring mesh is in the wrong place (i.e. it isnt’ in my two targets), indeed this is the image that I get regarding of the beam

and this one regarding of the scoring mesh (you see…I don’t have the color scale on my targets)

I don’t know the reason because as you can read in the run1.mac for the target 1 I wrote:

#/score/mesh/translate/xyz 0.1 0.1 0.0 cm
then, given that the line is commented, the scoring mesh should be at x=0,y=0,z=0 (i.e. same position of my first target)

for the second target I wrote
/score/mesh/translate/xyz 0. 0. 2.3 cm
then, the scoring mesh should be at x=0,y=0,z=2.3 (i.e. same position of my second target)

Moreover I noticed some problems also in the dump files

boxMesh_1.txt (1.5 MB) boxMesh_2.txt (1.5 MB)

indeed, looking for example the boxMesh_1.txt (target 1)

a. I’ve values as for example z=29mm, but it’s impossibile because my first target is centered at z=0 and it has thickness 3mm
b. I’ve all 0 energies and entries values.

I also noticed that during the run I got this error

so I tried to move the line

/run/initialize

from init_run.mac to run1.mac and I tried to run again the app both in batch and visualising mode! So This is the current version of my app

I just tried to simulate 1000 events and you see now I get no zero energies

boxMesh_1.txt.txt (1.6 MB) boxMesh_2.txt (1.6 MB)

but

a. I still get for example z=29mm (impossibile )
b. When I run in visualization mode

The visualization mode shows problems

Please does someone understand the bugs? It would be great to fix both batch and visualising mode…but if it’s impossible to fix the visualising mode, at least I nead to get good values in the batch mode

Thank you

Hello…anyone please?

Hi Fausto

I don’t think there is anything more we can do. We can’t do your project for you. Maybe the scoring volumes are not in the wrong place. Maybe they are in the place you have put them. You just have to figure it out. Try a few things.

Good luck

John

Hi @allison obviously I didn’t ask you to do my project and, as I wrote, I moved the line
/run/initialize
to fix the error of ignored beam. I’m a beginner, so I wask just asking if some expert can help me to understand the reason because of I get wrong results (for example, z>1.5mm)