Incident particles will deposit energy in the target material. At each step, can we know which atom the deposited energy is deposited on? I don’t konw if it can achieve. I need your help.
Thank you for reading my question. Any advice will be helpful for me.
lvll
Wouldn’t the locations (x,y,z) at which interactions are happening will be helpful? If yes, I guess you can achieve that in the volume of interest and extract the coordinates of those steps in SteppingAction.cc?
@lvll98 I presume you’re asking about the target “atom type”, not position? Unfortunately, I don’t believe that’s available in a generic way. If the interaction was hadronic, then G4Isotope* G4HadronicProcess::GetTargetIsotope() or G4Nucleus* G4HadronicProcess::GetTargetNucleus() can get you this information.
Use code along the lines of (note the null pointer checks at each step)
Thank you for your answer. I have tried that, but I don’t know what the corresponding target atom is at that position because I set up the mixture as the target material.
That’s exactly right. Geant4 does not setup the material with a layout of the different kinds of atoms in specific locations. The material is treated as a perfect continuum. The position of interaction is chosen, and can have any coordinates at all. Then for EM interactions, the average material properties are used, while for hadronic interaction, some isotope from the material definition is picked at random and used.