Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 94676 2015-12-02 09:51:20Z gunter $
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 
47 #include "globals.hh"
48 #include "G4HadronElastic.hh"
49 #include "G4HadProjectile.hh"
50 #include "G4Nucleus.hh"
51 
52 #include "G4Pow.hh"
53 
54 
56 class G4PhysicsTable;
57 class G4PhysicsLogVector;
58 
59 class G4DiffuseElastic : public G4HadronElastic // G4HadronicInteraction
60 {
61 public:
62 
64 
65  // G4DiffuseElastic(const G4ParticleDefinition* aParticle);
66 
67 
68 
69 
70 
71  virtual ~G4DiffuseElastic();
72 
73  virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/,
74  G4Nucleus & /*targetNucleus*/);
75 
76  void Initialise();
77 
79 
80  void BuildAngleTable();
81 
82 
83  // G4HadFinalState* ApplyYourself(const G4HadProjectile & aTrack, G4Nucleus & targetNucleus);
84 
86  G4double plab,
87  G4int Z, G4int A);
88 
90 
92 
93  void SetHEModelLowLimit(G4double value);
94 
95  void SetQModelLowLimit(G4double value);
96 
97  void SetLowestEnergyLimit(G4double value);
98 
100 
101  G4double SampleT(const G4ParticleDefinition* aParticle,
102  G4double p, G4double A);
103 
104  G4double SampleTableT(const G4ParticleDefinition* aParticle,
105  G4double p, G4double Z, G4double A);
106 
108 
110  G4double Z, G4double A);
111 
113 
114  G4double SampleThetaLab(const G4HadProjectile* aParticle,
115  G4double tmass, G4double A);
116 
118  G4double theta,
119  G4double momentum,
120  G4double A );
121 
123  G4double theta,
124  G4double momentum,
125  G4double A, G4double Z );
126 
128  G4double theta,
129  G4double momentum,
130  G4double A, G4double Z );
131 
133  G4double tMand,
134  G4double momentum,
135  G4double A, G4double Z );
136 
138  G4double theta,
139  G4double momentum,
140  G4double A );
141 
142 
144  G4double theta,
145  G4double momentum,
146  G4double Z );
147 
149  G4double tMand,
150  G4double momentum,
151  G4double A, G4double Z );
152 
154  G4double momentum, G4double Z );
155 
157  G4double momentum, G4double Z,
158  G4double theta1, G4double theta2 );
159 
160 
162  G4double momentum );
163 
165 
167 
169 
171  G4double tmass, G4double thetaCMS);
172 
174  G4double tmass, G4double thetaLab);
175 
176  void TestAngleTable(const G4ParticleDefinition* theParticle, G4double partMom,
177  G4double Z, G4double A);
178 
179 
180 
185 
190 
191 
192  G4double GetNuclearRadius(){return fNuclearRadius;};
193 
194 private:
195 
196 
197  G4ParticleDefinition* theProton;
198  G4ParticleDefinition* theNeutron;
199  G4ParticleDefinition* theDeuteron;
200  G4ParticleDefinition* theAlpha;
201 
202  const G4ParticleDefinition* thePionPlus;
203  const G4ParticleDefinition* thePionMinus;
204 
205  G4double lowEnergyRecoilLimit;
206  G4double lowEnergyLimitHE;
207  G4double lowEnergyLimitQ;
208  G4double lowestEnergyLimit;
209  G4double plabLowLimit;
210 
211  G4int fEnergyBin;
212  G4int fAngleBin;
213 
214  G4PhysicsLogVector* fEnergyVector;
215  G4PhysicsTable* fAngleTable;
216  std::vector<G4PhysicsTable*> fAngleBank;
217 
218  std::vector<G4double> fElementNumberVector;
219  std::vector<G4String> fElementNameVector;
220 
221  const G4ParticleDefinition* fParticle;
222  G4double fWaveVector;
223  G4double fAtomicWeight;
224  G4double fAtomicNumber;
225  G4double fNuclearRadius;
226  G4double fBeta;
227  G4double fZommerfeld;
228  G4double fAm;
229  G4bool fAddCoulomb;
230 
231 };
232 
234  G4Nucleus & nucleus)
235 {
236  if( ( projectile.GetDefinition() == G4Proton::Proton() ||
237  projectile.GetDefinition() == G4Neutron::Neutron() ||
238  projectile.GetDefinition() == G4PionPlus::PionPlus() ||
239  projectile.GetDefinition() == G4PionMinus::PionMinus() ||
240  projectile.GetDefinition() == G4KaonPlus::KaonPlus() ||
241  projectile.GetDefinition() == G4KaonMinus::KaonMinus() ) &&
242 
243  nucleus.GetZ_asInt() >= 2 ) return true;
244  else return false;
245 }
246 
248 {
249  lowEnergyRecoilLimit = value;
250 }
251 
253 {
254  plabLowLimit = value;
255 }
256 
258 {
259  lowEnergyLimitHE = value;
260 }
261 
263 {
264  lowEnergyLimitQ = value;
265 }
266 
268 {
269  lowestEnergyLimit = value;
270 }
271 
272 
274 //
275 // Bessel J0 function based on rational approximation from
276 // J.F. Hart, Computer Approximations, New York, Willey 1968, p. 141
277 
279 {
280  G4double modvalue, value2, fact1, fact2, arg, shift, bessel;
281 
282  modvalue = std::fabs(value);
283 
284  if ( value < 8.0 && value > -8.0 )
285  {
286  value2 = value*value;
287 
288  fact1 = 57568490574.0 + value2*(-13362590354.0
289  + value2*( 651619640.7
290  + value2*(-11214424.18
291  + value2*( 77392.33017
292  + value2*(-184.9052456 ) ) ) ) );
293 
294  fact2 = 57568490411.0 + value2*( 1029532985.0
295  + value2*( 9494680.718
296  + value2*(59272.64853
297  + value2*(267.8532712
298  + value2*1.0 ) ) ) );
299 
300  bessel = fact1/fact2;
301  }
302  else
303  {
304  arg = 8.0/modvalue;
305 
306  value2 = arg*arg;
307 
308  shift = modvalue-0.785398164;
309 
310  fact1 = 1.0 + value2*(-0.1098628627e-2
311  + value2*(0.2734510407e-4
312  + value2*(-0.2073370639e-5
313  + value2*0.2093887211e-6 ) ) );
314 
315  fact2 = -0.1562499995e-1 + value2*(0.1430488765e-3
316  + value2*(-0.6911147651e-5
317  + value2*(0.7621095161e-6
318  - value2*0.934945152e-7 ) ) );
319 
320  bessel = std::sqrt(0.636619772/modvalue)*(std::cos(shift)*fact1 - arg*std::sin(shift)*fact2 );
321  }
322  return bessel;
323 }
324 
326 //
327 // Bessel J1 function based on rational approximation from
328 // J.F. Hart, Computer Approximations, New York, Willey 1968, p. 141
329 
331 {
332  G4double modvalue, value2, fact1, fact2, arg, shift, bessel;
333 
334  modvalue = std::fabs(value);
335 
336  if ( modvalue < 8.0 )
337  {
338  value2 = value*value;
339 
340  fact1 = value*(72362614232.0 + value2*(-7895059235.0
341  + value2*( 242396853.1
342  + value2*(-2972611.439
343  + value2*( 15704.48260
344  + value2*(-30.16036606 ) ) ) ) ) );
345 
346  fact2 = 144725228442.0 + value2*(2300535178.0
347  + value2*(18583304.74
348  + value2*(99447.43394
349  + value2*(376.9991397
350  + value2*1.0 ) ) ) );
351  bessel = fact1/fact2;
352  }
353  else
354  {
355  arg = 8.0/modvalue;
356 
357  value2 = arg*arg;
358 
359  shift = modvalue - 2.356194491;
360 
361  fact1 = 1.0 + value2*( 0.183105e-2
362  + value2*(-0.3516396496e-4
363  + value2*(0.2457520174e-5
364  + value2*(-0.240337019e-6 ) ) ) );
365 
366  fact2 = 0.04687499995 + value2*(-0.2002690873e-3
367  + value2*( 0.8449199096e-5
368  + value2*(-0.88228987e-6
369  + value2*0.105787412e-6 ) ) );
370 
371  bessel = std::sqrt( 0.636619772/modvalue)*(std::cos(shift)*fact1 - arg*std::sin(shift)*fact2);
372 
373  if (value < 0.0) bessel = -bessel;
374  }
375  return bessel;
376 }
377 
379 //
380 // damp factor in diffraction x/sh(x), x was already *pi
381 
383 {
384  G4double df;
385  G4double f2 = 2., f3 = 6., f4 = 24.; // first factorials
386 
387  // x *= pi;
388 
389  if( std::fabs(x) < 0.01 )
390  {
391  df = 1./(1. + x/f2 + x*x/f3 + x*x*x/f4);
392  }
393  else
394  {
395  df = x/std::sinh(x);
396  }
397  return df;
398 }
399 
400 
402 //
403 // return J1(x)/x with special case for small x
404 
406 {
407  G4double x2, result;
408 
409  if( std::fabs(x) < 0.01 )
410  {
411  x *= 0.5;
412  x2 = x*x;
413  result = 2. - x2 + x2*x2/6.;
414  }
415  else
416  {
417  result = BesselJone(x)/x;
418  }
419  return result;
420 }
421 
423 //
424 // return particle beta
425 
427  G4double momentum )
428 {
429  G4double mass = particle->GetPDGMass();
430  G4double a = momentum/mass;
431  fBeta = a/std::sqrt(1+a*a);
432 
433  return fBeta;
434 }
435 
437 //
438 // return Zommerfeld parameter for Coulomb scattering
439 
441 {
442  fZommerfeld = CLHEP::fine_structure_const*Z1*Z2/beta;
443 
444  return fZommerfeld;
445 }
446 
448 //
449 // return Wentzel correction for Coulomb scattering
450 
452 {
453  G4double k = momentum/CLHEP::hbarc;
454  G4double ch = 1.13 + 3.76*n*n;
455  G4double zn = 1.77*k*(1.0/G4Pow::GetInstance()->A13(Z))*CLHEP::Bohr_radius;
456  G4double zn2 = zn*zn;
457  fAm = ch/zn2;
458 
459  return fAm;
460 }
461 
463 //
464 // calculate nuclear radius for different atomic weights using different approximations
465 
467 {
468  G4double R, r0, a11, a12, a13, a2, a3;
469 
470  a11 = 1.26; // 1.08, 1.16
471  a12 = 1.; // 1.08, 1.16
472  a13 = 1.12; // 1.08, 1.16
473  a2 = 1.1;
474  a3 = 1.;
475 
476  // Special rms radii for light nucleii
477 
478  if (A < 50.)
479  {
480  if (std::abs(A-1.) < 0.5) return 0.89*CLHEP::fermi; // p
481  else if(std::abs(A-2.) < 0.5) return 2.13*CLHEP::fermi; // d
482  else if( // std::abs(Z-1.) < 0.5 &&
483 std::abs(A-3.) < 0.5) return 1.80*CLHEP::fermi; // t
484 
485  // else if(std::abs(Z-2.) < 0.5 && std::abs(A-3.) < 0.5) return 1.96CLHEP::fermi; // He3
486  else if( // std::abs(Z-2.) < 0.5 &&
487 std::abs(A-4.) < 0.5) return 1.68*CLHEP::fermi; // He4
488 
489  else if( // std::abs(Z-3.) < 0.5
490  std::abs(A-7.) < 0.5 ) return 2.40*CLHEP::fermi; // Li7
491  else if( // std::abs(Z-4.) < 0.5
492 std::abs(A-9.) < 0.5) return 2.51*CLHEP::fermi; // Be9
493 
494  else if( 10. < A && A <= 16. ) r0 = a11*( 1 - (1.0/G4Pow::GetInstance()->A23(A)) )*CLHEP::fermi; // 1.08CLHEP::fermi;
495  else if( 15. < A && A <= 20. ) r0 = a12*( 1 - (1.0/G4Pow::GetInstance()->A23(A)) )*CLHEP::fermi;
496  else if( 20. < A && A <= 30. ) r0 = a13*( 1 - (1.0/G4Pow::GetInstance()->A23(A)) )*CLHEP::fermi;
497  else r0 = a2*CLHEP::fermi;
498 
499  R = r0*G4Pow::GetInstance()->A13(A);
500  }
501  else
502  {
503  r0 = a3*CLHEP::fermi;
504 
505  R = r0*G4Pow::GetInstance()->powA(A, 0.27);
506  }
507  fNuclearRadius = R;
508  return R;
509  /*
510  G4double r0;
511  if( A < 50. )
512  {
513  if( A > 10. ) r0 = 1.16*( 1 - (1.0/G4Pow::GetInstance()->A23(A)) )*CLHEP::fermi; // 1.08CLHEP::fermi;
514  else r0 = 1.1*CLHEP::fermi;
515  fNuclearRadius = r0*G4Pow::GetInstance()->A13(A);
516  }
517  else
518  {
519  r0 = 1.7*CLHEP::fermi; // 1.7*CLHEP::fermi;
520  fNuclearRadius = r0*G4Pow::GetInstance()->powA(A, 0.27); // 0.27);
521  }
522  return fNuclearRadius;
523  */
524 }
525 
527 //
528 // return Coulomb scattering differential xsc with Wentzel correction
529 
531  G4double theta,
532  G4double momentum,
533  G4double Z )
534 {
535  G4double sinHalfTheta = std::sin(0.5*theta);
536  G4double sinHalfTheta2 = sinHalfTheta*sinHalfTheta;
537  G4double beta = CalculateParticleBeta( particle, momentum);
538  G4double z = particle->GetPDGCharge();
539  G4double n = CalculateZommerfeld( beta, z, Z );
540  G4double am = CalculateAm( momentum, n, Z);
541  G4double k = momentum/CLHEP::hbarc;
542  G4double ch = 0.5*n/k;
543  G4double ch2 = ch*ch;
544  G4double xsc = ch2/(sinHalfTheta2+am)/(sinHalfTheta2+am);
545 
546  return xsc;
547 }
548 
549 
551 //
552 // return Coulomb scattering total xsc with Wentzel correction
553 
555  G4double momentum, G4double Z )
556 {
557  G4double beta = CalculateParticleBeta( particle, momentum);
558  G4cout<<"beta = "<<beta<<G4endl;
559  G4double z = particle->GetPDGCharge();
560  G4double n = CalculateZommerfeld( beta, z, Z );
561  G4cout<<"fZomerfeld = "<<n<<G4endl;
562  G4double am = CalculateAm( momentum, n, Z);
563  G4cout<<"cof Am = "<<am<<G4endl;
564  G4double k = momentum/CLHEP::hbarc;
565  G4cout<<"k = "<<k*CLHEP::fermi<<" 1/fermi"<<G4endl;
566  G4cout<<"k*Bohr_radius = "<<k*CLHEP::Bohr_radius<<G4endl;
567  G4double ch = n/k;
568  G4double ch2 = ch*ch;
569  G4double xsc = ch2*CLHEP::pi/(am +am*am);
570 
571  return xsc;
572 }
573 
575 //
576 // return Coulomb scattering xsc with Wentzel correction integrated between
577 // theta1 and < theta2
578 
580  G4double momentum, G4double Z,
581  G4double theta1, G4double theta2 )
582 {
583  G4double c1 = std::cos(theta1);
584  G4cout<<"c1 = "<<c1<<G4endl;
585  G4double c2 = std::cos(theta2);
586  G4cout<<"c2 = "<<c2<<G4endl;
587  G4double beta = CalculateParticleBeta( particle, momentum);
588  // G4cout<<"beta = "<<beta<<G4endl;
589  G4double z = particle->GetPDGCharge();
590  G4double n = CalculateZommerfeld( beta, z, Z );
591  // G4cout<<"fZomerfeld = "<<n<<G4endl;
592  G4double am = CalculateAm( momentum, n, Z);
593  // G4cout<<"cof Am = "<<am<<G4endl;
594  G4double k = momentum/CLHEP::hbarc;
595  // G4cout<<"k = "<<k*CLHEP::fermi<<" 1/fermi"<<G4endl;
596  // G4cout<<"k*Bohr_radius = "<<k*CLHEP::Bohr_radius<<G4endl;
597  G4double ch = n/k;
598  G4double ch2 = ch*ch;
599  am *= 2.;
600  G4double xsc = ch2*CLHEP::twopi*(c1-c2);
601  xsc /= (1 - c1 + am)*(1 - c2 + am);
602 
603  return xsc;
604 }
605 
606 #endif
G4double ThetaCMStoThetaLab(const G4DynamicParticle *aParticle, G4double tmass, G4double thetaCMS)
G4double G4ParticleHPJENDLHEData::G4double result
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
static c2_factory< G4double > c2
G4double IntegralElasticProb(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double A)
G4double CalculateNuclearRad(G4double A)
G4double CalculateZommerfeld(G4double beta, G4double Z1, G4double Z2)
G4double GetCoulombTotalXsc(const G4ParticleDefinition *particle, G4double momentum, G4double Z)
G4double BesselJzero(G4double z)
static constexpr double Bohr_radius
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
void InitialiseOnFly(G4double Z, G4double A)
static constexpr double hbarc
G4double GetInvElasticXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double A, G4double Z)
const char * p
Definition: xmltok.h:285
G4double NeutronTuniform(G4int Z)
tuple x
Definition: test.py:50
G4double GetDiffElasticSumProb(G4double theta)
G4double SampleThetaCMS(const G4ParticleDefinition *aParticle, G4double p, G4double A)
G4double GetScatteringAngle(G4int iMomentum, G4int iAngle, G4double position)
G4double BesselJone(G4double z)
G4double SampleT(const G4ParticleDefinition *aParticle, G4double p, G4double A)
int G4int
Definition: G4Types.hh:78
G4double SampleTableT(const G4ParticleDefinition *aParticle, G4double p, G4double Z, G4double A)
G4double SampleThetaLab(const G4HadProjectile *aParticle, G4double tmass, G4double A)
G4double GetCoulombElasticXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double Z)
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
void SetLowestEnergyLimit(G4double value)
G4double CalculateAm(G4double momentum, G4double n, G4double Z)
void SetRecoilKinEnergyLimit(G4double value)
G4double A23(G4double A) const
Definition: G4Pow.hh:160
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
const XML_Char int const XML_Char * value
Definition: expat.h:331
const G4ParticleDefinition * GetDefinition() const
virtual ~G4DiffuseElastic()
G4double GetDiffElasticProb(G4double theta)
bool G4bool
Definition: G4Types.hh:79
void SetQModelLowLimit(G4double value)
static G4Proton * Proton()
Definition: G4Proton.cc:93
G4double GetNuclearRadius()
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
G4double GetDiffuseElasticXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double A)
void TestAngleTable(const G4ParticleDefinition *theParticle, G4double partMom, G4double Z, G4double A)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
const G4int n
G4double DampFactor(G4double z)
G4double GetPDGMass() const
G4double A13(G4double A) const
Definition: G4Pow.hh:132
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
G4double GetInvElasticSumXsc(const G4ParticleDefinition *particle, G4double tMand, G4double momentum, G4double A, G4double Z)
G4int GetZ_asInt() const
Definition: G4Nucleus.hh:115
G4double GetDiffElasticSumProbA(G4double alpha)
static constexpr double fermi
Definition: SystemOfUnits.h:83
tuple z
Definition: test.py:28
G4double GetCoulombIntegralXsc(const G4ParticleDefinition *particle, G4double momentum, G4double Z, G4double theta1, G4double theta2)
G4double GetDiffuseElasticSumXsc(const G4ParticleDefinition *particle, G4double theta, G4double momentum, G4double A, G4double Z)
G4double CalculateParticleBeta(const G4ParticleDefinition *particle, G4double momentum)
#define G4endl
Definition: G4ios.hh:61
G4double BesselOneByArg(G4double z)
G4double ThetaLabToThetaCMS(const G4DynamicParticle *aParticle, G4double tmass, G4double thetaLab)
G4double SampleTableThetaCMS(const G4ParticleDefinition *aParticle, G4double p, G4double Z, G4double A)
virtual G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
double G4double
Definition: G4Types.hh:76
void SetHEModelLowLimit(G4double value)
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
static constexpr double fine_structure_const
G4double GetPDGCharge() const
static const G4double alpha
void SetPlabLowLimit(G4double value)
G4double GetInvCoulombElasticXsc(const G4ParticleDefinition *particle, G4double tMand, G4double momentum, G4double A, G4double Z)
static constexpr double twopi
Definition: SystemOfUnits.h:55
virtual G4bool IsApplicable(const G4HadProjectile &, G4Nucleus &)
static constexpr double pi
Definition: SystemOfUnits.h:54
tuple c1
Definition: plottest35.py:14
G4double GetIntegrandFunction(G4double theta)