Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4WentzelVIRelXSection Class Reference

#include <G4WentzelVIRelXSection.hh>

Public Member Functions

 G4WentzelVIRelXSection ()
 
virtual ~G4WentzelVIRelXSection ()
 
void Initialise (const G4ParticleDefinition *, G4double CosThetaLim)
 
void SetupParticle (const G4ParticleDefinition *)
 
G4double SetupTarget (G4int Z, G4double cut=DBL_MAX)
 
G4double ComputeTransportCrossSectionPerAtom (G4double CosThetaMax)
 
G4ThreeVector SampleSingleScattering (G4double CosThetaMin, G4double CosThetaMax, G4double elecRatio=0.0)
 
G4double ComputeNuclearCrossSection (G4double CosThetaMin, G4double CosThetaMax)
 
G4double ComputeElectronCrossSection (G4double CosThetaMin, G4double CosThetaMax)
 
G4double SetupKinematic (G4double kinEnergy, const G4Material *mat)
 
void SetTargetMass (G4double value)
 
G4double GetMomentumSquare () const
 
G4double GetCosThetaNuc () const
 
G4double GetCosThetaElec () const
 

Detailed Description

Definition at line 71 of file G4WentzelVIRelXSection.hh.

Constructor & Destructor Documentation

G4WentzelVIRelXSection::G4WentzelVIRelXSection ( )

Definition at line 66 of file G4WentzelVIRelXSection.cc.

References python.hepunit::classic_electr_radius, G4Electron::Electron(), python.hepunit::electron_mass_c2, python.hepunit::eV, python.hepunit::fine_structure_const, G4NistManager::GetA27(), G4Pow::GetInstance(), Initialise(), G4NistManager::Instance(), python.hepunit::MeV, G4Positron::Positron(), G4Proton::Proton(), python.hepunit::proton_mass_c2, python.hepunit::twopi, test::x, and G4Pow::Z13().

