I made detector and I get total energy deposit. But I want to get energy deposit only from incident particle. I also want the particle to be taken out of the entry if the incident particle collapses during the interaction. I solved how to get an inelastic process but couldn’t find a way to exclude it from entry and energy deposit.
How do you record the total energy?
If you implement your sensitive detector, you can check for many things in ProcessHits method before making the decision whether to record the energy or not. For instance, you can check if the energy is deposited by the primary particle (G4Step::GetTrack()::GetParentID() == 0).