My question is simple, but I have no idea if this is at all possible with Geant4.
I know that the Geantino has no interactions whatsoever, but I’d like to have different track colors depending on the amount of material the Geantino passes through. In addition, I’d like to be able to compute how much material (say in mm) has a given geantino passed through.
Are there methods to compute the above?
As for computing the amount of material the geantino passes through, I guess you can do this at each step (in your stepping action) with information available there. Your trajectory should be designed to store the accumulated material at each step. Then in your DrawTrajectory, draw each step with a colour according to the accumulated material. The vis manager will invoke this if you /vis/scene/add/trajectories.
Have a look at examples/extended/runAndEvent/RE01 and RE04, and examples/extended/optical/LXe.