Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNARPWBAIonisationModel Class Reference

#include <G4DNARPWBAIonisationModel.hh>

+ Inheritance diagram for G4DNARPWBAIonisationModel:

Public Member Functions

 G4DNARPWBAIonisationModel (const G4ParticleDefinition *p=nullptr, const G4String &nam="DNARPWBAIonisationModel")
 
 ~G4DNARPWBAIonisationModel () override
 
G4DNARPWBAIonisationModeloperator= (const G4DNARPWBAIonisationModel &right)=delete
 
 G4DNARPWBAIonisationModel (const G4DNARPWBAIonisationModel &)=delete
 
void Initialise (const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector())) override
 
G4double CrossSectionPerVolume (const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax) override
 
void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
 
G4double GetPartialCrossSection (const G4Material *, G4int, const G4ParticleDefinition *, G4double) override
 
G4double DifferentialCrossSection (const G4double &k, const G4double &energyTransfer, const G4int &shell)
 
G4double TransferedEnergy (G4double incomingParticleEnergy, G4int shell, const G4double &random)
 
void SelectFasterComputation (const G4bool &input)
 
void SelectStationary (const G4bool &input)
 
void SelectSPScaling (const G4bool &input)
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ComputeCrossSectionPerShell (const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void StartTracking (G4Track *)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double &length, G4double &eloss)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
virtual void FillNumberOfSecondaries (G4int &numberOfTriplets, G4int &numberOfRecoil)
 
virtual void ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectTargetAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementGetCurrentElement (const G4Material *mat=nullptr) const
 
G4int SelectRandomAtomNumber (const G4Material *) const
 
const G4IsotopeGetCurrentIsotope (const G4Element *elm=nullptr) const
 
G4int SelectIsotopeNumber (const G4Element *) const
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
G4VEmModelGetTripletModel ()
 
