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

#include <G4eCoulombScatteringModel.hh>

+ Inheritance diagram for G4eCoulombScatteringModel:

Public Member Functions

 G4eCoulombScatteringModel (G4bool combined=true)
 
 ~G4eCoulombScatteringModel () override
 
void Initialise (const G4ParticleDefinition *, const G4DataVector &) override
 
void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel) override
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax) override
 
void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
 
G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double) final
 
void SetLowEnergyThreshold (G4double val)
 
void SetRecoilThreshold (G4double eth)
 
void SetFixedCut (G4double)
 
G4double GetFixedCut () const
 
G4eCoulombScatteringModeloperator= (const G4eCoulombScatteringModel &right)=delete
 
 G4eCoulombScatteringModel (const G4eCoulombScatteringModel &)=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 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 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 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 Member Functions

void DefineMaterial (const G4MaterialCutsCouple *)
 
void SetupParticle (const G4ParticleDefinition *)
 
- 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 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
 

Detailed Description

Definition at line 77 of file G4eCoulombScatteringModel.hh.

Constructor & Destructor Documentation

◆ G4eCoulombScatteringModel() [1/2]

G4eCoulombScatteringModel::G4eCoulombScatteringModel ( G4bool combined = true)
explicit

Definition at line 68 of file G4eCoulombScatteringModel.cc.

69 : G4VEmModel("eCoulombScattering"), isCombined(combined)
70{
71 fNistManager = G4NistManager::Instance();
73 theProton = G4Proton::Proton();
74
75 wokvi = new G4WentzelOKandVIxSection(isCombined);
76
77 mass = CLHEP::proton_mass_c2;
78}
static G4NistManager * Instance()
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
static G4Proton * Proton()
Definition G4Proton.cc:90
G4VEmModel(const G4String &nam)
Definition G4VEmModel.cc:67

◆ ~G4eCoulombScatteringModel()

G4eCoulombScatteringModel::~G4eCoulombScatteringModel ( )
override

Definition at line 82 of file G4eCoulombScatteringModel.cc.

83{
84 delete wokvi;
85}

◆ G4eCoulombScatteringModel() [2/2]

G4eCoulombScatteringModel::G4eCoulombScatteringModel ( const G4eCoulombScatteringModel & )
delete

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4eCoulombScatteringModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition * p,
G4double kinEnergy,
G4double Z,
G4double A,
G4double cut,
G4double emax )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 162 of file G4eCoulombScatteringModel.cc.

167{
168 /*
169 G4cout << "### G4eCoulombScatteringModel::ComputeCrossSectionPerAtom for "
170 << p->GetParticleName()<<" Z= "<<Z<<" e(MeV)= "<< kinEnergy/MeV
171 << G4endl;
172 */
173 G4double cross = 0.0;
174 elecRatio = 0.0;
175 if(p != particle) { SetupParticle(p); }
176
177 // cross section is set to zero to avoid problems in sample secondary
178 if(kinEnergy <= 0.0) { return cross; }
180 G4double costmin = wokvi->SetupKinematic(kinEnergy, currentMaterial);
181
182 //G4cout << "cosThetaMax= "<<cosThetaMax<<" costmin= "<<costmin<< G4endl;
183
184 if(cosThetaMax < costmin) {
185 G4int iz = G4lrint(Z);
186 G4double cut = (0.0 < fixedCut) ? fixedCut : cutEnergy;
187 costmin = wokvi->SetupTarget(iz, cut);
188 //G4cout << "SetupTarget: Z= " << iz << " cut= " << cut << " "
189 // << costmin << G4endl;
190 G4double costmax = (1 == iz && particle == theProton && cosThetaMax < 0.0)
191 ? 0.0 : cosThetaMax;
192 if(costmin > costmax) {
193 cross = wokvi->ComputeNuclearCrossSection(costmin, costmax)
194 + wokvi->ComputeElectronCrossSection(costmin, costmax);
195 }
196 /*
197 if(p->GetParticleName() == "e-")
198 G4cout << "Z= " << Z << " e(MeV)= " << kinEnergy/MeV
199 << " cross(b)= " << cross/barn << " 1-costmin= " << 1-costmin
200 << " 1-costmax= " << 1-costmax
201 << " 1-cosThetaMax= " << 1-cosThetaMax
202 << " " << currentMaterial->GetName()
203 << G4endl;
204 */
205 }
206 //G4cout << "====== cross= " << cross << G4endl;
207 return cross;
208}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
const G4MaterialCutsCouple * CurrentCouple() const
G4double SetupTarget(G4int Z, G4double cut)
G4double ComputeElectronCrossSection(G4double CosThetaMin, G4double CosThetaMax)
virtual G4double SetupKinematic(G4double kinEnergy, const G4Material *mat)
G4double ComputeNuclearCrossSection(G4double CosThetaMin, G4double CosThetaMax)
void DefineMaterial(const G4MaterialCutsCouple *)
void SetupParticle(const G4ParticleDefinition *)
int G4lrint(double ad)
Definition templates.hh:134

