G4QAntiBaryonNuclearCrossSection.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: G4QAntiBaryonNuclearCrossSection 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 // This Header is a part of the CHIPS physics package (author: M. Kosov)
00037 // ****************************************************************************************
00038 // Short description: CHIPS cross-sections for AntiBaryon(minus&zero)-nuclear interactions
00039 // ----------------------------------------------------------------------------------------
00040 //
00041 //#define debug
00042 //#define pdebug
00043 //#define debug3
00044 //#define debugn
00045 //#define debugs
00046 
00047 #include "G4QAntiBaryonNuclearCrossSection.hh"
00048 #include "G4SystemOfUnits.hh"
00049 
00050 // Initialization of the
00051 G4double* G4QAntiBaryonNuclearCrossSection::lastLEN=0; // Pointer to lastArray of LowEn CS
00052 G4double* G4QAntiBaryonNuclearCrossSection::lastHEN=0; // Pointer to lastArray of HighEn CS
00053 G4int     G4QAntiBaryonNuclearCrossSection::lastN=0;   // The last N of calculated nucleus
00054 G4int     G4QAntiBaryonNuclearCrossSection::lastZ=0;   // The last Z of calculated nucleus
00055 G4double  G4QAntiBaryonNuclearCrossSection::lastP=0.;  // Last used Cross Section Momentum
00056 G4double  G4QAntiBaryonNuclearCrossSection::lastTH=0.; // Last threshold momentum
00057 G4double  G4QAntiBaryonNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
00058 G4int     G4QAntiBaryonNuclearCrossSection::lastI=0;   // The last position in the DAMDB
00059 std::vector<G4double*>* G4QAntiBaryonNuclearCrossSection::LEN = new std::vector<G4double*>;
00060 std::vector<G4double*>* G4QAntiBaryonNuclearCrossSection::HEN = new std::vector<G4double*>;
00061 
00062 // Returns Pointer to the G4VQCrossSection class
00063 G4VQCrossSection* G4QAntiBaryonNuclearCrossSection::GetPointer()
00064 {
00065   static G4QAntiBaryonNuclearCrossSection theCrossSection; //*Static body of Cross Section*
00066   return &theCrossSection;
00067 }
00068 
00069 G4QAntiBaryonNuclearCrossSection::~G4QAntiBaryonNuclearCrossSection()
00070 {
00071   G4int lens=LEN->size();
00072   for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
00073   delete LEN;
00074   G4int hens=HEN->size();
00075   for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
00076   delete HEN;
00077 }
00078 
00079 // The main member function giving the collision cross section (P is in IU, CS is in mb)
00080 // Make pMom in independent units ! (Now it is MeV)
00081 G4double G4QAntiBaryonNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
00082                                                        G4int tgZ, G4int tgN, G4int PDG)
00083 {
00084   //A.R.23-Oct-2012 Shadowed variable  static G4double tolerance=0.001;     // Tolerance (0.1%) to consider as "the same mom"
00085   static G4int j;                      // A#0f Z/N-records already tested in AMDB
00086   static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
00087   static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
00088   static std::vector <G4double> colP;  // Vector of last momenta for the reaction
00089   static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
00090   static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
00091   // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
00092 #ifdef debug
00093   G4cout<<"G4QaBCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
00094         <<"("<<lastN<<"),PDG="<<PDG<<", thresh="<<lastTH<<",Sz="<<colN.size()<<G4endl;
00095 #endif
00096   if(PDG>-2111 || PDG==-3112 || PDG==-3312 || PDG==-3334)
00097     G4cout<<"-Warning-G4QAntiBaryonCS::GetCS: Not Negat/Zero AntiBaryon,PDG="<<PDG<<G4endl;
00098   G4bool in=false;                     // By default the isotope must be found in the AMDB
00099   if(tgN!=lastN || tgZ!=lastZ)         // The nucleus was not the last used isotope
00100   {
00101     in = false;                        // By default the isotope haven't be found in AMDB  
00102     lastP   = 0.;                      // New momentum history (nothing to compare with)
00103     lastN   = tgN;                     // The last N of the calculated nucleus
00104     lastZ   = tgZ;                     // The last Z of the calculated nucleus
00105     lastI   = colN.size();             // Size of the Associative Memory DB in the heap
00106     j  = 0;                            // A#0f records found in DB for this projectile
00107 #ifdef debug
00108     G4cout<<"G4QaBarNucCS::GetCS: the amount of records in the AMDB lastI="<<lastI<<G4endl;
00109 #endif
00110     if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
00111     {
00112       if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
00113       {
00114         lastI=i;                       // Remember the index for future fast/last use
00115         lastTH =colTH[i];              // The last THreshold (A-dependent)
00116 #ifdef debug
00117         G4cout<<"G4QaBCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
00118 #endif
00119         if(pMom<=lastTH)
00120         {
00121 #ifdef debug
00122           G4cout<<"G4QPCS::GetCS:Found,P="<<pMom<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
00123 #endif
00124           return 0.;                   // Energy is below the Threshold value
00125         }
00126         lastP  =colP [i];              // Last Momentum  (A-dependent)
00127         lastCS =colCS[i];              // Last CrossSect (A-dependent)
00128         if(std::fabs(lastP-pMom)<tolerance*pMom)
00129         //if(lastP==pMom)              // VI do not use tolerance
00130         {
00131 #ifdef debug
00132           G4cout<<"..G4QaBCS::GetCS:.DoNothing.P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
00133 #endif
00134           //CalculateCrossSection(fCS,-1,j,PDG,lastZ,lastN,pMom); // Update param's only
00135           return lastCS*millibarn;     // Use theLastCS
00136         }
00137         in = true;                     // This is the case when the isotop is found in DB
00138         // Momentum pMom is in IU ! @@ Units
00139 #ifdef debug
00140         G4cout<<"G4QaBCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
00141 #endif
00142         lastCS=CalculateCrossSection(fCS,-1,j,PDG,lastZ,lastN,pMom); // read & update
00143 #ifdef debug
00144         G4cout<<"G4QaBCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
00145 #endif
00146         if(lastCS<=0. && pMom>lastTH)  // Correct the threshold (@@ No intermediate Zeros)
00147         {
00148 #ifdef debug
00149           G4cout<<"G4QaBNucCS::GetCS: New P="<<pMom<<"(CS=0) > Threshold="<<lastTH<<G4endl;
00150 #endif
00151           lastCS=0.;
00152           lastTH=pMom;
00153         }
00154         break;                         // Go out of the LOOP
00155       }
00156 #ifdef debug
00157       G4cout<<"-->G4QaBNucCrossSec::GetCrosSec: pPDG="<<PDG<<", j="<<j<<", N="<<colN[i]
00158             <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
00159 #endif
00160       j++;                             // Increment a#0f records found in DB
00161     }
00162 #ifdef debug
00163     G4cout<<"-?-G4QaBCS::GetCS:RC Z="<<tgZ<<",N="<<tgN<<",in="<<in<<",j="<<j<<" ?"<<G4endl;
00164 #endif
00165     if(!in)                            // This isotope has not been calculated previously
00166     {
00167 #ifdef debug
00168       G4cout<<"^^^G4QaBCS::GetCS:CalcNew P="<<pMom<<", f="<<fCS<<", lastI="<<lastI<<G4endl;
00169 #endif
00171       lastCS=CalculateCrossSection(fCS,0,j,PDG,lastZ,lastN,pMom); //calculate & create
00172       //if(lastCS>0.)                   // It means that the AMBD was initialized
00173       //{
00174 
00175         lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
00176 #ifdef debug
00177         G4cout<<"G4QaBCrossSection::GetCrossSect: NewThresh="<<lastTH<<",P="<<pMom<<G4endl;
00178 #endif
00179         colN.push_back(tgN);
00180         colZ.push_back(tgZ);
00181         colP.push_back(pMom);
00182         colTH.push_back(lastTH);
00183         colCS.push_back(lastCS);
00184 #ifdef debug
00185         G4cout<<"G4QaBCS::GetCrosSec:recCS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
00186 #endif
00187       //} // M.K. Presence of H1 with high threshold breaks the syncronization
00188 #ifdef pdebug
00189       G4cout<<"G4QaBCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
00190 #endif
00191       return lastCS*millibarn;
00192     } // End of creation of the new set of parameters
00193     else
00194     {
00195 #ifdef debug
00196       G4cout<<"G4QAntiBaryNucCrossSection::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
00197 #endif
00198       colP[lastI]=pMom;
00199       colCS[lastI]=lastCS;
00200     }
00201   } // End of parameters udate
00202   else if(pMom<=lastTH)
00203   {
00204 #ifdef debug
00205     G4cout<<"G4QaBNCS::GetCS: Current P="<<pMom<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
00206 #endif
00207     return 0.;                         // Momentum is below the Threshold Value -> CS=0
00208   }
00209   else if(std::fabs(lastP-pMom)<tolerance*pMom)
00210   //else if(lastP==pMom)               // VI do not use tolerance
00211   {
00212 #ifdef debug
00213     G4cout<<"..G4QPCS::GetCS:OldNZ&P="<<lastP<<"="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
00214 #endif
00215     return lastCS*millibarn;           // Use theLastCS
00216   }
00217   else                                 // It is the last used -> use the current tables
00218   {
00219 #ifdef debug
00220     G4cout<<"-!-G4QPCS::GetCS:UseCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
00221 #endif
00222     lastCS=CalculateCrossSection(fCS,1,j,PDG,lastZ,lastN,pMom); // Only read and UpdateDB
00223     lastP=pMom;
00224   }
00225 #ifdef debug
00226   G4cout<<"==>G4QaBCS::GetCroSec: P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
00227 #endif
00228   return lastCS*millibarn;
00229 }
00230 
00231 // The main member function giving the gamma-A cross section (E in GeV, CS in mb)
00232 G4double G4QAntiBaryonNuclearCrossSection::CalculateCrossSection(G4bool, G4int F, G4int I,
00233                                         G4int, G4int targZ, G4int targN, G4double Momentum)
00234 {
00235   static const G4double THmin=27.;     // default minimum Momentum (MeV/c) Threshold
00236   static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
00237   static const G4double dP=10.;        // step for the LEN (Low ENergy) table MeV/c
00238   static const G4double dPG=dP*.001;   // step for the LEN (Low ENergy) table GeV/c
00239   static const G4int    nL=105;        // A#of LEN points in E (step 10 MeV/c)
00240   static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
00241   static const G4double Pmax=227000.;  // maxP for the HEN (High ENergy) part 227 GeV
00242   static const G4int    nH=224;        // A#of HEN points in lnE
00243   static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
00244   static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
00245   static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
00246   static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
00247 #ifdef debug
00248   G4cout<<"G4QaBarNCS::CalCS:N="<<targN<<",Z="<<targZ<<",P="<<Momentum<<">"<<THmin<<G4endl;
00249 #endif
00250   G4double sigma=0.;
00251   if(F&&I) sigma=0.;                   // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
00252   //G4double A=targN+targZ;              // A of the target
00253 #ifdef debug
00254   G4cout<<"G4QaBarNucCS::CalCS: A="<<A<<",F="<<F<<",I="<<I<<",nL="<<nL<<",nH="<<nH<<G4endl;
00255 #endif
00256   if(F<=0)                             // This isotope was not the last used isotop
00257   {
00258     if(F<0)                            // This isotope was found in DAMDB =-----=> RETRIEVE
00259     {
00260       G4int sync=LEN->size();
00261       if(sync<=I) G4cerr<<"*!*G4QPiMinusNuclCS::CalcCrosSect:Sync="<<sync<<"<="<<I<<G4endl;
00262       lastLEN=(*LEN)[I];               // Pointer to prepared LowEnergy cross sections
00263       lastHEN=(*HEN)[I];               // Pointer to prepared High Energy cross sections
00264     }
00265     else                               // This isotope wasn't calculated before => CREATE
00266     {
00267       lastLEN = new G4double[nL];      // Allocate memory for the new LEN cross sections
00268       lastHEN = new G4double[nH];      // Allocate memory for the new HEN cross sections
00269       // --- Instead of making a separate function ---
00270       G4double P=THmiG;                // Table threshold in GeV/c
00271       for(G4int n=0; n<nL; n++)
00272       {
00273         lastLEN[n] = CrossSectionLin(targZ, targN, P);
00274         P+=dPG;
00275       }
00276       G4double lP=milPG;
00277       for(G4int n=0; n<nH; n++)
00278       {
00279         lastHEN[n] = CrossSectionLog(targZ, targN, lP);
00280         lP+=dlP;
00281       }
00282 #ifdef debug
00283       G4cout<<"-*->G4QaBarNucCS::CalcCS:Tab for Z="<<targZ<<",N="<<targN<<",I="<<I<<G4endl;
00284 #endif
00285       // --- End of possible separate function
00286       // *** The synchronization check ***
00287       G4int sync=LEN->size();
00288       if(sync!=I)
00289       {
00290         G4cerr<<"***G4QPiMinusNuclCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
00291               <<", N="<<targN<<", F="<<F<<G4endl;
00292         //G4Exception("G4PiMinusNuclearCS::CalculateCS:","39",FatalException,"DBoverflow");
00293       }
00294       LEN->push_back(lastLEN);         // remember the Low Energy Table
00295       HEN->push_back(lastHEN);         // remember the High Energy Table
00296     } // End of creation of the new set of parameters
00297   } // End of parameters udate
00298   // =-------------------= NOW the Magic Formula =--------------------=
00299 #ifdef debug
00300   G4cout<<"G4QaBNCS::CalcCS:lTH="<<lastTH<<",Pmi="<<Pmin<<",dP="<<dP<<",dlP="<<dlP<<G4endl;
00301 #endif
00302   if (Momentum<lastTH) return 0.;      // It must be already checked in the interface class
00303   else if (Momentum<Pmin)              // High Energy region
00304   {
00305 #ifdef debug
00306     G4cout<<"G4QaBNCS::CalcCS:bLEN nL="<<nL<<",TH="<<THmin<<",dP="<<dP<<G4endl;
00307 #endif
00308     sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
00309 #ifdef debugn
00310     if(sigma<0.)
00311       G4cout<<"G4QaBNuCS::CalcCS: E="<<Momentum<<",T="<<THmin<<",dP="<<dP<<G4endl;
00312 #endif
00313   }
00314   else if (Momentum<Pmax)              // High Energy region
00315   {
00316     G4double lP=std::log(Momentum);
00317 #ifdef debug
00318     G4cout<<"G4QaBarNucCS::CalcCS: before HEN nH="<<nH<<",iE="<<milP<<",dlP="<<dlP<<G4endl;
00319 #endif
00320     sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
00321   }
00322   else                                 // UHE region (calculation, not frequent)
00323   {
00324     G4double P=0.001*Momentum;         // Approximation formula is for P in GeV/c
00325     sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
00326   }
00327 #ifdef debug
00328   G4cout<<"G4QAntiBaryonNuclearCrossSection::CalcCS: CS="<<sigma<<G4endl;
00329 #endif
00330   if(sigma<0.) return 0.;
00331   return sigma;
00332 }
00333 
00334 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
00335 G4double G4QAntiBaryonNuclearCrossSection::CrossSectionLin(G4int tZ, G4int tN, G4double P)
00336 {
00337   G4double lP=std::log(P);
00338   return CrossSectionFormula(tZ, tN, P, lP);
00339 }
00340 
00341 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
00342 G4double G4QAntiBaryonNuclearCrossSection::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
00343 {
00344   G4double P=std::exp(lP);
00345   return CrossSectionFormula(tZ, tN, P, lP);
00346 }
00347 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
00348 G4double G4QAntiBaryonNuclearCrossSection::CrossSectionFormula(G4int tZ, G4int tN,
00349                                                               G4double P, G4double lP)
00350 {
00351   G4double sigma=0.;
00352   if(tZ==1 && !tN)                        // AntiBar-Prot interaction from G4QuasiElRatios
00353   {
00354     G4double ld=lP-3.5;
00355     G4double ld2=ld*ld;
00356     G4double ye=std::exp(lP*1.25);
00357     G4double yt=std::exp(lP*0.35);
00358     G4double El=80./(ye+1.);
00359     G4double To=(80./yt+.3)/yt;
00360     sigma=(To-El)+.2443*ld2+31.48;
00361   }
00362   else if(tZ==1 && tN==1)
00363   {
00364     G4double r=lP-3.7;
00365     sigma=0.6*r*r+67.+90.*std::exp(-lP*.666);
00366   }
00367   else if(tZ<97 && tN<152)                // General solution
00368   {
00369     G4double d=lP-4.2;
00370     G4double sp=std::sqrt(P);
00371     G4double a=tN+tZ;                      // A of the target
00372     G4double sa=std::sqrt(a);
00373     G4double a2=a*a;
00374     G4double a3=a2*a;
00375     G4double a2s=a2*sa;
00376     G4double c=(170.+3600./a2s)/(1.+65./a2s)+40.*std::pow(a,0.712)/(1.+12.2/a)/(1.+34./a2);
00377     G4double r=(170.+0.01*a3)/(1.+a3/28000.);
00378     sigma=c+d*d+r/sp;
00379 #ifdef pdebug
00380     G4cout<<"G4QAntiBarNucCS::CSForm: A="<<a<<",P="<<P<<",CS="<<sigma<<",c="<<c<<",g="<<g
00381           <<",d="<<d<<",r="<<r<<",e="<<e<<",h="<<h<<G4endl;
00382 #endif
00383   }
00384   else
00385   {
00386     G4cerr<<"-Warning-G4QAntiBarNuclearCroSect::CSForm:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
00387     sigma=0.;
00388   }
00389   if(sigma<0.) return 0.;
00390   return sigma;  
00391 }

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