#include <G4hImpactIonisation.hh>
Inheritance diagram for G4hImpactIonisation:
Definition at line 75 of file G4hImpactIonisation.hh.
G4hImpactIonisation::G4hImpactIonisation | ( | const G4String & | processName = "hImpactIoni" |
) |
Definition at line 83 of file G4hImpactIonisation.cc.
00084 : G4hRDEnergyLoss(processName), 00085 betheBlochModel(0), 00086 protonModel(0), 00087 antiprotonModel(0), 00088 theIonEffChargeModel(0), 00089 theNuclearStoppingModel(0), 00090 theIonChuFluctuationModel(0), 00091 theIonYangFluctuationModel(0), 00092 protonTable("ICRU_R49p"), 00093 antiprotonTable("ICRU_R49p"), 00094 theNuclearTable("ICRU_R49"), 00095 nStopping(true), 00096 theBarkas(true), 00097 theMeanFreePathTable(0), 00098 paramStepLimit (0.005), 00099 pixeCrossSectionHandler(0) 00100 { 00101 InitializeMe(); 00102 }
G4hImpactIonisation::~G4hImpactIonisation | ( | ) |
Definition at line 132 of file G4hImpactIonisation.cc.
References G4PhysicsTable::clearAndDestroy().
00133 { 00134 if (theMeanFreePathTable) 00135 { 00136 theMeanFreePathTable->clearAndDestroy(); 00137 delete theMeanFreePathTable; 00138 } 00139 00140 if (betheBlochModel) delete betheBlochModel; 00141 if (protonModel) delete protonModel; 00142 if (antiprotonModel) delete antiprotonModel; 00143 if (theNuclearStoppingModel) delete theNuclearStoppingModel; 00144 if (theIonEffChargeModel) delete theIonEffChargeModel; 00145 if (theIonChuFluctuationModel) delete theIonChuFluctuationModel; 00146 if (theIonYangFluctuationModel) delete theIonYangFluctuationModel; 00147 00148 delete pixeCrossSectionHandler; 00149 00150 // ---- MGP ---- The following is to be checked 00151 // if (shellVacancy) delete shellVacancy; 00152 00153 cutForDelta.clear(); 00154 }
void G4hImpactIonisation::ActivateAugerElectronProduction | ( | G4bool | val | ) |
Definition at line 1707 of file G4hImpactIonisation.cc.
References G4AtomicDeexcitation::ActivateAugerElectronProduction().
01708 { 01709 atomicDeexcitation.ActivateAugerElectronProduction(val); 01710 }
G4VParticleChange * G4hImpactIonisation::AlongStepDoIt | ( | const G4Track & | trackData, | |
const G4Step & | stepData | |||
) | [virtual] |
Reimplemented from G4VContinuousDiscreteProcess.
Definition at line 718 of file G4hImpactIonisation.cc.
References G4AntiProton::AntiProton(), G4VProcess::aParticleChange, G4hRDEnergyLoss::EnlossFlucFlag, fStopAndKill, fStopButAlive, G4ProcessManager::GetAtRestProcessVector(), G4DynamicParticle::GetDefinition(), G4Track::GetDynamicParticle(), G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetMass(), G4MaterialCutsCouple::GetMaterial(), G4Track::GetMaterialCutsCouple(), G4EnergyLossTables::GetPreciseEnergyFromRange(), G4ParticleDefinition::GetProcessManager(), G4Step::GetStepLength(), G4hRDEnergyLoss::HighestKineticEnergy, G4ParticleChange::Initialize(), G4hRDEnergyLoss::linLossLimit, G4hRDEnergyLoss::MinKineticEnergy, G4ParticleChange::ProposeEnergy(), G4VParticleChange::ProposeLocalEnergyDeposit(), G4VParticleChange::ProposeTrackStatus(), G4Proton::Proton(), G4InuclParticleNames::proton, G4ProcessVector::size(), and G4VLowEnergyModel::TheValue().
00720 { 00721 // compute the energy loss after a step 00722 G4Proton* proton = G4Proton::Proton(); 00723 G4AntiProton* antiproton = G4AntiProton::AntiProton(); 00724 G4double finalT = 0.; 00725 00726 aParticleChange.Initialize(track) ; 00727 00728 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple(); 00729 const G4Material* material = couple->GetMaterial(); 00730 00731 // get the actual (true) Step length from step 00732 const G4double stepLength = step.GetStepLength() ; 00733 00734 const G4DynamicParticle* particle = track.GetDynamicParticle() ; 00735 00736 G4double kineticEnergy = particle->GetKineticEnergy() ; 00737 G4double massRatio = proton_mass_c2/(particle->GetMass()) ; 00738 G4double tScaled = kineticEnergy * massRatio ; 00739 G4double eLoss = 0.0 ; 00740 G4double nLoss = 0.0 ; 00741 00742 00743 // very small particle energy 00744 if (kineticEnergy < MinKineticEnergy) 00745 { 00746 eLoss = kineticEnergy ; 00747 // particle energy outside tabulated energy range 00748 } 00749 00750 else if( kineticEnergy > HighestKineticEnergy) 00751 { 00752 eLoss = stepLength * fdEdx ; 00753 // big step 00754 } 00755 else if (stepLength >= fRangeNow ) 00756 { 00757 eLoss = kineticEnergy ; 00758 00759 // tabulated range 00760 } 00761 else 00762 { 00763 // step longer than linear step limit 00764 if(stepLength > linLossLimit * fRangeNow) 00765 { 00766 G4double rScaled = fRangeNow * massRatio * chargeSquare ; 00767 G4double sScaled = stepLength * massRatio * chargeSquare ; 00768 00769 if(charge > 0.0) 00770 { 00771 eLoss = G4EnergyLossTables::GetPreciseEnergyFromRange(proton,rScaled, couple) - 00772 G4EnergyLossTables::GetPreciseEnergyFromRange(proton,rScaled-sScaled,couple) ; 00773 00774 } 00775 else 00776 { 00777 // Antiproton 00778 eLoss = G4EnergyLossTables::GetPreciseEnergyFromRange(antiproton,rScaled,couple) - 00779 G4EnergyLossTables::GetPreciseEnergyFromRange(antiproton,rScaled-sScaled,couple) ; 00780 } 00781 eLoss /= massRatio ; 00782 00783 // Barkas correction at big step 00784 eLoss += fBarkas * stepLength; 00785 00786 // step shorter than linear step limit 00787 } 00788 else 00789 { 00790 eLoss = stepLength *fdEdx ; 00791 } 00792 if (nStopping && tScaled < protonHighEnergy) 00793 { 00794 nLoss = (theNuclearStoppingModel->TheValue(particle, material)) * stepLength; 00795 } 00796 } 00797 00798 if (eLoss < 0.0) eLoss = 0.0; 00799 00800 finalT = kineticEnergy - eLoss - nLoss; 00801 00802 if ( EnlossFlucFlag && 0.0 < eLoss && finalT > MinKineticEnergy) 00803 { 00804 00805 // now the electron loss with fluctuation 00806 eLoss = ElectronicLossFluctuation(particle, couple, eLoss, stepLength) ; 00807 if (eLoss < 0.0) eLoss = 0.0; 00808 finalT = kineticEnergy - eLoss - nLoss; 00809 } 00810 00811 // stop particle if the kinetic energy <= MinKineticEnergy 00812 if (finalT*massRatio <= MinKineticEnergy ) 00813 { 00814 00815 finalT = 0.0; 00816 if (!particle->GetDefinition()->GetProcessManager()->GetAtRestProcessVector()->size()) 00817 aParticleChange.ProposeTrackStatus(fStopAndKill); 00818 else 00819 aParticleChange.ProposeTrackStatus(fStopButAlive); 00820 } 00821 00822 aParticleChange.ProposeEnergy( finalT ); 00823 eLoss = kineticEnergy-finalT; 00824 00825 aParticleChange.ProposeLocalEnergyDeposit(eLoss); 00826 return &aParticleChange ; 00827 }
void G4hImpactIonisation::BuildPhysicsTable | ( | const G4ParticleDefinition & | aParticleType | ) | [virtual] |
Reimplemented from G4VProcess.
Definition at line 191 of file G4hImpactIonisation.cc.
References G4AntiProton::AntiProton(), G4hRDEnergyLoss::BuildDEDXTable(), G4hRDEnergyLoss::CounterOfpbarProcess, G4hRDEnergyLoss::CounterOfpProcess, G4hRDEnergyLoss::CutsWhereModified(), G4cout, G4endl, G4ProductionCutsTable::GetEnergyCutsVector(), G4Material::GetIonisation(), G4MaterialCutsCouple::GetMaterial(), G4ProductionCutsTable::GetMaterialCutsCouple(), G4IonisParamMat::GetMeanExcitationEnergy(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetParticleSubType(), G4ParticleDefinition::GetParticleType(), G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGMass(), G4ProcessManager::GetProcessList(), G4ParticleDefinition::GetProcessManager(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), G4hRDEnergyLoss::HighestKineticEnergy, G4hRDEnergyLoss::LowestKineticEnergy, PrintInfoDefinition(), G4Proton::Proton(), G4InuclParticleNames::proton, G4hRDEnergyLoss::RecorderOfpbarProcess, G4hRDEnergyLoss::RecorderOfpProcess, G4EnergyLossTables::Register(), G4hRDEnergyLoss::theDEDXpTable, G4hRDEnergyLoss::theInverseRangepTable, G4hRDEnergyLoss::theLabTimepTable, G4hRDEnergyLoss::theLossTable, G4hRDEnergyLoss::theProperTimepTable, G4hRDEnergyLoss::theRangepTable, G4hRDEnergyLoss::TotBin, and G4VProcess::verboseLevel.
00194 { 00195 00196 // Verbose print-out 00197 if(verboseLevel > 0) 00198 { 00199 G4cout << "G4hImpactIonisation::BuildPhysicsTable for " 00200 << particleDef.GetParticleName() 00201 << " mass(MeV)= " << particleDef.GetPDGMass()/MeV 00202 << " charge= " << particleDef.GetPDGCharge()/eplus 00203 << " type= " << particleDef.GetParticleType() 00204 << G4endl; 00205 00206 if(verboseLevel > 1) 00207 { 00208 G4ProcessVector* pv = particleDef.GetProcessManager()->GetProcessList(); 00209 00210 G4cout << " 0: " << (*pv)[0]->GetProcessName() << " " << (*pv)[0] 00211 << " 1: " << (*pv)[1]->GetProcessName() << " " << (*pv)[1] 00212 // << " 2: " << (*pv)[2]->GetProcessName() << " " << (*pv)[2] 00213 << G4endl; 00214 G4cout << "ionModel= " << theIonEffChargeModel 00215 << " MFPtable= " << theMeanFreePathTable 00216 << " iniMass= " << initialMass 00217 << G4endl; 00218 } 00219 } 00220 // End of verbose print-out 00221 00222 if (particleDef.GetParticleType() == "nucleus" && 00223 particleDef.GetParticleName() != "GenericIon" && 00224 particleDef.GetParticleSubType() == "generic") 00225 { 00226 00227 G4EnergyLossTables::Register(&particleDef, 00228 theDEDXpTable, 00229 theRangepTable, 00230 theInverseRangepTable, 00231 theLabTimepTable, 00232 theProperTimepTable, 00233 LowestKineticEnergy, HighestKineticEnergy, 00234 proton_mass_c2/particleDef.GetPDGMass(), 00235 TotBin); 00236 00237 return; 00238 } 00239 00240 if( !CutsWhereModified() && theLossTable) return; 00241 00242 InitializeParametrisation() ; 00243 G4Proton* proton = G4Proton::Proton(); 00244 G4AntiProton* antiproton = G4AntiProton::AntiProton(); 00245 00246 charge = particleDef.GetPDGCharge() / eplus; 00247 chargeSquare = charge*charge ; 00248 00249 const G4ProductionCutsTable* theCoupleTable= 00250 G4ProductionCutsTable::GetProductionCutsTable(); 00251 size_t numOfCouples = theCoupleTable->GetTableSize(); 00252 00253 cutForDelta.clear(); 00254 cutForGamma.clear(); 00255 00256 for (size_t j=0; j<numOfCouples; j++) { 00257 00258 // get material parameters needed for the energy loss calculation 00259 const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(j); 00260 const G4Material* material= couple->GetMaterial(); 00261 00262 // the cut cannot be below lowest limit 00263 G4double tCut = (*(theCoupleTable->GetEnergyCutsVector(1)))[j]; 00264 if(tCut > HighestKineticEnergy) tCut = HighestKineticEnergy; 00265 00266 G4double excEnergy = material->GetIonisation()->GetMeanExcitationEnergy(); 00267 00268 tCut = std::max(tCut,excEnergy); 00269 cutForDelta.push_back(tCut); 00270 00271 // the cut cannot be below lowest limit 00272 tCut = (*(theCoupleTable->GetEnergyCutsVector(0)))[j]; 00273 if(tCut > HighestKineticEnergy) tCut = HighestKineticEnergy; 00274 tCut = std::max(tCut,minGammaEnergy); 00275 cutForGamma.push_back(tCut); 00276 } 00277 00278 if(verboseLevel > 0) { 00279 G4cout << "Cuts are defined " << G4endl; 00280 } 00281 00282 if(0.0 < charge) 00283 { 00284 { 00285 BuildLossTable(*proton) ; 00286 00287 // The following vector has a fixed dimension (see src/G4hImpactLoss.cc for more details) 00288 // It happended in the past that caused memory corruption errors. The problem is still pending, even if temporary solved 00289 // G4cout << "[NOTE]: __LINE__=" << __LINE__ << ", particleDef=" << particleDef.GetParticleName() << ", proton=" << proton << ", theLossTable=" << theLossTable << ", CounterOfpProcess=" << CounterOfpProcess << G4endl; 00290 00291 RecorderOfpProcess[CounterOfpProcess] = theLossTable ; 00292 CounterOfpProcess++; 00293 } 00294 } else { 00295 { 00296 BuildLossTable(*antiproton) ; 00297 00298 // The following vector has a fixed dimension (see src/G4hImpactLoss.cc for more details) 00299 // It happended in the past that caused memory corruption errors. The problem is still pending, even if temporary solved 00300 // G4cout << "[NOTE]: __LINE__=" << __LINE__ << ", particleDef=" << particleDef.GetParticleName() << ", antiproton=" << antiproton << ", theLossTable=" << theLossTable << ", CounterOfpbarProcess=" << CounterOfpbarProcess << G4endl; 00301 00302 RecorderOfpbarProcess[CounterOfpbarProcess] = theLossTable ; 00303 CounterOfpbarProcess++; 00304 } 00305 } 00306 00307 if(verboseLevel > 0) { 00308 G4cout << "G4hImpactIonisation::BuildPhysicsTable: " 00309 << "Loss table is built " 00310 // << theLossTable 00311 << G4endl; 00312 } 00313 00314 BuildLambdaTable(particleDef) ; 00315 // BuildDataForFluorescence(particleDef); 00316 00317 if(verboseLevel > 1) { 00318 G4cout << (*theMeanFreePathTable) << G4endl; 00319 } 00320 00321 if(verboseLevel > 0) { 00322 G4cout << "G4hImpactIonisation::BuildPhysicsTable: " 00323 << "DEDX table will be built " 00324 // << theDEDXpTable << " " << theDEDXpbarTable 00325 // << " " << theRangepTable << " " << theRangepbarTable 00326 << G4endl; 00327 } 00328 00329 BuildDEDXTable(particleDef) ; 00330 00331 if(verboseLevel > 1) { 00332 G4cout << (*theDEDXpTable) << G4endl; 00333 } 00334 00335 if((&particleDef == proton) || (&particleDef == antiproton)) PrintInfoDefinition() ; 00336 00337 if(verboseLevel > 0) { 00338 G4cout << "G4hImpactIonisation::BuildPhysicsTable: end for " 00339 << particleDef.GetParticleName() << G4endl; 00340 } 00341 }
G4double G4hImpactIonisation::ComputeDEDX | ( | const G4ParticleDefinition * | aParticle, | |
const G4MaterialCutsCouple * | couple, | |||
G4double | kineticEnergy | |||
) |
Definition at line 1266 of file G4hImpactIonisation.cc.
References G4AntiProton::AntiProton(), G4EnergyLossTables::GetDEDX(), G4MaterialCutsCouple::GetMaterial(), G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGMass(), G4Proton::Proton(), G4InuclParticleNames::proton, and G4VLowEnergyModel::TheValue().
01269 { 01270 const G4Material* material = couple->GetMaterial(); 01271 G4Proton* proton = G4Proton::Proton(); 01272 G4AntiProton* antiproton = G4AntiProton::AntiProton(); 01273 G4double dedx = 0.; 01274 01275 G4double tScaled = kineticEnergy * proton_mass_c2 / (aParticle->GetPDGMass()) ; 01276 charge = aParticle->GetPDGCharge() ; 01277 01278 if( charge > 0.) 01279 { 01280 if (tScaled > protonHighEnergy) 01281 { 01282 dedx = G4EnergyLossTables::GetDEDX(proton,tScaled,couple) ; 01283 } 01284 else 01285 { 01286 dedx = ProtonParametrisedDEDX(couple,tScaled) ; 01287 } 01288 } 01289 else 01290 { 01291 if (tScaled > antiprotonHighEnergy) 01292 { 01293 dedx = G4EnergyLossTables::GetDEDX(antiproton,tScaled,couple); 01294 } 01295 else 01296 { 01297 dedx = AntiProtonParametrisedDEDX(couple,tScaled) ; 01298 } 01299 } 01300 dedx *= theIonEffChargeModel->TheValue(aParticle, material, kineticEnergy) ; 01301 01302 return dedx ; 01303 }
G4double G4hImpactIonisation::GetContinuousStepLimit | ( | const G4Track & | track, | |
G4double | previousStepSize, | |||
G4double | currentMinimumStep, | |||
G4double & | currentSafety | |||
) | [inline, virtual] |
Implements G4VContinuousDiscreteProcess.
Definition at line 294 of file G4hImpactIonisation.hh.
References G4Track::GetDynamicParticle(), and G4Track::GetMaterialCutsCouple().
00298 { 00299 G4double step = GetConstraints(track.GetDynamicParticle(),track.GetMaterialCutsCouple()) ; 00300 00301 // ---- MGP ---- The following line, taken as is from G4hLowEnergyIonisation, 00302 // is meaningless: currentMinimumStep is passed by value, 00303 // therefore any local modification to it has no effect 00304 00305 if ((step > 0.) && (step < currentMinimumStep)) currentMinimumStep = step ; 00306 00307 return step ; 00308 }
G4double G4hImpactIonisation::GetMeanFreePath | ( | const G4Track & | track, | |
G4double | previousStepSize, | |||
enum G4ForceCondition * | condition | |||
) | [virtual] |
Implements G4hRDEnergyLoss.
Definition at line 589 of file G4hImpactIonisation.cc.
References DBL_MAX, G4DynamicParticle::GetCharge(), G4Track::GetDynamicParticle(), G4MaterialCutsCouple::GetIndex(), G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetMass(), G4MaterialCutsCouple::GetMaterial(), G4Track::GetMaterialCutsCouple(), G4hRDEnergyLoss::HighestKineticEnergy, NotForced, and G4VLowEnergyModel::TheValue().
00592 { 00593 const G4DynamicParticle* dynamicParticle = track.GetDynamicParticle(); 00594 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple(); 00595 const G4Material* material = couple->GetMaterial(); 00596 00597 G4double meanFreePath = DBL_MAX; 00598 // ---- MGP ---- What is the meaning of the local variable isOutOfRange? 00599 G4bool isOutRange = false; 00600 00601 *condition = NotForced ; 00602 00603 G4double kineticEnergy = (dynamicParticle->GetKineticEnergy())*initialMass/(dynamicParticle->GetMass()); 00604 charge = dynamicParticle->GetCharge()/eplus; 00605 chargeSquare = theIonEffChargeModel->TheValue(dynamicParticle, material); 00606 00607 if (kineticEnergy < LowestKineticEnergy) 00608 { 00609 meanFreePath = DBL_MAX; 00610 } 00611 else 00612 { 00613 if (kineticEnergy > HighestKineticEnergy) kineticEnergy = HighestKineticEnergy; 00614 meanFreePath = (((*theMeanFreePathTable)(couple->GetIndex()))-> 00615 GetValue(kineticEnergy,isOutRange))/chargeSquare; 00616 } 00617 00618 return meanFreePath ; 00619 }
G4bool G4hImpactIonisation::IsApplicable | ( | const G4ParticleDefinition & | ) | [inline, virtual] |
Reimplemented from G4VProcess.
Definition at line 311 of file G4hImpactIonisation.hh.
References G4ParticleDefinition::GetPDGCharge(), and G4ParticleDefinition::GetPDGMass().
00312 { 00313 // ---- MGP ---- Better criterion for applicability to be defined; 00314 // now hard-coded particle mass > 0.1 * proton_mass 00315 00316 return (particle.GetPDGCharge() != 0.0 && particle.GetPDGMass() > CLHEP::proton_mass_c2*0.1); 00317 }
G4VParticleChange * G4hImpactIonisation::PostStepDoIt | ( | const G4Track & | track, | |
const G4Step & | Step | |||
) | [virtual] |
Implements G4hRDEnergyLoss.
Definition at line 952 of file G4hImpactIonisation.cc.
References G4ParticleChange::AddSecondary(), G4VProcess::aParticleChange, G4AtomicShell::BindingEnergy(), G4InuclSpecialFunctions::bindingEnergy(), G4Electron::Electron(), fStopAndKill, fStopButAlive, G4UniformRand, G4Gamma::Gamma(), G4AtomicDeexcitation::GenerateParticles(), G4DynamicParticle::GetDefinition(), G4Track::GetDefinition(), G4Track::GetDynamicParticle(), G4MaterialCutsCouple::GetIndex(), G4DynamicParticle::GetKineticEnergy(), G4MaterialCutsCouple::GetMaterial(), G4Track::GetMaterialCutsCouple(), G4DynamicParticle::GetMomentumDirection(), G4ParticleDefinition::GetPDGMass(), G4ParticleDefinition::GetPDGSpin(), G4ParticleDefinition::GetProcessManager(), G4ParticleChange::Initialize(), G4AtomicTransitionManager::Instance(), G4PixeCrossSectionHandler::LoadShellData(), G4hRDEnergyLoss::MinKineticEnergy, G4VContinuousDiscreteProcess::PostStepDoIt(), G4ParticleChange::ProposeEnergy(), G4VParticleChange::ProposeLocalEnergyDeposit(), G4ParticleChange::ProposeMomentumDirection(), G4VParticleChange::ProposeTrackStatus(), G4Proton::ProtonDefinition(), G4PixeCrossSectionHandler::SelectRandomAtom(), G4PixeCrossSectionHandler::SelectRandomShell(), G4DynamicParticle::SetDefinition(), G4DynamicParticle::SetKineticEnergy(), G4DynamicParticle::SetMomentumDirection(), G4VParticleChange::SetNumberOfSecondaries(), G4AtomicTransitionManager::Shell(), and G4AtomicShell::ShellId().
00954 { 00955 // Units are expressed in GEANT4 internal units. 00956 00957 // std::cout << "----- Calling PostStepDoIt ----- " << std::endl; 00958 00959 aParticleChange.Initialize(track) ; 00960 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple(); 00961 const G4DynamicParticle* aParticle = track.GetDynamicParticle() ; 00962 00963 // Some kinematics 00964 00965 G4ParticleDefinition* definition = track.GetDefinition(); 00966 G4double mass = definition->GetPDGMass(); 00967 G4double kineticEnergy = aParticle->GetKineticEnergy(); 00968 G4double totalEnergy = kineticEnergy + mass ; 00969 G4double pSquare = kineticEnergy *( totalEnergy + mass) ; 00970 G4double eSquare = totalEnergy * totalEnergy; 00971 G4double betaSquare = pSquare / eSquare; 00972 G4ThreeVector particleDirection = aParticle->GetMomentumDirection() ; 00973 00974 G4double gamma = kineticEnergy / mass + 1.; 00975 G4double r = electron_mass_c2 / mass; 00976 G4double tMax = 2. * electron_mass_c2 *(gamma*gamma - 1.) / (1. + 2.*gamma*r + r*r); 00977 00978 // Validity range for delta electron cross section 00979 G4double deltaCut = cutForDelta[couple->GetIndex()]; 00980 00981 // This should not be a case 00982 if (deltaCut >= tMax) 00983 return G4VContinuousDiscreteProcess::PostStepDoIt(track,step); 00984 00985 G4double xc = deltaCut / tMax; 00986 G4double rate = tMax / totalEnergy; 00987 rate = rate*rate ; 00988 G4double spin = aParticle->GetDefinition()->GetPDGSpin() ; 00989 00990 // Sampling follows ... 00991 G4double x = 0.; 00992 G4double gRej = 0.; 00993 00994 do { 00995 x = xc / (1. - (1. - xc) * G4UniformRand()); 00996 00997 if (0.0 == spin) 00998 { 00999 gRej = 1.0 - betaSquare * x ; 01000 } 01001 else if (0.5 == spin) 01002 { 01003 gRej = (1. - betaSquare * x + 0.5 * x*x * rate) / (1. + 0.5 * rate) ; 01004 } 01005 else 01006 { 01007 gRej = (1. - betaSquare * x ) * (1. + x/(3.*xc)) + 01008 x*x * rate * (1. + 0.5*x/xc) / 3.0 / 01009 (1. + 1./(3.*xc) + rate *(1.+ 0.5/xc) / 3.); 01010 } 01011 01012 } while( G4UniformRand() > gRej ); 01013 01014 G4double deltaKineticEnergy = x * tMax; 01015 G4double deltaTotalMomentum = std::sqrt(deltaKineticEnergy * 01016 (deltaKineticEnergy + 2. * electron_mass_c2 )); 01017 G4double totalMomentum = std::sqrt(pSquare) ; 01018 G4double cosTheta = deltaKineticEnergy * (totalEnergy + electron_mass_c2) / (deltaTotalMomentum*totalMomentum); 01019 01020 // protection against cosTheta > 1 or < -1 01021 if ( cosTheta < -1. ) cosTheta = -1.; 01022 if ( cosTheta > 1. ) cosTheta = 1.; 01023 01024 // direction of the delta electron 01025 G4double phi = twopi * G4UniformRand(); 01026 G4double sinTheta = std::sqrt(1. - cosTheta*cosTheta); 01027 G4double dirX = sinTheta * std::cos(phi); 01028 G4double dirY = sinTheta * std::sin(phi); 01029 G4double dirZ = cosTheta; 01030 01031 G4ThreeVector deltaDirection(dirX,dirY,dirZ); 01032 deltaDirection.rotateUz(particleDirection); 01033 01034 // create G4DynamicParticle object for delta ray 01035 G4DynamicParticle* deltaRay = new G4DynamicParticle; 01036 deltaRay->SetKineticEnergy( deltaKineticEnergy ); 01037 deltaRay->SetMomentumDirection(deltaDirection.x(), 01038 deltaDirection.y(), 01039 deltaDirection.z()); 01040 deltaRay->SetDefinition(G4Electron::Electron()); 01041 01042 // fill aParticleChange 01043 G4double finalKineticEnergy = kineticEnergy - deltaKineticEnergy; 01044 size_t totalNumber = 1; 01045 01046 // Atomic relaxation 01047 01048 // ---- MGP ---- Temporary limitation: currently PIXE only for incident protons 01049 01050 size_t nSecondaries = 0; 01051 std::vector<G4DynamicParticle*>* secondaryVector = 0; 01052 01053 if (definition == G4Proton::ProtonDefinition()) 01054 { 01055 const G4Material* material = couple->GetMaterial(); 01056 01057 // Lazy initialization of pixeCrossSectionHandler 01058 if (pixeCrossSectionHandler == 0) 01059 { 01060 // Instantiate pixeCrossSectionHandler with selected shell cross section models 01061 // Ownership of interpolation is transferred to pixeCrossSectionHandler 01062 G4IInterpolator* interpolation = new G4LogLogInterpolator(); 01063 pixeCrossSectionHandler = 01064 new G4PixeCrossSectionHandler(interpolation,modelK,modelL,modelM,eMinPixe,eMaxPixe); 01065 G4String fileName("proton"); 01066 pixeCrossSectionHandler->LoadShellData(fileName); 01067 // pixeCrossSectionHandler->PrintData(); 01068 } 01069 01070 // Select an atom in the current material based on the total shell cross sections 01071 G4int Z = pixeCrossSectionHandler->SelectRandomAtom(material,kineticEnergy); 01072 // std::cout << "G4hImpactIonisation::PostStepDoIt - Z = " << Z << std::endl; 01073 01074 // G4double microscopicCross = MicroscopicCrossSection(*definition, 01075 // kineticEnergy, 01076 // Z, deltaCut); 01077 // G4double crossFromShells = pixeCrossSectionHandler->FindValue(Z,kineticEnergy); 01078 01079 //std::cout << "G4hImpactIonisation: Z= " 01080 // << Z 01081 // << ", energy = " 01082 // << kineticEnergy/MeV 01083 // <<" MeV, microscopic = " 01084 // << microscopicCross/barn 01085 // << " barn, from shells = " 01086 // << crossFromShells/barn 01087 // << " barn" 01088 // << std::endl; 01089 01090 // Select a shell in the target atom based on the individual shell cross sections 01091 G4int shellIndex = pixeCrossSectionHandler->SelectRandomShell(Z,kineticEnergy); 01092 01093 G4AtomicTransitionManager* transitionManager = G4AtomicTransitionManager::Instance(); 01094 const G4AtomicShell* atomicShell = transitionManager->Shell(Z,shellIndex); 01095 G4double bindingEnergy = atomicShell->BindingEnergy(); 01096 01097 // if (verboseLevel > 1) 01098 // { 01099 // G4cout << "G4hImpactIonisation::PostStepDoIt - Z = " 01100 // << Z 01101 // << ", shell = " 01102 // << shellIndex 01103 // << ", bindingE (keV) = " 01104 // << bindingEnergy/keV 01105 // << G4endl; 01106 // } 01107 01108 // Generate PIXE if binding energy larger than cut for photons or electrons 01109 01110 G4ParticleDefinition* type = 0; 01111 01112 if (finalKineticEnergy >= bindingEnergy) 01113 // && (bindingEnergy >= minGammaEnergy || bindingEnergy >= minElectronEnergy) ) 01114 { 01115 // Vacancy in subshell shellIndex; shellId is the subshell identifier in EADL jargon 01116 G4int shellId = atomicShell->ShellId(); 01117 // Atomic relaxation: generate secondaries 01118 secondaryVector = atomicDeexcitation.GenerateParticles(Z, shellId); 01119 01120 // ---- Debug ---- 01121 //std::cout << "ShellId = " 01122 // <<shellId << " ---- Atomic relaxation secondaries: ---- " 01123 // << secondaryVector->size() 01124 // << std::endl; 01125 01126 // ---- End debug --- 01127 01128 if (secondaryVector != 0) 01129 { 01130 nSecondaries = secondaryVector->size(); 01131 for (size_t i = 0; i<nSecondaries; i++) 01132 { 01133 G4DynamicParticle* aSecondary = (*secondaryVector)[i]; 01134 if (aSecondary) 01135 { 01136 G4double e = aSecondary->GetKineticEnergy(); 01137 type = aSecondary->GetDefinition(); 01138 01139 // ---- Debug ---- 01140 //if (type == G4Gamma::GammaDefinition()) 01141 // { 01142 // std::cout << "Z = " << Z 01143 // << ", shell: " << shellId 01144 // << ", PIXE photon energy (keV) = " << e/keV 01145 // << std::endl; 01146 // } 01147 // ---- End debug --- 01148 01149 if (e < finalKineticEnergy && 01150 ((type == G4Gamma::Gamma() && e > minGammaEnergy ) || 01151 (type == G4Electron::Electron() && e > minElectronEnergy ))) 01152 { 01153 // Subtract the energy of the emitted secondary from the primary 01154 finalKineticEnergy -= e; 01155 totalNumber++; 01156 // ---- Debug ---- 01157 //if (type == G4Gamma::GammaDefinition()) 01158 // { 01159 // std::cout << "Z = " << Z 01160 // << ", shell: " << shellId 01161 // << ", PIXE photon energy (keV) = " << e/keV 01162 // << std::endl; 01163 // } 01164 // ---- End debug --- 01165 } 01166 else 01167 { 01168 // The atomic relaxation product has energy below the cut 01169 // ---- Debug ---- 01170 // if (type == G4Gamma::GammaDefinition()) 01171 // { 01172 // std::cout << "Z = " << Z 01173 // 01174 // << ", PIXE photon energy = " << e/keV 01175 // << " keV below threshold " << minGammaEnergy/keV << " keV" 01176 // << std::endl; 01177 // } 01178 // ---- End debug --- 01179 01180 delete aSecondary; 01181 (*secondaryVector)[i] = 0; 01182 } 01183 } 01184 } 01185 } 01186 } 01187 } 01188 01189 01190 // Save delta-electrons 01191 01192 G4double eDeposit = 0.; 01193 01194 if (finalKineticEnergy > MinKineticEnergy) 01195 { 01196 G4double finalPx = totalMomentum*particleDirection.x() - deltaTotalMomentum*deltaDirection.x(); 01197 G4double finalPy = totalMomentum*particleDirection.y() - deltaTotalMomentum*deltaDirection.y(); 01198 G4double finalPz = totalMomentum*particleDirection.z() - deltaTotalMomentum*deltaDirection.z(); 01199 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz) ; 01200 finalPx /= finalMomentum; 01201 finalPy /= finalMomentum; 01202 finalPz /= finalMomentum; 01203 01204 aParticleChange.ProposeMomentumDirection( finalPx,finalPy,finalPz ); 01205 } 01206 else 01207 { 01208 eDeposit = finalKineticEnergy; 01209 finalKineticEnergy = 0.; 01210 aParticleChange.ProposeMomentumDirection(particleDirection.x(), 01211 particleDirection.y(), 01212 particleDirection.z()); 01213 if(!aParticle->GetDefinition()->GetProcessManager()-> 01214 GetAtRestProcessVector()->size()) 01215 aParticleChange.ProposeTrackStatus(fStopAndKill); 01216 else 01217 aParticleChange.ProposeTrackStatus(fStopButAlive); 01218 } 01219 01220 aParticleChange.ProposeEnergy(finalKineticEnergy); 01221 aParticleChange.ProposeLocalEnergyDeposit (eDeposit); 01222 aParticleChange.SetNumberOfSecondaries(totalNumber); 01223 aParticleChange.AddSecondary(deltaRay); 01224 01225 // ---- Debug ---- 01226 // std::cout << "RDHadronIonisation - finalKineticEnergy (MeV) = " 01227 // << finalKineticEnergy/MeV 01228 // << ", delta KineticEnergy (keV) = " 01229 // << deltaKineticEnergy/keV 01230 // << ", energy deposit (MeV) = " 01231 // << eDeposit/MeV 01232 // << std::endl; 01233 // ---- End debug --- 01234 01235 // Save Fluorescence and Auger 01236 01237 if (secondaryVector != 0) 01238 { 01239 for (size_t l = 0; l < nSecondaries; l++) 01240 { 01241 G4DynamicParticle* secondary = (*secondaryVector)[l]; 01242 if (secondary) aParticleChange.AddSecondary(secondary); 01243 01244 // ---- Debug ---- 01245 //if (secondary != 0) 01246 // { 01247 // if (secondary->GetDefinition() == G4Gamma::GammaDefinition()) 01248 // { 01249 // G4double eX = secondary->GetKineticEnergy(); 01250 // std::cout << " PIXE photon of energy " << eX/keV 01251 // << " keV added to ParticleChange; total number of secondaries is " << totalNumber 01252 // << std::endl; 01253 // } 01254 //} 01255 // ---- End debug --- 01256 01257 } 01258 delete secondaryVector; 01259 } 01260 01261 return G4VContinuousDiscreteProcess::PostStepDoIt(track,step); 01262 }
void G4hImpactIonisation::PrintInfoDefinition | ( | ) | const |
Definition at line 1714 of file G4hImpactIonisation.cc.
References G4cout, G4endl, G4MaterialCutsCouple::GetIndex(), G4Material::GetIonisation(), G4MaterialCutsCouple::GetMaterial(), G4ProductionCutsTable::GetMaterialCutsCouple(), G4IonisParamMat::GetMeanExcitationEnergy(), G4Material::GetName(), G4VProcess::GetProcessName(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), and G4hRDEnergyLoss::HighestKineticEnergy.
Referenced by BuildPhysicsTable().
01715 { 01716 G4String comments = " Knock-on electron cross sections . "; 01717 comments += "\n Good description above the mean excitation energy.\n"; 01718 comments += " Delta ray energy sampled from differential Xsection."; 01719 01720 G4cout << G4endl << GetProcessName() << ": " << comments 01721 << "\n PhysicsTables from " << LowestKineticEnergy / eV << " eV " 01722 << " to " << HighestKineticEnergy / TeV << " TeV " 01723 << " in " << TotBin << " bins." 01724 << "\n Electronic stopping power model is " 01725 << protonTable 01726 << "\n from " << protonLowEnergy / keV << " keV " 01727 << " to " << protonHighEnergy / MeV << " MeV " << "." << G4endl ; 01728 G4cout << "\n Parametrisation model for antiprotons is " 01729 << antiprotonTable 01730 << "\n from " << antiprotonLowEnergy / keV << " keV " 01731 << " to " << antiprotonHighEnergy / MeV << " MeV " << "." << G4endl ; 01732 if(theBarkas){ 01733 G4cout << " Parametrization of the Barkas effect is switched on." 01734 << G4endl ; 01735 } 01736 if(nStopping) { 01737 G4cout << " Nuclear stopping power model is " << theNuclearTable 01738 << G4endl ; 01739 } 01740 01741 G4bool printHead = true; 01742 01743 const G4ProductionCutsTable* theCoupleTable= 01744 G4ProductionCutsTable::GetProductionCutsTable(); 01745 size_t numOfCouples = theCoupleTable->GetTableSize(); 01746 01747 // loop for materials 01748 01749 for (size_t j=0 ; j < numOfCouples; j++) { 01750 01751 const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(j); 01752 const G4Material* material= couple->GetMaterial(); 01753 G4double deltaCutNow = cutForDelta[(couple->GetIndex())] ; 01754 G4double excitationEnergy = material->GetIonisation()->GetMeanExcitationEnergy(); 01755 01756 if(excitationEnergy > deltaCutNow) { 01757 if(printHead) { 01758 printHead = false ; 01759 01760 G4cout << " material min.delta energy(keV) " << G4endl; 01761 G4cout << G4endl; 01762 } 01763 01764 G4cout << std::setw(20) << material->GetName() 01765 << std::setw(15) << excitationEnergy/keV << G4endl; 01766 } 01767 } 01768 }
void G4hImpactIonisation::SetBarkasOff | ( | ) | [inline] |
void G4hImpactIonisation::SetBarkasOn | ( | ) | [inline] |
void G4hImpactIonisation::SetCutForAugerElectrons | ( | G4double | cut | ) |
void G4hImpactIonisation::SetCutForSecondaryPhotons | ( | G4double | cut | ) |
void G4hImpactIonisation::SetElectronicStoppingPowerModel | ( | const G4ParticleDefinition * | aParticle, | |
const G4String & | dedxTable | |||
) |
Definition at line 157 of file G4hImpactIonisation.cc.
References G4ParticleDefinition::GetPDGCharge().
00160 { 00161 if (particle->GetPDGCharge() > 0 ) 00162 { 00163 // Positive charge 00164 SetProtonElectronicStoppingPowerModel(dedxTable) ; 00165 } 00166 else 00167 { 00168 // Antiprotons 00169 SetAntiProtonElectronicStoppingPowerModel(dedxTable) ; 00170 } 00171 }
void G4hImpactIonisation::SetHighEnergyForAntiProtonParametrisation | ( | G4double | energy | ) | [inline] |
void G4hImpactIonisation::SetHighEnergyForProtonParametrisation | ( | G4double | energy | ) | [inline] |
void G4hImpactIonisation::SetLowEnergyForAntiProtonParametrisation | ( | G4double | energy | ) | [inline] |
void G4hImpactIonisation::SetLowEnergyForProtonParametrisation | ( | G4double | energy | ) | [inline] |
void G4hImpactIonisation::SetNuclearStoppingOff | ( | ) | [inline] |
void G4hImpactIonisation::SetNuclearStoppingOn | ( | ) | [inline] |
Definition at line 139 of file G4hImpactIonisation.hh.
Referenced by SetNuclearStoppingPowerModel().
void G4hImpactIonisation::SetNuclearStoppingPowerModel | ( | const G4String & | dedxTable | ) | [inline] |
Definition at line 131 of file G4hImpactIonisation.hh.
References SetNuclearStoppingOn().
00132 {theNuclearTable = dedxTable; SetNuclearStoppingOn();};
void G4hImpactIonisation::SetPixe | ( | const | G4bool | ) | [inline] |
void G4hImpactIonisation::SetPixeCrossSectionK | ( | const G4String & | name | ) | [inline] |
void G4hImpactIonisation::SetPixeCrossSectionL | ( | const G4String & | name | ) | [inline] |
void G4hImpactIonisation::SetPixeCrossSectionM | ( | const G4String & | name | ) | [inline] |
void G4hImpactIonisation::SetPixeProjectileMaxEnergy | ( | G4double | energy | ) | [inline] |
void G4hImpactIonisation::SetPixeProjectileMinEnergy | ( | G4double | energy | ) | [inline] |