void SetTripletModel (G4VEmModel *)
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy) const
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetFluctuationFlag (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
void SetUseBaseMaterials (G4bool val)
 
G4bool UseBaseMaterials () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 
void SetLPMFlag (G4bool)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

Protected Attributes

G4ParticleChangeForGammafParticleChangeForGamma = nullptr
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4PhysicsTablexSectionTable = nullptr
 
const G4MaterialpBaseMaterial = nullptr
 
const std::vector< G4double > * theDensityFactor = nullptr
 
const std::vector< G4int > * theDensityIdx = nullptr
 
G4double inveplus
 
G4double pFactor = 1.0
 
std::size_t currentCoupleIndex = 0
 
std::size_t basedCoupleIndex = 0
 
G4bool lossFlucFlag = true
 

Additional Inherited Members

- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Detailed Description

Definition at line 53 of file G4DNARPWBAIonisationModel.hh.

Constructor & Destructor Documentation

◆ G4DNARPWBAIonisationModel() [1/2]

G4DNARPWBAIonisationModel::G4DNARPWBAIonisationModel ( const G4ParticleDefinition * p = nullptr,
const G4String & nam = "DNARPWBAIonisationModel" )

Definition at line 50 of file G4DNARPWBAIonisationModel.cc.

52 : G4VEmModel(nam)
53{
54 // Verbosity scale:
55 // 0 = nothing
56 // 1 = warning for energy non-conservation
57 // 2 = details of energy budget
58 // 3 = calculation of cross sections, file openings, sampling of atoms
59 // 4 = entering in methods
60
61 if(verboseLevel > 0)
62 {
63 G4cout << "RPWBA ionisation model is constructed " << G4endl;
64 }
67}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void SetDeexcitationFlag(G4bool val)
G4VEmModel(const G4String &nam)
Definition G4VEmModel.cc:67
void SetAngularDistribution(G4VEmAngularDistribution *)

◆ ~G4DNARPWBAIonisationModel()

G4DNARPWBAIonisationModel::~G4DNARPWBAIonisationModel ( )
override

Definition at line 71 of file G4DNARPWBAIonisationModel.cc.

72{
73 eVecm.clear();
74 pVecm.clear();
75}

◆ G4DNARPWBAIonisationModel() [2/2]

G4DNARPWBAIonisationModel::G4DNARPWBAIonisationModel ( const G4DNARPWBAIonisationModel & )
delete

Member Function Documentation

◆ CrossSectionPerVolume()

G4double G4DNARPWBAIonisationModel::CrossSectionPerVolume ( const G4Material * material,
const G4ParticleDefinition * p,
G4double ekin,
G4double emin,
G4double emax )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 216 of file G4DNARPWBAIonisationModel.cc.

219{
220 if(particleDefinition != fProtonDef)
221 {
222 G4Exception("G4DNARPWBAIonisationModel::CrossSectionPerVolume", "em0402",
223 FatalException, "Model not applicable to particle type.");
224 }
225 if(verboseLevel > 3)
226 {
227 G4cout << "Calling CrossSectionPerVolume() of G4DNARPWBAIonisationModel"
228 << G4endl;
229 }
230 G4double sigma;
231 G4double waterDensity = (*fpMolWaterDensity)[material->GetIndex()];
232
233 if(InEnergyLimit(ekin))
234 {
235 sigma = fpTotalCrossSection->FindValue(ekin);
236 }
237 else
238 {
239 // nput energy is outside this interval the cross section is set to zero
240 // should add a warning or exception ?
241 return 0;
242 }
243
244 if(verboseLevel > 2)
245 {
246 G4cout << "__________________________________" << G4endl;
247 G4cout << "G4DNARPWBAIonisationModel - XS INFO START" << G4endl;
248 G4cout << "Kinetic energy(eV)=" << ekin / eV
249 << " particle : " << fProtonDef->GetParticleName() << G4endl;
250 G4cout << "Cross section per water molecule (cm^2)=" << sigma / cm / cm
251 << G4endl;
252 G4cout << "Cross section per water molecule (cm^-1)="
253 << sigma * waterDensity / (1. / cm) << G4endl;
254 G4cout << "G4DNARPWBAIonisationModel - XS INFO END" << G4endl;
255 }
256
257 return sigma * waterDensity;
258}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
double G4double
Definition G4Types.hh:83
std::size_t GetIndex() const
const G4String & GetParticleName() const

◆ DifferentialCrossSection()

G4double G4DNARPWBAIonisationModel::DifferentialCrossSection ( const G4double & k,
const G4double & energyTransfer,
const G4int & shell )

Definition at line 441 of file G4DNARPWBAIonisationModel.cc.

444{
445 G4double k = kine;
446 G4double sigma = 0.;
447 if(energyTransfer >=
448 waterStructure.IonisationEnergy(ionizationLevelIndex) / eV)
449 {
450 G4double valueT1 = 0;
451 G4double valueT2 = 0;
452 G4double valueE21 = 0;
453 G4double valueE22 = 0;
454 G4double valueE12 = 0;
455 G4double valueE11 = 0;
456
457 G4double xs11 = 0;
458 G4double xs12 = 0;
459 G4double xs21 = 0;
460 G4double xs22 = 0;
461
462 // Protection against out of boundary access - proton case : 100 MeV
463
464 if(k == pTdummyVec.back())
465 {
466 k = k * (1. - 1e-12);
467 }
468 // k should be in eV and energy transfer eV also
469 auto t2 = std::upper_bound(pTdummyVec.begin(), pTdummyVec.end(), k);
470 auto t1 = t2 - 1;
471
472 auto e12 = std::upper_bound(pVecm[(*t1)].begin(), pVecm[(*t1)].end(),
473 energyTransfer);
474 auto e11 = e12 - 1;
475
476 auto e22 = std::upper_bound(pVecm[(*t2)].begin(), pVecm[(*t2)].end(),
477 energyTransfer);
478 auto e21 = e22 - 1;
479
480 valueT1 = *t1;
481 valueT2 = *t2;
482 valueE21 = *e21;
483 valueE22 = *e22;
484 valueE12 = *e12;
485 valueE11 = *e11;
486
487 xs11 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
488 xs12 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
489 xs21 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
490 xs22 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
491
492 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
493 if(xsProduct != 0.)
494 {
495 sigma =
496 QuadInterpolator(valueE11, valueE12, valueE21, valueE22, xs11, xs12,
497 xs21, xs22, valueT1, valueT2, k, energyTransfer);
498 }
499 }
500 return sigma;
501}

◆ GetPartialCrossSection()

G4double G4DNARPWBAIonisationModel::GetPartialCrossSection ( const G4Material * ,
G4int level,
const G4ParticleDefinition * particle,
G4double kineticEnergy )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 570 of file G4DNARPWBAIonisationModel.cc.

573{
574 if(fpTotalCrossSection != nullptr && particle != fProtonDef)
575 {
576 G4Exception("G4DNARPWBAIonisationModel::GetPartialCrossSection", "em0010",
577 FatalException, "Model not applicable to particle type.");
578 }
579 return fpTotalCrossSection->GetComponent(level)->FindValue(kineticEnergy);
580}

◆ Initialise()

void G4DNARPWBAIonisationModel::Initialise ( const G4ParticleDefinition * particle,
const G4DataVector & = *(new G4DataVector()) )
overridevirtual

Implements G4VEmModel.

Definition at line 172 of file G4DNARPWBAIonisationModel.cc.

174{
175 if(isInitialised)
176 {
177 return;
178 }
179 if(verboseLevel > 3)
180 {
181 G4cout << "Calling G4DNARPWBAIonisationModel::Initialise()"
182 << particle->GetParticleName() << G4endl;
183 }
184
185 InitialiseForProton(particle);
186
187 if(verboseLevel > 0)
188 {
189 G4cout << "RPWBA ionisation model is initialized " << G4endl
190 << "Energy range: " << LowEnergyLimit() / MeV << " MeV - "
191 << HighEnergyLimit() / MeV << " MeV for "
192 << particle->GetParticleName() << G4endl;
193 }
194
195 // Initialize water density pointer
196 if(G4Material::GetMaterial("G4_WATER") != nullptr)
197 {
198 fpMolWaterDensity =
200 G4Material::GetMaterial("G4_WATER"));
201 }
202 else
203 {
204 G4ExceptionDescription exceptionDescription;
205 exceptionDescription << "G4_WATER does not exist :";
206 G4Exception("G4DNARPWBAIonisationModel::Initialise", "em00020",
207 FatalException, exceptionDescription);
208 }
209 fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
211 isInitialised = true;
212}
std::ostringstream G4ExceptionDescription
const std::vector< G4double > * GetNumMolPerVolTableFor(const G4Material *) const
Retrieve a table of molecular densities (number of molecules per unit volume) in the G4 unit system f...
static G4DNAMolecularMaterial * Instance()
G4ParticleChangeForGamma * fParticleChangeForGamma
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const