◆ DefineMaterial()

void G4eCoulombScatteringModel::DefineMaterial ( const G4MaterialCutsCouple * cup)
inlineprotected

Definition at line 160 of file G4eCoulombScatteringModel.hh.

161{
162 if(cup != currentCouple) {
163 currentCouple = cup;
164 currentMaterial = cup->GetMaterial();
165 currentMaterialIndex = currentCouple->GetIndex();
166 }
167}
const G4Material * GetMaterial() const

Referenced by ComputeCrossSectionPerAtom(), and SampleSecondaries().

◆ GetFixedCut()

G4double G4eCoulombScatteringModel::GetFixedCut ( ) const
inline

Definition at line 198 of file G4eCoulombScatteringModel.hh.

199{
200 return fixedCut;
201}

◆ Initialise()

void G4eCoulombScatteringModel::Initialise ( const G4ParticleDefinition * part,
const G4DataVector & cuts )
overridevirtual

Implements G4VEmModel.

Definition at line 89 of file G4eCoulombScatteringModel.cc.

91{
92 SetupParticle(part);
93 currentCouple = nullptr;
94
96
97 // defined theta limit between single and multiple scattering
98 if(isCombined) {
99 if(tet >= CLHEP::pi) { cosThetaMin = -1.0; }
100 else if(tet > 0.0) { cosThetaMin = std::cos(tet); }
101
102 // single scattering without multiple
103 } else if(tet > 0.0) {
104 cosThetaMin = std::cos(std::min(tet, CLHEP::pi));
105 }
106
107 wokvi->Initialise(part, cosThetaMin);
108 pCuts = &cuts;
109 /*
110 G4cout << "G4eCoulombScatteringModel::Initialise for "
111 << part->GetParticleName() << " 1-cos(TetMin)= " << 1.0 - cosThetaMin
112 << " 1-cos(TetMax)= " << 1. - cosThetaMax << G4endl;
113 G4cout << "cut[0]= " << (*pCuts)[0] << G4endl;
114 */
115 if(nullptr == fParticleChange) {
116 fParticleChange = GetParticleChangeForGamma();
117 }
118 if(IsMaster() && mass < GeV && part->GetParticleName() != "GenericIon") {
119 InitialiseElementSelectors(part, cuts);
120 }
121}
G4double PolarAngleLimit() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4bool IsMaster() const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
void Initialise(const G4ParticleDefinition *, G4double CosThetaLim)

◆ InitialiseLocal()

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

Reimplemented from G4VEmModel.

Definition at line 125 of file G4eCoulombScatteringModel.cc.

127{
129}
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
std::vector< G4EmElementSelector * > * GetElementSelectors()

◆ MinPrimaryEnergy()

G4double G4eCoulombScatteringModel::MinPrimaryEnergy ( const G4Material * material,
const G4ParticleDefinition * part,
G4double  )
finalvirtual

Reimplemented from G4VEmModel.

Definition at line 134 of file G4eCoulombScatteringModel.cc.

137{
138 SetupParticle(part);
139
140 // define cut using cuts for proton
141 G4double cut =
142 std::max(recoilThreshold, (*pCuts)[CurrentCouple()->GetIndex()]);
143
144 // find out lightest element
145 const G4ElementVector* theElementVector = material->GetElementVector();
146 std::size_t nelm = material->GetNumberOfElements();
147
148 // select lightest element
149 G4int Z = 300;
150 for (std::size_t j=0; j<nelm; ++j) {
151 Z = std::min(Z,(*theElementVector)[j]->GetZasInt());
152 }
153 G4int A = G4lrint(fNistManager->GetAtomicMassAmu(Z));
155 G4double t = std::max(cut, 0.5*(cut + sqrt(2*cut*targetMass)));
156
157 return t;
158}
std::vector< const G4Element * > G4ElementVector
const G4double A[17]
const G4ElementVector * GetElementVector() const
std::size_t GetNumberOfElements() const
G4double GetAtomicMassAmu(const G4String &symb) const
static G4double GetNuclearMass(const G4double A, const G4double Z)

◆ operator=()

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

◆ SampleSecondaries()

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

Implements G4VEmModel.

Definition at line 212 of file G4eCoulombScatteringModel.cc.

