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

#include <G4SeltzerBergerModel.hh>

+ Inheritance diagram for G4SeltzerBergerModel:

Public Member Functions

 G4SeltzerBergerModel (const G4ParticleDefinition *p=nullptr, const G4String &nam="eBremSB")
 
 ~G4SeltzerBergerModel () override
 
void Initialise (const G4ParticleDefinition *, const G4DataVector &) override
 
void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel) override
 
G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double ekin, G4double cutEnergy) override
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double ekin, G4double zet, G4double, G4double cutEnergy, G4double maxEnergy=DBL_MAX) override
 
void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double cutEnergy, G4double maxEnergy) override
 
void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double) override
 
G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cutEnergy) override
 
void SetBicubicInterpolationFlag (G4bool val)
 
G4SeltzerBergerModeloperator= (const G4SeltzerBergerModel &right)=delete
 
 G4SeltzerBergerModel (const G4SeltzerBergerModel &)=delete
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double GetPartialCrossSection (const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
 
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 MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
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

G4ParticleChangeForLossfParticleChange {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 69 of file G4SeltzerBergerModel.hh.

Constructor & Destructor Documentation

◆ G4SeltzerBergerModel() [1/2]

G4SeltzerBergerModel::G4SeltzerBergerModel ( const G4ParticleDefinition * p = nullptr,
const G4String & nam = "eBremSB" )
explicit

Definition at line 113 of file G4SeltzerBergerModel.cc.

115 : G4VEmModel(nam),
116 fGammaParticle(G4Gamma::Gamma()),
117 fLowestKinEnergy(1.0*CLHEP::keV)
118{
119 SetLowEnergyLimit(fLowestKinEnergy);
121 if (fPrimaryParticle != p) { SetParticle(p); }
122}
static G4Gamma * Gamma()
Definition G4Gamma.cc:81
void SetLowEnergyLimit(G4double)
G4VEmModel(const G4String &nam)
Definition G4VEmModel.cc:67
void SetAngularDistribution(G4VEmAngularDistribution *)

◆ ~G4SeltzerBergerModel()

G4SeltzerBergerModel::~G4SeltzerBergerModel ( )
override

Definition at line 124 of file G4SeltzerBergerModel.cc.

125{
126 // delete SB-DCS data per Z
127 if (isInitializer) {
128 for (std::size_t iz = 0; iz < gMaxZet; ++iz) {
129 if (gSBDCSData[iz]) {
130 delete gSBDCSData[iz];
131 gSBDCSData[iz] = nullptr;
132 }
133 }
134 if (gSBSamplingTable) {
135 delete gSBSamplingTable;
136 gSBSamplingTable = nullptr;
137 }
138 }
139}

◆ G4SeltzerBergerModel() [2/2]

G4SeltzerBergerModel::G4SeltzerBergerModel ( const G4SeltzerBergerModel & )
delete

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4SeltzerBergerModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition * p,
G4double ekin,
G4double zet,
G4double ,
G4double cutEnergy,
G4double maxEnergy = DBL_MAX )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 343 of file G4SeltzerBergerModel.cc.

349{
350 G4double crossSection = 0.0;
351 if (nullptr == fPrimaryParticle) {
352 SetParticle(p);
353 }
354 if (kineticEnergy <= fLowestKinEnergy) {
355 return crossSection;
356 }
357 // min/max kinetic energy limits of the DCS integration:
358 const G4double tmin = std::min(cut, kineticEnergy);
359 const G4double tmax = std::min(maxEnergy, kineticEnergy);
360 // zero restricted x-section if e- kinetic energy is below gamma cut
361 if (tmin >= tmax) {
362 return crossSection;
363 }
364 fCurrentIZ = std::min(G4lrint(Z), gMaxZet);
365 // integrate numerically (dependent part of) the DCS between the kin. limits:
366 // a. integrate between tmin and kineticEnergy of the e-
367 crossSection = ComputeXSectionPerAtom(tmin);
368 // allow partial integration: only if maxEnergy < kineticEnergy
369 // b. integrate between tmax and kineticEnergy (tmax=maxEnergy in this case)
370 // (so the result in this case is the integral of DCS between tmin and
371 // maxEnergy)
372 if (tmax < kineticEnergy) {
373 crossSection -= ComputeXSectionPerAtom(tmax);
374 }
375 // multiply with the constant factors: 16\alpha r_0^2/3 Z^2
376 crossSection *= Z*Z*gBremFactor;
377 return std::max(crossSection, 0.);
378}
double G4double
Definition G4Types.hh:83
int G4lrint(double ad)
Definition templates.hh:134

◆ ComputeDEDXPerVolume()

G4double G4SeltzerBergerModel::ComputeDEDXPerVolume ( const G4Material * material,
const G4ParticleDefinition * p,
G4double ekin,
G4double cutEnergy )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 262 of file G4SeltzerBergerModel.cc.

266{
267 G4double dedx = 0.0;
268 if (nullptr == fPrimaryParticle) {
269 SetParticle(p);
270 }
271 if (kineticEnergy <= fLowestKinEnergy) {
272 return dedx;
273 }
274 // maximum value of the dE/dx integral (the minimum is 0 of course)
275 G4double tmax = std::min(cutEnergy, kineticEnergy);
276 if (tmax == 0.0) {
277 return dedx;
278 }
279 // sets kinematical and material related variables
280 SetupForMaterial(fPrimaryParticle, material, kineticEnergy);
281 // get element compositions of the material
282 const G4ElementVector* theElemVector = material->GetElementVector();
283 const G4double* theAtomNumDensVector = material->GetAtomicNumDensityVector();
284 const std::size_t numberOfElements = theElemVector->size();
285 // loop over the elements of the material and compute their contributions to
286 // the restricted dE/dx by numerical integration of the dependent part of DCS
287 for (std::size_t ie = 0; ie < numberOfElements; ++ie) {
288 G4VEmModel::SetCurrentElement((*theElemVector)[ie]);
289 G4int Z = (*theElemVector)[ie]->GetZasInt();
290 fCurrentIZ = std::min(Z, gMaxZet);
291 dedx += (Z*Z)*theAtomNumDensVector[ie]*ComputeBremLoss(tmax);
292 }
293 // apply the constant factor C/Z = 16\alpha r_0^2/3
294 dedx *= gBremFactor;
295 return std::max(dedx, 0.);
296}
std::vector< const G4Element * > G4ElementVector
int G4int
Definition G4Types.hh:85
const G4ElementVector * GetElementVector() const
const G4double * GetAtomicNumDensityVector() const
void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double) override
void SetCurrentElement(const G4Element *)