◆ operator=()

G4DNARPWBAIonisationModel & G4DNARPWBAIonisationModel::operator= ( const G4DNARPWBAIonisationModel & right)
delete

◆ SampleSecondaries()

void G4DNARPWBAIonisationModel::SampleSecondaries ( std::vector< G4DynamicParticle * > * fvect,
const G4MaterialCutsCouple * couple,
const G4DynamicParticle * particle,
G4double tmin,
G4double maxEnergy )
overridevirtual

Implements G4VEmModel.

Definition at line 262 of file G4DNARPWBAIonisationModel.cc.

265{
266 if(verboseLevel > 3)
267 {
268 G4cout << "Calling SampleSecondaries() of G4DNARPWBAIonisationModel"
269 << G4endl;
270 }
271 G4double k = particle->GetKineticEnergy();
272 if(InEnergyLimit(k))
273 {
274 G4ParticleMomentum primaryDirection = particle->GetMomentumDirection();
275 G4double particleMass = particle->GetDefinition()->GetPDGMass();
276 G4double totalEnergy = k + particleMass;
277 G4double pSquare = k * (totalEnergy + particleMass);
278 G4double totalMomentum = std::sqrt(pSquare);
279 G4int ionizationShell;
280
281 if(!fasterCode)
282 {
283 ionizationShell = RandomSelect(k);
284 }
285 else
286 {
287 // fasterCode = true
288 do
289 {
290 ionizationShell = RandomSelect(k);
291 } while(k < 19 * eV && ionizationShell == 2 &&
293 }
294
295 G4double bindingEnergy = waterStructure.IonisationEnergy(ionizationShell);
296
297 // SI: additional protection if tcs interpolation method is modified
298 if(k < bindingEnergy)
299 {
300 return;
301 }
302 //
303 G4double secondaryKinetic;
304 if(!fasterCode)
305 {
306 secondaryKinetic = RandomizeEjectedElectronEnergy(k, ionizationShell);
307 }
308 else
309 {
310 secondaryKinetic =
311 RandomizeEjectedElectronEnergyFromCumulatedDcs(k, ionizationShell);
312 }
313
314 G4int Z = 8; // water Z (6 Oxygen + 2 hydrogen)
315 G4ThreeVector deltaDirection =
317 particle, secondaryKinetic, Z, ionizationShell, couple->GetMaterial());
318
319 if(secondaryKinetic > 0){
320 auto dp = new G4DynamicParticle(G4Electron::Electron(), deltaDirection,
321 secondaryKinetic);
322 fvect->push_back(dp);
323 }
324
326 G4double deltaTotalMomentum = std::sqrt(
327 secondaryKinetic * (secondaryKinetic + 2. * electron_mass_c2));
328
329 G4double finalPx = totalMomentum * primaryDirection.x() -
330 deltaTotalMomentum * deltaDirection.x();
331 G4double finalPy = totalMomentum * primaryDirection.y() -
332 deltaTotalMomentum * deltaDirection.y();
333 G4double finalPz = totalMomentum * primaryDirection.z() -
334 deltaTotalMomentum * deltaDirection.z();
335 G4double finalMomentum =
336 std::sqrt(finalPx * finalPx + finalPy * finalPy + finalPz * finalPz);
337 finalPx /= finalMomentum;
338 finalPy /= finalMomentum;
339 finalPz /= finalMomentum;
340 G4ThreeVector direction;
341 direction.set(finalPx, finalPy, finalPz);
343 }
344 else
345 {
347 }
348
349 // AM: sample deexcitation
350 // here we assume that H_{2}O electronic levels are the same as Oxygen.
351 // this can be considered true with a rough 10% error in energy on K-shell,
352
353 size_t secNumberInit; // need to know at a certain point the energy of
354 // secondaries
355 size_t
356 secNumberFinal; // So I'll make the diference and then sum the energies
357
358 G4double scatteredEnergy = k - bindingEnergy - secondaryKinetic;
359
360 // SI: only atomic deexcitation from K shell is considered
361 if((fAtomDeexcitation != nullptr) && ionizationShell == 4)
362 {
363 const G4AtomicShell* shell =
364 fAtomDeexcitation->GetAtomicShell(Z, G4AtomicShellEnumerator(0));
365 secNumberInit = fvect->size();
366 fAtomDeexcitation->GenerateParticles(fvect, shell, Z, 0, 0);
367 secNumberFinal = fvect->size();
368
369 if(secNumberFinal > secNumberInit){
370 for(size_t i = secNumberInit; i < secNumberFinal; ++i){
371 if(bindingEnergy >= ((*fvect)[i])->GetKineticEnergy())
372 {
373 bindingEnergy -= ((*fvect)[i])->GetKineticEnergy();
374 }else{
375 delete(*fvect)[i];
376 (*fvect)[i] = nullptr;
377 }
378 }
379 }
380 }
381
382 // This should never happen
383 if(bindingEnergy < 0.0)
384 {
385 G4Exception("G4DNARPWBAIonisatioModel::SampleSecondaries()", "em2050",
386 FatalException, "Negative local energy deposit");
387 }
388
389 // bindingEnergy has been decreased
390 // by the amount of energy taken away by deexc. products
391 if(!statCode){
394 }else{
397 }
398 const G4Track* theIncomingTrack =
401 eIonizedMolecule, ionizationShell, theIncomingTrack);
402 }
403}
@ eIonizedMolecule
int G4int
Definition G4Types.hh:85
double z() const
Hep3Vector unit() const
double x() const
double y() const
void set(double x, double y, double z)
static G4DNAChemistryManager * Instance()
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * ElectronDefinition()
Definition G4Electron.cc:86
static G4Electron * Electron()
Definition G4Electron.cc:91
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, G4int shellID, const G4Material *)
G4VEmAngularDistribution * GetAngularDistribution()
const G4Track * GetCurrentTrack() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double bindingEnergy(G4int A, G4int Z)

