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

#include <G4eSingleCoulombScatteringModel.hh>

+ Inheritance diagram for G4eSingleCoulombScatteringModel:

Public Member Functions

 G4eSingleCoulombScatteringModel (const G4String &nam="eSingleCoulombScat")
 
virtual ~G4eSingleCoulombScatteringModel ()
 
virtual void Initialise (const G4ParticleDefinition *, const G4DataVector &) final
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel) final
 
virtual G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax) final
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) final
 
void SetRecoilThreshold (G4double eth)
 
void SetXSectionModel (const G4String &model)
 
- 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 *, G4double &eloss, G4double &niel, G4double length)
 
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 ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
virtual 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)
 
G4int SelectRandomAtomNumber (const G4Material *)
 
G4int SelectIsotopeNumber (const G4Element *)
 
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 *)
 
const G4ElementGetCurrentElement () const
 
const G4IsotopeGetCurrentIsotope () const
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

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 *)
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData
 
G4VParticleChangepParticleChange
 
G4PhysicsTablexSectionTable
 
const G4MaterialpBaseMaterial
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
size_t idxTable
 
G4bool lossFlucFlag
 
G4double inveplus
 
G4double pFactor
 

Detailed Description

Definition at line 66 of file G4eSingleCoulombScatteringModel.hh.

Constructor & Destructor Documentation

◆ G4eSingleCoulombScatteringModel()

G4eSingleCoulombScatteringModel::G4eSingleCoulombScatteringModel ( const G4String nam = "eSingleCoulombScat")
explicit

Definition at line 75 of file G4eSingleCoulombScatteringModel.cc.

76 : G4VEmModel(nam),
77 cosThetaMin(1.0)
78{
79 fNistManager = G4NistManager::Instance();
81 fParticleChange = nullptr;
82
83 pCuts=nullptr;
84 currentMaterial = nullptr;
85 currentElement = nullptr;
86 currentCouple = nullptr;
87
88 lowEnergyLimit = 0*keV;
89 recoilThreshold = 0.*eV;
90 XSectionModel = 1;
91 FormFactor = 0;
92 particle = nullptr;
93 mass=0.0;
94 currentMaterialIndex = -1;
95
96 Mottcross = new G4ScreeningMottCrossSection();
97 //G4cout <<"## G4eSingleCoulombScatteringModel: " << this << " " << Mottcross << G4endl;
98}
static G4NistManager * Instance()
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()

◆ ~G4eSingleCoulombScatteringModel()

G4eSingleCoulombScatteringModel::~G4eSingleCoulombScatteringModel ( )
virtual

Definition at line 102 of file G4eSingleCoulombScatteringModel.cc.

103{
104 //G4cout <<"## G4eSingleCoulombScatteringModel: delete " << this << " " << Mottcross << G4endl;
105 delete Mottcross;
106}

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4eSingleCoulombScatteringModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition p,
G4double  kinEnergy,
G4double  Z,
G4double  A,
G4double  cut,
G4double  emax 
)
finalvirtual

Reimplemented from G4VEmModel.

Definition at line 167 of file G4eSingleCoulombScatteringModel.cc.

174{
175 SetupParticle(p);
176
177 G4double cross =0.0;
178 if(kinEnergy < lowEnergyLimit) return cross;
179
180 DefineMaterial(CurrentCouple());
181
182 //Total Cross section
183 Mottcross->SetupKinematic(kinEnergy, Z);
184 cross = Mottcross->NuclearCrossSection(FormFactor,XSectionModel);
185
186 //cout<< "Compute Cross Section....cross "<<G4BestUnit(cross,"Surface") << " cm2 "<< cross/cm2 <<" Z: "<<Z<<" kinEnergy: "<<kinEnergy<<endl;
187
188 //G4cout<<"Energy: "<<kinEnergy/MeV<<" Total Cross: "<<cross<<G4endl;
189 return cross;
190}
double G4double
Definition: G4Types.hh:83
G4double NuclearCrossSection(G4int form, G4int fast)
void SetupKinematic(G4double kinEnergy, G4int Z)
const G4MaterialCutsCouple * CurrentCouple() const
Definition: G4VEmModel.hh:480

