Geant4 11.1.1
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 SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double cutEnergy, G4double maxEnergy) override
 
void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double) override
 
void SetBicubicInterpolationFlag (G4bool val)
 
G4SeltzerBergerModeloperator= (const G4SeltzerBergerModel &right)=delete
 
 G4SeltzerBergerModel (const G4SeltzerBergerModel &)=delete
 
- Public Member Functions inherited from G4eBremsstrahlungRelModel
 G4eBremsstrahlungRelModel (const G4ParticleDefinition *p=nullptr, const G4String &nam="eBremLPM")
 
 ~G4eBremsstrahlungRelModel () 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
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &)=0
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
 
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 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 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 LPMFlag () 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 SetLPMFlag (G4bool val)
 
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)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

Protected Member Functions

G4double ComputeDXSectionPerAtom (G4double gammaEnergy) override
 
- Protected Member Functions inherited from G4eBremsstrahlungRelModel
virtual G4double ComputeDXSectionPerAtom (G4double gammaEnergy)
 
void SetParticle (const G4ParticleDefinition *p)
 
- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 

Additional Inherited Members

- Protected Attributes inherited from G4eBremsstrahlungRelModel
G4bool fIsElectron = true
 
G4bool fIsScatOffElectron = false
 
G4bool fIsLPMActive = false
 
G4int fCurrentIZ = 0
 
const G4ParticleDefinitionfPrimaryParticle = nullptr
 
G4ParticleDefinitionfGammaParticle = nullptr
 
G4ParticleChangeForLossfParticleChange = nullptr
 
G4double fPrimaryParticleMass = 0.
 
G4double fPrimaryKinEnergy = 0.
 
G4double fPrimaryTotalEnergy = 0.
 
G4double fDensityFactor = 0.
 
G4double fDensityCorr = 0.
 
G4double fLowestKinEnergy
 
G4double fNucTerm = 0.
 
G4double fSumTerm = 0.
 
- 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
 
size_t currentCoupleIndex = 0
 
size_t basedCoupleIndex = 0
 
G4bool lossFlucFlag = true
 
- Static Protected Attributes inherited from G4eBremsstrahlungRelModel
static const G4double gBremFactor
 
static const G4double gMigdalConstant
 

Detailed Description

Definition at line 68 of file G4SeltzerBergerModel.hh.

Constructor & Destructor Documentation

◆ G4SeltzerBergerModel() [1/2]

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

Definition at line 90 of file G4SeltzerBergerModel.cc.

92: G4eBremsstrahlungRelModel(p,nam), fIsUseBicubicInterpolation(false),
93 fIsUseSamplingTables(true), fNumWarnings(0), fIndx(0), fIndy(0)
94{
95 fLowestKinEnergy = 1.0*keV;
97 SetLPMFlag(false);
99}
void SetLPMFlag(G4bool val)
Definition: G4VEmModel.hh:795
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:753
void SetAngularDistribution(G4VEmAngularDistribution *)
Definition: G4VEmModel.hh:607

◆ ~G4SeltzerBergerModel()

G4SeltzerBergerModel::~G4SeltzerBergerModel ( )
override

Definition at line 101 of file G4SeltzerBergerModel.cc.

102{
103 // delete SB-DCS data per Z
104 if (IsMaster()) {
105 for (std::size_t iz = 0; iz < gMaxZet; ++iz) {
106 if (gSBDCSData[iz]) {
107 delete gSBDCSData[iz];
108 gSBDCSData[iz] = nullptr;
109 }
110 }
111 if (gSBSamplingTable) {
112 delete gSBSamplingTable;
113 gSBSamplingTable = nullptr;
114 }
115 }
116}
G4bool IsMaster() const
Definition: G4VEmModel.hh:725

◆ G4SeltzerBergerModel() [2/2]

G4SeltzerBergerModel::G4SeltzerBergerModel ( const G4SeltzerBergerModel )
delete

Member Function Documentation

◆ ComputeDXSectionPerAtom()

G4double G4SeltzerBergerModel::ComputeDXSectionPerAtom ( G4double  gammaEnergy)
overrideprotectedvirtual

Reimplemented from G4eBremsstrahlungRelModel.

Definition at line 216 of file G4SeltzerBergerModel.cc.

