[Solved] Secondaries not tracked with energies above thrershold

Dear Developers and Users,

I’m still a bit new to Geant4. I found a strange behaviour with respect to (muon) ionization.

So i have a simple setup:
1 experiment hall, inside there is 1 Pb absorber and a sensitive detector (built up by small boxes). (I shoot 500 MeV negative muons through the Pb towards the sensitive detector.)

When i checked the tracking with verbosity level 2 (one_primary.txt (99.4 KB) ) i found that there are electrons created (in Pb) above tracking threshold (which is now about 57.88 keV), but they don’t get tracked.
What’s stranger, when i shoot 1000 primary muons (with the exact same parameters) eventually some of the electrons (created by muIoni process in the Pb) get tracked. (tracked_secondaries_created_by_muIoni.txt (14.2 KB), the Shielding_Box is the absorber) And there is no energy difference between the tracked and untracked electrons. (ie. some electrons with higher energies don’t get tracked, while some with lower energies get tracked.)

I got this list of secondaries from UserSteppingAction with this code:

if ( (step->GetTrack()->GetCurrentStepNumber() == 1) && (step->GetTrack()->GetParentID() != 0) ){
const G4Track
G4cout << std::fixed << std::setprecision(3);
G4cout << "Tracked secondary: " << std::setw(12) << partTrack->GetParticleDefinition()->GetParticleName() <<
" Energy before 1st step (MeV): " << step->GetPreStepPoint()->GetKineticEnergy() <<
"\tEnergy after 1st step (MeV): " << step->GetPostStepPoint()->GetKineticEnergy() <<
"\tCreated at: " << step->GetTrack()->GetOriginTouchable()->GetVolume()->GetName() <<
"\tCreated by this: " << step->GetTrack()->GetCreatorProcess()->GetProcessName() << G4endl;

So my question is, why might some electrons get tracked and others not?

Regards, Gábor

Note 1: i haven’t test it with other geant4 installation(s) yet. I will update this, if i do so. (Also i didn’t find any code snippet wich might kill particles “manually”.)

Note 2: earlier i’ve tried to get the (total) energy change of the muons (through the Pb) with step->GetTotalEnergyDeposit() and i’ve got some really strange distribution at low (production) cut values. (It seemed that muons lose less energy than they should have.) I’m not sure if this can be related to the tarcking issue.

Also i listed all the secondaries created: tracked_secondaries.txt (211.2 KB) I just couldn’t add a third link as a new user.

Sorry vor the inconvenience. Actually there was a line, wich killed the secondaries. It was hiding in the sensitive detector’s ProcessHits(…) method. (step->GetTrack()->SetTrackStatus(fKillTrackAndSecondaries); )