Scoring secondary electron produced by bremsstrahlung and annihilation

hi dear experts,
I want to score secondary electrons energy deposited that are produced by bremsstrahlung and annihilation photons.
I am using force interaction biasing like example /GB02.
the problem is that I can not find out which electron have been created by bremsstrahlung and annihilation.
because each electron and positron at any ParentIDs and TrackIDs can produce bremsstrahlung and annihilation.
i can just find bremsstrahlung and annihilation photon by

      if(step->GetTrack()->GetParentID()!=0)
        if(step->GetTrack()->GetCreatorProcess()->GetProcessName()=="eBrem" || step->GetTrack()->GetCreatorProcess()->GetProcessName()=="annihil")

I imagine that if I can score TrackIDs and ParentIDs of secondary electrons produced by bremsstrahlung and annihilation I will be able to score their energy when the photon is totally absorbed or escape from the detector.

how can i find that secondaries?

many thanks

How about use

step->GetParticleDefinition()->GetParticleName();

to obtain the particle of current step (or track, I dont remember the detail), and filter the information you want.

Hi, saluta,
Thank you for your reply
I tried to get secondary particles created in the current step of these photons, they had not correct trackId yet. I think they obtain trackid when they are being processed just after stopping their parent photon.

Maybe I should score their ParticleDefinition objects in an array when they are produced, then when they are processed, I find them by iteration in the ParticleDefinition array.

Geant4: G4Step Class Reference (kek.jp)
Here we see there is an interface of G4Step class:

const std::vector< const G4Track * > * 	GetSecondaryInCurrentStep () const;

I have no experience on this interface but I guess it will be helpful.