2 #include "G4ParticleTable.hh"
3 #include "Randomize.hh"
10 AddDataSet(
new G4HadronElasticDataSet);
16 if (!G4HadronicProcess::GetCrossSectionDataStore()) {
19 G4HadronicProcess::GetCrossSectionDataStore()->BuildPhysicsTable(aParticleType);
23 const G4Element* element,
25 return 30 * millibarn * element->GetN();
29 if (aParticleType.GetParticleType() ==
"rhadron")
38 G4ParticleChange* pc =
new G4ParticleChange();
39 pc->Initialize(aTrack);
40 const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
43 G4double ParentEnergy = aParticle->GetTotalEnergy();
44 const G4ThreeVector& ParentDirection(aParticle->GetMomentumDirection());
46 G4double energyDeposit = 0.0;
47 G4double finalGlobalTime = aTrack.GetGlobalTime();
49 G4int numberOfSecondaries = 1;
50 pc->SetNumberOfSecondaries(numberOfSecondaries);
51 const G4TouchableHandle& thand = aTrack.GetTouchableHandle();
56 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
57 float randomParticle = G4UniformRand();
58 G4ParticleDefinition* newType;
59 if (randomParticle < 0.333)
60 newType = particleTable->FindParticle(1009213);
61 else if (randomParticle > 0.667)
62 newType = particleTable->FindParticle(-1009213);
64 newType = particleTable->FindParticle(1009113);
66 G4cout <<
"RHADRON: New charge = " << newType->GetPDGCharge() << G4endl;
68 G4DynamicParticle* newP =
new G4DynamicParticle(newType, ParentDirection, ParentEnergy);
69 G4Track* secondary =
new G4Track(newP, finalGlobalTime, aTrack.GetPosition());
71 secondary->SetGoodForTrackingFlag();
72 secondary->SetTouchableHandle(thand);
74 pc->AddSecondary(secondary);
77 pc->ProposeTrackStatus(fStopAndKill);
78 pc->ProposeLocalEnergyDeposit(energyDeposit);
79 pc->ProposeGlobalTime(finalGlobalTime);
81 ClearNumberOfInteractionLengthLeft();