51G4double* G4QProtonNuclearCrossSection::lastLEN=0;
52G4double* G4QProtonNuclearCrossSection::lastHEN=0;
53G4int G4QProtonNuclearCrossSection::lastN=0;
54G4int G4QProtonNuclearCrossSection::lastZ=0;
55G4double G4QProtonNuclearCrossSection::lastP=0.;
56G4double G4QProtonNuclearCrossSection::lastTH=0.;
57G4double G4QProtonNuclearCrossSection::lastCS=0.;
58G4int G4QProtonNuclearCrossSection::lastI=0;
59std::vector<G4double*>* G4QProtonNuclearCrossSection::LEN =
new std::vector<G4double*>;
60std::vector<G4double*>* G4QProtonNuclearCrossSection::HEN =
new std::vector<G4double*>;
66 return &theCrossSection;
71 G4int lens=LEN->size();
72 for(
G4int i=0; i<lens; ++i)
delete[] (*LEN)[i];
74 G4int hens=HEN->size();
75 for(
G4int i=0; i<hens; ++i)
delete[] (*HEN)[i];
86 static std::vector <G4int> colN;
87 static std::vector <G4int> colZ;
88 static std::vector <G4double> colP;
89 static std::vector <G4double> colTH;
90 static std::vector <G4double> colCS;
93 G4cout<<
"G4QPrCS::GetCS:>>> f="<<fCS<<
", p="<<pMom<<
", Z="<<tgZ<<
"("<<lastZ<<
") ,N="<<tgN
94 <<
"("<<lastN<<
"),PDG=2212, thresh="<<lastTH<<
",Sz="<<colN.size()<<
G4endl;
96 if(PDG!=2212)
G4cout<<
"-Warning-G4QProtonCS::GetCS:***Not a proton***,PDG="<<PDG<<
G4endl;
98 if(tgN!=lastN || tgZ!=lastZ)
107 G4cout<<
"G4QPrCS::GetCS: the amount of records in the AMDB lastI="<<lastI<<
G4endl;
109 if(lastI)
for(
G4int i=0; i<lastI; i++)
111 if(colN[i]==tgN && colZ[i]==tgZ)
116 G4cout<<
"G4QPrCS::GetCS:*Found* P="<<pMom<<
",Threshold="<<lastTH<<
",j="<<j<<
G4endl;
121 G4cout<<
"G4QPCS::GetCS:Found,P="<<pMom<<
" < Threshold="<<lastTH<<
",CS=0"<<
G4endl;
131 G4cout<<
"..G4QPrCS::GetCS:.DoNothing.P="<<pMom<<
",CS="<<lastCS*millibarn<<
G4endl;
134 return lastCS*millibarn;
139 G4cout<<
"G4QPrCS::G:UpdatDB P="<<pMom<<
",f="<<fCS<<
",lI="<<lastI<<
",j="<<j<<
G4endl;
143 G4cout<<
"G4QPrCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<
G4endl;
145 if(lastCS<=0. && pMom>lastTH)
148 G4cout<<
"G4QPrCS::GetCS: New P="<<pMom<<
"(CS=0) > Threshold="<<lastTH<<
G4endl;
156 G4cout<<
"-->G4QPrCrossSec::GetCrosSec: pPDG=2212, j="<<j<<
", N="<<colN[i]
157 <<
",Z["<<i<<
"]="<<colZ[i]<<
G4endl;
162 G4cout<<
"-?-G4QPrCS::GetCS:RC Z="<<tgZ<<
",N="<<tgN<<
",in="<<in<<
",j="<<j<<
" ?"<<
G4endl;
167 G4cout<<
"^^^G4QPrCS::GetCS:CalcNew P="<<pMom<<
", f="<<fCS<<
", lastI="<<lastI<<
G4endl;
176 G4cout<<
"G4QPrCrossSection::GetCrossSect: NewThresh="<<lastTH<<
",P="<<pMom<<
G4endl;
180 colP.push_back(pMom);
181 colTH.push_back(lastTH);
182 colCS.push_back(lastCS);
184 G4cout<<
"G4QPrCS::GetCrosSec:recCS="<<lastCS<<
",lZ="<<lastN<<
",lN="<<lastZ<<
G4endl;
188 G4cout<<
"G4QPrCS::GetCS:1st,P="<<pMom<<
"(MeV),CS="<<lastCS*millibarn<<
"(mb)"<<
G4endl;
190 return lastCS*millibarn;
195 G4cout<<
"G4QPrCS::GetCS: Update lastI="<<lastI<<
",j="<<j<<
G4endl;
201 else if(pMom<=lastTH)
204 G4cout<<
"G4QPrCS::GetCS: Current P="<<pMom<<
" < Threshold="<<lastTH<<
", CS=0"<<
G4endl;
208 else if(std::fabs(lastP-pMom)<
tolerance*pMom)
212 G4cout<<
"..G4QPCS::GetCS:OldNZ&P="<<lastP<<
"="<<pMom<<
",CS="<<lastCS*millibarn<<
G4endl;
214 return lastCS*millibarn;
219 G4cout<<
"-!-G4QPCS::GetCS:UseCur P="<<pMom<<
",f="<<fCS<<
",I="<<lastI<<
",j="<<j<<
G4endl;
225 G4cout<<
"==>G4QPrCS::GetCroSec: P="<<pMom<<
"(MeV),CS="<<lastCS*millibarn<<
"(mb)"<<
G4endl;
227 return lastCS*millibarn;
235 static const G4double THmiG=THmin*.001;
238 static const G4int nL=105;
239 static const G4double Pmin=THmin+(nL-1)*dP;
241 static const G4int nH=224;
242 static const G4double milP=std::log(Pmin);
243 static const G4double malP=std::log(Pmax);
244 static const G4double dlP=(malP-milP)/(nH-1);
245 static const G4double milPG=std::log(.001*Pmin);
247 G4cout<<
"G4QProtNCS::CalCS:N="<<targN<<
",Z="<<targZ<<
",P="<<Momentum<<
">"<<THmin<<
G4endl;
253 G4cout<<
"G4QProtNucCS::CalCS: A="<<A<<
",F="<<F<<
",I="<<I<<
",nL="<<nL<<
",nH="<<nH<<
G4endl;
259 G4int sync=LEN->size();
260 if(sync<=I)
G4cout<<
"*!*G4QProtonNuclCS::CalcCrossSect:Sync="<<sync<<
"<="<<I<<
G4endl;
270 for(
G4int n=0; n<nL; n++)
272 lastLEN[n] = CrossSectionLin(targZ, targN, P);
276 for(
G4int n=0; n<nH; n++)
278 lastHEN[n] = CrossSectionLog(targZ, targN, lP);
282 G4cout<<
"-*->G4QPr0tNucCS::CalcCS:Tab for Z="<<targZ<<
",N="<<targN<<
",I="<<I<<
G4endl;
286 G4int sync=LEN->size();
289 G4cout<<
"***G4QProtonNuclCS::CalcCrossSect: Sinc="<<sync<<
"#"<<I<<
", Z=" <<targZ
290 <<
", N="<<targN<<
", F="<<F<<
G4endl;
293 LEN->push_back(lastLEN);
294 HEN->push_back(lastHEN);
299 G4cout<<
"G4QPrNCS::CalcCS:lTH="<<lastTH<<
",Pmi="<<Pmin<<
",dP="<<dP<<
",dlP="<<dlP<<
G4endl;
301 if (Momentum<lastTH)
return 0.;
302 else if (Momentum<Pmin)
305 G4cout<<
"G4QPrNCS::CalcCS:bLEN nL="<<nL<<
",TH="<<THmin<<
",dP="<<dP<<
G4endl;
310 G4cout<<
"G4QPrNuCS::CalcCS: E="<<Momentum<<
",T="<<THmin<<
",dP="<<dP<<
G4endl;
313 else if (Momentum<Pmax)
317 G4cout<<
"G4QProtNucCS::CalcCS: before HEN nH="<<nH<<
",iE="<<milP<<
",dlP="<<dlP<<
G4endl;
324 sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
327 G4cout<<
"G4QProtonNuclearCrossSection::CalcCS: CS="<<sigma<<
G4endl;
329 if(sigma<0.)
return 0.;
340 if(tZ<.99 || tN<0.)
return 0.;
341 else if(tZ==1 && tN==0)
return 800.;
343 G4double dE=tZ/(1.+std::pow(tA,third));
346 return std::sqrt(T*(tpM+T));
353 if(P<ThresholdMomentum(tZ,tN)*.001)
return sigma;
355 if(tZ==1&&!tN){
if(P>.35) sigma=CrossSectionFormula(tZ,tN,P,lP);}
356 else if(tZ<97 && tN<152)
375 else if(tZ==5 && tN==6)
381 else if(tZ==4 && tN==5)
387 else if(tZ==3 && tN==4)
393 else if(tZ==3 && tN==3)
399 else if(tZ==2 && tN==1)
406 sigma=CrossSectionFormula(tZ,tN,P,lP);
410 sigma+=pex*std::exp(-dp*dp/wid);
415 G4cerr<<
"-Warning-G4QProtonNuclearCroSect::CSLin:*Bad A* Z="<<tZ<<
", N="<<tN<<
G4endl;
418 if(sigma<0.)
return 0.;
426 return CrossSectionFormula(tZ, tN, P, lP);
439 El=1./(0.00012+p2*0.2);
456 El=
LE+(0.0557*lp2+6.72+32.6/P)/(1.+rp2/P);
457 To=
LE+(0.3 *lp2+38.2+52.7*rp2)/(1.+2.72*rp2*rp2);
470 else if(tZ<97 && tN<152)
485 G4double c=(170.+3600./a2s)/(1.+65./a2s);
489 G4double g_value=40.*std::exp(al*0.712)/(1.+12.2/a)/(1.+34./a2);
490 G4double e=318.+a4/(1.+.0015*a4/std::exp(al*0.09))/(1.+4.e-28*a12)+
491 8.e-18/(1./a16+1.3e-20)/(1.+1.e-21*a12);
492 G4double s_value=3.57+.009*a2/(1.+.0001*a2*a);
493 G4double h=(.01/a4+2.5e-6/a)*(1.+6.e-6*a2*a)/(1.+6.e7/a12/a2);
494 sigma=(c+d*d)/(1.+r/p4)+(g_value+e*std::exp(-s_value*P))/(1.+h/p4/p4);
496 G4cout<<
"G4QProtNucCS::CSForm: A="<<a<<
",P="<<P<<
",CS="<<sigma<<
",c="<<c<<
",g="<<g_value
497 <<
",d="<<d<<
",r="<<r<<
",e="<<e<<
",h="<<h<<
G4endl;
502 G4cerr<<
"-Warning-G4QProtonNuclearCroSect::CSForm:*Bad A* Z="<<tZ<<
", N="<<tN<<
G4endl;
505 if(sigma<0.)
return 0.;
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
static G4VQCrossSection * GetPointer()
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN, G4int pPDG=2212)
~G4QProtonNuclearCrossSection()
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0)
static G4double tolerance