◆ Initialise()

void G4SeltzerBergerModel::Initialise ( const G4ParticleDefinition * p,
const G4DataVector & cuts )
overridevirtual

Implements G4VEmModel.

Definition at line 141 of file G4SeltzerBergerModel.cc.

143{
144 // parameters in each thread
145 if (fPrimaryParticle != p) {
146 SetParticle(p);
147 }
148 fIsUseSamplingTables = G4EmParameters::Instance()->EnableSamplingTable();
149 fCurrentIZ = 0;
150
151 // initialise static tables for the Seltzer-Berger model
152 std::call_once(applyOnce, [this]() { isInitializer = true; });
153
154 if (isInitializer) {
155 G4AutoLock l(&theSBMutex);
156
157 // initialisation per element is done only once
158 auto elemTable = G4Element::GetElementTable();
159 for (auto const & elm : *elemTable) {
160 G4int Z = std::max(1,std::min(elm->GetZasInt(), gMaxZet-1));
161 // load SB-DCS data for this atomic number if it has not been loaded yet
162 if (gSBDCSData[Z] == nullptr) ReadData(Z);
163 }
164
165 // init sampling tables if it was requested
166 if (fIsUseSamplingTables) {
167 if (nullptr == gSBSamplingTable) {
168 gSBSamplingTable = new G4SBBremTable();
169 }
170 gSBSamplingTable->Initialize(std::max(fLowestKinEnergy, LowEnergyLimit()),
172 }
173 l.unlock();
174 }
175 // element selectors are initialized in the master thread
176 if (IsMaster()) {
178 }
179 // initialisation in all threads
180 if (nullptr == fParticleChange) {
182 }
183 auto trmodel = GetTripletModel();
184 if (nullptr != trmodel) {
185 trmodel->Initialise(p, cuts);
186 fIsScatOffElectron = true;
187 }
188}
static G4ElementTable * GetElementTable()
Definition G4Element.cc:389
static G4EmParameters * Instance()
G4bool EnableSamplingTable() const
void Initialize(const G4double lowe, const G4double highe)
G4ParticleChangeForLoss * fParticleChange
G4double LowEnergyLimit() const
G4bool IsMaster() const
G4VEmModel * GetTripletModel()
G4double HighEnergyLimit() const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
G4ParticleChangeForLoss * GetParticleChangeForLoss()

Referenced by G4PolarizedBremsstrahlungModel::Initialise().

◆ InitialiseLocal()

void G4SeltzerBergerModel::InitialiseLocal ( const G4ParticleDefinition * ,
G4VEmModel * masterModel )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 190 of file G4SeltzerBergerModel.cc.

192{
194}
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
std::vector< G4EmElementSelector * > * GetElementSelectors()

◆ MinPrimaryEnergy()

G4double G4SeltzerBergerModel::MinPrimaryEnergy ( const G4Material * ,
const G4ParticleDefinition * ,
G4double cutEnergy )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 238 of file G4SeltzerBergerModel.cc.

241{
242 return std::max(fLowestKinEnergy, cut);
243}

◆ operator=()

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

◆ SampleSecondaries()

void G4SeltzerBergerModel::SampleSecondaries ( std::vector< G4DynamicParticle * > * vdp,
const G4MaterialCutsCouple * couple,
const G4DynamicParticle * dp,
G4double cutEnergy,
G4double maxEnergy )
overridevirtual

Implements G4VEmModel.

Definition at line 466 of file G4SeltzerBergerModel.cc.

471{
472 const G4double kinEnergy = dp->GetKineticEnergy();
473 const G4double logKinEnergy = dp->GetLogKineticEnergy();
474 const G4double tmin = std::min(cutEnergy, kinEnergy);
475 const G4double tmax = std::min(maxEnergy, kinEnergy);
476 if (tmin >= tmax) {
477 return;
478 }
479 // set local variables and select target element
480 SetupForMaterial(fPrimaryParticle, couple->GetMaterial(), kinEnergy);
481 const G4Element* elm = SelectTargetAtom(couple, fPrimaryParticle, kinEnergy,
482 logKinEnergy, tmin, tmax);
483 fCurrentIZ = std::max(std::min(elm->GetZasInt(), gMaxZet-1), 1);
484 //
485 const G4double totMomentum = std::sqrt(kinEnergy*(kinEnergy + twoMass));
486 /*
487 G4cout << "G4SeltzerBergerModel::SampleSecondaries E(MeV)= "
488 << kinEnergy/MeV
489 << " Z= " << fCurrentIZ << " cut(MeV)= " << tmin/MeV
490 << " emax(MeV)= " << tmax/MeV << " corr= " << fDensityCorr << G4endl;
491 */
492 // sample emitted photon energy either by rejection or from samplign tables
493 const G4double gammaEnergy = !fIsUseSamplingTables
494 ? SampleEnergyTransfer(kinEnergy, logKinEnergy, tmin, tmax)
495 : gSBSamplingTable->SampleEnergyTransfer(kinEnergy, logKinEnergy, tmin,
496 fDensityCorr, fCurrentIZ, couple->GetIndex(), fIsElectron);
497 // should never happen under normal conditions but protect it
498 if (gammaEnergy <= 0.) {
499 return;
500 }
501 //
502 // angles of the emitted gamma. ( Z - axis along the parent particle) use
503 // general interface
505 fPrimaryTotalEnergy-gammaEnergy, fCurrentIZ, couple->GetMaterial());
506 // create G4DynamicParticle object for the emitted Gamma
507 auto gamma = new G4DynamicParticle(fGammaParticle, gamDir, gammaEnergy);
508 vdp->push_back(gamma);
509 //
510 // compute post-interaction kinematics of the primary e-/e+
511 G4ThreeVector dir =
512 (totMomentum*dp->GetMomentumDirection() - gammaEnergy*gamDir).unit();
513 const G4double finalE = kinEnergy - gammaEnergy;
514 /*
515 G4cout << "### G4SBModel: v= "
516 << " Eg(MeV)= " << gammaEnergy
517 << " Ee(MeV)= " << kineticEnergy
518 << " DirE " << direction << " DirG " << gammaDirection
519 << G4endl;
520 */
521 // if secondary gamma energy is higher than threshold(very high by default)
522 // then stop tracking the primary particle and create new secondary e-/e+
523 // instead of the primary
524 if (gammaEnergy > SecondaryThreshold()) {
527 auto el = new G4DynamicParticle(
528 const_cast<G4ParticleDefinition*>(fPrimaryParticle), dir, finalE);
529 vdp->push_back(el);
530 } else { // continue tracking the primary e-/e+ otherwise
533 }
534}
@ fStopAndKill
Hep3Vector unit() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const
G4int GetZasInt() const
Definition G4Element.hh:120
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
const G4Element * SelectTargetAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4double SecondaryThreshold() const
void ProposeTrackStatus(G4TrackStatus status)

