2 #include "G4ParticleTable.hh" 3 #include "Randomize.hh" 11 G4HadronicProcess(processName)
13 AddDataSet(
new G4HadronElasticDataSet);
24 if (!G4HadronicProcess::GetCrossSectionDataStore()) {
27 G4HadronicProcess::GetCrossSectionDataStore()->BuildPhysicsTable(aParticleType);
33 const G4DynamicParticle* ,
const G4Element* element, G4double )
36 return 30*millibarn*element->GetN();
44 if(aParticleType.GetParticleType() ==
"rhadron")
60 const G4Track &aTrack,
const G4Step &)
62 G4ParticleChange * pc =
new G4ParticleChange();
63 pc->Initialize(aTrack);
64 const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
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;
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 G4cout <<
"RHADRON: New charge = " << newType->GetPDGCharge() << G4endl;
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();
void DumpPhysicsTable(const G4ParticleDefinition &aParticleType)
G4double GetMicroscopicCrossSection(const G4DynamicParticle *aParticle, const G4Element *anElement, G4double aTemp)
DummyChargeFlipProcess(const G4String &processName="Dummy")
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType)
~DummyChargeFlipProcess()
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)