60 G4ParticleChange * pc =
new G4ParticleChange();
61 pc->Initialize(aTrack);
62 const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
63 G4ParticleDefinition* aParticleDef = aParticle->GetDefinition();
65 G4double ParentEnergy = aParticle->GetTotalEnergy();
66 G4ThreeVector ParentDirection(aParticle->GetMomentumDirection());
68 G4double energyDeposit = 0.0;
69 G4double finalGlobalTime = aTrack.GetGlobalTime();
71 G4int numberOfSecondaries = 1;
72 pc->SetNumberOfSecondaries(numberOfSecondaries);
73 const G4TouchableHandle thand = aTrack.GetTouchableHandle();
78 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
79 float randomParticle = G4UniformRand();
80 G4ParticleDefinition * newType = aParticleDef;
81 if(randomParticle < 0.333)
82 newType=particleTable->FindParticle(1009213);
83 else if(randomParticle > 0.667)
84 newType=particleTable->FindParticle(-1009213);
86 newType=particleTable->FindParticle(1009113);
88 std::cout <<
"RHADRON: New charge = " << newType->GetPDGCharge() << std::endl;
90 G4DynamicParticle * newP =
new G4DynamicParticle(newType,ParentDirection,ParentEnergy);
91 G4Track* secondary =
new G4Track( newP ,
96 secondary->SetGoodForTrackingFlag();
97 secondary->SetTouchableHandle(thand);
99 pc->AddSecondary(secondary);
102 pc->ProposeTrackStatus( fStopAndKill ) ;
103 pc->ProposeLocalEnergyDeposit(energyDeposit);
104 pc->ProposeGlobalTime( finalGlobalTime );
106 ClearNumberOfInteractionLengthLeft();