Geant4_10
G4RKFieldIntegrator.cc
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 // G4RKFieldIntegrator
27 #include "G4RKFieldIntegrator.hh"
28 #include "G4PhysicalConstants.hh"
29 #include "G4SystemOfUnits.hh"
30 #include "G4NucleiProperties.hh"
31 #include "G4FermiMomentum.hh"
32 #include "G4NuclearFermiDensity.hh"
34 #include "G4Nucleon.hh"
35 
36 // Class G4RKFieldIntegrator
37 //*************************************************************************************************************************************
38 
39 // only theActive are propagated, nothing else
40 // only theSpectators define the field, nothing else
41 
42 void G4RKFieldIntegrator::Transport(G4KineticTrackVector &theActive, const G4KineticTrackVector &theSpectators, G4double theTimeStep)
43 {
44  (void)theActive;
45  (void)theSpectators;
46  (void)theTimeStep;
47 }
48 
49 
50 G4double G4RKFieldIntegrator::CalculateTotalEnergy(const G4KineticTrackVector& Barions)
51 {
52  const G4double Alpha = 0.25/fermi/fermi;
53  const G4double t1 = -7264.04*fermi*fermi*fermi;
54  const G4double tGamma = 87.65*fermi*fermi*fermi*fermi*fermi*fermi;
55 // const G4double Gamma = 1.676;
56  const G4double Vo = -0.498*fermi;
57  const G4double GammaY = 1.4*fermi;
58 
59  G4double Etot = 0;
60  G4int nBarion = Barions.size();
61  for(G4int c1 = 0; c1 < nBarion; c1++)
62  {
63  G4KineticTrack* p1 = Barions.operator[](c1);
64  // Ekin
65  Etot += p1->Get4Momentum().e();
66  for(G4int c2 = c1 + 1; c2 < nBarion; c2++)
67  {
68  G4KineticTrack* p2 = Barions.operator[](c2);
69  G4double r12 = (p1->GetPosition() - p2->GetPosition()).mag()*fermi;
70 
71  // Esk2
72  Etot += t1*std::pow(Alpha/pi, 3/2)*std::exp(-Alpha*r12*r12);
73 
74  // Eyuk
75  Etot += Vo*0.5/r12*std::exp(1/(4*Alpha*GammaY*GammaY))*
76  (std::exp(-r12/GammaY)*(1 - Erf(0.5/GammaY/std::sqrt(Alpha) - std::sqrt(Alpha)*r12)) -
77  std::exp( r12/GammaY)*(1 - Erf(0.5/GammaY/std::sqrt(Alpha) + std::sqrt(Alpha)*r12)));
78 
79  // Ecoul
80  Etot += 1.44*p1->GetDefinition()->GetPDGCharge()*p2->GetDefinition()->GetPDGCharge()/r12*Erf(std::sqrt(Alpha)*r12);
81 
82  // Epaul
83  Etot = 0;
84 
85  for(G4int c3 = c2 + 1; c3 < nBarion; c3++)
86  {
87  G4KineticTrack* p3 = Barions.operator[](c3);
88  G4double r13 = (p1->GetPosition() - p3->GetPosition()).mag()*fermi;
89 
90  // Esk3
91  Etot = tGamma*std::pow(4*Alpha*Alpha/3/pi/pi, 1.5)*std::exp(-Alpha*(r12*r12 + r13*r13));
92  }
93  }
94  }
95  return Etot;
96 }
97 
98 //************************************************************************************************
99 // originated from the Numerical recipes error function
100 G4double G4RKFieldIntegrator::Erf(G4double X)
101 {
102  const G4double Z1 = 1;
103  const G4double HF = Z1/2;
104  const G4double C1 = 0.56418958;
105 
106  const G4double P10 = +3.6767877;
107  const G4double Q10 = +3.2584593;
108  const G4double P11 = -9.7970465E-2;
109 
110 // static G4ThreadLocal G4double P2[5] = { 7.3738883, 6.8650185, 3.0317993, 0.56316962, 4.3187787e-5 };
111 // static G4ThreadLocal G4double Q2[5] = { 7.3739609, 15.184908, 12.79553, 5.3542168, 1. };
112  const G4double P2[5] = { 7.3738883, 6.8650185, 3.0317993, 0.56316962, 4.3187787e-5 };
113  const G4double Q2[5] = { 7.3739609, 15.184908, 12.79553, 5.3542168, 1. };
114 
115  const G4double P30 = -1.2436854E-1;
116  const G4double Q30 = +4.4091706E-1;
117  const G4double P31 = -9.6821036E-2;
118 
119  G4double V = std::abs(X);
120  G4double H;
121  G4double Y;
122  G4int c1;
123 
124  if(V < HF)
125  {
126  Y = V*V;
127  H = X*(P10 + P11*Y)/(Q10+Y);
128  }
129  else
130  {
131  if(V < 4)
132  {
133  G4double AP = P2[4];
134  G4double AQ = Q2[4];
135  for(c1 = 3; c1 >= 0; c1--)
136  {
137  AP = P2[c1] + V*AP;
138  AQ = Q2[c1] + V*AQ;
139  }
140  H = 1 - std::exp(-V*V)*AP/AQ;
141  }
142  else
143  {
144  Y = 1./V*V;
145  H = 1 - std::exp(-V*V)*(C1+Y*(P30 + P31*Y)/(Q30 + Y))/V;
146  }
147  if (X < 0)
148  H = -H;
149  }
150  return H;
151 }
152 
153 //************************************************************************************************
154 //This is a QMD version to calculate excitation energy of a fragment,
155 //which consists from G4KTV &the Particles
156 /*
157 G4double G4RKFieldIntegrator::GetExcitationEnergy(const G4KineticTrackVector &theParticles)
158 {
159  // Excitation energy of a fragment consisting from A nucleons and Z protons
160  // is Etot - Z*Mp - (A - Z)*Mn - B(A, Z), where B(A,Z) is the binding energy of fragment
161  // and Mp, Mn are proton and neutron mass, respectively.
162  G4int NZ = 0;
163  G4int NA = 0;
164  G4double Etot = CalculateTotalEnergy(theParticles);
165  for(G4int cParticle = 0; cParticle < theParticles.length(); cParticle++)
166  {
167  G4KineticTrack* pKineticTrack = theParticles.at(cParticle);
168  G4int Encoding = std::abs(pKineticTrack->GetDefinition()->GetPDGEncoding());
169  if (Encoding == 2212)
170  NZ++, NA++;
171  if (Encoding == 2112)
172  NA++;
173  Etot -= pKineticTrack->GetDefinition()->GetPDGMass();
174  }
175  return Etot - G4NucleiProperties::GetBindingEnergy(NZ, NA);
176 }
177 */
178 
179 //*************************************************************************************************************************************
180 //This is a simplified method to get excitation energy of a residual
181 // nucleus with nHitNucleons.
183 {
184  const G4double MeanE = 50;
185  G4double Sum = 0;
186  for(G4int c1 = 0; c1 < nHitNucleons; c1++)
187  {
188  Sum += -MeanE*std::log(G4UniformRand());
189  }
190  return Sum;
191 }
192 //*************************************************************************************************************************************
193 
194 /*
195 //This is free propagation of particles for CASCADE mode. Target nucleons should be frozen
196 void G4RKFieldIntegrator::Integrate(G4KineticTrackVector& theParticles)
197  {
198  for(G4int cParticle = 0; cParticle < theParticles.length(); cParticle++)
199  {
200  G4KineticTrack* pKineticTrack = theParticles.at(cParticle);
201  pKineticTrack->SetPosition(pKineticTrack->GetPosition() + theTimeStep*pKineticTrack->Get4Momentum().boostVector());
202  }
203  }
204 */
205 //*************************************************************************************************************************************
206 
207 void G4RKFieldIntegrator::Integrate(const G4KineticTrackVector& theBarions, G4double theTimeStep)
208 {
209  for(size_t cParticle = 0; cParticle < theBarions.size(); cParticle++)
210  {
211  G4KineticTrack* pKineticTrack = theBarions[cParticle];
212  pKineticTrack->SetPosition(pKineticTrack->GetPosition() + theTimeStep*pKineticTrack->Get4Momentum().boostVector());
213  }
214 }
215 
216 //*************************************************************************************************************************************
217 
218 // constant to calculate theCoulomb barrier
219 const G4double G4RKFieldIntegrator::coulomb = 1.44 / 1.14 * MeV;
220 
221 // kaon's potential constant (real part only)
222 // 0.35 + i0.82 or 0.63 + i0.89 fermi
223 const G4double G4RKFieldIntegrator::a_kaon = 0.35;
224 
225 // pion's potential constant (real part only)
227 // 0.35 + i0.82 or 0.63 + i0.89 fermi
228 const G4double G4RKFieldIntegrator::a_pion = 0.35;
229 
230 // antiproton's potential constant (real part only)
231 // 1.53 + i2.50 fermi
232 const G4double G4RKFieldIntegrator::a_antiproton = 1.53;
233 
234 // methods for calculating potentials for different types of particles
235 // aPosition is relative to the nucleus center
237 {
238  /*
239  const G4double Mn = 939.56563 * MeV; // mass of nuetron
240 
241  G4VNuclearDensity *theDencity;
242  if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
243  else theDencity = new G4NuclearFermiDensity(theA, theZ);
244 
245  // GetDencity() accepts only G4ThreeVector so build it:
246  G4ThreeVector aPosition(0.0, 0.0, radius);
247  G4double density = theDencity->GetDensity(aPosition);
248  delete theDencity;
249 
250  G4FermiMomentum *fm = new G4FermiMomentum();
251  fm->Init(theA, theZ);
252  G4double fermiMomentum = fm->GetFermiMomentum(density);
253  delete fm;
254 
255  return sqr(fermiMomentum)/(2 * Mn)
256  + G4CreateNucleus::GetBindingEnergy(theZ, theA)/theA;
257  //+ G4NucleiProperties::GetBindingEnergy(theZ, theA)/theA;
258  */
259 
260  return 0.0;
261 }
262 
264 {
265  /*
266  // calculate Coulomb barrier value
267  G4double theCoulombBarrier = coulomb * theZ/(1. + std::pow(theA, 1./3.));
268  const G4double Mp = 938.27231 * MeV; // mass of proton
269 
270  G4VNuclearDensity *theDencity;
271  if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
272  else theDencity = new G4NuclearFermiDensity(theA, theZ);
273 
274  // GetDencity() accepts only G4ThreeVector so build it:
275  G4ThreeVector aPosition(0.0, 0.0, radius);
276  G4double density = theDencity->GetDensity(aPosition);
277  delete theDencity;
278 
279  G4FermiMomentum *fm = new G4FermiMomentum();
280  fm->Init(theA, theZ);
281  G4double fermiMomentum = fm->GetFermiMomentum(density);
282  delete fm;
283 
284  return sqr(fermiMomentum)/ (2 * Mp)
285  + G4CreateNucleus::GetBindingEnergy(theZ, theA)/theA;
286  //+ G4NucleiProperties::GetBindingEnergy(theZ, theA)/theA
287  + theCoulombBarrier;
288  */
289 
290  return 0.0;
291 }
292 
294 {
295  /*
296  //G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
297  G4double theM = theZ * G4Proton::Proton()->GetPDGMass()
298  + (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
299  + G4CreateNucleus::GetBindingEnergy(theZ, theA);
300 
301  const G4double Mp = 938.27231 * MeV; // mass of proton
302  G4double mu = (theM * Mp)/(theM + Mp);
303 
304  // antiproton's potential coefficient
305  // V = coeff_antiproton * nucleus_density
306  G4double coeff_antiproton = -2.*pi/mu * (1. + Mp) * a_antiproton;
307 
308  G4VNuclearDensity *theDencity;
309  if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
310  else theDencity = new G4NuclearFermiDensity(theA, theZ);
311 
312  // GetDencity() accepts only G4ThreeVector so build it:
313  G4ThreeVector aPosition(0.0, 0.0, radius);
314  G4double density = theDencity->GetDensity(aPosition);
315  delete theDencity;
316 
317  return coeff_antiproton * density;
318  */
319 
320  return 0.0;
321 }
322 
324 {
325  /*
326  //G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
327  G4double theM = theZ * G4Proton::Proton()->GetPDGMass()
328  + (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
329  + G4CreateNucleus::GetBindingEnergy(theZ, theA);
330 
331  const G4double Mk = 496. * MeV; // mass of "kaon"
332  G4double mu = (theM * Mk)/(theM + Mk);
333 
334  // kaon's potential coefficient
335  // V = coeff_kaon * nucleus_density
336  G4double coeff_kaon = -2.*pi/mu * (1. + Mk/theM) * a_kaon;
337 
338  G4VNuclearDensity *theDencity;
339  if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
340  else theDencity = new G4NuclearFermiDensity(theA, theZ);
341 
342  // GetDencity() accepts only G4ThreeVector so build it:
343  G4ThreeVector aPosition(0.0, 0.0, radius);
344  G4double density = theDencity->GetDensity(aPosition);
345  delete theDencity;
346 
347  return coeff_kaon * density;
348  */
349 
350  return 0.0;
351 }
352 
354 {
355  /*
356  //G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
357  G4double theM = theZ * G4Proton::Proton()->GetPDGMass()
358  + (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
359  + G4CreateNucleus::GetBindingEnergy(theZ, theA);
360 
361  const G4double Mpi = 139. * MeV; // mass of "pion"
362  G4double mu = (theM * Mpi)/(theM + Mpi);
363 
364  // pion's potential coefficient
365  // V = coeff_pion * nucleus_density
366  G4double coeff_pion = -2.*pi/mu * (1. + Mpi) * a_pion;
367 
368  G4VNuclearDensity *theDencity;
369  if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
370  else theDencity = new G4NuclearFermiDensity(theA, theZ);
371 
372  // GetDencity() accepts only G4ThreeVector so build it:
373  G4ThreeVector aPosition(0.0, 0.0, radius);
374  G4double density = theDencity->GetDensity(aPosition);
375  delete theDencity;
376 
377  return coeff_pion * density;
378  */
379 
380  return 0.0;
381 }
G4double GetPionPotential(G4double radius)
Hep3Vector boostVector() const
TTree * t1
Definition: plottest35.C:26
const G4ThreeVector & GetPosition() const
typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData
Float_t Y
Definition: plot.C:39
TCanvas * c1
Definition: plotHisto.C:7
int G4int
Definition: G4Types.hh:78
Float_t X
Definition: plot.C:39
G4ParticleDefinition * GetDefinition() const
void Transport(G4KineticTrackVector &theActive, const G4KineticTrackVector &theSpectators, G4double theTimeStep)
#define G4UniformRand()
Definition: Randomize.hh:87
void SetPosition(const G4ThreeVector aPosition)
#define C1
G4double GetKaonPotential(G4double radius)
G4double GetProtonPotential(G4double radius)
G4double GetExcitationEnergy(G4int nHitNucleons, const G4KineticTrackVector &theParticles)
G4double GetNeutronPotential(G4double radius)
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
const G4LorentzVector & Get4Momentum() const
Double_t Z1
Definition: plot.C:266
G4double GetAntiprotonPotential(G4double radius)