How to determine position with the mesh scoring data?

Hello everyone,
I want to plot the dose vs depth(z-axis). I used mesh scoring to extract the data and have many data for (ix,iy, iz).
How I can understand the exact z?

You can’t. The mesh scoring is by design binned. You can assign an “effective z” corresponding to the midpoint of the bin, if you want to do that.

If you want to save the exact (x,y,z) coordinates, then you should be filling an N-tuple with hits. You can then choose to do whatever binning you want in your analysis code.

Hi, thanks for your response.
What you are trying to tell me(N-tuple), is that I should use RunAction and EventAction…?
how can I assign an “effective z” in mesh scoring?

Yes. You’d write a SensitiveDetector (SD) to attach to your volume, and use that to fill an N-tuple; the N-tuple is created in your Run and Event actions, as usual. There are several examples which show how to do this.

I presume that you know your geometry, and you know how you defined the mesh. So you should be able to convert the mesh cell index (ix,iy,iz) into spatial coordinates from the dimensions of the volume. Depending on how you do the arithmetic, you can get either the corner of each cell, or the center.

1 Like

Thank you so much for advice