Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/hadronic/models/coherent_elastic/src/G4AntiNuclElastic.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/hadronic/models/coherent_elastic/src/G4AntiNuclElastic.cc (Version 11.3.0) and /processes/hadronic/models/coherent_elastic/src/G4AntiNuclElastic.cc (Version 10.4.p3)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
                                                   >>  26 // $Id: G4AntiNuclElastic.cc  - A.Galoyan 02.05.2011
 26 //                                                 27 //
 27 // Geant4 Header : G4AntiNuclElastic               28 // Geant4 Header : G4AntiNuclElastic
 28 //                                                 29 //
 29 //                                                 30 // 
 30                                                    31 
 31 #include "G4AntiNuclElastic.hh"                    32 #include "G4AntiNuclElastic.hh"
 32                                                    33 
 33 #include "G4PhysicalConstants.hh"                  34 #include "G4PhysicalConstants.hh"
 34 #include "G4SystemOfUnits.hh"                      35 #include "G4SystemOfUnits.hh"
 35 #include "G4ParticleTable.hh"                      36 #include "G4ParticleTable.hh"
 36 #include "G4ParticleDefinition.hh"                 37 #include "G4ParticleDefinition.hh"
 37 #include "G4IonTable.hh"                           38 #include "G4IonTable.hh"
 38 #include "Randomize.hh"                            39 #include "Randomize.hh"
 39 #include "G4AntiProton.hh"                         40 #include "G4AntiProton.hh"
 40 #include "G4AntiNeutron.hh"                        41 #include "G4AntiNeutron.hh"
 41 #include "G4AntiDeuteron.hh"                       42 #include "G4AntiDeuteron.hh"
 42 #include "G4AntiAlpha.hh"                          43 #include "G4AntiAlpha.hh"
 43 #include "G4AntiTriton.hh"                         44 #include "G4AntiTriton.hh"
 44 #include "G4AntiHe3.hh"                            45 #include "G4AntiHe3.hh"
 45 #include "G4Proton.hh"                             46 #include "G4Proton.hh"
 46 #include "G4Neutron.hh"                            47 #include "G4Neutron.hh"
 47 #include "G4Deuteron.hh"                           48 #include "G4Deuteron.hh"
 48 #include "G4Alpha.hh"                              49 #include "G4Alpha.hh"
 49 #include "G4Pow.hh"                                50 #include "G4Pow.hh"
 50 #include "G4Exp.hh"                                51 #include "G4Exp.hh"
 51 #include "G4Log.hh"                                52 #include "G4Log.hh"
 52                                                    53 
 53 #include "G4NucleiProperties.hh"                   54 #include "G4NucleiProperties.hh"
 54 #include "G4CrossSectionDataSetRegistry.hh"    <<  55 
 55                                                    56 
 56 G4AntiNuclElastic::G4AntiNuclElastic()             57 G4AntiNuclElastic::G4AntiNuclElastic() 
 57   : G4HadronElastic("AntiAElastic")                58   : G4HadronElastic("AntiAElastic")
 58 {                                                  59 {
 59   //V.Ivanchenko commented out                     60   //V.Ivanchenko commented out 
 60   //SetMinEnergy( 0.1*GeV );                       61   //SetMinEnergy( 0.1*GeV );
 61   //SetMaxEnergy( 10.*TeV );                       62   //SetMaxEnergy( 10.*TeV );
 62                                                    63 
                                                   >>  64 
 63   theAProton       = G4AntiProton::AntiProton(     65   theAProton       = G4AntiProton::AntiProton();
 64   theANeutron      = G4AntiNeutron::AntiNeutro     66   theANeutron      = G4AntiNeutron::AntiNeutron();
 65   theADeuteron     = G4AntiDeuteron::AntiDeute     67   theADeuteron     = G4AntiDeuteron::AntiDeuteron();
 66   theATriton       = G4AntiTriton::AntiTriton(     68   theATriton       = G4AntiTriton::AntiTriton();
 67   theAAlpha        = G4AntiAlpha::AntiAlpha();     69   theAAlpha        = G4AntiAlpha::AntiAlpha();
 68   theAHe3          = G4AntiHe3::AntiHe3();         70   theAHe3          = G4AntiHe3::AntiHe3();
 69                                                    71 
 70   theProton   = G4Proton::Proton();                72   theProton   = G4Proton::Proton();
 71   theNeutron  = G4Neutron::Neutron();              73   theNeutron  = G4Neutron::Neutron();
 72   theDeuteron = G4Deuteron::Deuteron();            74   theDeuteron = G4Deuteron::Deuteron();
 73   theAlpha    = G4Alpha::Alpha();                  75   theAlpha    = G4Alpha::Alpha();
 74                                                    76 
 75   G4CrossSectionDataSetRegistry* reg = G4Cross << 
 76   cs = static_cast<G4ComponentAntiNuclNuclearX << 
 77   if(!cs) { cs = new G4ComponentAntiNuclNuclea << 
 78                                                    77 
                                                   >>  78   cs = new G4ComponentAntiNuclNuclearXS();
 79   fParticle = 0;                                   79   fParticle = 0;
 80   fWaveVector = 0.;                                80   fWaveVector = 0.;
 81   fBeta = 0.;                                      81   fBeta = 0.;
 82   fZommerfeld = 0.;                                82   fZommerfeld = 0.;
 83   fAm = 0.;                                        83   fAm = 0.;
 84   fTetaCMS = 0.;                                   84   fTetaCMS = 0.;    
 85   fRa = 0.;                                        85   fRa = 0.;
 86   fRef = 0.;                                       86   fRef = 0.;
 87   fceff = 0.;                                      87   fceff = 0.;
 88   fptot = 0.;                                      88   fptot = 0.;
 89   fTmax = 0.;                                      89   fTmax = 0.;
 90   fThetaLab = 0.;                                  90   fThetaLab = 0.;
 91 }                                                  91 }
 92                                                    92 
 93 //////////////////////////////////////////////     93 /////////////////////////////////////////////////////////////////////////
 94 G4AntiNuclElastic::~G4AntiNuclElastic()            94 G4AntiNuclElastic::~G4AntiNuclElastic()
 95 {}                                             <<  95 {
                                                   >>  96   delete cs;  
                                                   >>  97 }
 96                                                    98 
 97 //////////////////////////////////////////////     99 ////////////////////////////////////////////////////////////////////////
 98 // sample momentum transfer in the CMS system     100 // sample momentum transfer in the CMS system 
 99 G4double G4AntiNuclElastic::SampleInvariantT(c    101 G4double G4AntiNuclElastic::SampleInvariantT(const G4ParticleDefinition* particle, 
100                G4double Plab,  G4int Z, G4int     102                G4double Plab,  G4int Z, G4int A)
101 {                                                 103 {
102   G4double T;                                     104   G4double T;
103   G4double Mproj = particle->GetPDGMass();        105   G4double Mproj = particle->GetPDGMass();
104   G4LorentzVector Pproj(0.,0.,Plab,std::sqrt(P    106   G4LorentzVector Pproj(0.,0.,Plab,std::sqrt(Plab*Plab+Mproj*Mproj));
105   G4double ctet1 = GetcosTeta1(Plab, A);          107   G4double ctet1 = GetcosTeta1(Plab, A); 
106                                                   108 
107   G4double energy=Pproj.e()-Mproj;                109   G4double energy=Pproj.e()-Mproj;   
108                                                   110   
109   const G4ParticleDefinition* theParticle = pa    111   const G4ParticleDefinition* theParticle = particle;
110                                                   112 
111   G4ParticleDefinition * theTargetDef = 0;     << 113   G4ParticleDefinition * theDef = 0;
112                                                   114 
113   if      (Z == 1 && A == 1) theTargetDef = th << 115   if(Z == 1 && A == 1)       theDef = theProton;
114   else if (Z == 1 && A == 2) theTargetDef = th << 116   else if (Z == 1 && A == 2) theDef = theDeuteron;
115   else if (Z == 1 && A == 3) theTargetDef = G4 << 117   else if (Z == 1 && A == 3) theDef = G4Triton::Triton();
116   else if (Z == 2 && A == 3) theTargetDef = G4 << 118   else if (Z == 2 && A == 3) theDef = G4He3::He3();
117   else if (Z == 2 && A == 4) theTargetDef = th << 119   else if (Z == 2 && A == 4) theDef = theAlpha;
118                                                   120 
119                                                   121 
120   G4double TargMass =G4NucleiProperties::GetNu    122   G4double TargMass =G4NucleiProperties::GetNuclearMass(A,Z); 
121                                                   123 
122   //transform to CMS                              124   //transform to CMS
123                                                   125 
124   G4LorentzVector lv(0.0,0.0,0.0,TargMass);       126   G4LorentzVector lv(0.0,0.0,0.0,TargMass);   
125   lv += Pproj;                                    127   lv += Pproj;
126   G4double S = lv.mag2()/(GeV*GeV);            << 128   G4double S = lv.mag2()/GeV/GeV;
127                                                   129 
128   G4ThreeVector bst = lv.boostVector();           130   G4ThreeVector bst = lv.boostVector();
129   Pproj.boost(-bst);                              131   Pproj.boost(-bst);
130                                                   132 
131   G4ThreeVector p1 = Pproj.vect();                133   G4ThreeVector p1 = Pproj.vect();
132   G4double ptot    = p1.mag();                    134   G4double ptot    = p1.mag();
133                                                   135 
134   fbst = bst;                                     136   fbst = bst;
135   fptot= ptot;                                    137   fptot= ptot;
136   fTmax = 4.0*ptot*ptot;  // In (MeV/c)^2      << 138   fTmax = 4.0*ptot*ptot;  
137                                                   139 
138   if(Plab < (std::abs(particle->GetBaryonNumbe << 140   if(Plab/std::abs(particle->GetBaryonNumber()) < 100.*MeV)    // Uzhi 24 Nov. 2011
139   {return fTmax*G4UniformRand();}              << 141   {return fTmax*G4UniformRand();}                              // Uzhi 24 Nov. 2011
140                                                   142   
141   // Calculation of NN collision properties    << 
142   G4double PlabPerN = Plab/std::abs(theParticl << 
143   G4double NucleonMass = 0.5*( theProton->GetP << 
144   G4double PrNucleonMass(0.);  // Projectile a << 
145   if( std::abs(theParticle->GetBaryonNumber()) << 
146   else                                         << 
147   G4double energyPerN = std::sqrt( sqr(PlabPer << 
148   energyPerN -= PrNucleonMass;                 << 
149   //---                                        << 
150                                                << 
151   G4double  Z1 = particle->GetPDGCharge();        143   G4double  Z1 = particle->GetPDGCharge();
152   G4double  Z2 = Z;                               144   G4double  Z2 = Z;  
153                                                   145   
154   G4double beta = CalculateParticleBeta(partic    146   G4double beta = CalculateParticleBeta(particle, ptot); 
155   G4double n  = CalculateZommerfeld( beta,  Z1    147   G4double n  = CalculateZommerfeld( beta,  Z1,  Z2 );
156   G4double Am = CalculateAm( ptot,  n,  Z2 );     148   G4double Am = CalculateAm( ptot,  n,  Z2 );
157   fWaveVector = ptot;     //   /hbarc;            149   fWaveVector = ptot;     //   /hbarc; 
158                                                   150       
159   G4LorentzVector Fproj(0.,0.,0.,0.);             151   G4LorentzVector Fproj(0.,0.,0.,0.);  
160   const G4double mevToBarn = 0.38938e+6;       << 152   G4double  XsCoulomb = sqr(n/fWaveVector)*pi*(1+ctet1)/(1.+Am)/(1.+2.*Am-ctet1); 
161   G4double XsCoulomb = mevToBarn*sqr(n/fWaveVe << 153   XsCoulomb=XsCoulomb*0.38938e+6;
                                                   >> 154 
                                                   >> 155 
                                                   >> 156   G4double XsElastHad =cs->GetElasticElementCrossSection(particle, energy, Z, (G4double)A);
                                                   >> 157   G4double XstotalHad =cs->GetTotalElementCrossSection(particle, energy, Z, (G4double)A);
162                                                   158 
163   G4double XsElastHadronic =cs->GetElasticElem << 
164   G4double XsTotalHadronic =cs->GetTotalElemen << 
165                                                   159 
166   XsElastHadronic/=millibarn; XsTotalHadronic/ << 160   XsElastHad/=millibarn; XstotalHad/=millibarn;
167                                                   161 
168   G4double CoulombProb =  XsCoulomb/(XsCoulomb << 162 
                                                   >> 163   G4double CoulombProb =  XsCoulomb/(XsCoulomb+XsElastHad);
                                                   >> 164 
                                                   >> 165 // G4cout<<" XselastHadron " << XsElastHad << "  XsCol "<< XsCoulomb <<G4endl; 
                                                   >> 166 // G4cout <<"  XsTotal" << XstotalHad <<G4endl;  
                                                   >> 167 // G4cout<<"XsInel"<< XstotalHad-XsElastHad<<G4endl;        
169                                                   168 
170   if(G4UniformRand() < CoulombProb)               169   if(G4UniformRand() < CoulombProb)
171   {  // Simulation of Coulomb scattering          170   {  // Simulation of Coulomb scattering
172                                                   171 
173     G4double phi = twopi * G4UniformRand();    << 172    G4double phi = twopi * G4UniformRand();
174     G4double Ksi =  G4UniformRand();           << 173    G4double Ksi =  G4UniformRand();
175                                                   174 
176     G4double par1 = 2.*(1.+Am)/(1.+ctet1);     << 175    G4double par1 = 2.*(1.+Am)/(1.+ctet1);
177                                                   176 
178     // ////sample ThetaCMS in Coulomb part     << 177 // ////sample ThetaCMS in Coulomb part
179                                                   178 
180     G4double cosThetaCMS = (par1*ctet1- Ksi*(1 << 179    G4double cosThetaCMS = (par1*ctet1- Ksi*(1.+2.*Am))/(par1-Ksi);
181                                                   180 
182     G4double PtZ=ptot*cosThetaCMS;             << 181    G4double PtZ=ptot*cosThetaCMS;
183     Fproj.setPz(PtZ);                          << 182    Fproj.setPz(PtZ);
184     G4double PtProjCMS = ptot*std::sqrt(1.0 -  << 183    G4double PtProjCMS = ptot*std::sqrt(1.0 - cosThetaCMS*cosThetaCMS);
185     G4double PtX= PtProjCMS * std::cos(phi);   << 184    G4double PtX= PtProjCMS * std::cos(phi);
186     G4double PtY= PtProjCMS * std::sin(phi);   << 185    G4double PtY= PtProjCMS * std::sin(phi);
187     Fproj.setPx(PtX);                          << 186    Fproj.setPx(PtX);     
188     Fproj.setPy(PtY);                          << 187    Fproj.setPy(PtY);
189     Fproj.setE(std::sqrt(PtX*PtX+PtY*PtY+PtZ*P << 188    Fproj.setE(std::sqrt(PtX*PtX+PtY*PtY+PtZ*PtZ+Mproj*Mproj));    
190     T =  -(Pproj-Fproj).mag2();                << 189    T =  -(Pproj-Fproj).mag2();      
191   }                                            << 190   } else
192   else                                         << 
193   {                                            << 
194     // Simulation of strong interaction scatte << 
195                                                   191 
196     G4double Qmax = 2.*ptot/197.33;   // in fm << 192   {  
                                                   >> 193 ///////Simulation of strong interaction scattering////////////////////////////
197                                                   194 
198     G4double Amag      = 1.0;  // A1 in Majora << 195 //   G4double Qmax = 2.*ptot*197.33;    // in fm^-1
199     G4double SlopeMag  = 0.5;  // A2 in Majora << 196    G4double Qmax = 2.*3.0*197.33;    // in fm^-1
200                                                << 197    G4double Amag = 70*70;          //  A1 in Magora funct:A1*exp(-q*A2)
201     G4double sig_pbarp = cs->GetAntiHadronNucl << 198    G4double SlopeMag = 2.*3.0;    // A2 in Magora funct:A1*exp(-q*A2)
202                                                << 199 
203     fRa = 1.113*G4Pow::GetInstance()->Z13(A) - << 200    G4double sig_pbarp= cs->GetAntiHadronNucleonTotCrSc(particle,energy); 
204           0.227/G4Pow::GetInstance()->Z13(A);  << 201    
205     if(A == 3) fRa=1.81;                       << 202    fRa = 1.113*G4Pow::GetInstance()->Z13(A) -                     
206     if(A == 4) fRa=1.37;                       << 203          0.227/G4Pow::GetInstance()->Z13(A);                      
                                                   >> 204    if(A == 3) fRa=1.81;
                                                   >> 205    if(A == 4) fRa=1.37;
207                                                   206  
208     if((A>=12.) && (A<27) ) fRa=fRa*0.85;      << 207    if((A>=12.) && (A<27) ) fRa=fRa*0.85;
209     if((A>=27.) && (A<48) ) fRa=fRa*0.90;      << 208    if((A>=27.) && (A<48) ) fRa=fRa*0.90;
210     if((A>=48.) && (A<65) ) fRa=fRa*0.95;      << 209    if((A>=48.) && (A<65) ) fRa=fRa*0.95;
211                                                << 210 
212     G4double Ref2 = XsTotalHadronic/10./2./pi; << 211    G4double Ref2 = 0;
213     G4double ceff2 = 0.0;                      << 212    G4double ceff2 =0;
214     G4double rho = 0.0;                        << 213    G4double rho = 0;
215                                                << 214    if  ((theParticle == theAProton) || (theParticle == theANeutron))  
216     if  ((theParticle == theAProton) || (thePa << 215    {
217     {                                          << 216     if(theDef == theProton)
218       if(theTargetDef == theProton)            << 217     { 
219       {                                        << 218 //   G4double Mp2=sqr(theDef->GetPDGMass()/GeV ); 
220         // Determination of the real part of P << 219 
221         if(Plab < 610.)                        << 220 // change 30 October
222         { rho = 1.3347-10.342*Plab/1000.+22.27 << 221   
223                 13.634*Plab/1000.*Plab/1000.*P << 222      if(Plab < 610.) 
224         if((Plab < 5500.)&&(Plab >= 610.) )    << 223      { rho = 1.3347-10.342*Plab/1000.+22.277*Plab/1000.*Plab/1000.-
225         { rho = 0.22; }                        << 224       13.634*Plab/1000.*Plab/1000.*Plab/1000. ;}
226         if((Plab >= 5500.)&&(Plab < 12300.) )  << 225      if((Plab < 5500.)&&(Plab >= 610.) )
227         { rho = -0.32; }                       << 226      { rho = 0.22; }
228         if( Plab >= 12300.)                    << 227      if((Plab >= 5500.)&&(Plab < 12300.) )
229         { rho = 0.135-2.26/(std::sqrt(S)) ;}   << 228      { rho = -0.32; }
230         Ref2  = 0.35 + 0.9/std::sqrt(std::sqrt << 229      if( Plab >= 12300.)
231         ceff2 = 0.375 - 2./S + 0.44/(sqr(S-4.) << 230      { rho = 0.135-2.26/(std::sqrt(S)) ;}
232         Ref2  =Ref2*Ref2;                      << 231 
233         ceff2 = ceff2*ceff2;                   << 232      Ref2 = 0.35 + 0.9/std::sqrt(std::sqrt(S-4.*0.88))+0.04*G4Log(S) ;
234       }                                        << 233      ceff2 = 0.375 - 2./S + 0.44/(sqr(S-4.)+1.5) ;
235                                                << 234 
236       if( (Z==1)&&(A==2) )                     << 235 /*   
237       {                                        << 236    Ref2=0.8/std::sqrt(std::sqrt(S-4.*Mp2)) + 0.55; 
238         Ref2 = fRa*fRa - 0.28 + 0.019 * sig_pb << 237    if(S>1000.) Ref2=0.62+0.02*G4Log(S) ;
239         ceff2 = 0.297 + 7.853e-04*sig_pbarp +  << 238    ceff2 = 0.035/(sqr(S-4.3)+0.4) + 0.085 * G4Log(S) ;
240       }                                        << 239    if(S>1000.) ceff2 = 0.005 * G4Log(S) + 0.29;
241       if( (Z==1)&&(A==3) )                     << 240 */
242       {                                        << 241 
243         Ref2 = fRa*fRa - 1.36 + 0.025 * sig_pb << 242      Ref2=Ref2*Ref2;
244         ceff2 = 0.149 + 7.091e-04*sig_pbarp +  << 243      ceff2 = ceff2*ceff2;
245       }                                        << 244 
246       if( (Z==2)&&(A==3) )                     << 245      SlopeMag = 0.5;        // Uzhi
247       {                                        << 246      Amag= 1.;              // Uzhi
248         Ref2 = fRa*fRa - 1.36 + 0.025 * sig_pb << 247     }
249         ceff2 = 0.149 + 7.091e-04*sig_pbarp +  << 248 
250       }                                        << 249     if(Z>2) 
251       if( (Z==2)&&(A==4) )                     << 250     {  Ref2 = fRa*fRa +2.48*0.01*sig_pbarp*fRa - 2.23e-6*sig_pbarp*sig_pbarp*fRa*fRa; 
252       {                                        << 251        ceff2 = 0.16+3.3e-4*sig_pbarp+0.35*G4Exp(-0.03*sig_pbarp);
253         Ref2 = fRa*fRa -0.46 +0.03*sig_pbarp - << 252     }
254         ceff2= 0.078 + 6.657e-4*sig_pbarp + 0. << 253     if( (Z==2)&&(A==4) )
255       }                                        << 254     {  Ref2 = fRa*fRa -0.46 +0.03*sig_pbarp - 2.98e-6*sig_pbarp*sig_pbarp;
256       if(Z>2)                                  << 255        ceff2= 0.078 + 6.657e-4*sig_pbarp + 0.3359*G4Exp(-0.03*sig_pbarp);
257       {                                        << 256     }
258         Ref2 = fRa*fRa +2.48*0.01*sig_pbarp*fR << 257     if( (Z==1)&&(A==3) )
259         ceff2 = 0.16+3.3e-4*sig_pbarp+0.35*G4E << 258     {  Ref2 = fRa*fRa - 1.36 + 0.025 * sig_pbarp - 3.69e-7 * sig_pbarp*sig_pbarp;
260       }                                        << 259        ceff2 = 0.149 + 7.091e-04*sig_pbarp + 0.3743*G4Exp(-0.03*sig_pbarp);
261     }  // End of if ((theParticle == theAProto << 260     }
262                                                << 261     if( (Z==2)&&(A==3) )
263     if (theParticle == theADeuteron)           << 262     {  Ref2 = fRa*fRa - 1.36 + 0.025 * sig_pbarp - 3.69e-7 * sig_pbarp*sig_pbarp;
264     {                                          << 263        ceff2 = 0.149 + 7.091e-04*sig_pbarp + 0.3743*G4Exp(-0.03*sig_pbarp);
265       if(theTargetDef == theProton)            << 264     }  
266       {                                        << 265     if( (Z==1)&&(A==2) )
267         ceff2 = 0.297 + 7.853e-04*sig_pbarp +  << 266     {
268       }                                        << 267        Ref2 = fRa*fRa - 0.28 + 0.019 * sig_pbarp + 2.06e-6 * sig_pbarp*sig_pbarp;  
269       if(theTargetDef == theDeuteron)          << 268        ceff2 = 0.297 + 7.853e-04*sig_pbarp + 0.2899*G4Exp(-0.03*sig_pbarp);
270       {                                        << 269     }
271         ceff2 = 0.65 + 3.0e-4*sig_pbarp + 0.55 << 270    }
272       }                                        << 271 
273       if( (theTargetDef == G4Triton::Triton()) << 272    if (theParticle == theADeuteron)
274       {                                        << 273    {
275         ceff2 = 0.57 + 2.5e-4*sig_pbarp + 0.65 << 274     sig_pbarp= cs->GetAntiHadronNucleonTotCrSc(particle,energy/2.); 
276       }                                        << 275     Ref2 = XstotalHad/10./2./pi ;
277       if(theTargetDef == theAlpha)             << 276     if(Z>2)
278       {                                        << 277     {
279         ceff2 = 0.40 + 3.5e-4 *sig_pbarp + 0.4 << 278      ceff2 = 0.38 + 2.0e-4 *sig_pbarp + 0.5 * G4Exp(-0.03*sig_pbarp);
280       }                                        << 279     }
281       if(Z>2)                                  << 280     if(theDef == theProton)
282       {                                        << 281     { 
283         ceff2 = 0.38 + 2.0e-4 *sig_pbarp + 0.5 << 282      ceff2 = 0.297 + 7.853e-04*sig_pbarp + 0.2899*G4Exp(-0.03*sig_pbarp);
284       }                                        << 283     }
285     }                                          << 284     if(theDef == theDeuteron)
286                                                << 285     { 
287     if( (theParticle ==theAHe3) || (theParticl << 286      ceff2 = 0.65 + 3.0e-4*sig_pbarp + 0.55 * G4Exp(-0.03*sig_pbarp);
288     {                                          << 287     }
289       if(theTargetDef == theProton)            << 288     if( (theDef == G4Triton::Triton()) || (theDef == G4He3::He3() ) )
290       {                                        << 289     {
291         ceff2 = 0.149 + 7.091e-04*sig_pbarp +  << 290      ceff2 = 0.57 + 2.5e-4*sig_pbarp + 0.65 * G4Exp(-0.02*sig_pbarp);
292       }                                        << 291     }
293       if(theTargetDef == theDeuteron)          << 292     if(theDef == theAlpha)
294       {                                        << 293     {
295         ceff2 = 0.57 + 2.5e-4*sig_pbarp + 0.65 << 294      ceff2 = 0.40 + 3.5e-4 *sig_pbarp + 0.45 * G4Exp(-0.02*sig_pbarp);
296       }                                        << 295     }
297       if( (theTargetDef == G4Triton::Triton()) << 296    }
298       {                                        << 297 
299         ceff2 = 0.39 + 2.7e-4*sig_pbarp + 0.7  << 298    if( (theParticle ==theAHe3) || (theParticle ==theATriton) )
300       }                                        << 299    {
301       if(theTargetDef == theAlpha)             << 300     sig_pbarp = cs->GetAntiHadronNucleonTotCrSc(particle,energy/3.);
302       {                                        << 301     Ref2 = XstotalHad/10./2./pi ;
303         ceff2 = 0.24 + 3.5e-4*sig_pbarp + 0.75 << 302     if(Z>2)
304       }                                        << 303     {
305       if(Z>2)                                  << 304      ceff2 = 0.26 + 2.2e-4*sig_pbarp + 0.33*G4Exp(-0.03*sig_pbarp);
306       {                                        << 305     }  
307         ceff2 = 0.26 + 2.2e-4*sig_pbarp + 0.33 << 306     if(theDef == theProton)
308       }                                        << 307     {
309     }                                          << 308      ceff2 = 0.149 + 7.091e-04*sig_pbarp + 0.3743*G4Exp(-0.03*sig_pbarp);         
310                                                << 309     }
311     if ( (theParticle == theAAlpha) || (ceff2  << 310     if(theDef == theDeuteron)
312     {                                          << 311     {
313       if(theTargetDef == theProton)            << 312      ceff2 = 0.57 + 2.5e-4*sig_pbarp + 0.65 * G4Exp(-0.02*sig_pbarp);
314       {                                        << 313     }
315         ceff2= 0.078 + 6.657e-4*sig_pbarp + 0. << 314     if( (theDef == G4Triton::Triton()) || (theDef == G4He3::He3() ) )
316       }                                        << 315     {
317       if(theTargetDef == theDeuteron)          << 316      ceff2 = 0.39 + 2.7e-4*sig_pbarp + 0.7 * G4Exp(-0.02*sig_pbarp);
318       {                                        << 317     }
319         ceff2 = 0.40 + 3.5e-4 *sig_pbarp + 0.4 << 318     if(theDef == theAlpha)
320       }                                        << 319     {
321       if( (theTargetDef == G4Triton::Triton()) << 320      ceff2 = 0.24 + 3.5e-4*sig_pbarp + 0.75 * G4Exp(-0.03*sig_pbarp);
322       {                                        << 321     }
323         ceff2 = 0.24 + 3.5e-4*sig_pbarp + 0.75 << 322    }
324       }                                        << 323 
325       if(theTargetDef == theAlpha)             << 324 
326       {                                        << 325    if (theParticle == theAAlpha)
327         ceff2 = 0.17 + 3.5e-4*sig_pbarp + 0.45 << 326    {
328       }                                        << 327     sig_pbarp = cs->GetAntiHadronNucleonTotCrSc(particle,energy/3.);
329       if(Z>2)                                  << 328     Ref2 = XstotalHad/10./2./pi ;
330       {                                        << 329     if(Z>2)
331         ceff2 = 0.22 + 2.0e-4*sig_pbarp + 0.2  << 330     {
332       }                                        << 331      ceff2 = 0.22 + 2.0e-4*sig_pbarp + 0.2 * G4Exp(-0.03*sig_pbarp);
333     }                                          << 332     }
334                                                << 333     if(theDef == theProton)
335     fRef=std::sqrt(Ref2);                      << 334     {
336     fceff = std::sqrt(ceff2);                  << 335      ceff2= 0.078 + 6.657e-4*sig_pbarp + 0.3359*G4Exp(-0.03*sig_pbarp);   
337                                                << 336     }
338     G4double Q = 0.0 ;                         << 337     if(theDef == theDeuteron)  
339     G4double BracFunct;                        << 338     {
340                                                << 339      ceff2 = 0.40 + 3.5e-4 *sig_pbarp + 0.45 * G4Exp(-0.02*sig_pbarp);
341     const G4int maxNumberOfLoops = 10000;      << 340     }   
342     G4int loopCounter = 0;                     << 341     if( (theDef == G4Triton::Triton()) || (theDef == G4He3::He3() ) )
343     do                                         << 342     {
344     {                                          << 343      ceff2 = 0.24 + 3.5e-4*sig_pbarp + 0.75 * G4Exp(-0.03*sig_pbarp);   
345       Q = -G4Log(1.-(1.- G4Exp(-SlopeMag * Qma << 344     }
346       G4double x = fRef * Q;                   << 345     if(theDef == theAlpha)   
347       BracFunct = ( ( sqr(BesselOneByArg(x))+s << 346     {
348         *   sqr(DampFactor(pi*fceff*Q))) /(Ama << 347      ceff2 = 0.17 + 3.5e-4*sig_pbarp + 0.45 * G4Exp(-0.03*sig_pbarp);
349       BracFunct = BracFunct * Q;               << 
350     }                                          << 
351     while ( (G4UniformRand()>BracFunct) &&     << 
352             ++loopCounter < maxNumberOfLoops ) << 
353     if ( loopCounter >= maxNumberOfLoops ) {   << 
354       fTetaCMS = 0.0;                          << 
355       return 0.0;                              << 
356     }                                             348     }
                                                   >> 349    }
357                                                   350 
358     T= sqr(Q);                                 << 351    fRef=std::sqrt(Ref2);
359     T*=3.893913e+4;  // fm^(-2) -> MeV^2       << 352    fceff = std::sqrt(ceff2);     
                                                   >> 353 // G4cout<<" Ref  "<<fRef<<" c_eff "<<fceff<< " rho "<< rho<<G4endl; 
360                                                   354 
361   }  // End of simulation of strong interactio << 355  
                                                   >> 356    G4double Q = 0.0 ;
                                                   >> 357    G4double BracFunct;
                                                   >> 358    const G4int maxNumberOfLoops = 10000;
                                                   >> 359    G4int loopCounter = 0;
                                                   >> 360    do 
                                                   >> 361    {
                                                   >> 362     Q = -G4Log(1.-(1.- G4Exp(-SlopeMag * Qmax))* G4UniformRand() )/SlopeMag;
                                                   >> 363     G4double x = fRef * Q;
                                                   >> 364     BracFunct = ( ( sqr(BesselOneByArg(x))+sqr(rho/2. * BesselJzero(x)) )
                                                   >> 365 *   sqr(DampFactor(pi*fceff*Q))) /(Amag*G4Exp(-SlopeMag*Q));
                                                   >> 366 
                                                   >> 367     BracFunct = BracFunct * Q * sqr(sqr(fRef));   
                                                   >> 368    } 
                                                   >> 369    while ( (G4UniformRand()>BracFunct) && 
                                                   >> 370            ++loopCounter < maxNumberOfLoops );  /* Loop checking, 10.08.2015, A.Ribon */
                                                   >> 371    if ( loopCounter >= maxNumberOfLoops ) {
                                                   >> 372      fTetaCMS = 0.0;
                                                   >> 373      return 0.0;
                                                   >> 374    }
                                                   >> 375 
                                                   >> 376    T= sqr(Q); 
                                                   >> 377    T*=3.893913e+4;                // fm -> MeV^2
                                                   >> 378    }
                                                   >> 379 
                                                   >> 380    G4double cosTet=1.0-T/(2.*ptot*ptot);
                                                   >> 381    if(cosTet >  1.0 ) cosTet= 1.;          // Uzhi 30 Nov. 
                                                   >> 382    if(cosTet < -1.0 ) cosTet=-1.;          // Uzhi 30 Nov. 
                                                   >> 383    fTetaCMS=std::acos(cosTet);
362                                                   384 
363   return T;                                    << 385    return T;
364 }                                                 386 }
365                                                   387 
366 //////////////////////////////////////////////    388 /////////////////////////////////////////////////////////////////////
367 //  Sample of Theta in CMS                        389 //  Sample of Theta in CMS
368  G4double G4AntiNuclElastic::SampleThetaCMS(co    390  G4double G4AntiNuclElastic::SampleThetaCMS(const G4ParticleDefinition* p, G4double plab,
369                                                   391                                                                          G4int Z, G4int A)
370 {                                                 392 { 
371   G4double T;                                     393   G4double T;
372   T =  SampleInvariantT( p, plab,  Z,  A);        394   T =  SampleInvariantT( p, plab,  Z,  A);
373                                                   395 
374    // NaN finder                                  396    // NaN finder
375   if(!(T < 0.0 || T >= 0.0))                      397   if(!(T < 0.0 || T >= 0.0))
376   {                                               398   {
377     if (verboseLevel > 0)                         399     if (verboseLevel > 0)
378     {                                             400     {
379       G4cout << "G4DiffuseElastic:WARNING: A =    401       G4cout << "G4DiffuseElastic:WARNING: A = " << A
380              << " mom(GeV)= " << plab/GeV         402              << " mom(GeV)= " << plab/GeV
381              << " S-wave will be sampled"         403              << " S-wave will be sampled"
382              << G4endl;                           404              << G4endl;
383     }                                             405     }
384     T = G4UniformRand()*fTmax;                    406     T = G4UniformRand()*fTmax;
385                                                   407  
386   }                                               408   }
387                                                   409 
388   if(fptot > 0.)                               << 410   if(fptot > 0.)                             // Uzhi 24 Nov. 2011
389   {                                               411   {
390    G4double cosTet=1.0-T/(2.*fptot*fptot);        412    G4double cosTet=1.0-T/(2.*fptot*fptot);
391    if(cosTet >  1.0 ) cosTet= 1.;              << 413    if(cosTet >  1.0 ) cosTet= 1.;          // Uzhi 30 Nov. 
392    if(cosTet < -1.0 ) cosTet=-1.;              << 414    if(cosTet < -1.0 ) cosTet=-1.;          // Uzhi 30 Nov. 
393    fTetaCMS=std::acos(cosTet);                    415    fTetaCMS=std::acos(cosTet); 
394    return fTetaCMS;                               416    return fTetaCMS;
395   } else                                       << 417   } else                                    // Uzhi 24 Nov. 2011
396   {                                            << 418   {                                         // Uzhi 24 Nov. 2011
397    return 2.*G4UniformRand()-1.;               << 419    return 2.*G4UniformRand()-1.;            // Uzhi 24 Nov. 2011
398   }                                            << 420   }                                         // Uzhi 24 Nov. 2011
399 }                                                 421 }  
400                                                   422 
401                                                   423 
402 //////////////////////////////////////////////    424 /////////////////////////////////////////////////////////////////////
403 //  Sample of Theta in Lab System                 425 //  Sample of Theta in Lab System
404  G4double G4AntiNuclElastic::SampleThetaLab(co    426  G4double G4AntiNuclElastic::SampleThetaLab(const G4ParticleDefinition* p, G4double plab,
405                                                   427                                                                          G4int Z, G4int A)
406 {                                                 428 { 
407   G4double T;                                     429   G4double T; 
408   T = SampleInvariantT( p, plab,  Z,  A);         430   T = SampleInvariantT( p, plab,  Z,  A);
409                                                   431 
410  // NaN finder                                    432  // NaN finder
411   if(!(T < 0.0 || T >= 0.0))                      433   if(!(T < 0.0 || T >= 0.0))
412   {                                               434   {
413     if (verboseLevel > 0)                         435     if (verboseLevel > 0)               
414     {                                             436     {
415       G4cout << "G4DiffuseElastic:WARNING: A =    437       G4cout << "G4DiffuseElastic:WARNING: A = " << A
416              << " mom(GeV)= " << plab/GeV         438              << " mom(GeV)= " << plab/GeV
417              << " S-wave will be sampled"         439              << " S-wave will be sampled"
418              << G4endl;                           440              << G4endl;
419     }                                             441     }
420     T = G4UniformRand()*fTmax;                    442     T = G4UniformRand()*fTmax;
421   }                                               443   }
422                                                   444 
423   G4double phi  = G4UniformRand()*twopi;          445   G4double phi  = G4UniformRand()*twopi;
424                                                   446 
425   G4double cost(1.);                              447   G4double cost(1.);
426   if(fTmax > 0.) {cost = 1. - 2.0*T/fTmax;}    << 448   if(fTmax > 0.) {cost = 1. - 2.0*T/fTmax;}             // Uzhi 24 Nov. 2011
427                                                   449 
428   G4double sint;                                  450   G4double sint;
429   if( cost >= 1.0 )                               451   if( cost >= 1.0 )
430   {                                               452   {
431     cost = 1.0;                                   453     cost = 1.0;
432     sint = 0.0;                                   454     sint = 0.0;
433   }                                               455   }
434   else if( cost <= -1.0)                          456   else if( cost <= -1.0)
435   {                                               457   {
436     cost = -1.0;                                  458     cost = -1.0;
437     sint =  0.0;                                  459     sint =  0.0;
438   }                                               460   }
439   else                                            461   else
440   {                                               462   {
441     sint = std::sqrt((1.0-cost)*(1.0+cost));      463     sint = std::sqrt((1.0-cost)*(1.0+cost));
442   }                                               464   }
443                                                   465 
444   G4double m1 = p->GetPDGMass();                  466   G4double m1 = p->GetPDGMass();
445   G4ThreeVector v(sint*std::cos(phi),sint*std:    467   G4ThreeVector v(sint*std::cos(phi),sint*std::sin(phi),cost);
446   v *= fptot;                                     468   v *= fptot;
447   G4LorentzVector nlv(v.x(),v.y(),v.z(),std::s    469   G4LorentzVector nlv(v.x(),v.y(),v.z(),std::sqrt(fptot*fptot + m1*m1));
448                                                   470    
449   nlv.boost(fbst);                                471   nlv.boost(fbst);
450                                                   472    
451   G4ThreeVector np = nlv.vect();                  473   G4ThreeVector np = nlv.vect();
452   G4double theta = np.theta();                    474   G4double theta = np.theta();
453   fThetaLab = theta;                              475   fThetaLab = theta; 
454                                                   476 
455   return theta;                                   477   return theta;
456 }                                                 478 }
457                                                   479 
458 //////////////////////////////////////////////    480 ////////////////////////////////////////////////////////////////////
459 //   Calculation of Damp factor                   481 //   Calculation of Damp factor
460  G4double G4AntiNuclElastic::DampFactor(G4doub    482  G4double G4AntiNuclElastic::DampFactor(G4double x)
461 {                                                 483 {
462    G4double df;                                   484    G4double df;
463    G4double  f3 = 6.; // first factorials         485    G4double  f3 = 6.; // first factorials
464                                                   486 
465  if( std::fabs(x) < 0.01 )                        487  if( std::fabs(x) < 0.01 )
466   {                                               488   { 
467       df=1./(1.+x*x/f3);                          489       df=1./(1.+x*x/f3); 
468  }                                                490  }
469   else                                            491   else
470   {                                               492   {
471     df = x/std::sinh(x);                          493     df = x/std::sinh(x); 
472   }                                               494   }
473   return df;                                      495   return df;
474 }                                                 496 }
475                                                   497 
476                                                   498 
477 //////////////////////////////////////////////    499 /////////////////////////////////////////////////////////////////////////////////
478 //  Calculation of particle velocity Beta         500 //  Calculation of particle velocity Beta
479                                                   501 
480  G4double G4AntiNuclElastic::CalculateParticle    502  G4double G4AntiNuclElastic::CalculateParticleBeta( const G4ParticleDefinition* particle, 
481                                   G4double mom    503                                   G4double momentum    )
482 {                                                 504 {
483   G4double mass = particle->GetPDGMass();         505   G4double mass = particle->GetPDGMass();
484   G4double a    = momentum/mass;                  506   G4double a    = momentum/mass;
485   fBeta         = a/std::sqrt(1+a*a);             507   fBeta         = a/std::sqrt(1+a*a);
486                                                   508 
487   return fBeta;                                   509   return fBeta; 
488 }                                                 510 }
489                                                   511 
490                                                   512 
491 //////////////////////////////////////////////    513 ///////////////////////////////////////////////////////////////////////////////////
492 //   Calculation of parameter Zommerfeld          514 //   Calculation of parameter Zommerfeld
493                                                   515 
494  G4double G4AntiNuclElastic::CalculateZommerfe    516  G4double G4AntiNuclElastic::CalculateZommerfeld( G4double beta, G4double Z1, G4double Z2 )
495 {                                                 517 {
496   fZommerfeld = fine_structure_const*Z1*Z2/bet    518   fZommerfeld = fine_structure_const*Z1*Z2/beta;
497                                                   519 
498   return fZommerfeld;                             520   return fZommerfeld; 
499 }                                                 521 }
500                                                   522 
501 //////////////////////////////////////////////    523 ////////////////////////////////////////////////////////////////////////////////////
502 //                                                524 //  
503 G4double G4AntiNuclElastic::CalculateAm( G4dou    525 G4double G4AntiNuclElastic::CalculateAm( G4double momentum, G4double n, G4double Z)
504 {                                                 526 {
505   G4double k   = momentum/hbarc;                  527   G4double k   = momentum/hbarc;
506   G4double ch  = 1.13 + 3.76*n*n;                 528   G4double ch  = 1.13 + 3.76*n*n;
507   G4double zn  = 1.77*k/G4Pow::GetInstance()->    529   G4double zn  = 1.77*k/G4Pow::GetInstance()->A13(Z)*Bohr_radius; 
508   G4double zn2 = zn*zn;                           530   G4double zn2 = zn*zn;
509   fAm          = ch/zn2;                          531   fAm          = ch/zn2;
510                                                   532 
511   return fAm;                                     533   return fAm;
512 }                                                 534 }
513                                                   535 
514 //////////////////////////////////////////////    536 /////////////////////////////////////////////////////////////
515 //                                                537 //
516 // Bessel J0 function based on rational approx    538 // Bessel J0 function based on rational approximation from
517 // J.F. Hart, Computer Approximations, New Yor    539 // J.F. Hart, Computer Approximations, New York, Willey 1968, p. 141
518                                                   540    
519 G4double G4AntiNuclElastic::BesselJzero(G4doub    541 G4double G4AntiNuclElastic::BesselJzero(G4double value)
520 {                                                 542 {  
521   G4double modvalue, value2, fact1, fact2, arg    543   G4double modvalue, value2, fact1, fact2, arg, shift, bessel;
522                                                   544 
523   modvalue = std::fabs(value);                    545   modvalue = std::fabs(value);
524                                                   546 
525   if ( value < 8.0 && value > -8.0 )              547   if ( value < 8.0 && value > -8.0 )
526   {                                               548   {
527     value2 = value*value;                         549     value2 = value*value;
528                                                   550                  
529     fact1  = 57568490574.0 + value2*(-13362590    551     fact1  = 57568490574.0 + value2*(-13362590354.0
530                            + value2*( 65161964    552                            + value2*( 651619640.7  
531                            + value2*(-11214424    553                            + value2*(-11214424.18
532                            + value2*( 77392.33    554                            + value2*( 77392.33017
533                            + value2*(-184.9052    555                            + value2*(-184.9052456   ) ) ) ) );
534                                                   556                               
535     fact2  = 57568490411.0 + value2*( 10295329    557     fact2  = 57568490411.0 + value2*( 1029532985.0
536                            + value2*( 9494680.    558                            + value2*( 9494680.718
537                            + value2*(59272.648    559                            + value2*(59272.64853
538                            + value2*(267.85327    560                            + value2*(267.8532712
539                            + value2*1.0           561                            + value2*1.0               ) ) ) );
540                                                   562  
541     bessel = fact1/fact2;                         563     bessel = fact1/fact2;
542   }                                               564   }
543   else                                            565   else
544   {                                               566   {
545     arg    = 8.0/modvalue;                        567     arg    = 8.0/modvalue;
546                                                   568 
547     value2 = arg*arg;                             569     value2 = arg*arg;
548                                                   570  
549     shift  = modvalue-0.785398164;                571     shift  = modvalue-0.785398164;
550                                                   572 
551     fact1  = 1.0 + value2*(-0.1098628627e-2       573     fact1  = 1.0 + value2*(-0.1098628627e-2
552                  + value2*(0.2734510407e-4        574                  + value2*(0.2734510407e-4
553                  + value2*(-0.2073370639e-5       575                  + value2*(-0.2073370639e-5
554                  + value2*0.2093887211e-6    )    576                  + value2*0.2093887211e-6    ) ) );
555   fact2  = -0.1562499995e-1 + value2*(0.143048    577   fact2  = -0.1562499995e-1 + value2*(0.1430488765e-3
556                               + value2*(-0.691    578                               + value2*(-0.6911147651e-5
557                               + value2*(0.7621    579                               + value2*(0.7621095161e-6
558                               - value2*0.93494    580                               - value2*0.934945152e-7    ) ) );
559                                                   581 
560     bessel = std::sqrt(0.636619772/modvalue)*(    582     bessel = std::sqrt(0.636619772/modvalue)*(std::cos(shift)*fact1 - arg*std::sin(shift)*fact2);
561   }                                               583   }
562   return bessel;                                  584   return bessel;
563 }                                                 585 }
564                                                   586 
565                                                   587 
566 //////////////////////////////////////////////    588 //////////////////////////////////////////////////////////////////////////////
567 // Bessel J1 function based on rational approx    589 // Bessel J1 function based on rational approximation from
568 // J.F. Hart, Computer Approximations, New Yor    590 // J.F. Hart, Computer Approximations, New York, Willey 1968, p. 141
569                                                   591     
570  G4double G4AntiNuclElastic::BesselJone(G4doub    592  G4double G4AntiNuclElastic::BesselJone(G4double value)
571 {                                                 593 {
572   G4double modvalue, value2, fact1, fact2, arg    594   G4double modvalue, value2, fact1, fact2, arg, shift, bessel;
573                                                   595                           
574   modvalue = std::fabs(value);                    596   modvalue = std::fabs(value);
575                                                   597                  
576   if ( modvalue < 8.0 )                           598   if ( modvalue < 8.0 )
577   {                                               599   {
578     value2 = value*value;                         600     value2 = value*value;
579     fact1  = value*(72362614232.0 + value2*(-7    601     fact1  = value*(72362614232.0 + value2*(-7895059235.0
580                                   + value2*( 2    602                                   + value2*( 242396853.1
581                                   + value2*(-2    603                                   + value2*(-2972611.439
582                                   + value2*( 1    604                                   + value2*( 15704.48260
583                                   + value2*(-3    605                                   + value2*(-30.16036606  ) ) ) ) ) );
584                                                   606     
585     fact2  = 144725228442.0 + value2*(23005351    607     fact2  = 144725228442.0 + value2*(2300535178.0
586                             + value2*(18583304    608                             + value2*(18583304.74
587                             + value2*(99447.43    609                             + value2*(99447.43394
588                             + value2*(376.9991    610                             + value2*(376.9991397
589                             + value2*1.0          611                             + value2*1.0             ) ) ) );
590     bessel = fact1/fact2;                         612     bessel = fact1/fact2;
591   }                                               613   }
592   else                                            614   else
593   {                                               615   {
594     arg    = 8.0/modvalue;                        616     arg    = 8.0/modvalue;  
595   value2 = arg*arg;                               617   value2 = arg*arg;
596                                                   618 
597     shift  = modvalue - 2.356194491;              619     shift  = modvalue - 2.356194491;
598                                                   620 
599     fact1  = 1.0 + value2*( 0.183105e-2           621     fact1  = 1.0 + value2*( 0.183105e-2
600                  + value2*(-0.3516396496e-4       622                  + value2*(-0.3516396496e-4
601                  + value2*(0.2457520174e-5        623                  + value2*(0.2457520174e-5
602                  + value2*(-0.240337019e-6        624                  + value2*(-0.240337019e-6          ) ) ) );
603                                                   625 
604     fact2 = 0.04687499995 + value2*(-0.2002690    626     fact2 = 0.04687499995 + value2*(-0.2002690873e-3
605                           + value2*( 0.8449199    627                           + value2*( 0.8449199096e-5
606                           + value2*(-0.8822898    628                           + value2*(-0.88228987e-6
607                           + value2*0.105787412    629                           + value2*0.105787412e-6       ) ) );
608                                                   630 
609     bessel = std::sqrt( 0.636619772/modvalue)*    631     bessel = std::sqrt( 0.636619772/modvalue)*(std::cos(shift)*fact1 - arg*std::sin(shift)*fact2);
610     if (value < 0.0) bessel = -bessel;            632     if (value < 0.0) bessel = -bessel;
611   }                                               633   }
612   return bessel;                                  634   return bessel;
613 }                                                 635 }
614                                                   636 
615 //////////////////////////////////////////////    637 ////////////////////////////////////////////////////////////////////////////////
616 // return J1(x)/x with special case for small     638 // return J1(x)/x with special case for small x 
617 G4double G4AntiNuclElastic::BesselOneByArg(G4d    639 G4double G4AntiNuclElastic::BesselOneByArg(G4double x)
618 {                                                 640 {
619   G4double x2, result;                            641   G4double x2, result;
620                                                   642  
621   if( std::fabs(x) < 0.01 )                       643   if( std::fabs(x) < 0.01 )
622   {                                               644   {
623    x  *= 0.5;                                     645    x  *= 0.5;
624    x2 = x*x;                                      646    x2 = x*x;
625    result = (2.- x2 + x2*x2/6.)/4.;               647    result = (2.- x2 + x2*x2/6.)/4.;
626   }                                               648   }
627   else                                            649   else
628   {                                               650   {
629     result = BesselJone(x)/x;                     651     result = BesselJone(x)/x;
630   }                                               652   }
631   return result;                                  653   return result;
632 }                                                 654 } 
633                                                   655 
634 //////////////////////////////////////////////    656 /////////////////////////////////////////////////////////////////////////////////
635 // return  angle from which Coulomb scattering    657 // return  angle from which Coulomb scattering is calculated 
636 G4double G4AntiNuclElastic::GetcosTeta1(G4doub    658 G4double G4AntiNuclElastic::GetcosTeta1(G4double plab, G4int A)
637 {                                                 659 {
638                                                   660 
639 // G4double p0 =G4LossTableManager::Instance()    661 // G4double p0 =G4LossTableManager::Instance()->FactorForAngleLimit()*CLHEP::hbarc/CLHEP::fermi;
640   G4double p0 = 1.*hbarc/fermi;                   662   G4double p0 = 1.*hbarc/fermi;
641 //G4double cteta1 = 1.0 - p0*p0/2.0 * pow(A,2.    663 //G4double cteta1 = 1.0 - p0*p0/2.0 * pow(A,2./3.)/(plab*plab);
642   G4double cteta1 = 1.0 - p0*p0/2.0 * G4Pow::G    664   G4double cteta1 = 1.0 - p0*p0/2.0 * G4Pow::GetInstance()->Z23(A)/(plab*plab);
643 //////////////////                                665 //////////////////
644   if(cteta1 < -1.) cteta1 = -1.0;                 666   if(cteta1 < -1.) cteta1 = -1.0;
645   return cteta1;                                  667   return cteta1;
646 }                                                 668 }
647                                                   669 
648                                                   670 
649                                                   671 
650                                                   672 
651                                                   673 
652                                                   674 
653                                                   675 
654                                                   676