218{
219 G4double kinEnergy = dp->GetKineticEnergy();
221 DefineMaterial(couple);
222 /*
223 G4cout << "G4eCoulombScatteringModel::SampleSecondaries e(MeV)= "
224 << kinEnergy << " " << particle->GetParticleName()
225 << " cut= " << cutEnergy<< G4endl;
226 */
227 // Choose nucleus
228 G4double cut = (0.0 < fixedCut) ? fixedCut : cutEnergy;
229
230 wokvi->SetupKinematic(kinEnergy, currentMaterial);
231
232 const G4Element* currentElement = SelectTargetAtom(couple,particle,kinEnergy,
233 dp->GetLogKineticEnergy(),cut,kinEnergy);
234 G4int iz = currentElement->GetZasInt();
235
236 G4double costmin = wokvi->SetupTarget(iz, cut);
237 G4double costmax = (1 == iz && particle == theProton && cosThetaMax < 0.0)
238 ? 0.0 : cosThetaMax;
239 if(costmin <= costmax) { return; }
240
241 G4double cross = wokvi->ComputeNuclearCrossSection(costmin, costmax);
242 G4double ecross = wokvi->ComputeElectronCrossSection(costmin, costmax);
243 G4double ratio = ecross/(cross + ecross);
244
245 G4int ia = SelectIsotopeNumber(currentElement);
246 G4double targetMass = G4NucleiProperties::GetNuclearMass(ia, iz);
247 wokvi->SetTargetMass(targetMass);
248
249 G4ThreeVector newDirection =
250 wokvi->SampleSingleScattering(costmin, costmax, ratio);
251 G4double cost = newDirection.z();
252 /*
253 G4cout << "SampleSec: e(MeV)= " << kinEnergy/MeV
254 << " 1-costmin= " << 1-costmin
255 << " 1-costmax= " << 1-costmax
256 << " 1-cost= " << 1-cost
257 << " ratio= " << ratio
258 << G4endl;
259 */
260 G4ThreeVector direction = dp->GetMomentumDirection();
261 newDirection.rotateUz(direction);
262
263 fParticleChange->ProposeMomentumDirection(newDirection);
264
265 // recoil sampling assuming a small recoil
266 // and first order correction to primary 4-momentum
267 G4double mom2 = wokvi->GetMomentumSquare();
268 G4double trec = mom2*(1.0 - cost)
269 /(targetMass + (mass + kinEnergy)*(1.0 - cost));
270
271 // the check likely not needed
272 trec = std::min(trec, kinEnergy);
273 G4double finalT = kinEnergy - trec;
274 G4double edep = 0.0;
275 /*
276 G4cout<<"G4eCoulombScatteringModel: finalT= "<<finalT<<" Trec= "
277 <<trec << " Z= " << iz << " A= " << ia
278 << " tcut(keV)= " << (*pCuts)[currentMaterialIndex]/keV << G4endl;
279 */
280 G4double tcut = recoilThreshold;
281 if(pCuts) { tcut= std::max(tcut,(*pCuts)[currentMaterialIndex]); }
282
283 if(trec > tcut) {
284 G4ParticleDefinition* ion = theIonTable->GetIon(iz, ia, 0);
285 G4ThreeVector dir = (direction*sqrt(mom2) -
286 newDirection*sqrt(finalT*(2*mass + finalT))).unit();
287 auto newdp = new G4DynamicParticle(ion, dir, trec);
288 fvect->push_back(newdp);
289 } else {
290 edep = trec;
291 fParticleChange->ProposeNonIonizingEnergyDeposit(edep);
292 }
293
294 // finelize primary energy and energy balance
295 // this threshold may be applied only because for low-enegry
296 // e+e- msc model is applied
297 if(finalT < 0.0) {
298 edep += finalT;
299 finalT = 0.0;
300 }
301 edep = std::max(edep, 0.0);
302 fParticleChange->SetProposedKineticEnergy(finalT);
303 fParticleChange->ProposeLocalEnergyDeposit(edep);
304}
double z() const
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetLogKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4int GetZasInt() const
Definition G4Element.hh:120
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
G4int SelectIsotopeNumber(const G4Element *) const
const G4Element * SelectTargetAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4ThreeVector & SampleSingleScattering(G4double CosThetaMin, G4double CosThetaMax, G4double elecRatio)

◆ SetFixedCut()

void G4eCoulombScatteringModel::SetFixedCut ( G4double val)
inline

Definition at line 191 of file G4eCoulombScatteringModel.hh.

192{
193 fixedCut = val;
194}

◆ SetLowEnergyThreshold()

void G4eCoulombScatteringModel::SetLowEnergyThreshold ( G4double val)
inline

◆ SetRecoilThreshold()

void G4eCoulombScatteringModel::SetRecoilThreshold ( G4double eth)
inline

Definition at line 184 of file G4eCoulombScatteringModel.hh.

185{
186 recoilThreshold = eth;
187}

◆ SetupParticle()

void G4eCoulombScatteringModel::SetupParticle ( const G4ParticleDefinition * p)
inlineprotected

Definition at line 172 of file G4eCoulombScatteringModel.hh.

173{
174 // Initialise mass and charge
175 if(p != particle) {
176 particle = p;
177 mass = particle->GetPDGMass();
178 wokvi->SetupParticle(p);
179 }
180}
void SetupParticle(const G4ParticleDefinition *)

Referenced by ComputeCrossSectionPerAtom(), Initialise(), MinPrimaryEnergy(), and SampleSecondaries().


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