217{
218 G4double dxsec = 0.0;
219 if (gammaEnergy < 0.0 || fPrimaryKinEnergy <= 0.0) {
220 return dxsec;
221 }
222 // reduced photon energy
223 const G4double x = gammaEnergy/fPrimaryKinEnergy;
224 // l-kinetic energy of the e-/e+
225 const G4double y = G4Log(fPrimaryKinEnergy/CLHEP::MeV);
226 // make sure that the Z-related SB-DCS are loaded
227 // NOTE: fCurrentIZ should have been set before.
228 fCurrentIZ = std::max(std::min(fCurrentIZ, gMaxZet-1), 1);
229 if (nullptr == gSBDCSData[fCurrentIZ]) {
230 ReadData(fCurrentIZ);
231 }
232 // NOTE: SetupForMaterial should have been called before!
233 const G4double pt2 = fPrimaryKinEnergy*(fPrimaryKinEnergy+2.*kMC2);
235 G4double val = gSBDCSData[fCurrentIZ]->Value(x,y,fIndx,fIndy);
236 dxsec = val*invb2*CLHEP::millibarn/gBremFactor;
237 // e+ correction
238 if (!fIsElectron) {
239 const G4double invbeta1 = std::sqrt(invb2);
240 const G4double e2 = fPrimaryKinEnergy-gammaEnergy;
241 if (e2 > 0.0) {
242 const G4double invbeta2 = (e2+kMC2)/std::sqrt(e2*(e2+2.0*kMC2));
243 const G4double dum0 = kAlpha*fCurrentIZ*(invbeta1-invbeta2);
244 if (dum0 < gExpNumLimit) {
245 dxsec = 0.0;
246 } else {
247 dxsec *= G4Exp(dum0);
248 }
249 } else {
250 dxsec = 0.0;
251 }
252 }
253 return dxsec;
254}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:180
G4double G4Log(G4double x)
Definition: G4Log.hh:227
double G4double
Definition: G4Types.hh:83
G4double Value(G4double x, G4double y, std::size_t &lastidx, std::size_t &lastidy) const

◆ Initialise()

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

Reimplemented from G4eBremsstrahlungRelModel.

Definition at line 118 of file G4SeltzerBergerModel.cc.

120{
121 if (p) {
122 SetParticle(p);
123 }
124 fIsUseSamplingTables = G4EmParameters::Instance()->EnableSamplingTable();
125 // Access to elements
126 if (IsMaster()) {
127
128 auto theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
129 G4int numOfCouples = (G4int)theCoupleTable->GetTableSize();
130 for(G4int j=0; j<numOfCouples; ++j) {
131 auto mat = theCoupleTable->GetMaterialCutsCouple(j)->GetMaterial();
132 auto elmVec = mat->GetElementVector();
133 for (auto & elm : *elmVec) {
134 G4int Z = std::max(1,std::min(elm->GetZasInt(), gMaxZet-1));
135 // load SB-DCS data for this atomic number if it has not been loaded yet
136 if (gSBDCSData[Z] == nullptr) ReadData(Z);
137 }
138 }
139 // elem.selectr. only for master: base class init-local will set for workers
142 }
143 // init sampling tables if it was requested
144 if (fIsUseSamplingTables) {
145 if (!gSBSamplingTable) {
146 gSBSamplingTable = new G4SBBremTable();
147 }
148 gSBSamplingTable->Initialize(std::max(fLowestKinEnergy,LowEnergyLimit()),
150 }
151 }
152 //
154 if (GetTripletModel()) {
155 GetTripletModel()->Initialise(p, cuts);
156 fIsScatOffElectron = true;
157 }
158}
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
static G4EmParameters * Instance()
G4bool EnableSamplingTable() const
static G4ProductionCutsTable * GetProductionCutsTable()
void Initialize(const G4double lowe, const G4double highe)
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:641
G4VEmModel * GetTripletModel()
Definition: G4VEmModel.hh:617
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
Definition: G4VEmModel.cc:139
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)=0
G4ParticleChangeForLoss * GetParticleChangeForLoss()
Definition: G4VEmModel.cc:109
void SetParticle(const G4ParticleDefinition *p)
G4ParticleChangeForLoss * fParticleChange

Referenced by G4PolarizedBremsstrahlungModel::Initialise().

◆ 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

Reimplemented from G4eBremsstrahlungRelModel.

Definition at line 257 of file G4SeltzerBergerModel.cc.

