Hello G4 Community,
I am trying to get the total energy deposit through scoring volume. I wrote the following code at the end of my steppingaction.cc file:
if ((volume = fScoringVolume))
G4double edep = step ->GetTotalEnergyDeposit();
My Question is that by using the above code, I am getting the energy deposit but being new to the programming, I am not sure that only “=” is right in if statement. If I write
if(volume == fScoringVolume)
then I am not getting any energy deposit. I also tried,
if(volume!=fScoringVolume) but again there is no energy deposit. It is only in the first case that I am getting something.
I am not sure about the validity of the final result. I know this seems more like a programming type of question but any help would be highly appreciated.