Geant4  10.01
G4DiffuseElastic.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4DiffuseElastic.hh 82596 2014-06-30 08:59:33Z gcosmo $
28 //
29 // Author: V. Grichine (Vladimir,Grichine@cern.ch)
30 //
31 //
32 // G4 Model: diffuse optical elastic scattering with 4-momentum balance
33 //
34 // Class Description
35 // Final state production model for hadron nuclear elastic scattering;
36 // Class Description - End
37 //
38 //
39 // 24.05.07 V. Grichine, first implementation for hadron (no Coulomb) elastic scattering
40 // 04.09.07 V. Grichine, implementation for Coulomb elastic scattering
41 // 12.06.11 V. Grichine, new interface to G4hadronElastic
42 
43 #ifndef G4DiffuseElastic_h
44 #define G4DiffuseElastic_h 1
45 
46 #include <CLHEP/Units/PhysicalConstants.h>
47 #include "globals.hh"
48 #include "G4HadronElastic.hh"
49 #include "G4HadProjectile.hh"
50 #include "G4Nucleus.hh"
51 
52 using namespace std;
53 
55 class G4PhysicsTable;
56 class G4PhysicsLogVector;
57 
58 class G4DiffuseElastic : public G4HadronElastic // G4HadronicInteraction
59 {
60 public:
61 
63 
64  // G4DiffuseElastic(const G4ParticleDefinition* aParticle);
65 
66 
67 
68 
69 
70  virtual ~G4DiffuseElastic();
71 
72  virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/,
73  G4Nucleus & /*targetNucleus*/);
74 
75  void Initialise();
76 
77  void InitialiseOnFly(G4double Z, G4double A);
78 
79  void BuildAngleTable();
80 
81 
82  // G4HadFinalState* ApplyYourself(const G4HadProjectile & aTrack, G4Nucleus & targetNucleus);
83 
84  virtual G4double SampleInvariantT(const G4ParticleDefinition* p,
85  G4double plab,
86  G4int Z, G4int A);
87 
88  void SetPlabLowLimit(G4double value);
89 
90  void SetHEModelLowLimit(G4double value);
91 
92  void SetQModelLowLimit(G4double value);
93 
94  void SetLowestEnergyLimit(G4double value);
95 
96  void SetRecoilKinEnergyLimit(G4double value);
97 
98  G4double SampleT(const G4ParticleDefinition* aParticle,
99  G4double p, G4double A);
100 
101  G4double SampleTableT(const G4ParticleDefinition* aParticle,
102  G4double p, G4double Z, G4double A);
103 
104  G4double SampleThetaCMS(const G4ParticleDefinition* aParticle, G4double p, G4double A);
105 
106  G4double SampleTableThetaCMS(const G4ParticleDefinition* aParticle, G4double p,
107  G4double Z, G4double A);
108 
109  G4double GetScatteringAngle(G4int iMomentum, G4int iAngle, G4double position);
110 
111  G4double SampleThetaLab(const G4HadProjectile* aParticle,
112  G4double tmass, G4double A);
113 
114  G4double GetDiffuseElasticXsc( const G4ParticleDefinition* particle,
115  G4double theta,
116  G4double momentum,
117  G4double A );
118 
119  G4double GetInvElasticXsc( const G4ParticleDefinition* particle,
120  G4double theta,
121  G4double momentum,
122  G4double A, G4double Z );
123 
124  G4double GetDiffuseElasticSumXsc( const G4ParticleDefinition* particle,
125  G4double theta,
126  G4double momentum,
127  G4double A, G4double Z );
128 
129  G4double GetInvElasticSumXsc( const G4ParticleDefinition* particle,
130  G4double tMand,
131  G4double momentum,
132  G4double A, G4double Z );
133 
134  G4double IntegralElasticProb( const G4ParticleDefinition* particle,
135  G4double theta,
136  G4double momentum,
137  G4double A );
138 
139 
140  G4double GetCoulombElasticXsc( const G4ParticleDefinition* particle,
141  G4double theta,
142  G4double momentum,
143  G4double Z );
144 
145  G4double GetInvCoulombElasticXsc( const G4ParticleDefinition* particle,
146  G4double tMand,
147  G4double momentum,
148  G4double A, G4double Z );
149 
150  G4double GetCoulombTotalXsc( const G4ParticleDefinition* particle,
151  G4double momentum, G4double Z );
152 
153  G4double GetCoulombIntegralXsc( const G4ParticleDefinition* particle,
154  G4double momentum, G4double Z,
155  G4double theta1, G4double theta2 );
156 
157 
158  G4double CalculateParticleBeta( const G4ParticleDefinition* particle,
159  G4double momentum );
160 
161  G4double CalculateZommerfeld( G4double beta, G4double Z1, G4double Z2 );
162 
163  G4double CalculateAm( G4double momentum, G4double n, G4double Z);
164 
165  G4double CalculateNuclearRad( G4double A);
166 
167  G4double ThetaCMStoThetaLab(const G4DynamicParticle* aParticle,
168  G4double tmass, G4double thetaCMS);
169 
170  G4double ThetaLabToThetaCMS(const G4DynamicParticle* aParticle,
171  G4double tmass, G4double thetaLab);
172 
173  void TestAngleTable(const G4ParticleDefinition* theParticle, G4double partMom,
174  G4double Z, G4double A);
175 
176 
177 
178  G4double BesselJzero(G4double z);
179  G4double BesselJone(G4double z);
180  G4double DampFactor(G4double z);
181  G4double BesselOneByArg(G4double z);
182 
183  G4double GetDiffElasticProb(G4double theta);
184  G4double GetDiffElasticSumProb(G4double theta);
185  G4double GetDiffElasticSumProbA(G4double alpha);
186  G4double GetIntegrandFunction(G4double theta);
187 
188 
189  G4double GetNuclearRadius(){return fNuclearRadius;};
190 
191 private:
192 
193 
194  G4ParticleDefinition* theProton;
198 
201 
207 
210 
213  std::vector<G4PhysicsTable*> fAngleBank;
214 
215  std::vector<G4double> fElementNumberVector;
216  std::vector<G4String> fElementNameVector;
217 
227 
228 };
229 
231  G4Nucleus & nucleus)
232 {
233  if( ( projectile.GetDefinition() == G4Proton::Proton() ||
234  projectile.GetDefinition() == G4Neutron::Neutron() ||
235  projectile.GetDefinition() == G4PionPlus::PionPlus() ||
236  projectile.GetDefinition() == G4PionMinus::PionMinus() ||
237  projectile.GetDefinition() == G4KaonPlus::KaonPlus() ||
238  projectile.GetDefinition() == G4KaonMinus::KaonMinus() ) &&
239 
240  nucleus.GetZ_asInt() >= 2 ) return true;
241  else return false;
242 }
243 
245 {
246  lowEnergyRecoilLimit = value;
247 }
248 
250 {
251  plabLowLimit = value;
252 }
253 
255 {
256  lowEnergyLimitHE = value;
257 }
258 
260 {
261  lowEnergyLimitQ = value;
262 }
263 
265 {
266  lowestEnergyLimit = value;
267 }
268 
269 
271 //
272 // Bessel J0 function based on rational approximation from
273 // J.F. Hart, Computer Approximations, New York, Willey 1968, p. 141
274 
276 {
277  G4double modvalue, value2, fact1, fact2, arg, shift, bessel;
278 
279  modvalue = fabs(value);
280 
281  if ( value < 8.0 && value > -8.0 )
282  {
283  value2 = value*value;
284 
285  fact1 = 57568490574.0 + value2*(-13362590354.0
286  + value2*( 651619640.7
287  + value2*(-11214424.18
288  + value2*( 77392.33017
289  + value2*(-184.9052456 ) ) ) ) );
290 
291  fact2 = 57568490411.0 + value2*( 1029532985.0
292  + value2*( 9494680.718
293  + value2*(59272.64853
294  + value2*(267.8532712
295  + value2*1.0 ) ) ) );
296 
297  bessel = fact1/fact2;
298  }
299  else
300  {
301  arg = 8.0/modvalue;
302 
303  value2 = arg*arg;
304 
305  shift = modvalue-0.785398164;
306 
307  fact1 = 1.0 + value2*(-0.1098628627e-2
308  + value2*(0.2734510407e-4
309  + value2*(-0.2073370639e-5
310  + value2*0.2093887211e-6 ) ) );
311 
312  fact2 = -0.1562499995e-1 + value2*(0.1430488765e-3
313  + value2*(-0.6911147651e-5
314  + value2*(0.7621095161e-6
315  - value2*0.934945152e-7 ) ) );
316 
317  bessel = sqrt(0.636619772/modvalue)*(cos(shift)*fact1 - arg*sin(shift)*fact2 );
318  }
319  return bessel;
320 }
321 
323 //
324 // Bessel J1 function based on rational approximation from
325 // J.F. Hart, Computer Approximations, New York, Willey 1968, p. 141
326 
328 {
329  G4double modvalue, value2, fact1, fact2, arg, shift, bessel;
330 
331  modvalue = fabs(value);
332 
333  if ( modvalue < 8.0 )
334  {
335  value2 = value*value;
336 
337  fact1 = value*(72362614232.0 + value2*(-7895059235.0
338  + value2*( 242396853.1
339  + value2*(-2972611.439
340  + value2*( 15704.48260
341  + value2*(-30.16036606 ) ) ) ) ) );
342 
343  fact2 = 144725228442.0 + value2*(2300535178.0
344  + value2*(18583304.74
345  + value2*(99447.43394
346  + value2*(376.9991397
347  + value2*1.0 ) ) ) );
348  bessel = fact1/fact2;
349  }
350  else
351  {
352  arg = 8.0/modvalue;
353 
354  value2 = arg*arg;
355 
356  shift = modvalue - 2.356194491;
357 
358  fact1 = 1.0 + value2*( 0.183105e-2
359  + value2*(-0.3516396496e-4
360  + value2*(0.2457520174e-5
361  + value2*(-0.240337019e-6 ) ) ) );
362 
363  fact2 = 0.04687499995 + value2*(-0.2002690873e-3
364  + value2*( 0.8449199096e-5
365  + value2*(-0.88228987e-6
366  + value2*0.105787412e-6 ) ) );
367 
368  bessel = sqrt( 0.636619772/modvalue)*(cos(shift)*fact1 - arg*sin(shift)*fact2);
369 
370  if (value < 0.0) bessel = -bessel;
371  }
372  return bessel;
373 }
374 
376 //
377 // damp factor in diffraction x/sh(x), x was already *pi
378 
380 {
381  G4double df;
382  G4double f2 = 2., f3 = 6., f4 = 24.; // first factorials
383 
384  // x *= pi;
385 
386  if( std::fabs(x) < 0.01 )
387  {
388  df = 1./(1. + x/f2 + x*x/f3 + x*x*x/f4);
389  }
390  else
391  {
392  df = x/std::sinh(x);
393  }
394  return df;
395 }
396 
397 
399 //
400 // return J1(x)/x with special case for small x
401 
403 {
404  G4double x2, result;
405 
406  if( std::fabs(x) < 0.01 )
407  {
408  x *= 0.5;
409  x2 = x*x;
410  result = 2. - x2 + x2*x2/6.;
411  }
412  else
413  {
414  result = BesselJone(x)/x;
415  }
416  return result;
417 }
418 
420 //
421 // return particle beta
422 
424  G4double momentum )
425 {
426  G4double mass = particle->GetPDGMass();
427  G4double a = momentum/mass;
428  fBeta = a/std::sqrt(1+a*a);
429 
430  return fBeta;
431 }
432 
434 //
435 // return Zommerfeld parameter for Coulomb scattering
436 
438 {
439  fZommerfeld = CLHEP::fine_structure_const*Z1*Z2/beta;
440 
441  return fZommerfeld;
442 }
443 
445 //
446 // return Wentzel correction for Coulomb scattering
447 
449 {
450  G4double k = momentum/CLHEP::hbarc;
451  G4double ch = 1.13 + 3.76*n*n;
452  G4double zn = 1.77*k*std::pow(Z,-1./3.)*CLHEP::Bohr_radius;
453  G4double zn2 = zn*zn;
454  fAm = ch/zn2;
455 
456  return fAm;
457 }
458 
460 //
461 // calculate nuclear radius for different atomic weights using different approximations
462 
464 {
465  G4double r0;
466 
467  if( A < 50. )
468  {
469  if( A > 10. ) r0 = 1.16*( 1 - std::pow(A, -2./3.) )*CLHEP::fermi; // 1.08*fermi;
470  else r0 = 1.1*CLHEP::fermi;
471 
472  fNuclearRadius = r0*std::pow(A, 1./3.);
473  }
474  else
475  {
476  r0 = 1.7*CLHEP::fermi; // 1.7*fermi;
477 
478  fNuclearRadius = r0*std::pow(A, 0.27); // 0.27);
479  }
480  return fNuclearRadius;
481 }
482 
484 //
485 // return Coulomb scattering differential xsc with Wentzel correction
486 
488  G4double theta,
489  G4double momentum,
490  G4double Z )
491 {
492  G4double sinHalfTheta = std::sin(0.5*theta);
493  G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta;
494  G4double beta = CalculateParticleBeta( particle, momentum);
495  G4double z = particle->GetPDGCharge();
496  G4double n = CalculateZommerfeld( beta, z, Z );
497  G4double am = CalculateAm( momentum, n, Z);
498  G4double k = momentum/CLHEP::hbarc;
499  G4double ch = 0.5*n/k;
500  G4double ch2 = ch*ch;
501  G4double xsc = ch2/(sinHalfTheta2+am)/(sinHalfTheta2+am);
502 
503  return xsc;
504 }
505 
506 
508 //
509 // return Coulomb scattering total xsc with Wentzel correction
510 
512  G4double momentum, G4double Z )
513 {
514  G4double beta = CalculateParticleBeta( particle, momentum);
515  G4cout<<"beta = "<<beta<<G4endl;
516  G4double z = particle->GetPDGCharge();
517  G4double n = CalculateZommerfeld( beta, z, Z );
518  G4cout<<"fZomerfeld = "<<n<<G4endl;
519  G4double am = CalculateAm( momentum, n, Z);
520  G4cout<<"cof Am = "<<am<<G4endl;
521  G4double k = momentum/CLHEP::hbarc;
522  G4cout<<"k = "<<k*CLHEP::fermi<<" 1/fermi"<<G4endl;
523  G4cout<<"k*Bohr_radius = "<<k*CLHEP::Bohr_radius<<G4endl;
524  G4double ch = n/k;
525  G4double ch2 = ch*ch;
526  G4double xsc = ch2*CLHEP::pi/(am +am*am);
527 
528  return xsc;
529 }
530 
532 //
533 // return Coulomb scattering xsc with Wentzel correction integrated between
534 // theta1 and < theta2
535 
537  G4double momentum, G4double Z,
538  G4double theta1, G4double theta2 )
539 {
540  G4double c1 = std::cos(theta1);
541  G4cout<<"c1 = "<<c1<<G4endl;
542  G4double c2 = std::cos(theta2);
543  G4cout<<"c2 = "<<c2<<G4endl;
544  G4double beta = CalculateParticleBeta( particle, momentum);
545  // G4cout<<"beta = "<<beta<<G4endl;
546  G4double z = particle->GetPDGCharge();
547  G4double n = CalculateZommerfeld( beta, z, Z );
548  // G4cout<<"fZomerfeld = "<<n<<G4endl;
549  G4double am = CalculateAm( momentum, n, Z);
550  // G4cout<<"cof Am = "<<am<<G4endl;
551  G4double k = momentum/CLHEP::hbarc;
552  // G4cout<<"k = "<<k*CLHEP::fermi<<" 1/fermi"<<G4endl;
553  // G4cout<<"k*Bohr_radius = "<<k*CLHEP::Bohr_radius<<G4endl;
554  G4double ch = n/k;
555  G4double ch2 = ch*ch;
556  am *= 2.;
557  G4double xsc = ch2*CLHEP::twopi*(c1-c2);
558  xsc /= (1 - c1 + am)*(1 - c2 + am);
559 
560  return xsc;
561 }
562 
563 #endif
static c2_factory< G4double > c2
G4double CalculateNuclearRad(G4double A)
G4double CalculateZommerfeld(G4double beta, G4double Z1, G4double Z2)
G4double GetCoulombTotalXsc(const G4ParticleDefinition *particle, G4double momentum, G4double Z)
static const G4double f2
G4double BesselJzero(G4double z)
G4double z
Definition: TRTMaterials.hh:39
const G4double pi
std::vector< G4String > fElementNameVector
G4double a
Definition: TRTMaterials.hh:39
G4double BesselJone(G4double z)
int G4int
Definition: G4Types.hh:78
G4double GetCoulombElasticXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double Z)
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
void SetLowestEnergyLimit(G4double value)
const G4ParticleDefinition * thePionPlus
G4double CalculateAm(G4double momentum, G4double n, G4double Z)
void SetRecoilKinEnergyLimit(G4double value)
const G4ParticleDefinition * thePionMinus
#define position
Definition: xmlparse.cc:605
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
bool G4bool
Definition: G4Types.hh:79
std::vector< G4PhysicsTable * > fAngleBank
static const G4double f4
void SetQModelLowLimit(G4double value)
static G4Proton * Proton()
Definition: G4Proton.cc:93
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
const G4int n
static const G4double c1
static const G4double A[nN]
G4ParticleDefinition * theAlpha
G4double DampFactor(G4double z)
G4PhysicsLogVector * fEnergyVector
static const G4double f3
G4double GetPDGMass() const
G4double lowEnergyRecoilLimit
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
G4int GetZ_asInt() const
Definition: G4Nucleus.hh:115
G4double GetCoulombIntegralXsc(const G4ParticleDefinition *particle, G4double momentum, G4double Z, G4double theta1, G4double theta2)
G4double CalculateParticleBeta(const G4ParticleDefinition *particle, G4double momentum)
G4ParticleDefinition * theDeuteron
#define G4endl
Definition: G4ios.hh:61
G4double BesselOneByArg(G4double z)
const G4ParticleDefinition * fParticle
double G4double
Definition: G4Types.hh:76
void SetHEModelLowLimit(G4double value)
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
G4double GetPDGCharge() const
static const G4double alpha
std::vector< G4double > fElementNumberVector
void SetPlabLowLimit(G4double value)
G4PhysicsTable * fAngleTable
virtual G4bool IsApplicable(const G4HadProjectile &, G4Nucleus &)
static const double fermi
Definition: G4SIunits.hh:93
const G4double r0
G4ParticleDefinition * theNeutron