Creation or replacing the secondary particles

Hello everyone.
Is there a simple way to replace or add secondary particle? I would like to create e.g. geantino as secondary particle to check my geometry.
I tried this:
G4TrackVector* Secondaries = fpSteppingManager->GetfSecondary();
for (G4TrackVector::iterator it = Secondaries->begin();it!=Secondaries->end(); ++it)
{
G4VParticleChange *c = fpSteppingManager->GetfParticleChange();
G4DynamicParticle *dp=new G4DynamicParticle((it)->GetDefinition(),G4ThreeVector(1,0,0),1eV);
G4Track *t=new G4Track(dp,(*it)->GetGlobalTime(),(*it)->GetPosition());
c->AddSecondary(t);
}
but I cannot detect any geantinos when checking particles which travel through the border of volume where reaction take place.

1 Like