80 crossSectionHandler(0), energySpectrum(0)
82 fIntrinsicLowEnergyLimit = 10.0*eV;
83 fIntrinsicHighEnergyLimit = 100.0*GeV;
94 delete energySpectrum;
95 delete crossSectionHandler;
106 G4Exception(
"G4LivermoreIonisationModel::Initialise",
107 "em0002",
FatalException,
"Livermore Ionisation Model is applicable only to electrons");
113 delete energySpectrum;
117 if (verboseLevel > 3)
121 if (crossSectionHandler)
123 delete crossSectionHandler;
124 crossSectionHandler = 0;
127 const size_t nbins = 20;
130 G4int ndec =
G4int(std::log10(emax/emin) + 0.5);
131 if(ndec <= 0) { ndec = 1; }
135 emin,emax,nbins*ndec);
136 crossSectionHandler->
Clear();
145 if (verboseLevel > 0)
147 G4cout <<
"Livermore Ionisation model is initialized " <<
G4endl
154 if (verboseLevel > 3)
162 if(isInitialised) {
return; }
164 isInitialised =
true;
177 if (!crossSectionHandler)
179 G4Exception(
"G4LivermoreIonisationModel::ComputeCrossSectionPerAtom",
180 "em1007",
FatalException,
"The cross section handler is not correctly initialized");
188 if (verboseLevel > 1)
191 G4cout <<
"Cross section for delta emission > " << cutEnergy/keV <<
" keV at " <<
192 energy/keV <<
" keV and Z = " << iZ <<
" --> " << cs/barn <<
" barn" <<
G4endl;
209 const G4double* theAtomicNumDensityVector =
213 for (
size_t iel=0; iel<NumberOfElements; iel++ )
215 G4int iZ = (
G4int)((*theElementVector)[iel]->GetZ());
217 for (
G4int n=0; n<nShells; n++)
222 sPower += e * cs * theAtomicNumDensityVector[iel];
225 sPower += esp * theAtomicNumDensityVector[iel];
228 if (verboseLevel > 2)
231 G4cout <<
"Stopping power < " << cutEnergy/keV <<
" keV at " <<
232 kineticEnergy/keV <<
" keV = " << sPower/(keV/mm) <<
" keV/mm" <<
G4endl;
249 if (kineticEnergy <= fIntrinsicLowEnergyLimit)
266 kineticEnergy, shellIndex);
268 if (energyDelta == 0.)
272 G4double deltaKinE = energyDelta + 2.0*bindingEnergy;
273 G4double primaryKinE = kineticEnergy + 2.0*bindingEnergy;
276 G4double deltaMom = std::sqrt(deltaKinE*(deltaKinE + 2.0*electron_mass_c2));
277 G4double primaryMom = std::sqrt(primaryKinE*(primaryKinE + 2.0*electron_mass_c2));
279 G4double cost = deltaKinE * (primaryKinE + 2.0*electron_mass_c2)
280 / (deltaMom * primaryMom);
281 if (cost > 1.) { cost = 1.; }
282 G4double sint = std::sqrt((1. - cost)*(1. + cost));
284 G4double dirx = sint * std::cos(phi);
285 G4double diry = sint * std::sin(phi);
291 deltaDir.
rotateUz(primaryDirection);
300 sint = std::sqrt(1. - cost*cost);
302 G4double del = std::sqrt(bindingEnergy *(bindingEnergy + 2.0*electron_mass_c2))
304 dirx += del* sint * std::cos(phi);
305 diry += del* sint * std::sin(phi);
309 G4double finalPx = primaryMom*primaryDirection.
x() - deltaMom*dirx;
310 G4double finalPy = primaryMom*primaryDirection.
y() - deltaMom*diry;
311 G4double finalPz = primaryMom*primaryDirection.
z() - deltaMom*dirz;
316 G4double norm = 1.0/std::sqrt(dirx*dirx + diry*diry + dirz*dirz);
322 fvect->push_back(theDeltaRay);
325 G4double theEnergyDeposit = bindingEnergy;
329 G4double finalKinEnergy = kineticEnergy - energyDelta - theEnergyDeposit;
330 if(finalKinEnergy < 0.0)
332 theEnergyDeposit += finalKinEnergy;
333 finalKinEnergy = 0.0;
337 G4double normLocal = 1.0/std::sqrt(finalPx*finalPx+finalPy*finalPy+finalPz*finalPz);
338 finalPx *= normLocal;
339 finalPy *= normLocal;
340 finalPz *= normLocal;
345 if (theEnergyDeposit < 0)
347 G4cout <<
"G4LivermoreIonisationModel: Negative energy deposit: "
348 << theEnergyDeposit/eV <<
" eV" <<
G4endl;
349 theEnergyDeposit = 0.0;
355 if (verboseLevel > 1)
357 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
358 G4cout <<
"Energy balance from G4LivermoreIonisation" <<
G4endl;
359 G4cout <<
"Incoming primary energy: " << kineticEnergy/keV <<
" keV" <<
G4endl;
360 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
361 G4cout <<
"Outgoing primary energy: " << finalKinEnergy/keV <<
" keV" <<
G4endl;
362 G4cout <<
"Delta ray " << energyDelta/keV <<
" keV" <<
G4endl;
363 G4cout <<
"Fluorescence: " << (bindingEnergy-theEnergyDeposit)/keV <<
" keV" <<
G4endl;
364 G4cout <<
"Local energy deposit " << theEnergyDeposit/keV <<
" keV" <<
G4endl;
365 G4cout <<
"Total final state: " << (finalKinEnergy+energyDelta+bindingEnergy)
367 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
std::vector< G4Element * > G4ElementVector
G4DLLIMPORT std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
G4double BindingEnergy() const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
G4int NumberOfShells(G4int Z) const
static G4AtomicTransitionManager * Instance()
void SetMomentumDirection(const G4ThreeVector &aDirection)
const G4ThreeVector & GetMomentumDirection() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double GetKineticEnergy() const
void SetKineticEnergy(G4double aEnergy)
static G4Electron * Electron()
G4LivermoreIonisationModel(const G4ParticleDefinition *p=0, const G4String &processName="LowEnergyIoni")
virtual ~G4LivermoreIonisationModel()
G4ParticleChangeForLoss * fParticleChange
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetAtomicNumDensityVector() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4VEMDataSet * BuildMeanFreePathForMaterials(const G4DataVector *energyCuts=0)
void LoadShellData(const G4String &dataFile)
G4double FindValue(G4int Z, G4double e) const
G4int SelectRandomAtom(const G4MaterialCutsCouple *couple, G4double e) const
G4int SelectRandomShell(G4int Z, G4double e) const
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
G4ParticleChangeForLoss * GetParticleChangeForLoss()
virtual G4double SampleEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const =0
virtual void PrintData() const =0
virtual G4double MaxEnergyOfSecondaries(G4double kineticEnergy, G4int Z=0, const G4ParticleDefinition *pd=0) const =0
virtual G4double Excitation(G4int Z, G4double kineticEnergy) const =0
virtual G4double AverageEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const =0
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double GetCrossSectionAboveThresholdForElement(G4double energy, G4double cutEnergy, G4int Z)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)