Hello everyone!
The variable fTrackID stores the ID value of non-primary track particles.
However, later in the code, there is a condition where the current ID is checked different with fTrackID (non-primary track particles), and if they are not equal, the program exits. I believe that it should be go ahead.
This seems contradictory to what is stated in the comments of code. I would like to inquire if there is a bug in this part of the code.
Well, I’m not a Geant4 dev, but code seems ok.
Note 1: “if ( smth != var1 && smth2 != var2 )” → “if ( !(smth == var1 || smth2 == var2) )”, so first if might be read as except all primaries or electrons (11 in PDG is e-).
Note 2: fTrackID is class variable. ProcessHits executed on each step.
Note 3: if (!true) … else {} will result in executing the brackets. That’s exactly the second if case
1 Like
Thank you so much!
if ( !(smth == var1 || smth2 == var2) ) looks more easier to understand for me.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.