47 std::vector<std::pair<G4double,G4double>*> G4QFreeScattering::vX;
52 G4cout<<
"***^^^*** G4QFreeScattering singletone is created ***^^^***"<<
G4endl;
58 std::vector<std::pair<G4double,G4double>*>::iterator pos2;
59 for(pos2=vX.begin(); pos2<vX.end(); pos2++)
delete [] * pos2;
84 return std::make_pair(El,To);
89 G4cout<<
"G4QFreeScatter::CalcElTot:I=0, p="<<p<<
", pmi="<<pmi<<
", pma="<<pma<<
G4endl;
97 G4cout<<
"G4QFreeScatter::CalcElTot:I=0i, El="<<El<<
", To="<<To<<
", p2="<<p2<<
G4endl;
107 G4cout<<
"G4QFreeScat::CalcElTot:I=0a, El="<<El<<
", To="<<To<<
", lp2="<<lp2<<
G4endl;
117 El=LE+(pbe*lp2+6.72+32.6/
p)/(1.+rp2/p);
118 To=LE+(pbt*lp2+38.2+52.7*rp2)/(1.+2.72*rp2*rp2);
120 G4cout<<
"G4QFreeScat::CalcElTot:0,E="<<El<<
",T="<<To<<
",s="<<p2<<
",l="<<lp2<<
G4endl;
129 El=1./(.00012+p2*(.051+.1*p2));
146 El=LE+(pbe*lp2+6.72+30./
p)/(1.+.49*rp2/p);
147 To=LE+(pbt*lp2+38.2)/(1.+.54*rp2*rp2);
156 El=1.53/(lr*lr+.0676);
164 El=pbe*ld2+2.4+7./
sp;
165 To=pbt*ld2+22.3+12./
sp;
180 El=LE+(pbe*ld2+2.4+7./
sp)/(1.+.7/p4)+.6/md+.05/hd;
181 To=LE*3+(pbt*ld2+22.3+12./
sp)/(1.+.4/p4)+1./md+.06/hd;
191 El=13./(lr2+lr2*lr2+.0676);
199 El=pbe*ld2+2.4+6./
sp;
200 To=pbt*ld2+22.3+5./
sp;
214 El=LE+(pbe*ld2+2.4+6./
sp)/(1.+3./p4)+.7/md;
215 To=LE+(pbt*ld2+22.3+5./
sp)/(1.+1./p4)+.8/md;
246 El=5.2/psp+(pbe*ld2+2.23)/(1.-.7/sp+.075/p4)+.004/md+.15/hd;
247 To=14./psp+(pbt*ld2+19.5)/(1.-.21/sp+.52/p4)+.006/md+.30/hd;
257 El=.7/(lr*lr+.0676)+2./md;
278 El=LE+(pbe*ld2+2.23)/(1.-.7/sp+.1/p4)+2./md;
279 To=LE+(pbt*ld2+19.5)/(1.+.46/sp+1.6/p4)+2.6/md;
287 El=1./(.002+p2*(.12+p2));
295 El=(pbe*lp2+6.72)/(1.+2./
sp);
296 To=(pbt*lp2+38.2+900./
sp)/(1.+27./sp);
306 El=LE+(pbe*lp2+6.72+99./p2)/(1.+2./sp+2./p4);
307 To=LE+(pbt*lp2+38.2+900./
sp)/(1.+27./sp+3./p4);
325 El=80./(ye+1.)+pbe*lp2+6.72;
326 To=(80./yt+.3)/yt+pbt*lp2+38.2;
331 G4cout<<
"*Error*G4QFreeScattering::CalcElTot:ind="<<I<<
" is not defined (0-7)"<<
G4endl;
335 return std::make_pair(El,To);
345 if(PDG==90001000) PDG=2212;
346 if(PDG==90000001) PDG=2112;
347 if(PDG==91000000) PDG=3122;
348 if(PDG==130 || PDG==310)
353 if ( (PDG == 2212 && F) || (PDG == 2112 && !F) ) ind=0;
354 else if ( (PDG == 2112 && F) || (PDG == 2212 && !F) ) ind=1;
355 else if ( (PDG == -211 && F) || (PDG == 211 && !F) ) ind=2;
356 else if ( (PDG == 211 && F) || (PDG == -211 && !F) ) ind=3;
357 else if ( PDG == -321 || PDG == -311 || (kf && !kfl) ) ind=4;
358 else if ( PDG == 321 || PDG == 311 || (kf && kfl) ) ind=5;
359 else if ( PDG > 3000 && PDG < 3335) ind=6;
360 else if ( PDG > -3335 && PDG < -2000) ind=7;
365 G4cout<<
"*Error*G4QFreeScattering::CalcElTotXS: PDG="<<PDG
366 <<
", while it is defined only for p,n,hyperons,anti-baryons,pi,K/antiK"<<
G4endl;
375 static const G4int nlp=300;
376 static const G4int mlp=nlp+1;
379 static const G4double mi=std::exp(lpi);
380 static const G4double ma=std::exp(lpa);
381 static const G4double dl=(lpa-lpi)/nlp;
382 static const G4double edl=std::exp(dl);
385 static G4int lastH=0;
387 static std::pair<G4double,G4double> lastR(0.,0.);
389 static std::vector<G4int> vI;
390 static std::vector<G4double> vM;
391 static std::vector<G4int> vK;
393 static G4int lastI=0;
395 static G4int lastK=0;
396 static std::pair<G4double,G4double>* lastX=0;
399 if(PDG==90001000) PDG=2212;
400 if(PDG==90000001) PDG=2112;
401 if(PDG==91000000) PDG=3122;
403 G4cout<<
"G4QFreeScatter::FetchElTot:p="<<p<<
",PDG="<<PDG<<
",F="<<F<<
",nDB="<<nDB<<
G4endl;
405 if(nDB && lastH==PDG && lastF==F && p>0. && p==lastP)
return lastR;
414 if(PDG==130 || PDG==310)
419 if ( (PDG == 2212 && F) || (PDG == 2112 && !F) ) ind=0;
420 else if ( (PDG == 2112 && F) || (PDG == 2212 && !F) ) ind=1;
421 else if ( (PDG == -211 && F) || (PDG == 211 && !F) ) ind=2;
422 else if ( (PDG == 211 && F) || (PDG == -211 && !F) ) ind=3;
423 else if ( PDG == -321 || PDG == -311 || (kf && !kfl) ) ind=4;
424 else if ( PDG == 321 || PDG == 311 || (kf && kfl) ) ind=5;
425 else if ( PDG > 3000 && PDG < 3335) ind=6;
426 else if ( PDG > -3335 && PDG < -2000) ind=7;
432 G4cout<<
"*Error*G4QFreeScattering::FetchElTot: PDG="<<PDG
433 <<
", while it is defined only for p,n,hyperons,anti-baryons,pi,K/antiK"<<
G4endl;
436 if(nDB && lastI==ind && p>0. && p==lastP)
return lastR;
441 if(nDB)
for (i=0; i<nDB; ++i)
if(ind==vI[i])
448 G4cout<<
"G4QFreeScat::FetchElTot: I="<<ind<<
", i="<<i<<
",fd="<<found<<
",lp="<<lp<<
G4endl;
453 G4cout<<
"G4QFreeScattering::FetchElTot: NewX, ind="<<ind<<
", nDB="<<nDB<<
G4endl;
455 lastX =
new std::pair<G4double,G4double>[mlp];
457 lastK =
static_cast<int>((lp-lpi)/dl)+1;
463 else lastM = lastK*dl;
465 for(
G4int j=0; j<=lastK; ++j)
469 G4cout<<
"G4QFreeScat::FetchElTot:I,j="<<j<<
",pv="<<pv<<
",E="<<lastX[j].first<<
",T="
470 <<lastX[j].second<<
G4endl;
472 if(j!=lastK) pv*=edl;
489 G4cout<<
"G4QFreeScatt::FetchElTo:M="<<lpM<<
",l="<<lp<<
",K="<<lastK<<
",n="<<nlp<<
G4endl;
491 if(lp>lpM && lastK<nlp)
493 lastK =
static_cast<int>((lp-lpi)/dl)+1;
495 G4cout<<
"G4QFreeScat::FetET: K="<<lastK<<
",lp="<<lp<<
",li="<<lpi<<
",dl="<<dl<<
G4endl;
502 else lastM = lastK*dl;
504 for(
G4int j=nextK; j<=lastK; ++j)
509 G4cout<<
"G4QFreeScat::FetchElTot: U:j="<<j<<
",p="<<pv<<
",E="<<lastX[j].first<<
",T="
510 <<lastX[j].second<<
G4endl;
522 G4int n=
static_cast<int>(dlp/dl);
525 lastR.first=e+d*(lastX[n+1].first-
e)/dl;
526 if(lastR.first<0.) lastR.first = 0.;
528 lastR.second=t+d*(lastX[n+1].second-t)/dl;
529 if(lastR.second<0.) lastR.second= 0.;
531 G4cout<<
"=O=>G4QFreeScat::FetchElTot:1st="<<lastR.first<<
", 2nd="<<lastR.second<<
G4endl;
533 if(lastR.first>lastR.second) lastR.first = lastR.second;
542 if(hPDG==90001000) hPDG=2212;
543 if(hPDG==90000001) hPDG=2112;
544 if(hPDG==91000000) hPDG=3122;
546 G4cout<<
"->G4QFreeSc::GetElTotMean: P="<<pIU<<
",pPDG="<<hPDG<<
",Z="<<Z<<
",N="<<N<<
G4endl;
550 G4cout<<
"-Warning-G4QFreeScat::GetElTotMean: Z="<<Z<<
",N="<<N<<
", return zero"<<
G4endl;
551 return std::make_pair(0.,0.);
553 std::pair<G4double,G4double> hp=
FetchElTot(pGeV, hPDG,
true);
554 std::pair<G4double,G4double> hn=
FetchElTot(pGeV, hPDG,
false);
556 G4cout<<
"-OUT->G4QFreeScat::GetElTotMean: hp("<<hp.first<<
","<<hp.second<<
"), hn("
557 <<hn.first<<
","<<hn.second<<
")"<<
G4endl;
560 return std::make_pair((Z*hp.first+N*hn.first)/A,(Z*hp.second+N*hn.second)/A);
573 if(pPDG==90001000) pPDG=2212;
574 if(pPDG==90000001) pPDG=2112;
575 if(pPDG==91000000) pPDG=3122;
577 G4cout<<
"->G4QFR::Scat:p4M="<<p4M<<
",N4M="<<N4M<<
",t4M="<<tot4M<<
",NPDG="<<NPDG<<
G4endl;
584 if(NPDG==2212 || NPDG==90001000)
592 else if(NPDG!=2112 && NPDG!=90000001)
594 G4cout<<
"Error:G4QFreeScattering::Scatter:NPDG="<<NPDG<<
" is not 2212 or 2112"<<
G4endl;
602 G4cout<<
"G4QFS::Scat:qM="<<mT<<
",qM2="<<mT2<<
",pM2="<<mP2<<
",totM2="<<tot4M.
m2()<<
G4endl;
605 if( E < 0. || E2 < mP2)
608 G4cout<<
"-Warning-G4QFS::Scat:*Negative Energy*E="<<E<<
",E2="<<E2<<
"<M2="<<mP2<<
G4endl;
615 G4cout<<
"G4QFreeS::Scatter: Before XS, P="<<P<<
",Z="<<Z<<
",N="<<N<<
",PDG="<<pPDG<<
G4endl;
618 if(pPDG>3400 || pPDG<-3400)
G4cout<<
"-Warning-G4QFreeScat::Scatter: pPDG="<<pPDG<<
G4endl;
628 G4double theB1=(7.2+4.32/p4/(p4+12./P))/(1.+2.5/p4);
632 G4cout<<
"G4QFS::Scat:PDG="<<pPDG<<
",P="<<P<<
",-t="<<mint<<
"<"<<maxt<<
", Z="<<Z<<
",N="<<N
637 else G4cout<<
"*Warning*G4QFreeScattering::Scatter: -t="<<mint<<
G4endl;
641 G4cout<<
"G4QFS::Scat:-t="<<mint<<
"<"<<maxt<<
", cost="<<cost<<
", Z="<<Z<<
",N="<<N<<
G4endl;
643 if(cost>1. || cost<-1. || !(cost>-1. || cost<=1.))
645 if (cost > 1.) cost = 1.;
646 else if(cost <-1.) cost =-1.;
649 G4cerr<<
"G4QFreeScatter::Scat:*NAN* cost="<<cost<<
",-t="<<mint<<
",tm="<<maxt<<
G4endl;
655 if(!
G4QHadron(tot4M).RelDecayIn2(p4M, reco4M, dir4M, cost, cost))
657 G4cerr<<
"G4QFS::Scat:t="<<tot4M<<tot4M.
m()<<
",mT="<<mT<<
",mP="<<std::sqrt(mP2)<<
G4endl;
662 G4cout<<
"G4QFS::Scat:p4M="<<p4M<<
"+r4M="<<reco4M<<
",dr="<<dir4M<<
",t4M="<<tot4M<<
G4endl;
684 static const G4double twothd =2./3.;
689 if(pPDG==90001000) pPDG=2212;
690 if(pPDG==90000001) pPDG=2112;
691 if(pPDG==91000000) pPDG=3122;
693 G4cout<<
"->G4QFR::InElF: p4M="<<p4M<<
",N4M="<<N4M<<
", c4M="<<c4M<<
",NPDG="<<NPDG<<
G4endl;
698 if(NPDG==2212 || NPDG==90001000)
705 else if(NPDG!=2112 && NPDG!=90000001)
707 G4cout<<
"Error:G4QFreeScattering::InElF:NPDG="<<NPDG<<
" is not 2212 or 2112"<<
G4endl;
713 if( mC2 < -0.0000001 )
716 G4cout<<
"-Warning-G4QFS::InElF: Negative compoundMass ="<<mC2<<
", c4M="<<c4M<<
G4endl;
720 else if ( mC2 > 0.0000001) mC=std::sqrt(mC2);
726 if( mP2 < -0.0000001 )
729 G4cout<<
"-Warning-G4QFS::InElF: Negative projectileMass ="<<mC2<<
", c4M="<<c4M<<
G4endl;
733 else if ( mP2 > 0.0000001) mP=std::sqrt(mP2);
735 G4cout<<
"G4QFS::InElF:mT("<<mT<<
")+mP("<<mP<<
")+mPi0="<<mP+mT+mPi0<<
"<? mC="<<mC<<
G4endl;
737 if(pPDG > 3334 || pPDG < -321)
739 G4cout<<
"-Warning-G4QFreeScat::InElF: pPDG="<<pPDG<<
G4endl;
742 if(pPDG==130 || pPDG==310)
780 else if (pPDG == 2112)
810 else if (pPDG == 211)
840 else if (pPDG == -211)
870 else if (pPDG == -321)
914 else if (pPDG == -311)
958 else if (pPDG == 321)
1002 else if (pPDG == 311)
1046 else if (pPDG == 3122 || pPDG== 3212)
1116 else if (pPDG == 3112)
1160 else if (pPDG == 3222)
1204 else if (pPDG == 3312)
1248 else if (pPDG == 3322)
1292 else if (pPDG == 3334)
1317 G4cout<<
"*Error*G4QFreeScattering::InElF: PDG="<<pPDG
1318 <<
", while it is defined only for p,n,hyperons(not Omega),pi,K/antiK"<<
G4endl;
1321 if (mC-mP-mM-mT <-0.000001)
return 0;
1324 if(mC-mP-mM-mT < 0.000001)
1334 if(!
G4QHadron(c4M).DecayIn3(p4M,m4M,N4M))
1337 ed <<
"DecayIn3, TotM=" << mC <<
G4endl;
1341 TripQH->push_back(h1);
1343 G4cout <<
"G4QFreeScat::InElF: H1=" << pPDG << p4M <<
G4endl;
1346 TripQH->push_back(h2);
1348 G4cout <<
"G4QFreeScat::InElF: H2=" << mPDG << m4M <<
G4endl;
1351 TripQH->push_back(h3);
1353 G4cout <<
"G4QFreeScat::InElF: H3=" << NPDG << N4M <<
G4endl;