262{
263 const G4double kinEnergy = dp->GetKineticEnergy();
264 const G4double logKinEnergy = dp->GetLogKineticEnergy();
265 const G4double tmin = std::min(cutEnergy, kinEnergy);
266 const G4double tmax = std::min(maxEnergy, kinEnergy);
267 if (tmin >= tmax) {
268 return;
269 }
270 // set local variables and select target element
271 SetupForMaterial(fPrimaryParticle, couple->GetMaterial(), kinEnergy);
272 const G4Element* elm = SelectTargetAtom(couple, fPrimaryParticle, kinEnergy,
273 logKinEnergy, tmin, tmax);
274 fCurrentIZ = std::max(std::min(elm->GetZasInt(),gMaxZet-1), 1);
275 //
276 const G4double totMomentum = std::sqrt(kinEnergy*(fPrimaryTotalEnergy+kMC2));
277 /*
278 G4cout << "G4SeltzerBergerModel::SampleSecondaries E(MeV)= "
279 << kinEnergy/MeV
280 << " Z= " << fCurrentIZ << " cut(MeV)= " << tmin/MeV
281 << " emax(MeV)= " << tmax/MeV << " corr= " << fDensityCorr << G4endl;
282 */
283 // sample emitted photon energy either by rejection or from samplign tables
284 const G4double gammaEnergy = !fIsUseSamplingTables
285 ? SampleEnergyTransfer(kinEnergy, logKinEnergy, tmin, tmax)
286 : gSBSamplingTable->SampleEnergyTransfer(kinEnergy, logKinEnergy, tmin,
287 fDensityCorr, fCurrentIZ, couple->GetIndex(), fIsElectron);
288 // should never happen under normal conditions but protect it
289 if (gammaEnergy <= 0.) {
290 return;
291 }
292 //
293 // angles of the emitted gamma. ( Z - axis along the parent particle) use
294 // general interface
296 fPrimaryTotalEnergy-gammaEnergy, fCurrentIZ, couple->GetMaterial());
297 // create G4DynamicParticle object for the emitted Gamma
298 auto gamma = new G4DynamicParticle(fGammaParticle, gamDir, gammaEnergy);
299 vdp->push_back(gamma);
300 //
301 // compute post-interaction kinematics of the primary e-/e+
302 G4ThreeVector dir =
303 (totMomentum*dp->GetMomentumDirection()-gammaEnergy*gamDir).unit();
304 const G4double finalE = kinEnergy - gammaEnergy;
305 /*
306 G4cout << "### G4SBModel: v= "
307 << " Eg(MeV)= " << gammaEnergy
308 << " Ee(MeV)= " << kineticEnergy
309 << " DirE " << direction << " DirG " << gammaDirection
310 << G4endl;
311 */
312 // if secondary gamma energy is higher than threshold(very high by default)
313 // then stop tracking the primary particle and create new secondary e-/e+
314 // instead of the primary
315 if (gammaEnergy > SecondaryThreshold()) {
318 auto el = new G4DynamicParticle(
319 const_cast<G4ParticleDefinition*>(fPrimaryParticle), dir, finalE);
320 vdp->push_back(el);
321 } else { // continue tracking the primary e-/e+ otherwise
324 }
325}
@ fStopAndKill
const G4ThreeVector & GetMomentumDirection() const
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const
G4int GetZasInt() const
Definition: G4Element.hh:132
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double) override
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
Definition: G4VEmModel.hh:600
const G4Element * SelectTargetAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.hh:577
G4double SecondaryThreshold() const
Definition: G4VEmModel.hh:669
void ProposeTrackStatus(G4TrackStatus status)
const G4ParticleDefinition * fPrimaryParticle
G4ParticleDefinition * fGammaParticle

Referenced by G4PolarizedBremsstrahlungModel::SampleSecondaries().

◆ SetBicubicInterpolationFlag()

void G4SeltzerBergerModel::SetBicubicInterpolationFlag ( G4bool  val)
inline

Definition at line 89 of file G4SeltzerBergerModel.hh.

90 { fIsUseBicubicInterpolation = val; };

◆ SetupForMaterial()

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

Reimplemented from G4eBremsstrahlungRelModel.

Definition at line 406 of file G4SeltzerBergerModel.cc.

409{
411 // calculate threshold for density effect: gamma*k_p = sqrt(fDensityCorr)
412 fPrimaryKinEnergy = kineticEnergy;
413 fPrimaryTotalEnergy = kineticEnergy+CLHEP::electron_mass_c2;
416}
G4double GetElectronDensity() const
Definition: G4Material.hh:212
G4bool LPMFlag() const
Definition: G4VEmModel.hh:676

Referenced by SampleSecondaries().


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