G4ChipsKaonPlusInelasticXS.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 //
00027 // The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
00028 // GEANT4 tag $Name: not supported by cvs2svn $
00029 //
00030 //
00031 // G4 Physics class: G4QKaonPlusNuclearCrossSection for gamma+A cross sections
00032 // Created: M.V. Kossov, CERN/ITEP(Moscow), 20-Dec-03
00033 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Feb-04
00034 //
00035 // --------------------------------------------------------------------------------
00036 // Short description: Cross-sections extracted from the CHIPS package for 
00037 // kaon(minus)-nuclear interactions. Author: M. Kossov
00038 // -------------------------------------------------------------------------------------
00039 //
00040 
00041 #include "G4ChipsKaonPlusInelasticXS.hh"
00042 #include "G4SystemOfUnits.hh"
00043 #include "G4DynamicParticle.hh"
00044 #include "G4ParticleDefinition.hh"
00045 #include "G4KaonPlus.hh"
00046 #include "G4Proton.hh"
00047 #include "G4PionPlus.hh"
00048 
00049 // factory
00050 #include "G4CrossSectionFactory.hh"
00051 //
00052 G4_DECLARE_XS_FACTORY(G4ChipsKaonPlusInelasticXS);
00053 
00054 
00055 G4ChipsKaonPlusInelasticXS::G4ChipsKaonPlusInelasticXS():G4VCrossSectionDataSet(Default_Name())
00056 {
00057   // Initialization of the
00058   lastLEN=0; // Pointer to the lastArray of LowEn CS
00059   lastHEN=0; // Pointer to the lastArray of HighEn CS
00060   lastN=0;   // The last N of calculated nucleus
00061   lastZ=0;   // The last Z of calculated nucleus
00062   lastP=0.;  // Last used in cross section Momentum
00063   lastTH=0.; // Last threshold momentum
00064   lastCS=0.; // Last value of the Cross Section
00065   lastI=0;   // The last position in the DAMDB
00066   LEN = new std::vector<G4double*>;
00067   HEN = new std::vector<G4double*>;
00068 }
00069 
00070 G4ChipsKaonPlusInelasticXS::~G4ChipsKaonPlusInelasticXS()
00071 {
00072   G4int lens=LEN->size();
00073   for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
00074   delete LEN;
00075 
00076   G4int hens=HEN->size();
00077   for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
00078   delete HEN;
00079 }
00080 
00081 
00082 G4bool G4ChipsKaonPlusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,    
00083                                  const G4Element*,
00084                                  const G4Material*)
00085 {
00086   G4ParticleDefinition* particle = Pt->GetDefinition();
00087   if (particle ==       G4KaonPlus::KaonPlus()      ) return true;
00088   return false;
00089 }
00090 
00091 
00092 // The main member function giving the collision cross section (P is in IU, CS is in mb)
00093 // Make pMom in independent units ! (Now it is MeV)
00094 G4double G4ChipsKaonPlusInelasticXS::GetIsoCrossSection(const G4DynamicParticle* Pt, G4int tgZ, G4int A,  
00095                                                         const G4Isotope*,
00096                                                         const G4Element*,
00097                                                         const G4Material*)
00098 {
00099   G4double pMom=Pt->GetTotalMomentum();
00100   G4int tgN = A - tgZ;
00101   
00102   return GetChipsCrossSection(pMom, tgZ, tgN, 321);
00103 }
00104 
00105 G4double G4ChipsKaonPlusInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int )
00106 {
00107   static G4int j;                      // A#0f Z/N-records already tested in AMDB
00108   static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
00109   static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
00110   static std::vector <G4double> colP;  // Vector of last momenta for the reaction
00111   static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
00112   static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
00113   // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
00114 
00115   G4bool in=false;                     // By default the isotope must be found in the AMDB
00116   if(tgN!=lastN || tgZ!=lastZ)         // The nucleus was not the last used isotope
00117   {
00118     in = false;                        // By default the isotope haven't be found in AMDB  
00119     lastP   = 0.;                      // New momentum history (nothing to compare with)
00120     lastN   = tgN;                     // The last N of the calculated nucleus
00121     lastZ   = tgZ;                     // The last Z of the calculated nucleus
00122     lastI   = colN.size();             // Size of the Associative Memory DB in the heap
00123     j  = 0;                            // A#0f records found in DB for this projectile
00124 
00125     if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
00126     {
00127       if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
00128       {
00129         lastI=i;                       // Remember the index for future fast/last use
00130         lastTH =colTH[i];              // The last THreshold (A-dependent)
00131 
00132         if(pMom<=lastTH)
00133         {
00134           return 0.;                   // Energy is below the Threshold value
00135         }
00136         lastP  =colP [i];              // Last Momentum  (A-dependent)
00137         lastCS =colCS[i];              // Last CrossSect (A-dependent)
00138         in = true;                     // This is the case when the isotop is found in DB
00139         // Momentum pMom is in IU ! @@ Units
00140         lastCS=CalculateCrossSection(-1,j,321,lastZ,lastN,pMom); // read & update
00141 
00142         if(lastCS<=0. && pMom>lastTH)  // Correct the threshold (@@ No intermediate Zeros)
00143         {
00144           lastCS=0.;
00145           lastTH=pMom;
00146         }
00147         break;                         // Go out of the LOOP
00148       }
00149       j++;                             // Increment a#0f records found in DB
00150     }
00151     if(!in)                            // This isotope has not been calculated previously
00152     {
00154       lastCS=CalculateCrossSection(0,j,321,lastZ,lastN,pMom); //calculate & create
00155 
00156       //if(lastCS>0.)                   // It means that the AMBD was initialized
00157       //{
00158 
00159       lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
00160         colN.push_back(tgN);
00161         colZ.push_back(tgZ);
00162         colP.push_back(pMom);
00163         colTH.push_back(lastTH);
00164         colCS.push_back(lastCS);
00165       //} // M.K. Presence of H1 with high threshold breaks the syncronization
00166       return lastCS*millibarn;
00167     } // End of creation of the new set of parameters
00168     else
00169     {
00170       colP[lastI]=pMom;
00171       colCS[lastI]=lastCS;
00172     }
00173   } // End of parameters udate
00174   else if(pMom<=lastTH)
00175   {
00176     return 0.;                         // Momentum is below the Threshold Value -> CS=0
00177   }
00178   else                                 // It is the last used -> use the current tables
00179   {
00180     lastCS=CalculateCrossSection(1,j,321,lastZ,lastN,pMom); // Only read and UpdateDB
00181     lastP=pMom;
00182   }
00183   return lastCS*millibarn;
00184 }
00185 
00186 // The main member function giving the gamma-A cross section (E in GeV, CS in mb)
00187 G4double G4ChipsKaonPlusInelasticXS::CalculateCrossSection(G4int F, G4int I,
00188                                         G4int, G4int targZ, G4int targN, G4double Momentum)
00189 {
00190   static const G4double THmin=27.;     // default minimum Momentum (MeV/c) Threshold
00191   static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
00192   static const G4double dP=10.;        // step for the LEN (Low ENergy) table MeV/c
00193   static const G4double dPG=dP*.001;   // step for the LEN (Low ENergy) table GeV/c
00194   static const G4int    nL=105;        // A#of LEN points in E (step 10 MeV/c)
00195   static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
00196   static const G4double Pmax=227000.;  // maxP for the HEN (High ENergy) part 227 GeV
00197   static const G4int    nH=224;        // A#of HEN points in lnE
00198   static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
00199   static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
00200   static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
00201   static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
00202 
00203   G4double sigma=0.;
00204   if(F&&I) sigma=0.;                   // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
00205   G4double A=targN+targZ;              // A of the target
00206 
00207   if(F<=0)                             // This isotope was not the last used isotop
00208   {
00209     if(F<0)                            // This isotope was found in DAMDB =-----=> RETRIEVE
00210     {
00211       G4int sync=LEN->size();
00212       if(sync<=I) G4cerr<<"*!*G4ChipsKPlusNuclCS::CalcCrosSect:Sync="<<sync<<"<="<<I<<G4endl;
00213       lastLEN=(*LEN)[I];               // Pointer to prepared LowEnergy cross sections
00214       lastHEN=(*HEN)[I];               // Pointer to prepared High Energy cross sections
00215     }
00216     else                               // This isotope wasn't calculated before => CREATE
00217     {
00218       lastLEN = new G4double[nL];      // Allocate memory for the new LEN cross sections
00219       lastHEN = new G4double[nH];      // Allocate memory for the new HEN cross sections
00220       // --- Instead of making a separate function ---
00221       G4double P=THmiG;                // Table threshold in GeV/c
00222       for(G4int k=0; k<nL; k++)
00223       {
00224         lastLEN[k] = CrossSectionLin(targZ, targN, P);
00225         P+=dPG;
00226       }
00227       G4double lP=milPG;
00228       for(G4int n=0; n<nH; n++)
00229       {
00230         lastHEN[n] = CrossSectionLog(targZ, targN, lP);
00231         lP+=dlP;
00232       }
00233       // --- End of possible separate function
00234       // *** The synchronization check ***
00235       G4int sync=LEN->size();
00236       if(sync!=I)
00237       {
00238         G4cerr<<"***G4ChipsKPlusNuclCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
00239               <<", N="<<targN<<", F="<<F<<G4endl;
00240         //G4Exception("G4PiMinusNuclearCS::CalculateCS:","39",FatalException,"DBoverflow");
00241       }
00242       LEN->push_back(lastLEN);         // remember the Low Energy Table
00243       HEN->push_back(lastHEN);         // remember the High Energy Table
00244     } // End of creation of the new set of parameters
00245   } // End of parameters udate
00246   // =--------------------------= NOW the Magic Formula =---------------------------------=
00247 
00248   if (Momentum<lastTH) return 0.;      // It must be already checked in the interface class
00249   else if (Momentum<Pmin)              // Low Energy region
00250   {
00251     if(A<=1. && Momentum < 600.) sigma=0.; // Approximation tot/el uncertainty
00252     else sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
00253   }
00254   else if (Momentum<Pmax)              // High Energy region
00255   {
00256     G4double lP=std::log(Momentum);
00257     sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
00258   }
00259   else                                 // UHE region (calculation, not frequent)
00260   {
00261     G4double P=0.001*Momentum;         // Approximation formula is for P in GeV/c
00262     sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
00263   }
00264   if(sigma<0.) return 0.;
00265   return sigma;
00266 }
00267 
00268 // Electromagnetic momentum-threshold (in MeV/c) 
00269 G4double G4ChipsKaonPlusInelasticXS::ThresholdMomentum(G4int tZ, G4int tN)
00270 {
00271   static const G4double third=1./3.;
00272   static const G4double prM = G4Proton::Proton()->GetPDGMass(); // Proton mass in MeV
00273   static const G4double piM = G4PionPlus::PionPlus()->GetPDGMass()+.1; // Pion mass in MeV+Safety (WP)??
00274   static const G4double pM =  G4KaonPlus::KaonPlus()->GetPDGMass(); // Projectile mass in MeV
00275   static const G4double tpM= pM+pM;   // Doubled projectile mass (MeV)
00276   G4double tA=tZ+tN;
00277   if(tZ<.99 || tN<0.) return 0.;
00278   G4double tM=931.5*tA;
00279   G4double dE=piM;                    // At least one Pi0 must be created
00280   if(tZ==1 && tN==0) tM=prM;          // A threshold on the free proton
00281   else dE=tZ/(1.+std::pow(tA,third)); // Safety for diffused edge of the nucleus (QE)
00282   //G4double dE=1.263*tZ/(1.+std::pow(tA,third));
00283   G4double T=dE+dE*(dE/2+pM)/tM;
00284   return std::sqrt(T*(tpM+T));
00285 }
00286 
00287 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
00288 G4double G4ChipsKaonPlusInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double P)
00289 {
00290   G4double lP=std::log(P);
00291   return CrossSectionFormula(tZ, tN, P, lP);
00292 }
00293 
00294 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
00295 G4double G4ChipsKaonPlusInelasticXS::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
00296 {
00297   G4double P=std::exp(lP);
00298   return CrossSectionFormula(tZ, tN, P, lP);
00299 }
00300 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
00301 G4double G4ChipsKaonPlusInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
00302                                                               G4double P, G4double lP)
00303 {
00304   G4double sigma=0.;
00305   if(tZ==1 && !tN)                        // KPlus-Proton interaction from G4QuasiElRatios
00306   {
00307     G4double ld=lP-3.5;
00308     G4double ld2=ld*ld;
00309     G4double sp=std::sqrt(P);
00310     G4double p2=P*P;
00311     G4double p4=p2*p2;
00312     G4double lm=P-1.;
00313     G4double md=lm*lm+.372;
00314     G4double El=(.0557*ld2+2.23)/(1.-.7/sp+.1/p4);
00315     G4double To=(.3*ld2+19.5)/(1.+.46/sp+1.6/p4);
00316     sigma=(To-El)+.6/md;
00317   }
00318   else if(tZ<97 && tN<152)                // General solution
00319   {
00320     G4double p2=P*P;
00321     G4double p4=p2*p2;
00322     G4double a=tN+tZ;                       // A of the target
00323     G4double al=std::log(a);
00324     G4double sa=std::sqrt(a);
00325     G4double asa=a*sa;
00326     G4double a2=a*a;
00327     G4double a3=a2*a;
00328     G4double a4=a2*a2;
00329     G4double a8=a4*a4;
00330     G4double a12=a8*a4;
00331     G4double f=.6;                       // Default values for deutrons
00332     G4double r=.5;
00333     G4double gg=3.7;
00334     G4double c=36.;
00335     G4double ss=3.5;
00336     G4double t=3.;
00337     G4double u=.44;
00338     G4double v=5.E-9;
00339     if(tZ>1 && tN>1)                     // More than deuteron
00340     {
00341       f=1.;
00342       r=1./(1.+.007*a2);
00343       gg=4.2;
00344       c=52.*std::exp(al*.6)*(1.+95./a2)/(1.+9./a)/(1.+46./a2);
00345       ss=(40.+.14*a)/(1.+12./a);
00346       G4double y=std::exp(al*1.7);
00347       t=.185*y/(1.+.00012*y);
00348       u=(1.+80./asa)/(1.+200./asa);
00349       v=(1.+3.E-6*a4*(1.+6.E-7*a3+4.E10/a12))/a3/20000.;
00350     }
00351     G4double d=lP-gg;
00352     G4double w=P-1.;
00353     G4double rD=ss/(w*w+.36);
00354     G4double h=P-.44;
00355     G4double rR=t/(h*h+u*u);
00356     sigma=(f*d*d+c)/(1.+r/std::sqrt(P)+1./p4)+(rD+rR)/(1+v/p4/p4);
00357   }
00358   else
00359   {
00360     G4cerr<<"-Warning-G4ChipsKaonPlusNuclearCroSect::CSForm:Bad A, Z="<<tZ<<", N="<<tN<<G4endl;
00361     sigma=0.;
00362   }
00363   if(sigma<0.) return 0.;
00364   return sigma;  
00365 }
00366 
00367 G4double G4ChipsKaonPlusInelasticXS::EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double* Y)
00368 {
00369   if(DX<=0. || N<2)
00370     {
00371       G4cerr<<"***G4ChipsKaonPlusInelasticXS::EquLinearFit: DX="<<DX<<", N="<<N<<G4endl;
00372       return Y[0];
00373     }
00374   
00375   G4int    N2=N-2;
00376   G4double d=(X-X0)/DX;
00377   G4int         j=static_cast<int>(d);
00378   if     (j<0)  j=0;
00379   else if(j>N2) j=N2;
00380   d-=j; // excess
00381   G4double yi=Y[j];
00382   G4double sigma=yi+(Y[j+1]-yi)*d;
00383   
00384   return sigma;
00385 }

Generated on Mon May 27 17:47:52 2013 for Geant4 by  doxygen 1.4.7