79 crossSectionHandler(nullptr), energySpectrum(nullptr),
82 fIntrinsicLowEnergyLimit = 12.*eV;
83 fIntrinsicHighEnergyLimit = 100.0*GeV;
95 delete energySpectrum;
96 delete crossSectionHandler;
107 G4Exception(
"G4LivermoreIonisationModel::Initialise",
109 "Livermore Ionisation Model is applicable only to electrons");
116 delete energySpectrum;
117 energySpectrum =
nullptr;
120 if (verboseLevel > 3)
124 if (crossSectionHandler)
126 delete crossSectionHandler;
127 crossSectionHandler =
nullptr;
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 <<
" --> "
202 << cs/barn <<
" barn" <<
G4endl;
220 const G4double* theAtomicNumDensityVector =
224 for (
size_t iel=0; iel<NumberOfElements; iel++ )
226 G4int iZ = (
G4int)((*theElementVector)[iel]->GetZ());
228 for (
G4int n=0; n<nShells; n++)
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.)
291 fvect->push_back(delta);
295 G4double totalMomentum = std::sqrt(kineticEnergy*(kineticEnergy + 2*electron_mass_c2));
298 finalP = finalP.
unit();
301 G4double theEnergyDeposit = bindingEnergy;
305 G4double finalKinEnergy = kineticEnergy - energyDelta - theEnergyDeposit;
306 if(finalKinEnergy < 0.0)
308 theEnergyDeposit += finalKinEnergy;
309 finalKinEnergy = 0.0;
317 if (theEnergyDeposit < 0)
319 G4cout <<
"G4LivermoreIonisationModel: Negative energy deposit: "
320 << theEnergyDeposit/eV <<
" eV" <<
G4endl;
321 theEnergyDeposit = 0.0;
327 if (verboseLevel > 1)
329 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
330 G4cout <<
"Energy balance from G4LivermoreIonisation" <<
G4endl;
331 G4cout <<
"Incoming primary energy: " << kineticEnergy/keV <<
" keV" <<
G4endl;
332 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
333 G4cout <<
"Outgoing primary energy: " << finalKinEnergy/keV <<
" keV" <<
G4endl;
334 G4cout <<
"Delta ray " << energyDelta/keV <<
" keV" <<
G4endl;
335 G4cout <<
"Fluorescence: " << (bindingEnergy-theEnergyDeposit)/keV <<
" keV" <<
G4endl;
336 G4cout <<
"Local energy deposit " << theEnergyDeposit/keV <<
" keV" <<
G4endl;
337 G4cout <<
"Total final state: " << (finalKinEnergy+energyDelta+bindingEnergy)
339 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
std::vector< const G4Element * > G4ElementVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
G4double BindingEnergy() const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
void Initialise()
needs to be called once from other code before start of run
G4int NumberOfShells(G4int Z) const
static G4AtomicTransitionManager * Instance()
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
static G4Electron * Electron()
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
virtual ~G4LivermoreIonisationModel()
G4ParticleChangeForLoss * fParticleChange
G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) override
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4LivermoreIonisationModel(const G4ParticleDefinition *p=nullptr, const G4String &processName="LowEnergyIoni")
G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX) override
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetAtomicNumDensityVector() const
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void LoadShellData(const G4String &dataFile)
G4VEMDataSet * BuildMeanFreePathForMaterials(const G4DataVector *energyCuts=nullptr)
G4double FindValue(G4int Z, G4double e) const
G4int SelectRandomAtom(const G4MaterialCutsCouple *couple, G4double e) const
G4int SelectRandomShell(G4int Z, G4double e) const
G4VEmAngularDistribution * GetAngularDistribution()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetAngularDistribution(G4VEmAngularDistribution *)
G4ParticleChangeForLoss * GetParticleChangeForLoss()
virtual void PrintData() const =0
virtual G4double MaxEnergyOfSecondaries(G4double kineticEnergy, G4int Z=0, const G4ParticleDefinition *pd=nullptr) const =0
virtual G4double AverageEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=nullptr) const =0
virtual G4double SampleEnergy(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=nullptr) const =0
virtual G4double Excitation(G4int Z, G4double kineticEnergy) const =0
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double GetCrossSectionAboveThresholdForElement(G4double energy, G4double cutEnergy, G4int Z)