◆ Initialise()

void G4eSingleCoulombScatteringModel::Initialise ( const G4ParticleDefinition p,
const G4DataVector cuts 
)
finalvirtual

Implements G4VEmModel.

Definition at line 110 of file G4eSingleCoulombScatteringModel.cc.

112{
114
115 SetupParticle(p);
116 currentCouple = nullptr;
117 currentMaterialIndex = -1;
118 //cosThetaMin = cos(PolarAngleLimit());
119 Mottcross->Initialise(p,cosThetaMin);
120
121 pCuts = &cuts;
122 //G4ProductionCutsTable::GetProductionCutsTable()->GetEnergyCutsVector(3);
123
124 /*
125 G4cout << "!!! G4eSingleCoulombScatteringModel::Initialise for "
126 << part->GetParticleName() << " cos(TetMin)= " << cosThetaMin
127 << " cos(TetMax)= " << cosThetaMax <<G4endl;
128 G4cout << "cut= " << (*pCuts)[0] << " cut1= " << (*pCuts)[1] << G4endl;
129 */
130
131 if(!fParticleChange) {
132 fParticleChange = GetParticleChangeForGamma();
133 }
134
135 if(IsMaster()) {
137 }
138
139 FormFactor=param->NuclearFormfactorType();
140
141 //G4cout<<"NUCLEAR FORM FACTOR: "<<FormFactor<<G4endl;
142}
static G4EmParameters * Instance()
G4NuclearFormfactorType NuclearFormfactorType() const
void Initialise(const G4ParticleDefinition *, G4double cosThetaLim)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:133
G4bool IsMaster() const
Definition: G4VEmModel.hh:736
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
Definition: G4VEmModel.cc:148

◆ InitialiseLocal()

void G4eSingleCoulombScatteringModel::InitialiseLocal ( const G4ParticleDefinition ,
G4VEmModel masterModel 
)
finalvirtual

Reimplemented from G4VEmModel.

Definition at line 147 of file G4eSingleCoulombScatteringModel.cc.

149{
151}
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
Definition: G4VEmModel.hh:842
std::vector< G4EmElementSelector * > * GetElementSelectors()
Definition: G4VEmModel.hh:834

◆ SampleSecondaries()

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

Implements G4VEmModel.

Definition at line 194 of file G4eSingleCoulombScatteringModel.cc.

