G4RKFieldIntegrator.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // G4RKFieldIntegrator
00027 #include "G4RKFieldIntegrator.hh"
00028 #include "G4PhysicalConstants.hh"
00029 #include "G4SystemOfUnits.hh"
00030 #include "G4NucleiProperties.hh"
00031 #include "G4FermiMomentum.hh"
00032 #include "G4NuclearFermiDensity.hh"
00033 #include "G4NuclearShellModelDensity.hh"
00034 #include "G4Nucleon.hh"
00035 
00036 // Class G4RKFieldIntegrator 
00037 //*************************************************************************************************************************************
00038 
00039 // only theActive are propagated, nothing else
00040 // only theSpectators define the field, nothing else
00041 
00042 void G4RKFieldIntegrator::Transport(G4KineticTrackVector &theActive, const G4KineticTrackVector &theSpectators, G4double theTimeStep)
00043 {
00044    (void)theActive;
00045    (void)theSpectators;
00046    (void)theTimeStep;
00047 }
00048 
00049 
00050 G4double G4RKFieldIntegrator::CalculateTotalEnergy(const G4KineticTrackVector& Barions)
00051 {
00052    const G4double Alpha  =  0.25/fermi/fermi;
00053    const G4double t1     = -7264.04*fermi*fermi*fermi;
00054    const G4double tGamma =  87.65*fermi*fermi*fermi*fermi*fermi*fermi;
00055 //   const G4double Gamma  =  1.676;
00056    const G4double Vo     = -0.498*fermi;
00057    const G4double GammaY =  1.4*fermi;
00058 
00059    G4double Etot = 0;
00060    G4int nBarion = Barions.size();
00061    for(G4int c1 = 0; c1 < nBarion; c1++)
00062       {
00063       G4KineticTrack* p1 = Barions.operator[](c1);
00064    // Ekin
00065       Etot += p1->Get4Momentum().e();
00066       for(G4int c2 = c1 + 1; c2 < nBarion; c2++)
00067          {
00068          G4KineticTrack* p2 = Barions.operator[](c2);
00069          G4double r12 = (p1->GetPosition() - p2->GetPosition()).mag()*fermi;
00070 
00071          //  Esk2
00072          Etot += t1*std::pow(Alpha/pi, 3/2)*std::exp(-Alpha*r12*r12); 
00073 
00074          // Eyuk
00075          Etot += Vo*0.5/r12*std::exp(1/(4*Alpha*GammaY*GammaY))*
00076             (std::exp(-r12/GammaY)*(1 - Erf(0.5/GammaY/std::sqrt(Alpha) - std::sqrt(Alpha)*r12)) - 
00077              std::exp( r12/GammaY)*(1 - Erf(0.5/GammaY/std::sqrt(Alpha) + std::sqrt(Alpha)*r12)));
00078 
00079          // Ecoul        
00080          Etot += 1.44*p1->GetDefinition()->GetPDGCharge()*p2->GetDefinition()->GetPDGCharge()/r12*Erf(std::sqrt(Alpha)*r12);
00081 
00082          // Epaul
00083          Etot = 0;
00084 
00085          for(G4int c3 = c2 + 1; c3 < nBarion; c3++)
00086             {
00087             G4KineticTrack* p3 = Barions.operator[](c3);
00088             G4double r13 = (p1->GetPosition() - p3->GetPosition()).mag()*fermi;
00089 
00090             // Esk3
00091             Etot  = tGamma*std::pow(4*Alpha*Alpha/3/pi/pi, 1.5)*std::exp(-Alpha*(r12*r12 + r13*r13));
00092             }
00093          }
00094       }      
00095    return Etot;
00096 }  
00097 
00098 //************************************************************************************************       
00099 // originated from the Numerical recipes error function
00100 G4double G4RKFieldIntegrator::Erf(G4double X)
00101 {
00102    const G4double Z1 = 1;
00103    const G4double HF = Z1/2;
00104    const G4double C1 = 0.56418958;
00105 
00106    const G4double P10 = +3.6767877;
00107    const G4double Q10 = +3.2584593;
00108    const G4double P11 = -9.7970465E-2;
00109 
00110    static G4double P2[5] = { 7.3738883, 6.8650185,  3.0317993, 0.56316962, 4.3187787e-5 };
00111    static G4double Q2[5] = { 7.3739609, 15.184908, 12.79553,   5.3542168,  1. };
00112    
00113    const G4double P30 = -1.2436854E-1;
00114    const G4double Q30 = +4.4091706E-1;
00115    const G4double P31 = -9.6821036E-2;
00116 
00117    G4double V = std::abs(X);
00118    G4double H;   
00119    G4double Y;
00120    G4int c1;
00121       
00122    if(V < HF)
00123       {
00124       Y = V*V;
00125       H = X*(P10 + P11*Y)/(Q10+Y);
00126       }
00127    else
00128       {
00129       if(V < 4) 
00130          {
00131          G4double AP = P2[4];
00132          G4double AQ = Q2[4];
00133          for(c1 = 3; c1 >= 0; c1--)
00134             {
00135             AP = P2[c1] + V*AP;
00136             AQ = Q2[c1] + V*AQ;
00137             }
00138          H = 1 - std::exp(-V*V)*AP/AQ;
00139          }
00140       else
00141         {
00142         Y = 1./V*V;
00143         H = 1 - std::exp(-V*V)*(C1+Y*(P30 + P31*Y)/(Q30 + Y))/V;
00144         }
00145      if (X < 0) 
00146         H = -H;
00147      }
00148    return H;
00149 }
00150    
00151 //************************************************************************************************       
00152 //This is a QMD version to calculate excitation energy of a fragment,
00153 //which consists from G4KTV &the Particles
00154 /*
00155 G4double G4RKFieldIntegrator::GetExcitationEnergy(const G4KineticTrackVector &theParticles)
00156 {
00157    // Excitation energy of a fragment consisting from A nucleons and Z protons
00158    // is Etot - Z*Mp - (A - Z)*Mn - B(A, Z), where B(A,Z) is the binding energy of fragment 
00159    //  and Mp, Mn are proton and neutron mass, respectively. 
00160    G4int NZ = 0;
00161    G4int NA = 0;
00162    G4double Etot = CalculateTotalEnergy(theParticles);
00163    for(G4int cParticle = 0; cParticle < theParticles.length(); cParticle++)
00164       {
00165       G4KineticTrack* pKineticTrack = theParticles.at(cParticle);
00166       G4int Encoding =  std::abs(pKineticTrack->GetDefinition()->GetPDGEncoding());
00167       if (Encoding == 2212)
00168           NZ++, NA++;
00169       if (Encoding == 2112)
00170           NA++;
00171       Etot -= pKineticTrack->GetDefinition()->GetPDGMass();
00172       }
00173    return Etot - G4NucleiProperties::GetBindingEnergy(NZ, NA);
00174 }
00175 */
00176 
00177 //*************************************************************************************************************************************
00178 //This is a simplified method to get excitation energy of a residual 
00179 // nucleus with nHitNucleons.
00180 G4double G4RKFieldIntegrator::GetExcitationEnergy(G4int nHitNucleons, const G4KineticTrackVector &)
00181 {
00182    const G4double MeanE = 50;
00183    G4double Sum = 0;
00184    for(G4int c1 = 0; c1 < nHitNucleons; c1++)
00185        {
00186        Sum += -MeanE*std::log(G4UniformRand());
00187        }
00188    return Sum;
00189 }
00190 //*************************************************************************************************************************************
00191 
00192 /*
00193 //This is free propagation of particles for CASCADE mode. Target nucleons should be frozen
00194 void G4RKFieldIntegrator::Integrate(G4KineticTrackVector& theParticles)
00195    {
00196    for(G4int cParticle = 0; cParticle < theParticles.length(); cParticle++)
00197       {
00198       G4KineticTrack* pKineticTrack = theParticles.at(cParticle);
00199       pKineticTrack->SetPosition(pKineticTrack->GetPosition() + theTimeStep*pKineticTrack->Get4Momentum().boostVector());
00200       }
00201    }
00202 */   
00203 //*************************************************************************************************************************************
00204 
00205 void G4RKFieldIntegrator::Integrate(const G4KineticTrackVector& theBarions, G4double theTimeStep)
00206 {
00207    for(size_t cParticle = 0; cParticle < theBarions.size(); cParticle++)
00208       {
00209       G4KineticTrack* pKineticTrack = theBarions[cParticle];
00210       pKineticTrack->SetPosition(pKineticTrack->GetPosition() + theTimeStep*pKineticTrack->Get4Momentum().boostVector());
00211       } 
00212 }
00213    
00214 //*************************************************************************************************************************************
00215 
00216 // constant to calculate theCoulomb barrier
00217 const G4double G4RKFieldIntegrator::coulomb = 1.44 / 1.14 * MeV;
00218 
00219 // kaon's potential constant (real part only)
00220 // 0.35 + i0.82 or 0.63 + i0.89 fermi
00221 const G4double G4RKFieldIntegrator::a_kaon = 0.35;
00222 
00223 // pion's potential constant (real part only)
00225 // 0.35 + i0.82 or 0.63 + i0.89 fermi
00226 const G4double G4RKFieldIntegrator::a_pion = 0.35;
00227 
00228 // antiproton's potential constant (real part only)
00229 // 1.53 + i2.50 fermi
00230 const G4double G4RKFieldIntegrator::a_antiproton = 1.53;
00231 
00232 // methods for calculating potentials for different types of particles
00233 // aPosition is relative to the nucleus center
00234 G4double G4RKFieldIntegrator::GetNeutronPotential(G4double )
00235 {
00236    /*
00237    const G4double Mn  = 939.56563 * MeV; // mass of nuetron
00238 
00239    G4VNuclearDensity *theDencity;
00240    if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
00241    else          theDencity = new G4NuclearFermiDensity(theA, theZ);
00242    
00243    // GetDencity() accepts only G4ThreeVector so build it:   
00244    G4ThreeVector aPosition(0.0, 0.0, radius);
00245    G4double density = theDencity->GetDensity(aPosition);
00246    delete theDencity;
00247    
00248    G4FermiMomentum *fm = new G4FermiMomentum();
00249    fm->Init(theA, theZ);
00250    G4double fermiMomentum = fm->GetFermiMomentum(density);
00251    delete fm;
00252    
00253    return sqr(fermiMomentum)/(2 * Mn) 
00254       + G4CreateNucleus::GetBindingEnergy(theZ, theA)/theA;
00255       //+ G4NucleiProperties::GetBindingEnergy(theZ, theA)/theA;
00256    */
00257    
00258    return 0.0;
00259 }
00260 
00261 G4double G4RKFieldIntegrator::GetProtonPotential(G4double )
00262 {
00263    /*
00264    // calculate Coulomb barrier value
00265    G4double theCoulombBarrier = coulomb * theZ/(1. + std::pow(theA, 1./3.));
00266    const G4double Mp  = 938.27231 * MeV; // mass of proton
00267 
00268    G4VNuclearDensity *theDencity;
00269    if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
00270    else          theDencity = new G4NuclearFermiDensity(theA, theZ);
00271    
00272    // GetDencity() accepts only G4ThreeVector so build it:   
00273    G4ThreeVector aPosition(0.0, 0.0, radius);
00274    G4double density = theDencity->GetDensity(aPosition);
00275    delete theDencity;
00276    
00277    G4FermiMomentum *fm = new G4FermiMomentum();
00278    fm->Init(theA, theZ);
00279    G4double fermiMomentum = fm->GetFermiMomentum(density);
00280    delete fm;
00281 
00282    return sqr(fermiMomentum)/ (2 * Mp) 
00283       + G4CreateNucleus::GetBindingEnergy(theZ, theA)/theA;
00284       //+ G4NucleiProperties::GetBindingEnergy(theZ, theA)/theA 
00285       + theCoulombBarrier;
00286    */
00287 
00288    return 0.0;
00289 }
00290 
00291 G4double G4RKFieldIntegrator::GetAntiprotonPotential(G4double )
00292 {
00293    /*
00294    //G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
00295    G4double theM = theZ * G4Proton::Proton()->GetPDGMass() 
00296       + (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
00297       + G4CreateNucleus::GetBindingEnergy(theZ, theA);
00298       
00299    const G4double Mp  = 938.27231 * MeV; // mass of proton
00300    G4double mu = (theM * Mp)/(theM + Mp);
00301    
00302    // antiproton's potential coefficient
00303    //   V = coeff_antiproton * nucleus_density
00304    G4double coeff_antiproton = -2.*pi/mu * (1. + Mp) * a_antiproton;
00305    
00306    G4VNuclearDensity *theDencity;
00307    if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
00308    else          theDencity = new G4NuclearFermiDensity(theA, theZ);
00309    
00310    // GetDencity() accepts only G4ThreeVector so build it:   
00311    G4ThreeVector aPosition(0.0, 0.0, radius);
00312    G4double density = theDencity->GetDensity(aPosition);
00313    delete theDencity;
00314    
00315    return coeff_antiproton * density;
00316    */
00317 
00318    return 0.0;
00319 }
00320 
00321 G4double G4RKFieldIntegrator::GetKaonPotential(G4double )
00322 {
00323    /*
00324    //G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
00325    G4double theM = theZ * G4Proton::Proton()->GetPDGMass() 
00326       + (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
00327       + G4CreateNucleus::GetBindingEnergy(theZ, theA);
00328       
00329    const G4double Mk  = 496. * MeV;      // mass of "kaon"
00330    G4double mu = (theM * Mk)/(theM + Mk);
00331    
00332    // kaon's potential coefficient
00333    //   V = coeff_kaon * nucleus_density
00334    G4double coeff_kaon = -2.*pi/mu * (1. + Mk/theM) * a_kaon;
00335    
00336    G4VNuclearDensity *theDencity;
00337    if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
00338    else          theDencity = new G4NuclearFermiDensity(theA, theZ);
00339    
00340    // GetDencity() accepts only G4ThreeVector so build it:   
00341    G4ThreeVector aPosition(0.0, 0.0, radius);
00342    G4double density = theDencity->GetDensity(aPosition);
00343    delete theDencity;
00344    
00345    return coeff_kaon * density;
00346    */
00347 
00348    return 0.0;
00349 }
00350 
00351 G4double G4RKFieldIntegrator::GetPionPotential(G4double )
00352 {
00353    /*
00354    //G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
00355    G4double theM = theZ * G4Proton::Proton()->GetPDGMass() 
00356       + (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
00357       + G4CreateNucleus::GetBindingEnergy(theZ, theA);
00358       
00359    const G4double Mpi = 139. * MeV;      // mass of "pion"
00360    G4double mu = (theM * Mpi)/(theM + Mpi);
00361 
00362    // pion's potential coefficient
00363    //   V = coeff_pion * nucleus_density
00364    G4double coeff_pion = -2.*pi/mu * (1. + Mpi) * a_pion;
00365    
00366    G4VNuclearDensity *theDencity;
00367    if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
00368    else          theDencity = new G4NuclearFermiDensity(theA, theZ);
00369    
00370    // GetDencity() accepts only G4ThreeVector so build it:   
00371    G4ThreeVector aPosition(0.0, 0.0, radius);
00372    G4double density = theDencity->GetDensity(aPosition);
00373    delete theDencity;
00374    
00375    return coeff_pion * density;
00376    */
00377 
00378    return 0.0;
00379 }

Generated on Mon May 27 17:49:43 2013 for Geant4 by  doxygen 1.4.7