66  :
67  numlimit(0.1),
68  nwarnings(0),
69  nwarnlimit(50),
71 {
72  fNistManager = G4NistManager::Instance();
73  fG4pow = G4Pow::GetInstance();
74  theElectron = G4Electron::Electron();
75  thePositron = G4Positron::Positron();
76  theProton = G4Proton::Proton();
77  lowEnergyLimit = 1.0*eV;
79  coeff = twopi*p0*p0;
80  particle = 0;
81 
82  // Thomas-Fermi screening radii
83  // Formfactors from A.V. Butkevich et al., NIM A 488 (2002) 282
84 
85  if(0.0 == ScreenRSquare[0]) {
86  G4double a0 = electron_mass_c2/0.88534;
87  G4double constn = 6.937e-6/(MeV*MeV);
88 
89  ScreenRSquare[0] = alpha2*a0*a0;
90  for(G4int j=1; j<100; ++j) {
91  G4double x = a0*fG4pow->Z13(j);
92  //ScreenRSquare[j] = 0.5*(1 + exp(-j*j*0.001))*alpha2*x*x;
93  ScreenRSquare[j] = 0.5*alpha2*x*x;
94  x = fNistManager->GetA27(j);
95  FormFactor[j] = constn*x*x;
96  }
97  }
98  currentMaterial = 0;
99  elecXSRatio = factB = factD = formfactA = screenZ = 0.0;
100  cosTetMaxElec = cosTetMaxNuc = invbeta2 = kinFactor = gam0pcmp = pcmp2 = 1.0;
101 
102  factB1= 0.5*CLHEP::pi*fine_structure_const;
103 
104  Initialise(theElectron, 1.0);
105  targetMass = proton_mass_c2;
106 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:53
G4double GetA27(G4int Z)
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
G4double Z13(G4int Z) const
Definition: G4Pow.hh:129
static G4Proton * Proton()
Definition: G4Proton.cc:93
float proton_mass_c2
Definition: hepunit.py:275
float electron_mass_c2
Definition: hepunit.py:274
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4Electron * Electron()
Definition: G4Electron.cc:94
void Initialise(const G4ParticleDefinition *, G4double CosThetaLim)
double G4double
Definition: G4Types.hh:76
G4WentzelVIRelXSection::~G4WentzelVIRelXSection ( )
virtual

Definition at line 110 of file G4WentzelVIRelXSection.cc.

111 {}

Member Function Documentation

G4double G4WentzelVIRelXSection::ComputeElectronCrossSection ( G4double  CosThetaMin,
G4double  CosThetaMax 
)
inline

Definition at line 236 of file G4WentzelVIRelXSection.hh.

References G4INCL::Math::max().

Referenced by G4hCoulombScatteringModel::ComputeCrossSectionPerAtom().

238 {
239  G4double xsec = 0.0;
240  G4double cost1 = std::max(cosTMin,cosTetMaxElec);
241  G4double cost2 = std::max(cosTMax,cosTetMaxElec);
242  if(cost1 > cost2) {
243  xsec = kinFactor*(cost1 - cost2)/((1.0 - cost1 + screenZ)*(1.0 - cost2 + screenZ));
244  }
245  return xsec;
246 }
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double G4double
Definition: G4Types.hh:76
G4double G4WentzelVIRelXSection::ComputeNuclearCrossSection ( G4double  CosThetaMin,
G4double  CosThetaMax 
)
inline

Definition at line 222 of file G4WentzelVIRelXSection.hh.

Referenced by G4hCoulombScatteringModel::ComputeCrossSectionPerAtom().

224 {
225  G4double xsec = 0.0;
226  if(cosTMax < cosTMin) {
227  xsec = targetZ*kinFactor*(cosTMin - cosTMax)/
228  ((1.0 - cosTMin + screenZ)*(1.0 - cosTMax + screenZ));
229  }
230  return xsec;
231 }
double G4double
Definition: G4Types.hh:76
G4double G4WentzelVIRelXSection::ComputeTransportCrossSectionPerAtom ( G4double  CosThetaMax)

Definition at line 193 of file G4WentzelVIRelXSection.cc.

References G4cout, G4endl, G4Log(), G4ParticleDefinition::GetParticleName(), G4INCL::Math::max(), and test::x.

Referenced by G4WentzelVIRelModel::ComputeCrossSectionPerAtom().

194 {
195  G4double xsec = 0.0;
196  if(cosTMax >= 1.0) { return xsec; }
197 
198  G4double xSection = 0.0;
199  G4double x = 0;
200  G4double y = 0;
201  G4double x1= 0;
202  G4double x2= 0;
203  G4double xlog = 0.0;
204 
205  G4double costm = std::max(cosTMax,cosTetMaxElec);
206  G4double fb = screenZ*factB;
207 
208  // scattering off electrons
209  if(costm < 1.0) {
210  x = (1.0 - costm)/screenZ;
211  if(x < numlimit) {
212  x2 = 0.5*x*x;
213  y = x2*(1.0 - 1.3333333*x + 3*x2);
214  if(0.0 < factB) { y -= fb*x2*x*(0.6666667 - x); }
215  } else {
216  x1= x/(1 + x);
217  xlog = G4Log(1.0 + x);
218  y = xlog - x1;
219  if(0.0 < factB) { y -= fb*(x + x1 - 2*xlog); }
220  }
221 
222  if(y < 0.0) {
223  ++nwarnings;
224  if(nwarnings < nwarnlimit) {
225  G4cout << "G4WentzelVIRelXSection::ComputeTransportCrossSectionPerAtom scattering on e- <0"
226  << G4endl;
227  G4cout << "y= " << y
228  << " e(MeV)= " << tkin << " p(MeV/c)= " << sqrt(mom2)
229  << " Z= " << targetZ << " "
230  << particle->GetParticleName() << G4endl;
231  G4cout << " 1-costm= " << 1.0-costm << " screenZ= " << screenZ
232  << " x= " << x << G4endl;
233  }
234  y = 0.0;
235  }
236  xSection = y;
237  }
238  /*
239  G4cout << "G4WentzelVI:XS per A " << " Z= " << targetZ
240  << " e(MeV)= " << tkin/MeV << " XSel= " << xSection
241  << " cut(MeV)= " << ecut/MeV
242  << " zmaxE= " << (1.0 - cosTetMaxElec)/screenZ
243  << " zmaxN= " << (1.0 - cosThetaMax)/screenZ
244  << " 1-costm= " << 1.0 - cosThetaMax << G4endl;
245  */
246  // scattering off nucleus
247  if(cosTMax < 1.0) {
248  x = (1.0 - cosTMax)/screenZ;
249  if(x < numlimit) {
250  x2 = 0.5*x*x;
251  y = x2*(1.0 - 1.3333333*x + 3*x2);
252  if(0.0 < factB) { y -= fb*x2*x*(0.6666667 - x); }
253  } else {
254  x1= x/(1 + x);
255  xlog = G4Log(1.0 + x);
256  y = xlog - x1;
257  if(0.0 < factB) { y -= fb*(x + x1 - 2*xlog); }
258  }
259 
260  if(y < 0.0) {
261  ++nwarnings;
262  if(nwarnings < nwarnlimit) {
263  G4cout << "G4WentzelVIRelXSection::ComputeTransportCrossSectionPerAtom scattering on e- <0"
264  << G4endl;
265  G4cout << "y= " << y
266  << " e(MeV)= " << tkin << " Z= " << targetZ << " "
267  << particle->GetParticleName() << G4endl;
268  G4cout << " formfactA= " << formfactA << " screenZ= " << screenZ
269  << " x= " << " x1= " << x1 <<G4endl;
270  }
271  y = 0.0;
272  }
273  xSection += y*targetZ;
274  }
275  xSection *= kinFactor;
276  /*
277  G4cout << "Z= " << targetZ << " XStot= " << xSection/barn
278  << " screenZ= " << screenZ << " formF= " << formfactA
279  << " for " << particle->GetParticleName()
280  << " m= " << mass << " 1/v= " << sqrt(invbeta2) << " p= " << sqrt(mom2)
281  << " x= " << x
282  << G4endl;
283  */
284  return xSection;
285 }
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double G4Log(G4double x)
Definition: G4Log.hh:227
T max(const T t1, const T t2)
brief Return the largest of the two arguments
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double G4WentzelVIRelXSection::GetCosThetaElec ( ) const
inline

Definition at line 214 of file G4WentzelVIRelXSection.hh.

215 {
216  return cosTetMaxElec;
217 }
G4double G4WentzelVIRelXSection::GetCosThetaNuc ( ) const
inline

Definition at line 207 of file G4WentzelVIRelXSection.hh.

208 {
209  return cosTetMaxNuc;
210 }
G4double G4WentzelVIRelXSection::GetMomentumSquare ( ) const
inline

Definition at line 200 of file G4WentzelVIRelXSection.hh.

Referenced by G4hCoulombScatteringModel::SampleSecondaries().

201 {
202  return mom2;
203 }
void G4WentzelVIRelXSection::Initialise ( const G4ParticleDefinition p,
G4double  CosThetaLim 
)

Definition at line 115 of file G4WentzelVIRelXSection.cc.

References test::a, DBL_MAX, G4LossTableManager::FactorForAngleLimit(), G4LossTableManager::Instance(), and SetupParticle().

Referenced by G4WentzelVIRelXSection(), G4hCoulombScatteringModel::Initialise(), and G4WentzelVIRelModel::Initialise().

117 {
118  SetupParticle(p);
119  tkin = mom2 = momCM2 = 0.0;
120  ecut = etag = DBL_MAX;
121  targetZ = 0;
122  cosThetaMax = CosThetaLim;
123  G4double a =
124  G4LossTableManager::Instance()->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi;
125  factorA2 = 0.5*a*a;
126  currentMaterial = 0;
127 }
static G4LossTableManager * Instance()
G4double FactorForAngleLimit() const
void SetupParticle(const G4ParticleDefinition *)
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4ThreeVector G4WentzelVIRelXSection::SampleSingleScattering ( G4double  CosThetaMin,
G4double  CosThetaMax,
G4double  elecRatio = 0.0 
)

Definition at line 290 of file G4WentzelVIRelXSection.cc.

References fm, G4UniformRand, G4INCL::Math::max(), CLHEP::Hep3Vector::set(), python.hepunit::twopi, and test::v.

Referenced by G4WentzelVIRelModel::SampleScattering(), and G4hCoulombScatteringModel::SampleSecondaries().

293 {
294  G4ThreeVector v(0.0,0.0,1.0);
295 
296  G4double formf = formfactA;
297  G4double cost1 = cosTMin;
298  G4double cost2 = cosTMax;
299  if(elecRatio > 0.0) {
300  if(G4UniformRand() <= elecRatio) {
301  formf = 0.0;
302  cost1 = std::max(cost1,cosTetMaxElec);
303  cost2 = std::max(cost2,cosTetMaxElec);
304  }
305  }
306  if(cost1 < cost2) { return v; }
307 
308  G4double w1 = 1. - cost1 + screenZ;
309  G4double w2 = 1. - cost2 + screenZ;
310  G4double z1 = w1*w2/(w1 + G4UniformRand()*(w2 - w1)) - screenZ;
311 
312  //G4double fm = 1.0 + formf*z1/(1.0 + (mass + tkin)*z1/targetMass);
313  G4double fm = 1.0 + formf*z1;
314  //G4double grej = (1. - z1*factB)/( (1.0 + z1*factD)*fm*fm );
315  G4double grej = (1. - z1*factB + factB1*targetZ*sqrt(z1*factB)*(2 - z1))/( (1.0 + z1*factD)*fm*fm );
316  // "false" scattering
317  if( G4UniformRand() > grej ) { return v; }
318  // }
319  G4double cost = 1.0 - z1;
320 
321  if(cost > 1.0) { cost = 1.0; }
322  else if(cost < -1.0) { cost =-1.0; }
323  G4double sint = sqrt((1.0 - cost)*(1.0 + cost));
324  //G4cout << "sint= " << sint << G4endl;
325  G4double phi = twopi*G4UniformRand();
326  G4double vx1 = sint*cos(phi);
327  G4double vy1 = sint*sin(phi);
328 
329  // only direction is changed
330  v.set(vx1,vy1,cost);
331  return v;
332 }
#define G4UniformRand()
Definition: Randomize.hh:87
#define fm
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double G4double
Definition: G4Types.hh:76
void G4WentzelVIRelXSection::SetTargetMass ( G4double  value)
inline

Definition at line 192 of file G4WentzelVIRelXSection.hh.

Referenced by G4hCoulombScatteringModel::SampleSecondaries(), and SetupTarget().

193 {
194  targetMass = value;
195  factD = std::sqrt(mom2)/value;
196 }
const XML_Char int const XML_Char * value
G4double G4WentzelVIRelXSection::SetupKinematic ( G4double  kinEnergy,
const G4Material mat 
)
inline

Definition at line 176 of file G4WentzelVIRelXSection.hh.

References G4IonisParamMat::GetInvA23(), G4Material::GetIonisation(), and G4INCL::Math::max().

Referenced by G4hCoulombScatteringModel::ComputeCrossSectionPerAtom(), G4WentzelVIRelModel::ComputeCrossSectionPerAtom(), G4WentzelVIRelModel::ComputeGeomPathLength(), G4WentzelVIRelModel::ComputeTruePathLengthLimit(), and G4WentzelVIRelModel::ComputeTrueStepLength().

177 {
178  if(ekin != tkin || mat != currentMaterial) {
179  currentMaterial = mat;
180  tkin = ekin;
181  mom2 = tkin*(tkin + 2.0*mass);
182  invbeta2 = 1.0 + mass*mass/mom2;
183  factB = spin/invbeta2;
184  cosTetMaxNuc =
185  std::max(cosThetaMax,1.-factorA2*mat->GetIonisation()->GetInvA23()/mom2);
186  }
187  return cosTetMaxNuc;
188 }
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:224
G4double GetInvA23() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void G4WentzelVIRelXSection::SetupParticle ( const G4ParticleDefinition p)

Definition at line 131 of file G4WentzelVIRelXSection.cc.

References python.hepunit::eplus, G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGMass(), and G4ParticleDefinition::GetPDGSpin().

Referenced by Initialise(), and G4hCoulombScatteringModel::SetupParticle().

132 {
133  particle = p;
134  mass = particle->GetPDGMass();
135  spin = particle->GetPDGSpin();
136  if(0.0 != spin) { spin = 0.5; }
137  G4double q = std::fabs(particle->GetPDGCharge()/eplus);
138  chargeSquare = q*q;
139  charge3 = chargeSquare*q;
140  tkin = 0.0;
141  currentMaterial = 0;
142  targetZ = 0;
143 }
const char * p
Definition: xmltok.h:285
G4double GetPDGMass() const
G4double GetPDGSpin() const
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
G4double G4WentzelVIRelXSection::SetupTarget ( G4int  Z,
G4double  cut = DBL_MAX 
)

Definition at line 148 of file G4WentzelVIRelXSection.cc.

References G4NistManager::GetAtomicMassAmu(), G4INCL::Math::min(), and SetTargetMass().

Referenced by G4hCoulombScatteringModel::ComputeCrossSectionPerAtom(), G4WentzelVIRelModel::ComputeCrossSectionPerAtom(), and G4WentzelVIRelModel::SampleScattering().

149 {
150  G4double cosTetMaxNuc2 = cosTetMaxNuc;
151  if(Z != targetZ || tkin != etag) {
152  etag = tkin;
153  targetZ = Z;
154  if(targetZ > 99) { targetZ = 99; }
155  SetTargetMass(fNistManager->GetAtomicMassAmu(targetZ)*CLHEP::amu_c2);
156  //G4double tmass2 = targetMass*targetMass;
157  //G4double etot = tkin + mass;
158  //G4double invmass2 = mass*mass + tmass2 + 2*etot*targetMass;
159  //momCM2 = mom2*tmass2/invmass2;
160  //gam0pcmp = (etot + targetMass)*targetMass/invmass2;
161  //pcmp2 = tmass2/invmass2;
162 
163  kinFactor = coeff*targetZ*chargeSquare*invbeta2/mom2;
164 
165  screenZ = ScreenRSquare[targetZ]/mom2;
166  if(Z > 1) {
167  screenZ *= std::min(Z*1.13,1.13 +3.76*Z*Z*invbeta2*alpha2*chargeSquare);
168  /*
169  if(mass > MeV) {
170  screenZ *= std::min(Z*1.13,1.13 +3.76*Z*Z*invbeta2*alpha2*chargeSquare);
171  } else {
172  G4double tau = tkin/mass;
173  // screenZ *= std::min(Z*invbeta2,
174  screenZ *= std::min(Z*1.13,
175  (1.13 +3.76*Z*Z*invbeta2*alpha2*std::sqrt(tau/(tau + fG4pow->Z23(Z)))));
176  }
177  */
178  }
179  if(targetZ == 1 && cosTetMaxNuc2 < 0.0 && particle == theProton) {
180  cosTetMaxNuc2 = 0.0;
181  }
182  formfactA = FormFactor[targetZ]*mom2;
183 
184  cosTetMaxElec = 1.0;
185  ComputeMaxElectronScattering(cut);
186  }
187  return cosTetMaxNuc2;
188 }
G4double GetAtomicMassAmu(const G4String &symb) const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double G4double
Definition: G4Types.hh:76
void SetTargetMass(G4double value)

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