200{
201 G4double kinEnergy = dp->GetKineticEnergy();
202 //cout<<"--- kinEnergy "<<kinEnergy<<endl;
203
204 if(kinEnergy < lowEnergyLimit) return;
205
206 DefineMaterial(couple);
207 SetupParticle(dp->GetDefinition());
208
209 // Choose nucleus
210 //last two :cutEnergy= min e kinEnergy=max
211 currentElement = SelectTargetAtom(couple, particle, kinEnergy,
212 dp->GetLogKineticEnergy(), cutEnergy, kinEnergy);
213 G4int iz = currentElement->GetZasInt();
214 G4int ia = SelectIsotopeNumber(currentElement);
216
217 //G4cout<<"..Z: "<<Z<<" ..iz: "<<iz<<" ..ia: "<<ia<<" ..mass2: "<<mass2<<G4endl;
218
219 Mottcross->SetupKinematic(kinEnergy, iz);
220 G4double cross= Mottcross->NuclearCrossSection(FormFactor,XSectionModel);
221 if(cross == 0.0) { return; }
222 //cout<< "Energy: "<<kinEnergy/MeV<<" Z: "<<Z<<"....cross "<<G4BestUnit(cross,"Surface") << " cm2 "<< cross/cm2 <<endl;
223
224 G4double z1 = Mottcross->GetScatteringAngle(FormFactor,XSectionModel);
225 G4double sint = sin(z1);
226 G4double cost = cos(z1);
227 G4double phi = twopi* G4UniformRand();
228
229 // kinematics in the Lab system
230 G4double ptot = sqrt(kinEnergy*(kinEnergy + 2.0*mass));
231 G4double e1 = mass + kinEnergy;
232
233 // Lab. system kinematics along projectile direction
234 G4LorentzVector v0 = G4LorentzVector(0, 0, ptot, e1+mass2);
235 G4LorentzVector v1 = G4LorentzVector(0, 0, ptot, e1);
236 G4ThreeVector bst = v0.boostVector();
237 v1.boost(-bst);
238 // CM projectile
239 G4double momCM = v1.pz();
240
241 // Momentum after scattering of incident particle
242 v1.setX(momCM*sint*cos(phi));
243 v1.setY(momCM*sint*sin(phi));
244 v1.setZ(momCM*cost);
245
246 // CM--->Lab
247 v1.boost(bst);
248
249 // Rotate to global system
251 G4ThreeVector newDirection = v1.vect().unit();
252 newDirection.rotateUz(dir);
253
254 fParticleChange->ProposeMomentumDirection(newDirection);
255
256 // recoil
257 v0 -= v1;
258 G4double trec = std::max(v0.e() - mass2, 0.0);
259 G4double edep = 0.0;
260
261 G4double tcut = recoilThreshold;
262
263 //G4cout<<" Energy Transfered: "<<trec/eV<<G4endl;
264
265 if(pCuts) {
266 tcut= std::max(tcut,(*pCuts)[currentMaterialIndex]);
267 //G4cout<<"Cuts: "<<(*pCuts)[currentMaterialIndex]/eV<<" eV"<<G4endl;
268 //G4cout<<"Threshold: "<<tcut/eV<<" eV"<<G4endl;
269 }
270
271 if(trec > tcut) {
272 G4ParticleDefinition* ion = theIonTable->GetIon(iz, ia, 0);
273 newDirection = v0.vect().unit();
274 newDirection.rotateUz(dir);
275 G4DynamicParticle* newdp = new G4DynamicParticle(ion, newDirection, trec);
276 fvect->push_back(newdp);
277 } else if(trec > 0.0) {
278 edep = trec;
279 fParticleChange->ProposeNonIonizingEnergyDeposit(edep);
280 }
281
282 // finelize primary energy and energy balance
283 G4double finalT = v1.e() - mass;
284 //G4cout<<"Final Energy: "<<finalT/eV<<G4endl;
285 if(finalT <= lowEnergyLimit) {
286 edep += finalT;
287 finalT = 0.0;
288 }
289 edep = std::max(edep, 0.0);
290 fParticleChange->SetProposedKineticEnergy(finalT);
291 fParticleChange->ProposeLocalEnergyDeposit(edep);
292
293}
CLHEP::HepLorentzVector G4LorentzVector
int G4int
Definition: G4Types.hh:85
#define G4UniformRand()
Definition: Randomize.hh:52
Hep3Vector unit() const
Hep3Vector & rotateUz(const Hep3Vector &)
Definition: ThreeVector.cc:33
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
Hep3Vector vect() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetLogKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4int GetZasInt() const
Definition: G4Element.hh:131
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522
static G4double GetNuclearMass(const G4double A, const G4double Z)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetScatteringAngle(G4int form, G4int fast)
G4int SelectIsotopeNumber(const G4Element *)
Definition: G4VEmModel.cc:337
const G4Element * SelectTargetAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.hh:587
void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)

◆ SetRecoilThreshold()

void G4eSingleCoulombScatteringModel::SetRecoilThreshold ( G4double  eth)
inline

Definition at line 157 of file G4eSingleCoulombScatteringModel.hh.

158{
159 recoilThreshold = eth;
160}

◆ SetXSectionModel()

void G4eSingleCoulombScatteringModel::SetXSectionModel ( const G4String model)

Definition at line 155 of file G4eSingleCoulombScatteringModel.cc.

156{
157 if(model == "Fast" || model == "fast") { XSectionModel=1; }
158 else if(model == "Precise" || model == "precise") { XSectionModel=0; }
159 else {
160 G4cout<<"G4eSingleCoulombScatteringModel WARNING: "<<model
161 <<" is not a valid model name"<<G4endl;
162 }
163}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

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