source: trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QProtonNuclearCrossSection.cc @ 962

Last change on this file since 962 was 962, checked in by garnier, 15 years ago

update processes

File size: 17.8 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
28// GEANT4 tag $Name: geant4-09-02-ref-02 $
29//
30//
31// G4 Physics class: G4QProtonNuclearCrossSection for gamma+A cross sections
32// Created: M.V. Kossov, CERN/ITEP(Moscow), 20-Dec-03
33// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Feb-04
34// --------------------------------------------------------------------------------
35// ****************************************************************************************
36// ***** This HEADER is a property of the CHIPS hadronic package in Geant4 (M. Kosov) *****
37// *********** DO NOT MAKE ANY CHANGE without approval of Mikhail.Kossov@cern.ch **********
38// ****************************************************************************************
39//
40//#define debug
41//#define pdebug
42//#define debug3
43//#define debugn
44//#define debugs
45
46#include "G4QProtonNuclearCrossSection.hh"
47
48// Initialization of the
49G4double* G4QProtonNuclearCrossSection::lastLEN=0; // Pointer to the lastArray of LowEn CS
50G4double* G4QProtonNuclearCrossSection::lastHEN=0; // Pointer to the lastArray of HighEn CS
51G4int     G4QProtonNuclearCrossSection::lastN=0;   // The last N of calculated nucleus
52G4int     G4QProtonNuclearCrossSection::lastZ=0;   // The last Z of calculated nucleus
53G4double  G4QProtonNuclearCrossSection::lastP=0.;  // Last used in cross section Momentum
54G4double  G4QProtonNuclearCrossSection::lastTH=0.; // Last threshold momentum
55G4double  G4QProtonNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
56G4int     G4QProtonNuclearCrossSection::lastI=0;   // The last position in the DAMDB
57
58// Returns Pointer to the G4VQCrossSection class
59G4VQCrossSection* G4QProtonNuclearCrossSection::GetPointer()
60{
61  static G4QProtonNuclearCrossSection theCrossSection; //**Static body of Cross Section**
62  return &theCrossSection;
63}
64
65// The main member function giving the collision cross section (P is in IU, CS is in mb)
66// Make pMom in independent units ! (Now it is MeV)
67G4double G4QProtonNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
68                                                       G4int tgZ, G4int tgN, G4int)
69{
70  static G4int j;                      // A#0f records found in DB for this projectile
71  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
72  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
73  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
74  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
75  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
76  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
77  G4double pEn=pMom;
78#ifdef pdebug
79  G4cout<<"G4QPrCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
80        <<"("<<lastN<<"),PDG=2212, P="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
81#endif
82  G4bool in=false;                     // By default the isotope must be found in the AMDB
83  if(tgN!=lastN || tgZ!=lastZ)         // The nucleus was not the last used isotope
84  {
85    in = false;                        // By default the isotope haven't be found in AMDB 
86    lastP   = 0.;                      // New momentum history (nothing to compare with)
87    lastN   = tgN;                     // The last N of the calculated nucleus
88    lastZ   = tgZ;                     // The last Z of the calculated nucleus
89    lastI   = colN.size();             // Size of the Associative Memory DB in the heap
90    j  = 0;                            // A#0f records found in DB for this projectile
91    if(lastI) for(G4int i=0; i<lastI; i++) // The partType is found
92           {                                  // The nucleus with is found in AMDB
93      if(colN[i]==tgN && colZ[i]==tgZ)
94                                                {
95        lastI=i;
96        lastTH =colTH[i];                // Last THreshold (A-dependent)
97#ifdef pdebug
98        G4cout<<"G4QPrCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
99#endif
100        if(pEn<=lastTH)
101        {
102#ifdef pdebug
103          G4cout<<"G4QPrCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
104#endif
105          return 0.;                     // Energy is below the Threshold value
106        }
107        lastP  =colP [i];                // Last Momentum  (A-dependent)
108        lastCS =colCS[i];                // Last CrossSect (A-dependent)
109        //        if(std::fabs(lastP/pMom-1.)<tolerance)
110        if(lastP==pMom)                  // VI do not use tolerance
111        {
112#ifdef pdebug
113          G4cout<<"G4QPrCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
114#endif
115          CalculateCrossSection(fCS,-1,j,2212,lastZ,lastN,pMom); // Update param's only
116          return lastCS*millibarn;     // Use theLastCS
117        }
118        in = true;                       // This is the case when the isotop is found in DB
119        // Momentum pMom is in IU ! @@ Units
120#ifdef pdebug
121        G4cout<<"G4QPrCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
122#endif
123        lastCS=CalculateCrossSection(fCS,-1,j,2212,lastZ,lastN,pMom); // read & update
124#ifdef pdebug
125        G4cout<<"G4QPrCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
126#endif
127        if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
128        {
129#ifdef pdebug
130          G4cout<<"G4QPrCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
131#endif
132          lastTH=pEn;
133        }
134        break;                           // Go out of the LOOP
135      }
136#ifdef pdebug
137      G4cout<<"-->G4QPrCrossSec::GetCrosSec: pPDG=2212, j="<<j<<", N="<<colN[i]
138            <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
139#endif
140      j++;                             // Increment a#0f records found in DB
141           }
142           if(!in)                            // This nucleus has not been calculated previously
143           {
144#ifdef pdebug
145      G4cout<<"G4QPrCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
146#endif
147      //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
148      lastCS=CalculateCrossSection(fCS,0,j,2212,lastZ,lastN,pMom); //calculate & create
149      if(lastCS<=0.)
150                                                {
151        lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
152#ifdef pdebug
153        G4cout<<"G4QPrCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
154#endif
155        if(pEn>lastTH)
156        {
157#ifdef pdebug
158          G4cout<<"G4QPrCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
159#endif
160          lastTH=pEn;
161        }
162                                                }
163#ifdef pdebug
164      G4cout<<"G4QPrCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
165#endif
166      colN.push_back(tgN);
167      colZ.push_back(tgZ);
168      colP.push_back(pMom);
169      colTH.push_back(lastTH);
170      colCS.push_back(lastCS);
171#ifdef pdebug
172      G4cout<<"G4QPrCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
173#endif
174      return lastCS*millibarn;
175           } // End of creation of the new set of parameters
176    else
177                                {
178#ifdef pdebug
179      G4cout<<"G4QPrCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
180#endif
181      colP[lastI]=pMom;
182      colCS[lastI]=lastCS;
183    }
184  } // End of parameters udate
185  else if(pEn<=lastTH)
186  {
187#ifdef pdebug
188    G4cout<<"G4QPrCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
189#endif
190    return 0.;                         // Momentum is below the Threshold Value -> CS=0
191  }
192  //  else if(std::fabs(lastP/pMom-1.)<tolerance)
193  else if(lastP==pMom)                // VI do not use tolerance
194  {
195#ifdef pdebug
196    G4cout<<"G4QPrCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
197#endif
198    return lastCS*millibarn;     // Use theLastCS
199  }
200  else
201  {
202#ifdef pdebug
203    G4cout<<"G4QPrCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
204#endif
205    lastCS=CalculateCrossSection(fCS,1,j,2212,lastZ,lastN,pMom); // Only UpdateDB
206    lastP=pMom;
207  }
208#ifdef pdebug
209  G4cout<<"G4QPrCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
210#endif
211  return lastCS*millibarn;
212}
213
214// The main member function giving the gamma-A cross section (E in GeV, CS in mb)
215G4double G4QProtonNuclearCrossSection::CalculateCrossSection(G4bool, G4int F, G4int I,
216                                        G4int, G4int targZ, G4int targN, G4double Momentum)
217{
218  static const G4double THmin=27.;     // minimum Momentum (MeV/c) Threshold
219  static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
220  static const G4double dP=10.;        // step for the LEN (Low ENergy) table MeV/c
221  static const G4double dPG=dP*.001;   // step for the LEN (Low ENergy) table GeV/c
222  static const G4int    nL=105;        // A#of LEN points in E (step 10 MeV/c)
223  static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
224  static const G4double Pmax=227000.;  // maxP for the HEN (High ENergy) part 227 GeV
225  static const G4int    nH=224;        // A#of HEN points in lnE
226  static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
227  static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
228  static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
229  static const G4double milPG=std::log(.001*Pmin);// Low logarithm energy for the HEN part GeV/c
230  //
231  // Associative memory for acceleration
232  //static std::vector <G4double>  spA;  // shadowing coefficients (A-dependent)
233  static std::vector <G4double*> LEN;  // Vector of pointers to LowEnProtonCrossSection
234  static std::vector <G4double*> HEN;  // Vector of pointers to HighEnProtonCrossSection
235#ifdef debug
236  G4cout<<"G4QProtonNuclearCS::CalcCS: N="<<targN<<",Z="<<targZ<<",P="<<Momentum<<G4endl;
237#endif
238  if (Momentum<THmin) return 0.;       // @@ This can be dangerouse for the heaviest nuc.!
239  G4double sigma=0.;
240  if(F&&I) sigma=0.;                   // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
241  G4double A=targN+targZ;              // A of the target
242  if(F<=0)                           // This isotope was not the last used isotop
243  {
244    if(F<0)                          // This isotope was found in DAMDB =========> RETRIEVE
245                                {
246      lastLEN=LEN[I];                // Pointer to prepared LowEnergy cross sections
247      lastHEN=HEN[I];                // Pointer to prepared High Energy cross sections
248    }
249           else                             // This isotope wasn't calculated previously => CREATE
250           {
251      lastLEN = new G4double[nL];    // Allocate memory for the new LEN cross sections
252      lastHEN = new G4double[nH];    // Allocate memory for the new HEN cross sections
253      // --- Instead of making a separate function ---
254      G4double P=THmiG;              // Table threshold in GeV/c
255      for(G4int m=0; m<nL; m++)
256      {
257        lastLEN[m] = CrossSectionLin(targZ, targN, P);
258        P+=dPG;
259      }
260      G4double lP=milPG;
261      for(G4int n=0; n<nH; n++)
262      {
263        lastHEN[n] = CrossSectionLog(targZ, targN, lP);
264        lP+=dlP;
265      }
266      // --- End of possible separate function
267      // *** The synchronization check ***
268      G4int sync=LEN.size();
269      if(sync!=I) G4cerr<<"**G4QPhortonNuclCS::CalcCrossSect: Sync="<<sync<<"#"<<I<<G4endl;
270      LEN.push_back(lastLEN);          // added LEN, found by AH 10/7/02
271      HEN.push_back(lastHEN);          // added HEN, found by AH 10/7/02
272           } // End of creation of the new set of parameters
273  } // End of parameters udate
274  // ============================== NOW the Magic Formula =================================
275  if (Momentum<lastTH) return 0.;      // It must be already checked in the interface class
276  else if (Momentum<Pmin)                     // High Energy region
277  {
278#ifdef debug
279           G4cout<<"G4QPrNCS::CalcCS:bLEN A="<<A<<", nL="<<nL<<",TH="<<THmin<<",dP="<<dP<<G4endl;
280#endif
281    if(A<=1.) sigma=0.;
282    else      sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
283#ifdef debugn
284           if(sigma<0.)
285      G4cout<<"G4QPrNuCS::CalcCS:A="<<A<<",E="<<Momentum<<",T="<<THmin<<",dP="<<dP<<G4endl;
286#endif
287  }
288  else if (Momentum<Pmax)                     // High Energy region
289  {
290    G4double lP=std::log(Momentum);
291#ifdef debug
292    G4cout<<"G4QProtNucCS::CalcCS: before HEN nH="<<nH<<",iE="<<milP<<",dlP="<<dlP<<G4endl;
293#endif
294    sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
295  }
296  else                                      // UHE region (calculation, not frequent)
297  {
298    G4double P=0.001*Momentum;              // Approximation formula is for P in GeV/c
299    sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
300  }
301#ifdef debug
302  G4cout<<"G4QProtonNuclearCrossSection::CalcCS: sigma="<<sigma<<G4endl;
303#endif
304  if(sigma<0.) return 0.;
305  return sigma;
306}
307
308// Electromagnetic momentum-threshold (in MeV/c)
309G4double G4QProtonNuclearCrossSection::ThresholdMomentum(G4int tZ, G4int tN)
310{
311  static const G4double third=1./3.;
312  static const G4double pM = G4QPDGCode(2212).GetMass(); // Proton mass in MeV
313  static const G4double tpM= pM+pM;       // Doubled proton mass (MeV)
314  G4double tA=tZ+tN;
315  if(tZ<.99 || tN<0.) return 0.;
316  //G4double dE=1.263*tZ/(1.+std::pow(tA,third));
317  G4double dE=tZ/(1.+std::pow(tA,third)); // Safety for diffused edge of the nucleus (QE)
318  return std::sqrt(dE*(tpM+dE));
319}
320
321// Calculation formula for proton-nuclear inelastic cross-section (mb) (P in GeV/c)
322G4double G4QProtonNuclearCrossSection::CrossSectionLin(G4int tZ, G4int tN, G4double P)
323{
324  G4double sigma=0.;
325  if(P<ThresholdMomentum(tZ,tN)*.001) return sigma;
326  G4double lP=std::log(P);
327  if(tZ==1&&!tN){if(P>.35) sigma=CrossSectionFormula(tZ,tN,P,lP);}// s(pp)=0 below 350Mev/c
328  else if(tZ<93 && tN<239)                // General solution
329  {
330    G4double pex=0.;
331    G4double pos=0.;
332    G4double wid=1.;
333    if(tZ==13 && tN==14)                  // Excited metastable states
334    {
335      pex=230.;
336      pos=.13;
337      wid=8.e-5;
338    }
339    else if(tZ<7)
340    {
341      if(tZ==6 && tN==6)
342      {
343        pex=320.;
344        pos=.14;
345        wid=7.e-6;
346      }
347      else if(tZ==4 && tN==5)
348      {
349        pex=600.;
350        pos=.132;
351        wid=.005;
352      }
353      else if(tZ==3 && tN==4)
354      {
355        pex=280.;
356        pos=.19;
357        wid=.0025;
358      }
359      else if(tZ==3 && tN==3)
360      {
361        pex=370.;
362        pos=.171;
363        wid=.006;
364      }
365      else if(tZ==2 && tN==1)
366      {
367        pex=30.;
368        pos=.22;
369        wid=.0005;
370      }
371    }
372    sigma=CrossSectionFormula(tZ,tN,P,lP);
373    if(pex>0.)
374    {
375      G4double dp=P-pos;
376      sigma+=pex*std::exp(dp*dp/wid);
377    }
378  }
379  else
380  {
381    G4cerr<<"-Warning-G4QProtonNuclearCroSect::CSLin:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
382    sigma=0.;
383  }
384  if(sigma<0.) return 0.;
385  return sigma; 
386}
387
388// Calculation formula for proton-nuclear inelastic cross-section (mb) log(P in GeV/c)
389G4double G4QProtonNuclearCrossSection::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
390{
391  G4double P=std::exp(lP);
392  return CrossSectionFormula(tZ, tN, P, lP);
393}
394// Calculation formula for proton-nuclear inelastic cross-section (mb) log(P in GeV/c)
395G4double G4QProtonNuclearCrossSection::CrossSectionFormula(G4int tZ, G4int tN,
396                                                           G4double P, G4double lP)
397{
398  G4double sigma=0.;
399  if(tZ==1 && !tN)                        // pp interaction
400  {
401    G4double sp=std::sqrt(P);
402    G4double ds=lP-4.2;
403    G4double dp=P-.35;
404    G4double d3=dp*dp*dp;
405    sigma=(33.+.2*ds*ds)/(1.+.4/sp)/(1.+.5/d3/d3);
406  }
407  else if(tZ<93 && tN<146)                // General solution
408  {
409    G4double lP=std::log(P);
410    G4double d=lP-4.2;
411    G4double p2=P*P;
412    G4double p4=p2*p2;
413    G4double a=tN+tZ;                       // A of the target
414    G4double al=std::log(a);
415    G4double a2=a*a;
416    G4double a4=a2*a2;
417    G4double a8=a4*a4;
418    G4double a12=a8*a4;
419    G4double a16=a8*a8;
420    G4double c=170./(1.+5./std::exp(al*1.6));
421    G4double dl=al-2.8;
422    G4double r=.3+.2*dl*dl;
423    G4double g=40.*std::exp(al*0.712)/(1.+12.2/a)/(1.+34./a2);
424    G4double e=318.+a4/(1.+.0015*a4/std::exp(al*0.09))/(1.+4.e-28*a12)+
425               8.e-18/(1./a16+1.3e-20)/(1.+1.e-21*a12);
426    G4double s=3.57+.009*a2/(1.+.0001*a2*a);
427    G4double h=(.01/a4+2.5e-6/a)*(1.+7.e-8*a4)/(1.+6.e7/a12/a2);
428    sigma=(c+d*d)/(1.+r/p4)+(g+e*std::exp(-s*P))/(1.+h/p4/p4);
429  }
430  else
431  {
432    G4cerr<<"-Warning-G4QProtonNuclearCroSect::CSForm:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
433    sigma=0.;
434  }
435  if(sigma<0.) return 0.;
436  return sigma; 
437}
Note: See TracBrowser for help on using the repository browser.