Referenced by G4PolarizedBremsstrahlungModel::SampleSecondaries().

◆ SetBicubicInterpolationFlag()

void G4SeltzerBergerModel::SetBicubicInterpolationFlag ( G4bool val)
inline

Definition at line 109 of file G4SeltzerBergerModel.hh.

110 { fIsUseBicubicInterpolation = val; };

◆ SetupForMaterial()

void G4SeltzerBergerModel::SetupForMaterial ( const G4ParticleDefinition * ,
const G4Material * mat,
G4double kinEnergy )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 248 of file G4SeltzerBergerModel.cc.

251{
252 fDensityFactor = gMigdalConstant*mat->GetElectronDensity();
253 // calculate threshold for density effect: k_p = sqrt(fDensityCorr)
254 fPrimaryKinEnergy = kinEnergy;
255 fPrimaryTotalEnergy = kinEnergy + CLHEP::electron_mass_c2;
256 fDensityCorr = fDensityFactor*fPrimaryTotalEnergy*fPrimaryTotalEnergy;
257}
G4double GetElectronDensity() const

Referenced by ComputeDEDXPerVolume(), and SampleSecondaries().

Member Data Documentation

◆ fParticleChange

G4ParticleChangeForLoss* G4SeltzerBergerModel::fParticleChange {nullptr}
protected

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