62 G4ParticleChange * pc =
new G4ParticleChange();
63 pc->Initialize(aTrack);
64 const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
65 G4ParticleDefinition* aParticleDef = aParticle->GetDefinition();
67 G4double ParentEnergy = aParticle->GetTotalEnergy();
68 G4ThreeVector ParentDirection(aParticle->GetMomentumDirection());
70 G4double energyDeposit = 0.0;
71 G4double finalGlobalTime = aTrack.GetGlobalTime();
73 G4int numberOfSecondaries = 1;
74 pc->SetNumberOfSecondaries(numberOfSecondaries);
75 const G4TouchableHandle thand = aTrack.GetTouchableHandle();
80 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
81 float randomParticle = G4UniformRand();
82 G4ParticleDefinition * newType = aParticleDef;
83 if(randomParticle < 0.333)
84 newType=particleTable->FindParticle(1009213);
85 else if(randomParticle > 0.667)
86 newType=particleTable->FindParticle(-1009213);
88 newType=particleTable->FindParticle(1009113);
90 std::cout <<
"RHADRON: New charge = " << newType->GetPDGCharge() << std::endl;
92 G4DynamicParticle * newP =
new G4DynamicParticle(newType,ParentDirection,ParentEnergy);
93 G4Track* secondary =
new G4Track( newP ,
98 secondary->SetGoodForTrackingFlag();
99 secondary->SetTouchableHandle(thand);
101 pc->AddSecondary(secondary);
104 pc->ProposeTrackStatus( fStopAndKill ) ;
105 pc->ProposeLocalEnergyDeposit(energyDeposit);
106 pc->ProposeGlobalTime( finalGlobalTime );
108 ClearNumberOfInteractionLengthLeft();