81 crossSectionHandler(0), energySpectrum(0)
83 fIntrinsicLowEnergyLimit = 10.0*
eV;
84 fIntrinsicHighEnergyLimit = 100.0*
GeV;
96 delete energySpectrum;
97 delete crossSectionHandler;
108 G4Exception(
"G4LivermoreIonisationModel::Initialise",
110 "Livermore Ionisation Model is applicable only to electrons");
116 delete energySpectrum;
120 if (verboseLevel > 3)
124 if (crossSectionHandler)
126 delete crossSectionHandler;
127 crossSectionHandler = 0;
130 const size_t nbins = 20;
133 G4int ndec =
G4int(std::log10(emax/emin) + 0.5);
134 if(ndec <= 0) { ndec = 1; }
137 crossSectionHandler =
139 emin,emax,nbins*ndec);
140 crossSectionHandler->
Clear();
149 if (verboseLevel > 0)
151 G4cout <<
"Livermore Ionisation model is initialized " << G4endl
158 if (verboseLevel > 3)
166 if(isInitialised) {
return; }
168 isInitialised =
true;
182 if (!crossSectionHandler)
184 G4Exception(
"G4LivermoreIonisationModel::ComputeCrossSectionPerAtom",
186 "The cross section handler is not correctly initialized");
196 if (verboseLevel > 1)
199 G4cout <<
"Cross section for delta emission > "
200 << cutEnergy/
keV <<
" keV at "
201 << energy/
keV <<
" keV and Z = " << iZ <<
" --> "
220 const G4double* theAtomicNumDensityVector =
224 for (
size_t iel=0; iel<NumberOfElements; iel++ )
226 G4int iZ = (
G4int)((*theElementVector)[iel]->GetZ());
233 sPower += e * cs * theAtomicNumDensityVector[iel];
236 sPower += esp * theAtomicNumDensityVector[iel];
239 if (verboseLevel > 2)
242 G4cout <<
"Stopping power < " << cutEnergy/
keV
243 <<
" keV at " << kineticEnergy/
keV <<
" keV = "
244 << sPower/(
keV/
mm) <<
" keV/mm" << G4endl;
253 std::vector<G4DynamicParticle*>* fvect,
262 if (kineticEnergy <= fIntrinsicLowEnergyLimit)
279 kineticEnergy, shellIndex);
281 if (energyDelta == 0.)
293 / (deltaMom * primaryMom);
294 if (cost > 1.) { cost = 1.; }
295 G4double sint = std::sqrt((1. - cost)*(1. + cost));
297 G4double dirx = sint * std::cos(phi);
298 G4double diry = sint * std::sin(phi);
304 deltaDir.
rotateUz(primaryDirection);
313 sint = std::sqrt(1. - cost*cost);
317 dirx += del* sint * std::cos(phi);
318 diry += del* sint * std::sin(phi);
322 G4double finalPx = primaryMom*primaryDirection.
x() - deltaMom*dirx;
323 G4double finalPy = primaryMom*primaryDirection.
y() - deltaMom*diry;
324 G4double finalPz = primaryMom*primaryDirection.
z() - deltaMom*dirz;
329 G4double norm = 1.0/std::sqrt(dirx*dirx + diry*diry + dirz*dirz);
335 fvect->push_back(theDeltaRay);
342 G4double finalKinEnergy = kineticEnergy - energyDelta - theEnergyDeposit;
343 if(finalKinEnergy < 0.0)
345 theEnergyDeposit += finalKinEnergy;
346 finalKinEnergy = 0.0;
350 G4double normLocal = 1.0/std::sqrt(finalPx*finalPx+finalPy*finalPy+finalPz*finalPz);
351 finalPx *= normLocal;
352 finalPy *= normLocal;
353 finalPz *= normLocal;
358 if (theEnergyDeposit < 0)
360 G4cout <<
"G4LivermoreIonisationModel: Negative energy deposit: "
361 << theEnergyDeposit/
eV <<
" eV" <<
G4endl;
362 theEnergyDeposit = 0.0;
368 if (verboseLevel > 1)
370 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
371 G4cout <<
"Energy balance from G4LivermoreIonisation" <<
G4endl;
372 G4cout <<
"Incoming primary energy: " << kineticEnergy/
keV <<
" keV" <<
G4endl;
373 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
374 G4cout <<
"Outgoing primary energy: " << finalKinEnergy/
keV <<
" keV" <<
G4endl;
376 G4cout <<
"Fluorescence: " << (bindingEnergy-theEnergyDeposit)/
keV <<
" keV" << G4endl;
377 G4cout <<
"Local energy deposit " << theEnergyDeposit/
keV <<
" keV" <<
G4endl;
380 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double LowEnergyLimit() const
virtual void PrintData() const =0
G4ParticleChangeForLoss * GetParticleChangeForLoss()
G4int NumberOfShells(G4int Z) const
std::vector< G4Element * > G4ElementVector
G4double GetCrossSectionAboveThresholdForElement(G4double energy, G4double cutEnergy, G4int Z)
G4double GetKineticEnergy() const
G4double HighEnergyLimit() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
G4int SelectRandomShell(G4int Z, G4double e) const
void SetMomentumDirection(const G4ThreeVector &aDirection)
G4double BindingEnergy() const
const G4ElementVector * GetElementVector() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4ParticleChangeForLoss * fParticleChange
virtual G4double SampleEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const =0
G4double FindValue(G4int Z, G4double e) const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
virtual G4double AverageEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=0) const =0
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
Hep3Vector & rotateUz(const Hep3Vector &)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4VEMDataSet * BuildMeanFreePathForMaterials(const G4DataVector *energyCuts=0)
virtual G4double MaxEnergyOfSecondaries(G4double kineticEnergy, G4int Z=0, const G4ParticleDefinition *pd=0) const =0
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
const G4double * GetAtomicNumDensityVector() const
void SetKineticEnergy(G4double aEnergy)
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy)
void LoadShellData(const G4String &dataFile)
G4LivermoreIonisationModel(const G4ParticleDefinition *p=0, const G4String &processName="LowEnergyIoni")
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual ~G4LivermoreIonisationModel()
virtual G4double Excitation(G4int Z, G4double kineticEnergy) const =0
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static G4Electron * Electron()
size_t GetNumberOfElements() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4double bindingEnergy(G4int A, G4int Z)
static G4AtomicTransitionManager * Instance()
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
G4int SelectRandomAtom(const G4MaterialCutsCouple *couple, G4double e) const