Meaning of the tracking results

_Geant4 Version:_geant4-v11.2.0
_Operating System:_win11
_Compiler/Version:_Visual Studio Version 17.3.5
_CMake Version:_cmake-3.28.1

Hello everyone, I need help on reading the tracking/verbose/2 results. I try to understand what particles do I count as detected. Can you help me to understand what is saying?

I am trying to get number of particle reach to the geCrystalSolid. My first question is, Is there any seconderies that I count?

I just sent gamma particles at 1000 keV. Why are there e- particles?

And lastly is there any particle that goes out and comes in the detector again? I do not want to count all these particles.

Thank you :pray:

I’m not sure if you’re asking for a detailed description of all of the data in the G4Track Information: blocks, but I’ll just start with the specific points you asked:

These are secondaries created by the interaction of the gamma with the material it’s passing through. You can see the physical process that was selected in the last column of the track information table. For example in the second screenshot, an electron is created through Compton scattering of the gamma.

What sensitive detectors or primitive scorers have you attached to geCrystalSolid or how otherwise are you try to score this? If these aren’t filtering on things like (see below) particle type, then yes, secondaries will be considered by the scoring.

Depends completely on the geometry of the problem. If I understand the problem correctly, then you want to:

  1. Count only gammas that reach the outer surface of geCrystalSolid, passing from outside->inside.
  2. That have not already been recorded.

If that’s the case, then you could set up a sensitive detector such that it counts, then kills, any incoming gamma.

// pseudo code of ProcessHits for a Sensitive Detector
G4bool ExampleSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
  // Unless we're a gamma, ignore
  G4Track* theTrack = aStep->GetTrack();
  if(theTrack->GetDefinition() != G4Gamma::Gamma())
    return false;

  // Are we crossing into the volume from the outside?
  if(aStep->GetPreStepPoint()->GetStepStatus() == fGeomBoundary)
    // Count/score/record this. Here assume there's a counter
    countOfGammasEntering += 1;

    // Don't care about what happens next, so can kill this track

  return true;

If you’re only concerned with the primary gammas, then you could add a further condition on only counting gammas whose Parent ID is zero.