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());
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.)
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);
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);
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;
363 G4cout <<
"Fluorescence: " << (bindingEnergy-theEnergyDeposit)/
keV <<
" keV" << G4endl;
364 G4cout <<
"Local energy deposit " << theEnergyDeposit/
keV <<
" keV" <<
G4endl;
367 G4cout <<
"-----------------------------------------------------------" <<
G4endl;