and want the program to tell me when the current particle interacted with is an C12 Atom. I think there must be a way with G4Ions but I don’t know how to exactly get the particle I want with that class to compare it to the current Track.
I worked out how to do it with protons as H1:
G4Proton* proton = G4Proton::Definition();
if (proton == particle) {...}
And this works. But how can I do this with other Ions with given A,Z such as C12?
Can anyone help me?
sorry, one question regarding this. What particle is addressed by this if clause? For example if I shoot neutrons on a mixture of C and H. First it hits H and transfers all its energy. the energy deposited falls under particle == hydrogen, right? And after that the proton of hydrogen bounces into C. I guess that would fall under particle == Carbon. So is the first energy removed from the record or do you record more than the original energy?
And another question is there also a method to ask for the source particle like: if (sourceparticle == proton && target particle == C12) {…}
Thanks for the help