How to determine of coordinates of registered particles on detector?

Hi experts,

I am interested in determining of coordinates of registered particles and extract to .txt file…

Best regards,

Hi @eyvaz94 !!

If I am understanding your question, you want to score x,y,z,directioncosines, etc of primary particle. Right?
This can be done by putting condition on ParentID == 0 that means only primary particles. Now you can call functions getX, getY, etc from G4step object and can store data in txt format using
#include “G4CsvAnalysisManager.hh” in your scoring file.

Regards
VRS

1 Like