◆ SelectFasterComputation()

void G4DNARPWBAIonisationModel::SelectFasterComputation ( const G4bool & input)
inline

Definition at line 135 of file G4DNARPWBAIonisationModel.hh.

137{
138 fasterCode = input;
139}

◆ SelectSPScaling()

void G4DNARPWBAIonisationModel::SelectSPScaling ( const G4bool & input)
inline

Definition at line 148 of file G4DNARPWBAIonisationModel.hh.

149{
150 spScaling = input;
151}

◆ SelectStationary()

void G4DNARPWBAIonisationModel::SelectStationary ( const G4bool & input)
inline

Definition at line 142 of file G4DNARPWBAIonisationModel.hh.

143{
144 statCode = input;
145}

◆ TransferedEnergy()

G4double G4DNARPWBAIonisationModel::TransferedEnergy ( G4double incomingParticleEnergy,
G4int shell,
const G4double & random )

Definition at line 640 of file G4DNARPWBAIonisationModel.cc.

643{
644 G4double nrj = 0.;
645 G4double valueK1 = 0;
646 G4double valueK2 = 0;
647 G4double valuePROB21 = 0;
648 G4double valuePROB22 = 0;
649 G4double valuePROB12 = 0;
650 G4double valuePROB11 = 0;
651 G4double nrjTransf11 = 0;
652 G4double nrjTransf12 = 0;
653 G4double nrjTransf21 = 0;
654 G4double nrjTransf22 = 0;
655 // Protection against out of boundary access - proton case : 100 MeV
656 if(k == pTdummyVec.back())
657 {
658 k = k * (1. - 1e-12);
659 }
660 // k should be in eV
661
662 auto k2 = std::upper_bound(pTdummyVec.begin(), pTdummyVec.end(), k);
663 auto k1 = k2 - 1;
664
665 // SI : the following condition avoids situations where random > last vector
666 // element,
667 // for eg. when the last element is zero
668 if(random <= pProbaShellMap[ionizationLevelIndex][(*k1)].back() &&
669 random <= pProbaShellMap[ionizationLevelIndex][(*k2)].back())
670 {
671 auto prob12 = std::upper_bound(
672 pProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
673 pProbaShellMap[ionizationLevelIndex][(*k1)].end(), random);
674 auto prob11 = prob12 - 1;
675 auto prob22 = std::upper_bound(
676 pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
677 pProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
678
679 auto prob21 = prob22 - 1;
680
681 valueK1 = *k1;
682 valueK2 = *k2;
683 valuePROB21 = *prob21;
684 valuePROB22 = *prob22;
685 valuePROB12 = *prob12;
686 valuePROB11 = *prob11;
687
688 nrjTransf11 = pNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
689 nrjTransf12 = pNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
690 nrjTransf21 = pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
691 nrjTransf22 = pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
692 }
693
694 // Avoids cases where cum xs is zero for k1 and is not for k2 (with always
695 // k1<k2)
696
697 if(random > pProbaShellMap[ionizationLevelIndex][(*k1)].back())
698 {
699 auto prob22 = std::upper_bound(
700 pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
701 pProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
702 auto prob21 = prob22 - 1;
703
704 valueK1 = *k1;
705 valueK2 = *k2;
706 valuePROB21 = *prob21;
707 valuePROB22 = *prob22;
708 nrjTransf21 = pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
709 nrjTransf22 = pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
710
711 G4double interpolatedvalue2 =
712 Interpolate(valuePROB21, valuePROB22, random, nrjTransf21, nrjTransf22);
713
714 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
715 return value;
716 }
717 G4double nrjTransfProduct =
718 nrjTransf11 * nrjTransf12 * nrjTransf21 * nrjTransf22;
719
720 if(nrjTransfProduct != 0.)
721 {
722 nrj = QuadInterpolator(valuePROB11, valuePROB12, valuePROB21, valuePROB22,
723 nrjTransf11, nrjTransf12, nrjTransf21, nrjTransf22,
724 valueK1, valueK2, k, random);
725 }
726 return nrj;
727}

Member Data Documentation

◆ fParticleChangeForGamma

G4ParticleChangeForGamma* G4DNARPWBAIonisationModel::fParticleChangeForGamma = nullptr
protected

Definition at line 83 of file G4DNARPWBAIonisationModel.hh.

Referenced by Initialise(), and SampleSecondaries().


The documentation for this class was generated from the following files: