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

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