Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4QuasiElRatios Class Reference

#include <G4QuasiElRatios.hh>

Public Member Functions

G4double ChExElCoef (G4double p, G4int Z, G4int N, G4int pPDG)
 
std::pair< G4LorentzVector, G4LorentzVectorChExer (G4int NPDG, G4LorentzVector N4M, G4int pPDG, G4LorentzVector p4M)
 
std::pair< G4double, G4doubleFetchElTot (G4double pGeV, G4int PDG, G4bool F)
 
 G4QuasiElRatios ()
 
std::pair< G4double, G4doubleGetChExFactor (G4double pIU, G4int pPDG, G4int Z, G4int N)
 
std::pair< G4double, G4doubleGetElTot (G4double pIU, G4int hPDG, G4int Z, G4int N)
 
std::pair< G4double, G4doubleGetElTotXS (G4double Mom, G4int PDG, G4bool F)
 
std::pair< G4double, G4doubleGetRatios (G4double pIU, G4int prPDG, G4int tgZ, G4int tgN)
 
G4bool RelDecayIn2 (G4LorentzVector &theMomentum, G4LorentzVector &f4Mom, G4LorentzVector &s4Mom, G4LorentzVector &dir, G4double maxCost=1., G4double minCost=-1.)
 
std::pair< G4LorentzVector, G4LorentzVectorScatter (G4int NPDG, G4LorentzVector N4M, G4int pPDG, G4LorentzVector p4M)
 
 ~G4QuasiElRatios ()
 

Private Member Functions

std::pair< G4double, G4doubleCalcElTot (G4double pGeV, G4int Index)
 
G4double CalcQF2IN_Ratio (G4double TCSmb, G4int A)
 
G4double GetQF2IN_Ratio (G4double TotCS_mb, G4int A)
 

Private Attributes

G4int lastARatio
 
G4bool lastFtot
 
G4double lastHRatio
 
G4int lastHtot
 
G4int lastItot
 
G4int lastKRatio
 
G4int lastKtot
 
G4doublelastLRatio
 
G4double lastMRatio
 
G4double lastMtot
 
G4int lastNRatio
 
G4double lastPtot
 
G4double lastRRatio
 
std::pair< G4double, G4doublelastRtot
 
G4double lastSRatio
 
G4doublelastTRatio
 
std::pair< G4double, G4double > * lastXtot
 
G4ChipsNeutronElasticXSNCSmanager
 
G4ChipsProtonElasticXSPCSmanager
 
std::vector< G4intvARatio
 
std::vector< G4doublevHRatio
 
std::vector< G4intvItot
 
std::vector< G4intvKRatio
 
std::vector< G4intvKtot
 
std::vector< G4double * > * vL
 
std::vector< G4doublevMRatio
 
std::vector< G4doublevMtot
 
std::vector< G4intvNRatio
 
std::vector< G4double * > * vT
 
std::vector< std::pair< G4double, G4double > * > * vX
 

Detailed Description

Definition at line 52 of file G4QuasiElRatios.hh.

Constructor & Destructor Documentation

◆ G4QuasiElRatios()

G4QuasiElRatios::G4QuasiElRatios ( )

Definition at line 87 of file G4QuasiElRatios.cc.

88{
89 vT = new std::vector<G4double*>;
90 vL = new std::vector<G4double*>;
91 vX = new std::vector<std::pair<G4double,G4double>*>;
92
93 lastSRatio=0.; // The last sigma value for which R was calculated
94 lastRRatio=0.; // The last ratio R which was calculated
95 lastARatio=0; // theLast of calculated A
96 lastHRatio=0.; // theLast of max s initialized in the LinTable
97 lastNRatio=0; // theLast of topBin number initialized in LinTable
98 lastMRatio=0.; // theLast of rel max ln(s) initialized in LogTable
99 lastKRatio=0; // theLast of topBin number initialized in LogTable
100 lastTRatio=0; // theLast of pointer to LinTable in the C++ heap
101 lastLRatio=0; // theLast of pointer to LogTable in the C++ heap
102 lastPtot=0.; // The last momentum for which XS was calculated
103 lastHtot=0; // The last projPDG for which XS was calculated
104 lastFtot=true; // The last nucleon for which XS was calculated
105 lastItot=0; // The Last index for which XS was calculated
106 lastMtot=0.; // The Last rel max ln(p) initialized in LogTable
107 lastKtot=0; // The Last topBin number initialized in LogTable
108 lastXtot = nullptr; // The Last ETPointers to LogTable in heap
109
111
113}
static const char * Default_Name()
static const char * Default_Name()
G4VCrossSectionDataSet * GetCrossSectionDataSet(const G4String &name, G4bool warning=false)
static G4CrossSectionDataSetRegistry * Instance()
std::vector< G4double * > * vL
std::vector< G4double * > * vT
std::pair< G4double, G4double > * lastXtot
G4double * lastLRatio
std::vector< std::pair< G4double, G4double > * > * vX
G4double * lastTRatio
G4ChipsNeutronElasticXS * NCSmanager
G4ChipsProtonElasticXS * PCSmanager

References G4ChipsNeutronElasticXS::Default_Name(), G4ChipsProtonElasticXS::Default_Name(), G4CrossSectionDataSetRegistry::GetCrossSectionDataSet(), G4CrossSectionDataSetRegistry::Instance(), lastARatio, lastFtot, lastHRatio, lastHtot, lastItot, lastKRatio, lastKtot, lastLRatio, lastMRatio, lastMtot, lastNRatio, lastPtot, lastRRatio, lastSRatio, lastTRatio, lastXtot, NCSmanager, PCSmanager, vL, vT, and vX.

◆ ~G4QuasiElRatios()

G4QuasiElRatios::~G4QuasiElRatios ( )

Definition at line 115 of file G4QuasiElRatios.cc.

116{
117 std::vector<G4double*>::iterator pos;
118 for(pos=vT->begin(); pos<vT->end(); pos++)
119 { delete [] *pos; }
120 vT->clear();
121 delete vT;
122
123 for(pos=vL->begin(); pos<vL->end(); pos++)
124 { delete [] *pos; }
125 vL->clear();
126 delete vL;
127
128 std::vector<std::pair<G4double,G4double>*>::iterator pos2;
129 for(pos2=vX->begin(); pos2<vX->end(); pos2++)
130 { delete [] *pos2; }
131 vX->clear();
132 delete vX;
133}
static const G4double pos

References pos, vL, vT, and vX.

Member Function Documentation

◆ CalcElTot()

std::pair< G4double, G4double > G4QuasiElRatios::CalcElTot ( G4double  pGeV,
G4int  Index 
)
private

Definition at line 322 of file G4QuasiElRatios.cc.

323{
324 // ---------> Each parameter set can have not more than nPoints=128 parameters
325
326 G4double El=0.; // prototype of the elastic hN cross-section
327 G4double To=0.; // prototype of the total hN cross-section
328 if(p<=0.)
329 {
330 G4cout<<"-Warning-G4QuasiElRatios::CalcElTot: p="<<p<<" is zero or negative"<<G4endl;
331 return std::make_pair(El,To);
332 }
333 if (!I) // pp/nn
334 {
335 if(p<pmi)
336 {
337 G4double p2=p*p;
338 El=1./(.00012+p2*.2);
339 To=El;
340 }
341 else if(p>pma)
342 {
343 G4double lp=G4Log(p)-lmi;
344 G4double lp2=lp*lp;
345 El=pbe*lp2+6.72;
346 To=pbt*lp2+38.2;
347 }
348 else
349 {
350 G4double p2=p*p;
351 G4double LE=1./(.00012+p2*.2);
352 G4double lp=G4Log(p)-lmi;
353 G4double lp2=lp*lp;
354 G4double rp2=1./p2;
355 El=LE+(pbe*lp2+6.72+32.6/p)/(1.+rp2/p);
356 To=LE+(pbt*lp2+38.2+52.7*rp2)/(1.+2.72*rp2*rp2);
357 }
358 }
359 else if(I==1) // np/pn
360 {
361 if(p<pmi)
362 {
363 G4double p2=p*p;
364 El=1./(.00012+p2*(.051+.1*p2));
365 To=El;
366 }
367 else if(p>pma)
368 {
369 G4double lp=G4Log(p)-lmi;
370 G4double lp2=lp*lp;
371 El=pbe*lp2+6.72;
372 To=pbt*lp2+38.2;
373 }
374 else
375 {
376 G4double p2=p*p;
377 G4double LE=1./(.00012+p2*(.051+.1*p2));
378 G4double lp=G4Log(p)-lmi;
379 G4double lp2=lp*lp;
380 G4double rp2=1./p2;
381 El=LE+(pbe*lp2+6.72+30./p)/(1.+.49*rp2/p);
382 To=LE+(pbt*lp2+38.2)/(1.+.54*rp2*rp2);
383 }
384 }
385 else if(I==2) // pimp/pipn
386 {
387 G4double lp=G4Log(p);
388 if(p<pmi)
389 {
390 G4double lr=lp+1.27;
391 El=1.53/(lr*lr+.0676);
392 To=El*3;
393 }
394 else if(p>pma)
395 {
396 G4double ld=lp-lmi;
397 G4double ld2=ld*ld;
398 G4double sp=std::sqrt(p);
399 El=pbe*ld2+2.4+7./sp;
400 To=pbt*ld2+22.3+12./sp;
401 }
402 else
403 {
404 G4double lr=lp+1.27; // p1
405 G4double LE=1.53/(lr*lr+.0676); // p2, p3
406 G4double ld=lp-lmi; // p4 (lmi=3.5)
407 G4double ld2=ld*ld;
408 G4double p2=p*p;
409 G4double p4=p2*p2;
410 G4double sp=std::sqrt(p);
411 G4double lm=lp+.36; // p5
412 G4double md=lm*lm+.04; // p6
413 G4double lh=lp-.017; // p7
414 G4double hd=lh*lh+.0025; // p8
415 El=LE+(pbe*ld2+2.4+7./sp)/(1.+.7/p4)+.6/md+.05/hd;//p9(pbe=.0557),p10,p11,p12,p13,p14
416 To=LE*3+(pbt*ld2+22.3+12./sp)/(1.+.4/p4)+1./md+.06/hd;
417 }
418 }
419 else if(I==3) // pipp/pimn
420 {
421 G4double lp=G4Log(p);
422 if(p<pmi)
423 {
424 G4double lr=lp+1.27;
425 G4double lr2=lr*lr;
426 El=13./(lr2+lr2*lr2+.0676);
427 To=El;
428 }
429 else if(p>pma)
430 {
431 G4double ld=lp-lmi;
432 G4double ld2=ld*ld;
433 G4double sp=std::sqrt(p);
434 El=pbe*ld2+2.4+6./sp;
435 To=pbt*ld2+22.3+5./sp;
436 }
437 else
438 {
439 G4double lr=lp+1.27; // p1
440 G4double lr2=lr*lr;
441 G4double LE=13./(lr2+lr2*lr2+.0676); // p2, p3
442 G4double ld=lp-lmi; // p4 (lmi=3.5)
443 G4double ld2=ld*ld;
444 G4double p2=p*p;
445 G4double p4=p2*p2;
446 G4double sp=std::sqrt(p);
447 G4double lm=lp-.32; // p5
448 G4double md=lm*lm+.0576; // p6
449 El=LE+(pbe*ld2+2.4+6./sp)/(1.+3./p4)+.7/md; // p7(pbe=.0557), p8, p9, p10, p11
450 To=LE+(pbt*ld2+22.3+5./sp)/(1.+1./p4)+.8/md;
451 }
452 }
453 else if(I==4) // Kmp/Kmn/K0p/K0n
454 {
455
456 if(p<pmi)
457 {
458 G4double psp=p*std::sqrt(p);
459 El=5.2/psp;
460 To=14./psp;
461 }
462 else if(p>pma)
463 {
464 G4double ld=G4Log(p)-lmi;
465 G4double ld2=ld*ld;
466 El=pbe*ld2+2.23;
467 To=pbt*ld2+19.5;
468 }
469 else
470 {
471 G4double ld=G4Log(p)-lmi;
472 G4double ld2=ld*ld;
473 G4double sp=std::sqrt(p);
474 G4double psp=p*sp;
475 G4double p2=p*p;
476 G4double p4=p2*p2;
477 G4double lm=p-.39;
478 G4double md=lm*lm+.000156;
479 G4double lh=p-1.;
480 G4double hd=lh*lh+.0156;
481 El=5.2/psp+(pbe*ld2+2.23)/(1.-.7/sp+.075/p4)+.004/md+.15/hd;
482 To=14./psp+(pbt*ld2+19.5)/(1.-.21/sp+.52/p4)+.006/md+.30/hd;
483 }
484 }
485 else if(I==5) // Kpp/Kpn/aKp/aKn
486 {
487 if(p<pmi)
488 {
489 G4double lr=p-.38;
490 G4double lm=p-1.;
491 G4double md=lm*lm+.372;
492 El=.7/(lr*lr+.0676)+2./md;
493 To=El+.6/md;
494 }
495 else if(p>pma)
496 {
497 G4double ld=G4Log(p)-lmi;
498 G4double ld2=ld*ld;
499 El=pbe*ld2+2.23;
500 To=pbt*ld2+19.5;
501 }
502 else
503 {
504 G4double ld=G4Log(p)-lmi;
505 G4double ld2=ld*ld;
506 G4double lr=p-.38;
507 G4double LE=.7/(lr*lr+.0676);
508 G4double sp=std::sqrt(p);
509 G4double p2=p*p;
510 G4double p4=p2*p2;
511 G4double lm=p-1.;
512 G4double md=lm*lm+.372;
513 El=LE+(pbe*ld2+2.23)/(1.-.7/sp+.1/p4)+2./md;
514 To=LE+(pbt*ld2+19.5)/(1.+.46/sp+1.6/p4)+2.6/md;
515 }
516 }
517 else if(I==6) // hyperon-N
518 {
519 if(p<pmi)
520 {
521 G4double p2=p*p;
522 El=1./(.002+p2*(.12+p2));
523 To=El;
524 }
525 else if(p>pma)
526 {
527 G4double lp=G4Log(p)-lmi;
528 G4double lp2=lp*lp;
529 G4double sp=std::sqrt(p);
530 El=(pbe*lp2+6.72)/(1.+2./sp);
531 To=(pbt*lp2+38.2+900./sp)/(1.+27./sp);
532 }
533 else
534 {
535 G4double p2=p*p;
536 G4double LE=1./(.002+p2*(.12+p2));
537 G4double lp=G4Log(p)-lmi;
538 G4double lp2=lp*lp;
539 G4double p4=p2*p2;
540 G4double sp=std::sqrt(p);
541 El=LE+(pbe*lp2+6.72+99./p2)/(1.+2./sp+2./p4);
542 To=LE+(pbt*lp2+38.2+900./sp)/(1.+27./sp+3./p4);
543 }
544 }
545 else if(I==7) // antibaryon-N
546 {
547 if(p>pma)
548 {
549 G4double lp=G4Log(p)-lmi;
550 G4double lp2=lp*lp;
551 El=pbe*lp2+6.72;
552 To=pbt*lp2+38.2;
553 }
554 else
555 {
556 G4double ye=G4Pow::GetInstance()->powA(p,1.25);
557 G4double yt=G4Pow::GetInstance()->powA(p,.35);
558 G4double lp=G4Log(p)-lmi;
559 G4double lp2=lp*lp;
560 El=80./(ye+1.)+pbe*lp2+6.72;
561 To=(80./yt+.3)/yt+pbt*lp2+38.2;
562 }
563 }
564 else
565 {
566 G4cout<<"*Error*G4QuasiElRatios::CalcElTot:ind="<<I<<" is not defined (0-7)"<<G4endl;
567 G4Exception("G4QuasiElRatios::CalcElTot:","23",FatalException,"QEcrash");
568 }
569 if(El>To) El=To;
570 return std::make_pair(El,To);
571} // End of CalcElTot
@ LE
Definition: Evaluator.cc:65
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
G4double G4Log(G4double x)
Definition: G4Log.hh:226
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:230

References FatalException, G4cout, G4endl, G4Exception(), G4Log(), G4Pow::GetInstance(), LE, anonymous_namespace{G4QuasiElRatios.cc}::lmi, anonymous_namespace{G4QuasiElRatios.cc}::pbe, anonymous_namespace{G4QuasiElRatios.cc}::pbt, anonymous_namespace{G4QuasiElRatios.cc}::pma, anonymous_namespace{G4QuasiElRatios.cc}::pmi, G4Pow::powA(), and G4InuclParticleNames::sp.

Referenced by FetchElTot(), and GetElTotXS().

◆ CalcQF2IN_Ratio()

G4double G4QuasiElRatios::CalcQF2IN_Ratio ( G4double  TCSmb,
G4int  A 
)
private

Definition at line 310 of file G4QuasiElRatios.cc.

311{
312 G4double s2=m_s*m_s;
313 G4double s4=s2*s2;
314 G4double ss=std::sqrt(std::sqrt(m_s));
315 G4double P=7.48e-5*s2/(1.+8.77e12/s4/s4/s2);
316 G4double E=.2644+.016/(1.+G4Exp((29.54-m_s)/2.49));
317 G4double F=ss*.1526*G4Exp(-s2*ss*.0000859);
318 return C*G4Exp(-E*G4Pow::GetInstance()->powA(G4double(A-1.),F))/G4Pow::GetInstance()->powA(G4double(A),P);
319} // End of CalcQF2IN_Ratio
G4double C(G4double temp)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179
const G4double A[17]
static double P[]

References A, C(), G4Exp(), G4Pow::GetInstance(), P, and G4Pow::powA().

Referenced by GetQF2IN_Ratio().

◆ ChExElCoef()

G4double G4QuasiElRatios::ChExElCoef ( G4double  p,
G4int  Z,
G4int  N,
G4int  pPDG 
)

Definition at line 1016 of file G4QuasiElRatios.cc.

1017{
1018
1019 p/=MeV; // Converted from independent units
1020 G4double A=Z+N;
1021 if(A<1.5) return 0.;
1022 G4double Cex=0.;
1023 if (pPDG==2212) Cex=N/(A+Z);
1024 else if(pPDG==2112) Cex=Z/(A+N);
1025 else G4cout<<"*Warning*G4CohChrgExchange::ChExElCoef: wrong PDG="<<pPDG<<G4endl;
1026 Cex*=Cex; // Coherent processes squares the amplitude
1027 // @@ This is true only for nucleons: other projectiles must be treated differently
1028 G4double sp=std::sqrt(p);
1029 G4double p2=p*p;
1030 G4double p4=p2*p2;
1031 G4double dl1=G4Log(p)-5.;
1032 G4double T=(6.75+.14*dl1*dl1+13./p)/(1.+.14/p4)+.6/(p4+.00013);
1033 G4double U=(6.25+8.33e-5/p4/p)*(p*sp+.34)/p2/p;
1034 G4double R=U/T;
1035 return Cex*R*R;
1036}
static constexpr double MeV
Definition: G4SIunits.hh:200
const G4int Z[17]

References A, G4cout, G4endl, G4Log(), MeV, G4InuclParticleNames::sp, and Z.

◆ ChExer()

std::pair< G4LorentzVector, G4LorentzVector > G4QuasiElRatios::ChExer ( G4int  NPDG,
G4LorentzVector  N4M,
G4int  pPDG,
G4LorentzVector  p4M 
)

Definition at line 904 of file G4QuasiElRatios.cc.

906{
907 static const G4double mNeut= G4Neutron::Neutron()->GetPDGMass();
908 static const G4double mProt= G4Proton::Proton()->GetPDGMass();
909 G4LorentzVector pr4M=p4M/megaelectronvolt; // Convert 4-momenta in MeV(keep p4M)
910 N4M/=megaelectronvolt;
911 G4LorentzVector tot4M=N4M+p4M;
912 G4int Z=0;
913 G4int N=1;
914 G4int sPDG=0; // PDG code of the scattered hadron
915 G4double mS=0.; // proto of mass of scattered hadron
916 G4double mT=mProt; // mass of the recoil nucleon
917 if(NPDG==2212)
918 {
919 mT=mNeut;
920 Z=1;
921 N=0;
922 if(pPDG==-211) sPDG=111; // pi+ -> pi0
923 else if(pPDG==-321)
924 {
925 sPDG=310; // K+ -> K0S
926 if(G4UniformRand()>.5) sPDG=130; // K+ -> K0L
927 }
928 else if(pPDG==-311||pPDG==311||pPDG==130||pPDG==310) sPDG=321; // K0 -> K+ (?)
929 else if(pPDG==3112) sPDG=3212; // Sigma- -> Sigma0
930 else if(pPDG==3212) sPDG=3222; // Sigma0 -> Sigma+
931 else if(pPDG==3312) sPDG=3322; // Xi- -> Xi0
932 }
933 else if(NPDG==2112) // Default
934 {
935 if(pPDG==211) sPDG=111; // pi+ -> pi0
936 else if(pPDG==321)
937 {
938 sPDG=310; // K+ -> K0S
939 if(G4UniformRand()>.5) sPDG=130; // K+ -> K0L
940 }
941 else if(pPDG==-311||pPDG==311||pPDG==130||pPDG==310) sPDG=-321; // K0 -> K- (?)
942 else if(pPDG==3222) sPDG=3212; // Sigma+ -> Sigma0
943 else if(pPDG==3212) sPDG=3112; // Sigma0 -> Sigma-
944 else if(pPDG==3322) sPDG=3312; // Xi0 -> Xi-
945 }
946 else
947 {
948 G4cout<<"Error:G4QuasiElRatios::ChExer: NPDG="<<NPDG<<" is not 2212 or 2112"<<G4endl;
949 G4Exception("G4QuasiElRatios::ChExer:","21",FatalException,"QE complain");
950 //return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M);// Use this if not exception
951 }
952 if(sPDG) mS=mNeut;
953 else
954 {
955 G4cout<<"Error:G4QuasiElRatios::ChExer: BAD pPDG="<<pPDG<<", NPDG="<<NPDG<<G4endl;
956 G4Exception("G4QuasiElRatios::ChExer:","21",FatalException,"QE complain");
957 //return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M);// Use this if not exception
958 }
959 G4double mT2=mT*mT;
960 G4double mS2=mS*mS;
961 G4double E=(tot4M.m2()-mT2-mS2)/(mT+mT);
962 G4double E2=E*E;
963 if(E<0. || E2<mS2)
964 {
965 return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
966 }
967 G4double P=std::sqrt(E2-mS2); // Momentum in pseudo laboratory system
968 // @@ Temporary NN t-dependence for all hadrons
969 G4int PDG=2212; // *TMP* instead of pPDG
970 if(pPDG==2112||pPDG==-211||pPDG==-321) PDG=2112; // *TMP* instead of pPDG
971 if(!Z && N==1) // Change for Quasi-Elastic on neutron
972 {
973 Z=1;
974 N=0;
975 if (PDG==2212) PDG=2112;
976 else if(PDG==2112) PDG=2212;
977 }
978 G4double xSec=0.; // Prototype of Recalculated Cross Section *TMP*
979 if(PDG==2212) xSec=PCSmanager->GetChipsCrossSection(P, Z, N, PDG); // P CrossSect *TMP*
980 else xSec=NCSmanager->GetChipsCrossSection(P, Z, N, PDG); // N CrossSect *TMP*
981 // @@ check a possibility to separate p, n, or alpha (!)
982 if(xSec <= 0.) // The cross-section iz 0 -> Do Nothing
983 {
984 return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); //Do Nothing Action
985 }
986 G4double mint=0.; // Prototype of functional rand -t (MeV^2) *TMP*
987 if(PDG==2212) mint=PCSmanager->GetExchangeT(Z,N,PDG);// P functional rand -t(MeV^2) *TMP*
988 else mint=NCSmanager->GetExchangeT(Z,N,PDG);// N functional rand -t(MeV^2) *TMP*
989 G4double maxt=0.; // Prototype of max possible -t
990 if(PDG==2212) maxt=PCSmanager->GetHMaxT(); // max possible -t
991 else maxt=NCSmanager->GetHMaxT(); // max possible -t
992 G4double cost=1.-mint/maxt; // cos(theta) in CMS
993 if(cost>1. || cost<-1. || !(cost>-1. || cost<=1.))
994 {
995 if (cost>1.) cost=1.;
996 else if(cost<-1.) cost=-1.;
997 else
998 {
999 G4cerr<<"G4QuasiFreeRatio::ChExer:*NAN* c="<<cost<<",t="<<mint<<",tm="<<maxt<<G4endl;
1000 return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
1001 }
1002 }
1003 G4LorentzVector reco4M=G4LorentzVector(0.,0.,0.,mT); // 4mom of the recoil nucleon
1004 pr4M=G4LorentzVector(0.,0.,0.,mS); // 4mom of the scattered hadron
1005 G4LorentzVector dir4M=tot4M-G4LorentzVector(0.,0.,0.,(tot4M.e()-mT)*.01);
1006 if(!RelDecayIn2(tot4M, pr4M, reco4M, dir4M, cost, cost))
1007 {
1008 G4cerr<<"G4QFR::ChEx:t="<<tot4M<<tot4M.m()<<",mT="<<mT<<",mP="<<mS<<G4endl;
1009 //G4Exception("G4QFR::ChExer:","009",FatalException,"Decay of ElasticComp");
1010 return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
1011 }
1012 return std::make_pair(reco4M*megaelectronvolt,pr4M*megaelectronvolt); // Result
1013} // End of ChExer
CLHEP::HepLorentzVector G4LorentzVector
static constexpr double megaelectronvolt
Definition: G4SIunits.hh:193
int G4int
Definition: G4Types.hh:85
G4GLOB_DLL std::ostream G4cerr
#define G4UniformRand()
Definition: Randomize.hh:52
G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG)
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG)
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
static G4Proton * Proton()
Definition: G4Proton.cc:92
G4bool RelDecayIn2(G4LorentzVector &theMomentum, G4LorentzVector &f4Mom, G4LorentzVector &s4Mom, G4LorentzVector &dir, G4double maxCost=1., G4double minCost=-1.)

References CLHEP::HepLorentzVector::e(), FatalException, G4cerr, G4cout, G4endl, G4Exception(), G4UniformRand, G4ChipsNeutronElasticXS::GetChipsCrossSection(), G4ChipsProtonElasticXS::GetChipsCrossSection(), G4ChipsNeutronElasticXS::GetExchangeT(), G4ChipsProtonElasticXS::GetExchangeT(), G4ChipsNeutronElasticXS::GetHMaxT(), G4ChipsProtonElasticXS::GetHMaxT(), G4ParticleDefinition::GetPDGMass(), CLHEP::HepLorentzVector::m(), CLHEP::HepLorentzVector::m2(), megaelectronvolt, anonymous_namespace{G4ChipsNeutronElasticXS.cc}::mNeut, anonymous_namespace{G4ChipsNeutronElasticXS.cc}::mProt, NCSmanager, G4Neutron::Neutron(), P, PCSmanager, G4Proton::Proton(), RelDecayIn2(), and Z.

◆ FetchElTot()

std::pair< G4double, G4double > G4QuasiElRatios::FetchElTot ( G4double  pGeV,
G4int  PDG,
G4bool  F 
)

Definition at line 610 of file G4QuasiElRatios.cc.

611{
612 // LogTable is created only if necessary. The ratio R(s>8100 mb) = 0 for any nuclei
613 G4int nDB=vItot.size(); // A number of hadrons already initialized in AMDB
614 if(nDB && lastHtot==PDG && lastFtot==F && p>0. && p==lastPtot) return lastRtot;// VI don't use toler.
615 // if(nDB && lastH==PDG && lastF==F && p>0. && std::fabs(p-lastP)/p<toler) return lastR;
616 lastHtot=PDG;
617 lastFtot=F;
618 G4int ind=-1; // Prototipe of the index of the PDG/F combination
619 // i=0: pp(nn), i=1: np(pn), i=2: pimp(pipn), i=3: pipp(pimn), i=4: Kmp(Kmn,K0n,K0p),
620 // i=5: Kpp(Kpn,aK0n,aK0p), i=6: Hp(Hn), i=7: app(apn,ann,anp)
621 G4bool kfl=true; // Flag of K0/aK0 oscillation
622 G4bool kf=false;
623 if(PDG==130||PDG==310)
624 {
625 kf=true;
626 if(G4UniformRand()>.5) kfl=false;
627 }
628 if ( (PDG == 2212 && F) || (PDG == 2112 && !F) ) ind=0; // pp/nn
629 else if ( (PDG == 2112 && F) || (PDG == 2212 && !F) ) ind=1; // np/pn
630 else if ( (PDG == -211 && F) || (PDG == 211 && !F) ) ind=2; // pimp/pipn
631 else if ( (PDG == 211 && F) || (PDG == -211 && !F) ) ind=3; // pipp/pimn
632 //AR-Jul2020: Extended to charmed and bottom hadrons:
633 // - treat mesons with constituent c quark or b quark as a meson with s quark (e.g. K-);
634 // - treat mesons with constituent cbar antiquark or bbar antiquark as a meson with sbar antiquark (e.g. K+);
635 // - treat all heavy baryons (i.e. hyperons, charmed and bottom baryons) as lambda;
636 // - treat all heavy anti-baryons (i.e. anti-hyperons, charmed and bottom anti-baryons) as anti-p/anti-n.
637 else if ( PDG == -321 || PDG == -311 || (kf && !kfl) || // mesons with s quark
638 PDG == 411 || PDG == 421 || PDG == 431 || // mesons with c quark
639 PDG == -521 || PDG == -511 || PDG == -531 || PDG == -541 ) ind=4; // mesons with b quark
640 else if ( PDG == 321 || PDG == 311 || (kf && kfl) || // mesons with sbar antiquark
641 PDG == -411 || PDG == -421 || PDG == -431 || // mesons with cbar antiquark
642 PDG == 521 || PDG == 511 || PDG == 531 || PDG == 541 ) ind=5; // mesons with bbar antiquark
643 else if ( PDG > 3000 && PDG < 5333 ) ind=6; // @@ for all heavy baryons - take Lambda
644 else if ( PDG > -5333 && PDG < -2000 ) ind=7; // @@ for all anti-baryons (anti-p/anti-n)
645 else {
646 G4cout<<"*Error*G4QuasiElRatios::FetchElTot: PDG="<<PDG
647 <<", while it is defined only for p,n,hyperons,anti-baryons,pi,K/antiK"<<G4endl;
648 G4Exception("G4QuasiELRatio::FetchElTot:","22",FatalException,"QECrash");
649 }
650 if(nDB && lastItot==ind && p>0. && p==lastPtot) return lastRtot; // VI do not use toler
651 // if(nDB && lastI==ind && p>0. && std::fabs(p-lastP)/p<toler) return lastR;
652 if(p<=mip || p>=map) return CalcElTot(p,ind); // @@ Slow calculation ! (Warning?)
653 G4bool found=false;
654 G4int i=-1;
655 if(nDB) for (i=0; i<nDB; i++) if(ind==vItot[i]) // Sirch for this index in AMDB
656 {
657 found=true; // The index is found
658 break;
659 }
660 G4double lp=G4Log(p);
661 if(!nDB || !found) // Create new line in the AMDB
662 {
663 lastXtot = new std::pair<G4double,G4double>[mlp]; // Create logarithmic Table for ElTot
664 lastItot = ind; // Remember the initialized inex
665 lastKtot = static_cast<int>((lp-lpi)/dlp)+1; // MaxBin to be initialized in LogTaB
666 if(lastKtot>nlp)
667 {
670 }
671 else lastMtot = lastKtot*dlp; // Calculate max initialized ln(p)-lpi for LogTab
672 G4double pv=mip;
673 for(G4int j=0; j<=lastKtot; j++) // Calculate LogTab values
674 {
675 lastXtot[j]=CalcElTot(pv,ind);
676 if(j!=lastKtot) pv*=edlp;
677 }
678 i++; // Make a new record to AMDB and position on it
679 vItot.push_back(lastItot);
680 vMtot.push_back(lastMtot);
681 vKtot.push_back(lastKtot);
682 vX->push_back(lastXtot);
683 }
684 else // The A value was found in AMDB
685 {
686 lastItot=vItot[i];
687 lastMtot=vMtot[i];
688 lastKtot=vKtot[i];
689 lastXtot=(*vX)[i];
690 G4int nextK=lastKtot+1;
692 if(lp>lpM && lastKtot<nlp) // LogTab must be updated
693 {
694 lastKtot = static_cast<int>((lp-lpi)/dlp)+1; // MaxBin to be initialized in LogTab
695 if(lastKtot>nlp)
696 {
699 }
700 else lastMtot = lastKtot*dlp; // Calculate max initialized ln(p)-lpi for LogTab
701 G4double pv=G4Exp(lpM); // momentum of the last calculated beam
702 for(G4int j=nextK; j<=lastKtot; j++)// Calculate LogTab values
703 {
704 pv*=edlp;
705 lastXtot[j]=CalcElTot(pv,ind);
706 }
707 } // End of LogTab update
708 if(lastKtot>=nextK) // The AMDB was apdated
709 {
710 vMtot[i]=lastMtot;
711 vKtot[i]=lastKtot;
712 }
713 }
714 // Now one can use tabeles to calculate the value
715 G4double dlpp=lp-lpi; // Shifted log(p) value
716 G4int n=static_cast<int>(dlpp/dlp); // Low edge number of the bin
717 G4double d=dlpp-n*dlp; // Log shift
718 G4double e=lastXtot[n].first; // E-Base
719 lastRtot.first=e+d*(lastXtot[n+1].first-e)/dlp; // E-Result
720 if(lastRtot.first<0.) lastRtot.first = 0.;
721 G4double t=lastXtot[n].second; // T-Base
722 lastRtot.second=t+d*(lastXtot[n+1].second-t)/dlp; // T-Result
723 if(lastRtot.second<0.) lastRtot.second= 0.;
724 if(lastRtot.first>lastRtot.second) lastRtot.first = lastRtot.second;
725 return lastRtot;
726} // End of FetchElTot
bool G4bool
Definition: G4Types.hh:86
std::vector< G4double > vMtot
std::pair< G4double, G4double > CalcElTot(G4double pGeV, G4int Index)
std::vector< G4int > vKtot
std::pair< G4double, G4double > lastRtot
std::vector< G4int > vItot

References CalcElTot(), anonymous_namespace{G4QuasiElRatios.cc}::dlp, anonymous_namespace{G4QuasiElRatios.cc}::edlp, FatalException, G4cout, G4endl, G4Exception(), G4Exp(), G4Log(), G4UniformRand, lastFtot, lastHtot, lastItot, lastKtot, lastMtot, lastPtot, lastRtot, lastXtot, anonymous_namespace{G4QuasiElRatios.cc}::lpa, anonymous_namespace{G4QuasiElRatios.cc}::lpi, anonymous_namespace{G4QuasiElRatios.cc}::map, anonymous_namespace{G4QuasiElRatios.cc}::mip, anonymous_namespace{G4QuasiElRatios.cc}::mlp, CLHEP::detail::n, anonymous_namespace{G4QuasiElRatios.cc}::nlp, vItot, vKtot, vMtot, and vX.

Referenced by GetChExFactor(), and GetElTot().

◆ GetChExFactor()

std::pair< G4double, G4double > G4QuasiElRatios::GetChExFactor ( G4double  pIU,
G4int  pPDG,
G4int  Z,
G4int  N 
)

Definition at line 745 of file G4QuasiElRatios.cc.

747{
748 G4double pGeV=pIU/gigaelectronvolt;
749 G4double resP=0.;
750 G4double resN=0.;
751 if(Z<1 && N<1)
752 {
753 G4cout<<"-Warning-G4QuasiElRatio::GetChExF:Z="<<Z<<",N="<<N<<", return zero"<<G4endl;
754 return std::make_pair(resP,resN);
755 }
756 G4double A=Z+N;
757 G4double pf=0.; // Possibility to interact with a proton
758 G4double nf=0.; // Possibility to interact with a neutron
759 if (hPDG==-211||hPDG==-321||hPDG==3112||hPDG==3212||hPDG==3312) pf=Z/(A+N);
760 else if(hPDG==211||hPDG==321||hPDG==3222||hPDG==3212||hPDG==3322) nf=N/(A+Z);
761 else if(hPDG==-311||hPDG==311||hPDG==130||hPDG==310)
762 {
763 G4double dA=A+A;
764 pf=Z/(dA+N+N);
765 nf=N/(dA+Z+Z);
766 }
767 G4double mult=1.; // Factor of increasing multiplicity ( ? @@)
768 if(pGeV>.5)
769 {
770 mult=1./(1.+G4Log(pGeV+pGeV))/pGeV;
771 if(mult>1.) mult=1.;
772 }
773 if(pf)
774 {
775 std::pair<G4double,G4double> hp=FetchElTot(pGeV, hPDG, true);
776 resP=pf*(hp.second/hp.first-1.)*mult;
777 }
778 if(nf)
779 {
780 std::pair<G4double,G4double> hn=FetchElTot(pGeV, hPDG, false);
781 resN=nf*(hn.second/hn.first-1.)*mult;
782 }
783 return std::make_pair(resP,resN);
784} // End of GetChExFactor
static constexpr double gigaelectronvolt
Definition: G4SIunits.hh:194
std::pair< G4double, G4double > FetchElTot(G4double pGeV, G4int PDG, G4bool F)

References A, FetchElTot(), G4cout, G4endl, G4Log(), gigaelectronvolt, and Z.

◆ GetElTot()

std::pair< G4double, G4double > G4QuasiElRatios::GetElTot ( G4double  pIU,
G4int  hPDG,
G4int  Z,
G4int  N 
)

Definition at line 729 of file G4QuasiElRatios.cc.

731{
732 G4double pGeV=pIU/gigaelectronvolt;
733 if(Z<1 && N<1)
734 {
735 G4cout<<"-Warning-G4QuasiElRatio::GetElTot:Z="<<Z<<",N="<<N<<", return zero"<<G4endl;
736 return std::make_pair(0.,0.);
737 }
738 std::pair<G4double,G4double> hp=FetchElTot(pGeV, hPDG, true);
739 std::pair<G4double,G4double> hn=FetchElTot(pGeV, hPDG, false);
740 G4double A=(Z+N)/millibarn; // To make the result in independent units(IU)
741 return std::make_pair((Z*hp.first+N*hn.first)/A,(Z*hp.second+N*hn.second)/A);
742} // End of GetElTot
static constexpr double millibarn
Definition: G4SIunits.hh:86

References A, FetchElTot(), G4cout, G4endl, gigaelectronvolt, millibarn, and Z.

Referenced by GetRatios().

◆ GetElTotXS()

std::pair< G4double, G4double > G4QuasiElRatios::GetElTotXS ( G4double  Mom,
G4int  PDG,
G4bool  F 
)

Definition at line 574 of file G4QuasiElRatios.cc.

575{
576 G4int ind=0; // Prototype of the reaction index
577 G4bool kfl=true; // Flag of K0/aK0 oscillation
578 G4bool kf=false;
579 if(PDG==130||PDG==310)
580 {
581 kf=true;
582 if(G4UniformRand()>.5) kfl=false;
583 }
584 if ( (PDG == 2212 && F) || (PDG == 2112 && !F) ) ind=0; // pp/nn
585 else if ( (PDG == 2112 && F) || (PDG == 2212 && !F) ) ind=1; // np/pn
586 else if ( (PDG == -211 && F) || (PDG == 211 && !F) ) ind=2; // pimp/pipn
587 else if ( (PDG == 211 && F) || (PDG == -211 && !F) ) ind=3; // pipp/pimn
588 //AR-Jul2020: Extended to charmed and bottom hadrons:
589 // - treat mesons with constituent c quark or b quark as a meson with s quark (e.g. K-);
590 // - treat mesons with constituent cbar antiquark or bbar antiquark as a meson with sbar antiquark (e.g. K+);
591 // - treat all heavy baryons (i.e. hyperons, charmed and bottom baryons) as lambda;
592 // - treat all heavy anti-baryons (i.e. anti-hyperons, charmed and bottom anti-baryons) as anti-p/anti-n.
593 else if ( PDG == -321 || PDG == -311 || (kf && !kfl) || // mesons with s quark
594 PDG == 411 || PDG == 421 || PDG == 431 || // mesons with c quark
595 PDG == -521 || PDG == -511 || PDG == -531 || PDG == -541 ) ind=4; // mesons with b quark
596 else if ( PDG == 321 || PDG == 311 || (kf && kfl) || // mesons with sbar antiquark
597 PDG == -411 || PDG == -421 || PDG == -431 || // mesons with cbar antiquark
598 PDG == 521 || PDG == 511 || PDG == 531 || PDG == 541 ) ind=5; // mesons with bbar antiquark
599 else if ( PDG > 3000 && PDG < 5333 ) ind=6; // @@ for all heavy baryons - take Lambda
600 else if ( PDG > -5333 && PDG < -2000 ) ind=7; // @@ for all anti-baryons (anti-p/anti-n)
601 else {
602 G4cout<<"*Error*G4QuasiElRatios::CalcElTotXS: PDG="<<PDG
603 <<", while it is defined only for p,n,hyperons,anti-baryons,pi,K/antiK"<<G4endl;
604 G4Exception("G4QuasiElRatio::CalcElTotXS:","22",FatalException,"QEcrash");
605 }
606 return CalcElTot(p,ind);
607}

References CalcElTot(), FatalException, G4cout, G4endl, G4Exception(), and G4UniformRand.

◆ GetQF2IN_Ratio()

G4double G4QuasiElRatios::GetQF2IN_Ratio ( G4double  TotCS_mb,
G4int  A 
)
private

Definition at line 155 of file G4QuasiElRatios.cc.

156{
157 // LogTable is created only if necessary. The ratio R(s>8100 mb) = 0 for any nuclei
158 if(m_s<toler || A<2) return 1.;
159 if(m_s>min_s) return 0.;
160
161 //if(A>238)
162 //{
163 // G4cout<<"-Warning-G4QuasiElRatio::GetQF2IN_Ratio:A="<<A<<">238, return zero"<<G4endl;
164 // return 0.;
165 //}
166 G4int nDB=vARatio.size(); // A number of nuclei already initialized in AMDB
167 if(nDB && lastARatio==A && m_s==lastSRatio) return lastRRatio; // VI do not use tolerance
168 G4bool found=false;
169 G4int i=-1;
170 if(nDB) for (i=0; i<nDB; i++) if(A==vARatio[i]) // Search for this A in AMDB
171 {
172 found=true; // The A value is found
173 break;
174 }
175 if(!nDB || !found) // Create new line in the AMDB
176 {
177 lastARatio = A;
178 lastTRatio = new G4double[mps]; // Create the linear Table
179 lastNRatio = static_cast<int>(m_s/ds)+1; // MaxBin to be initialized
180 if(lastNRatio>nps)
181 {
184 }
185 else lastHRatio = lastNRatio*ds; // Calculate max initialized s for LinTab
186 G4double sv=0;
187 lastTRatio[0]=1.;
188 for(G4int j=1; j<=lastNRatio; j++) // Calculate LogTab values
189 {
190 sv+=ds;
192 }
193 lastLRatio=new G4double[mls]; // Create the logarithmic Table
194 // Initialize the logarithmic Table
195 for(G4int j=0; j<mls; ++j) lastLRatio[j]=0.0;
196 if(m_s>sma)
197 {
198 G4double ls=G4Log(m_s);
199 lastKRatio = static_cast<int>((ls-lsi)/dls)+1; // MaxBin to be initialized in LogTaB
200 if(lastKRatio>nls)
201 {
204 }
205 else lastMRatio = lastKRatio*dls; // Calculate max initialized ln(s)-lsi for LogTab
206 sv=mi;
207 for(G4int j=0; j<=lastKRatio; j++) // Calculate LogTab values
208 {
210 if(j!=lastKRatio) sv*=edls;
211 }
212 }
213 else // LogTab is not initialized
214 {
215 lastKRatio = 0;
216 lastMRatio = 0.;
217 }
218 i++; // Make a new record to AMDB and position on it
219 vARatio.push_back(lastARatio);
220 vHRatio.push_back(lastHRatio);
221 vNRatio.push_back(lastNRatio);
222 vMRatio.push_back(lastMRatio);
223 vKRatio.push_back(lastKRatio);
224 vT->push_back(lastTRatio);
225 vL->push_back(lastLRatio);
226 }
227 else // The A value was found in AMDB
228 {
234 lastTRatio=(*vT)[i];
235 lastLRatio=(*vL)[i];
236 if(m_s>lastHRatio) // At least LinTab must be updated
237 {
238 G4int nextN=lastNRatio+1; // The next bin to be initialized
239 if(lastNRatio<nps)
240 {
241 G4double sv=lastHRatio; // bug fix by WP
242
243 lastNRatio = static_cast<int>(m_s/ds)+1;// MaxBin to be initialized
244 if(lastNRatio>nps)
245 {
248 }
249 else lastHRatio = lastNRatio*ds; // Calculate max initialized s for LinTab
250
251 for(G4int j=nextN; j<=lastNRatio; j++)// Calculate LogTab values
252 {
253 sv+=ds;
255 }
256 } // End of LinTab update
257 if(lastNRatio>=nextN)
258 {
261 }
262 G4int nextK=lastKRatio+1;
263 if(!lastKRatio) nextK=0;
264 if(m_s>sma && lastKRatio<nls) // LogTab must be updated
265 {
266 G4double sv=G4Exp(lastMRatio+lsi); // Define starting poit (lastM will be changed)
267 G4double ls=G4Log(m_s);
268 lastKRatio = static_cast<int>((ls-lsi)/dls)+1; // MaxBin to be initialized in LogTaB
269 if(lastKRatio>nls)
270 {
273 }
274 else lastMRatio = lastKRatio*dls; // Calculate max initialized ln(s)-lsi for LogTab
275 for(G4int j=nextK; j<=lastKRatio; j++)// Calculate LogTab values
276 {
277 sv*=edls;
279 }
280 } // End of LogTab update
281 if(lastKRatio>=nextK)
282 {
285 }
286 }
287 }
288 // Now one can use tabeles to calculate the value
289 if(m_s<sma) // Use linear table
290 {
291 G4int n=static_cast<int>(m_s/ds); // Low edge number of the bin
292 G4double d=m_s-n*ds; // Linear shift
293 G4double v=lastTRatio[n]; // Base
294 lastRRatio=v+d*(lastTRatio[n+1]-v)/ds; // Result
295 }
296 else // Use log table
297 {
298 G4double ls=G4Log(m_s)-lsi; // ln(s)-l_min
299 G4int n=static_cast<int>(ls/dls); // Low edge number of the bin
300 G4double d=ls-n*dls; // Log shift
301 G4double v=lastLRatio[n]; // Base
302 lastRRatio=v+d*(lastLRatio[n+1]-v)/dls; // Result
303 }
304 if(lastRRatio<0.) lastRRatio=0.;
305 if(lastRRatio>1.) lastRRatio=1.;
306 return lastRRatio;
307} // End of CalcQF2IN_Ratio
std::vector< G4int > vARatio
std::vector< G4double > vHRatio
std::vector< G4int > vKRatio
std::vector< G4double > vMRatio
G4double CalcQF2IN_Ratio(G4double TCSmb, G4int A)
std::vector< G4int > vNRatio
def ls(target="")
Definition: g4zmq.py:69

References A, CalcQF2IN_Ratio(), anonymous_namespace{G4QuasiElRatios.cc}::dls, anonymous_namespace{G4QuasiElRatios.cc}::ds, anonymous_namespace{G4QuasiElRatios.cc}::edls, G4Exp(), G4Log(), lastARatio, lastHRatio, lastKRatio, lastLRatio, lastMRatio, lastNRatio, lastRRatio, lastSRatio, lastTRatio, g4zmq::ls(), anonymous_namespace{G4QuasiElRatios.cc}::lsa, anonymous_namespace{G4QuasiElRatios.cc}::lsi, anonymous_namespace{G4QuasiElRatios.cc}::mi, anonymous_namespace{G4QuasiElRatios.cc}::min_s, anonymous_namespace{G4QuasiElRatios.cc}::mls, anonymous_namespace{G4QuasiElRatios.cc}::mps, CLHEP::detail::n, anonymous_namespace{G4QuasiElRatios.cc}::nls, anonymous_namespace{G4QuasiElRatios.cc}::nps, anonymous_namespace{G4QuasiElRatios.cc}::sma, anonymous_namespace{G4QuasiElRatios.cc}::toler, vARatio, vHRatio, vKRatio, vL, vMRatio, vNRatio, and vT.

Referenced by GetRatios().

◆ GetRatios()

std::pair< G4double, G4double > G4QuasiElRatios::GetRatios ( G4double  pIU,
G4int  prPDG,
G4int  tgZ,
G4int  tgN 
)

Definition at line 136 of file G4QuasiElRatios.cc.

138{
139 G4double R=0.;
140 G4double QF2In=1.; // Prototype of QuasiFree/Inel ratio for hN_tot
141 G4int tgA=tgZ+tgN;
142 if(tgA<2) return std::make_pair(QF2In,R); // No quasi-elastic on the only nucleon
143 std::pair<G4double,G4double> ElTot=GetElTot(pIU, pPDG, tgZ, tgN); // mean hN El&Tot(IU)
144 //if( ( (pPDG>999 && pIU<227.) || pIU<27.) && tgA>1) R=1.; // @@ TMP to accelerate @lowE
145 if(pPDG>999 && pIU<227. && tgZ+tgN>1) R=1.; // To accelerate @lowE
146 else if(ElTot.second>0.)
147 {
148 R=ElTot.first/ElTot.second; // El/Total ratio (does not depend on units
149 QF2In=GetQF2IN_Ratio(ElTot.second/millibarn, tgZ+tgN); // QuasiFree/Inelastic ratio
150 }
151 return std::make_pair(QF2In,R);
152}
G4double GetQF2IN_Ratio(G4double TotCS_mb, G4int A)
std::pair< G4double, G4double > GetElTot(G4double pIU, G4int hPDG, G4int Z, G4int N)

References GetElTot(), GetQF2IN_Ratio(), and millibarn.

Referenced by G4QuasiElasticChannel::GetFraction().

◆ RelDecayIn2()

G4bool G4QuasiElRatios::RelDecayIn2 ( G4LorentzVector theMomentum,
G4LorentzVector f4Mom,
G4LorentzVector s4Mom,
G4LorentzVector dir,
G4double  maxCost = 1.,
G4double  minCost = -1. 
)

Definition at line 1039 of file G4QuasiElRatios.cc.

1041{
1042 G4double fM2 = f4Mom.m2();
1043 G4double fM = std::sqrt(fM2); // Mass of the 1st Hadron
1044 G4double sM2 = s4Mom.m2();
1045 G4double sM = std::sqrt(sM2); // Mass of the 2nd Hadron
1046 G4double iM2 = theMomentum.m2();
1047 G4double iM = std::sqrt(iM2); // Mass of the decaying hadron
1048 G4double vP = theMomentum.rho(); // Momentum of the decaying hadron
1049 G4double dE = theMomentum.e(); // Energy of the decaying hadron
1050 if(dE<vP)
1051 {
1052 G4cerr<<"***G4QHad::RelDecIn2: Tachionic 4-mom="<<theMomentum<<", E-p="<<dE-vP<<G4endl;
1053 G4double accuracy=.000001*vP;
1054 G4double emodif=std::fabs(dE-vP);
1055 //if(emodif<accuracy)
1056 //{
1057 G4cerr<<"G4QHadron::RelDecIn2: *Boost* E-p shift is corrected to "<<emodif<<G4endl;
1058 theMomentum.setE(vP+emodif+.01*accuracy);
1059 //}
1060 }
1061 G4ThreeVector ltb = theMomentum.boostVector();// Boost vector for backward Lorentz Trans.
1062 G4ThreeVector ltf = -ltb; // Boost vector for forward Lorentz Trans.
1063 G4LorentzVector cdir = dir; // A copy to make a transformation to CMS
1064 cdir.boost(ltf); // Direction transpormed to CMS of the Momentum
1065 G4ThreeVector vdir = cdir.vect(); // 3-Vector of the direction-particle
1066 G4ThreeVector vx(0.,0.,1.); // Ort in the direction of the reference particle
1067 G4ThreeVector vy(0.,1.,0.); // First ort orthogonal to the direction
1068 G4ThreeVector vz(1.,0.,0.); // Second ort orthoganal to the direction
1069 if(vdir.mag2() > 0.) // the refference particle isn't at rest in CMS
1070 {
1071 vx = vdir.unit(); // Ort in the direction of the reference particle
1072 G4ThreeVector vv= vx.orthogonal(); // Not normed orthogonal vector (!)
1073 vy = vv.unit(); // First ort orthogonal to the direction
1074 vz = vx.cross(vy); // Second ort orthoganal to the direction
1075 }
1076 if(maxCost> 1.) maxCost= 1.;
1077 if(minCost<-1.) minCost=-1.;
1078 if(maxCost<-1.) maxCost=-1.;
1079 if(minCost> 1.) minCost= 1.;
1080 if(minCost> maxCost) minCost=maxCost;
1081 if(std::fabs(iM-fM-sM)<.00000001)
1082 {
1083 G4double fR=fM/iM;
1084 G4double sR=sM/iM;
1085 f4Mom=fR*theMomentum;
1086 s4Mom=sR*theMomentum;
1087 return true;
1088 }
1089 else if (iM+.001<fM+sM || iM==0.)
1090 {//@@ Later on make a quark content check for the decay
1091 G4cerr<<"***G4QH::RelDecIn2: fM="<<fM<<"+sM="<<sM<<">iM="<<iM<<",d="<<iM-fM-sM<<G4endl;
1092 return false;
1093 }
1094 G4double d2 = iM2-fM2-sM2;
1095 G4double p2 = (d2*d2/4.-fM2*sM2)/iM2; // Decay momentum(^2) in CMS of Quasmon
1096 if(p2<0.)
1097 {
1098 p2=0.;
1099 }
1100 G4double p = std::sqrt(p2);
1101 G4double ct = maxCost;
1102 if(maxCost>minCost)
1103 {
1104 G4double dcost=maxCost-minCost;
1105 ct = minCost+dcost*G4UniformRand();
1106 }
1107 G4double phi= twopi*G4UniformRand(); // @@ Change 360.*deg to M_TWOPI (?)
1108 G4double pss=0.;
1109 if(std::fabs(ct)<1.) pss = p * std::sqrt(1.-ct*ct);
1110 else
1111 {
1112 if(ct>1.) ct=1.;
1113 if(ct<-1.) ct=-1.;
1114 }
1115 G4ThreeVector pVect=(pss*std::sin(phi))*vz+(pss*std::cos(phi))*vy+p*ct*vx;
1116
1117 f4Mom.setVect(pVect);
1118 f4Mom.setE(std::sqrt(fM2+p2));
1119 s4Mom.setVect((-1)*pVect);
1120 s4Mom.setE(std::sqrt(sM2+p2));
1121
1122 if(f4Mom.e()+.001<f4Mom.rho())G4cerr<<"*G4QH::RDIn2:*Boost* f4M="<<f4Mom<<",e-p="
1123 <<f4Mom.e()-f4Mom.rho()<<G4endl;
1124 f4Mom.boost(ltb); // Lor.Trans. of 1st hadron back to LS
1125 if(s4Mom.e()+.001<s4Mom.rho())G4cerr<<"*G4QH::RDIn2:*Boost* s4M="<<s4Mom<<",e-p="
1126 <<s4Mom.e()-s4Mom.rho()<<G4endl;
1127 s4Mom.boost(ltb); // Lor.Trans. of 2nd hadron back to LS
1128 return true;
1129} // End of "RelDecayIn2"
static const G4double d2
static const G4double dE
static constexpr double twopi
Definition: G4SIunits.hh:56
Hep3Vector unit() const
Hep3Vector orthogonal() const
double mag2() const
Hep3Vector cross(const Hep3Vector &) const
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
Hep3Vector vect() const
void setVect(const Hep3Vector &)

References CLHEP::HepLorentzVector::boost(), CLHEP::HepLorentzVector::boostVector(), CLHEP::Hep3Vector::cross(), d2, dE, CLHEP::HepLorentzVector::e(), G4cerr, G4endl, G4UniformRand, CLHEP::HepLorentzVector::m2(), CLHEP::Hep3Vector::mag2(), CLHEP::Hep3Vector::orthogonal(), CLHEP::HepLorentzVector::rho(), CLHEP::HepLorentzVector::setE(), CLHEP::HepLorentzVector::setVect(), twopi, CLHEP::Hep3Vector::unit(), and CLHEP::HepLorentzVector::vect().

Referenced by ChExer(), and Scatter().

◆ Scatter()

std::pair< G4LorentzVector, G4LorentzVector > G4QuasiElRatios::Scatter ( G4int  NPDG,
G4LorentzVector  N4M,
G4int  pPDG,
G4LorentzVector  p4M 
)

Definition at line 788 of file G4QuasiElRatios.cc.

790{
791 static const G4double mNeut= G4Neutron::Neutron()->GetPDGMass();
792 static const G4double mProt= G4Proton::Proton()->GetPDGMass();
793 static const G4double mDeut= G4Deuteron::Deuteron()->GetPDGMass();
794 static const G4double mTrit= G4Triton::Triton()->GetPDGMass();
795 static const G4double mHel3= G4He3::He3()->GetPDGMass();
796 static const G4double mAlph= G4Alpha::Alpha()->GetPDGMass();
797
798 G4LorentzVector pr4M=p4M/megaelectronvolt; // Convert 4-momenta in MeV (keep p4M)
799 N4M/=megaelectronvolt;
800 G4LorentzVector tot4M=N4M+p4M;
801 G4double mT=mNeut;
802 G4int Z=0;
803 G4int N=1;
804 if(NPDG==2212||NPDG==90001000)
805 {
806 mT=mProt;
807 Z=1;
808 N=0;
809 }
810 else if(NPDG==90001001)
811 {
812 mT=mDeut;
813 Z=1;
814 N=1;
815 }
816 else if(NPDG==90002001)
817 {
818 mT=mHel3;
819 Z=2;
820 N=1;
821 }
822 else if(NPDG==90001002)
823 {
824 mT=mTrit;
825 Z=1;
826 N=2;
827 }
828 else if(NPDG==90002002)
829 {
830 mT=mAlph;
831 Z=2;
832 N=2;
833 }
834 else if(NPDG!=2112&&NPDG!=90000001)
835 {
836 G4cout<<"Error:G4QuasiElRatios::Scatter:NPDG="<<NPDG<<" is not 2212 or 2112"<<G4endl;
837 G4Exception("G4QuasiElRatios::Scatter:","21",FatalException,"QEcomplain");
838 //return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M);// Use this if not exception
839 }
840 G4double mT2=mT*mT;
841 G4double mP2=pr4M.m2();
842 G4double E=(tot4M.m2()-mT2-mP2)/(mT+mT);
843 G4double E2=E*E;
844 if(E<0. || E2<mP2)
845 {
846 return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
847 }
848 G4double P=std::sqrt(E2-mP2); // Momentum in pseudo laboratory system
849 // @@ Temporary NN t-dependence for all hadrons
850 //if(pPDG>3400 || pPDG<-3400) G4cout<<"-Warning-G4QE::Scatter: pPDG="<<pPDG<<G4endl;
851 G4int PDG=2212; // *TMP* instead of pPDG
852 if(pPDG==2112||pPDG==-211||pPDG==-321) PDG=2112; // *TMP* instead of pPDG
853 if(!Z && N==1) // Change for Quasi-Elastic on neutron
854 {
855 Z=1;
856 N=0;
857 if (PDG==2212) PDG=2112;
858 else if(PDG==2112) PDG=2212;
859 }
860 G4double xSec=0.; // Prototype of Recalculated Cross Section *TMP*
861 if(PDG==2212) xSec=PCSmanager->GetChipsCrossSection(P, Z, N, PDG); // P CrossSect *TMP*
862 else xSec=NCSmanager->GetChipsCrossSection(P, Z, N, PDG); // N CrossSect *TMP*
863 // @@ check a possibility to separate p, n, or alpha (!)
864 if(xSec <= 0.) // The cross-section iz 0 -> Do Nothing
865 {
866 return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); //Do Nothing Action
867 }
868 G4double mint=0.; // Prototype of functional rand -t (MeV^2) *TMP*
869 if(PDG==2212) mint=PCSmanager->GetExchangeT(Z,N,PDG);// P functional rand -t(MeV^2) *TMP*
870 else mint=NCSmanager->GetExchangeT(Z,N,PDG);// N functional rand -t(MeV^2) *TMP*
871 G4double maxt=0.; // Prototype of max possible -t
872 if(PDG==2212) maxt=PCSmanager->GetHMaxT(); // max possible -t
873 else maxt=NCSmanager->GetHMaxT(); // max possible -t
874 G4double cost=1.-(mint+mint)/maxt; // cos(theta) in CMS
875 if(cost>1. || cost<-1. || !(cost>-1. || cost<=1.))
876 {
877 if (cost>1.) cost=1.;
878 else if(cost<-1.) cost=-1.;
879 else
880 {
881 G4double tm=0.;
882 if(PDG==2212) tm=PCSmanager->GetHMaxT();
883 else tm=NCSmanager->GetHMaxT();
884 G4cerr<<"G4QuasiFreeRatio::Scat:*NAN* cost="<<cost<<",-t="<<mint<<",tm="<<tm<<G4endl;
885 return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
886 }
887 }
888 G4LorentzVector reco4M=G4LorentzVector(0.,0.,0.,mT); // 4mom of the recoil nucleon
889 G4LorentzVector dir4M=tot4M-G4LorentzVector(0.,0.,0.,(tot4M.e()-mT)*.01);
890 if(!RelDecayIn2(tot4M, pr4M, reco4M, dir4M, cost, cost))
891 {
892 G4cerr<<"G4QFR::Scat:t="<<tot4M<<tot4M.m()<<",mT="<<mT<<",mP="<<std::sqrt(mP2)<<G4endl;
893 //G4Exception("G4QFR::Scat:","009",FatalException,"Decay of ElasticComp");
894 return std::make_pair(G4LorentzVector(0.,0.,0.,0.),p4M); // Do Nothing Action
895 }
896 return std::make_pair(reco4M*megaelectronvolt,pr4M*megaelectronvolt); // Result
897} // End of Scatter
static G4Alpha * Alpha()
Definition: G4Alpha.cc:88
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:93
static G4He3 * He3()
Definition: G4He3.cc:93
static G4Triton * Triton()
Definition: G4Triton.cc:93

References G4Alpha::Alpha(), G4Deuteron::Deuteron(), CLHEP::HepLorentzVector::e(), FatalException, G4cerr, G4cout, G4endl, G4Exception(), G4ChipsNeutronElasticXS::GetChipsCrossSection(), G4ChipsProtonElasticXS::GetChipsCrossSection(), G4ChipsNeutronElasticXS::GetExchangeT(), G4ChipsProtonElasticXS::GetExchangeT(), G4ChipsNeutronElasticXS::GetHMaxT(), G4ChipsProtonElasticXS::GetHMaxT(), G4ParticleDefinition::GetPDGMass(), G4He3::He3(), CLHEP::HepLorentzVector::m(), CLHEP::HepLorentzVector::m2(), megaelectronvolt, anonymous_namespace{G4ChipsNeutronElasticXS.cc}::mNeut, anonymous_namespace{G4ChipsNeutronElasticXS.cc}::mProt, NCSmanager, G4Neutron::Neutron(), P, PCSmanager, G4Proton::Proton(), RelDecayIn2(), G4InuclParticleNames::tm, G4Triton::Triton(), and Z.

Referenced by G4QuasiElasticChannel::Scatter().

Field Documentation

◆ lastARatio

G4int G4QuasiElRatios::lastARatio
private

Definition at line 113 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastFtot

G4bool G4QuasiElRatios::lastFtot
private

Definition at line 123 of file G4QuasiElRatios.hh.

Referenced by FetchElTot(), and G4QuasiElRatios().

◆ lastHRatio

G4double G4QuasiElRatios::lastHRatio
private

Definition at line 114 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastHtot

G4int G4QuasiElRatios::lastHtot
private

Definition at line 122 of file G4QuasiElRatios.hh.

Referenced by FetchElTot(), and G4QuasiElRatios().

◆ lastItot

G4int G4QuasiElRatios::lastItot
private

Definition at line 128 of file G4QuasiElRatios.hh.

Referenced by FetchElTot(), and G4QuasiElRatios().

◆ lastKRatio

G4int G4QuasiElRatios::lastKRatio
private

Definition at line 117 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastKtot

G4int G4QuasiElRatios::lastKtot
private

Definition at line 130 of file G4QuasiElRatios.hh.

Referenced by FetchElTot(), and G4QuasiElRatios().

◆ lastLRatio

G4double* G4QuasiElRatios::lastLRatio
private

Definition at line 119 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastMRatio

G4double G4QuasiElRatios::lastMRatio
private

Definition at line 116 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastMtot

G4double G4QuasiElRatios::lastMtot
private

Definition at line 129 of file G4QuasiElRatios.hh.

Referenced by FetchElTot(), and G4QuasiElRatios().

◆ lastNRatio

G4int G4QuasiElRatios::lastNRatio
private

Definition at line 115 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastPtot

G4double G4QuasiElRatios::lastPtot
private

Definition at line 121 of file G4QuasiElRatios.hh.

Referenced by FetchElTot(), and G4QuasiElRatios().

◆ lastRRatio

G4double G4QuasiElRatios::lastRRatio
private

Definition at line 106 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastRtot

std::pair<G4double,G4double> G4QuasiElRatios::lastRtot
private

Definition at line 124 of file G4QuasiElRatios.hh.

Referenced by FetchElTot().

◆ lastSRatio

G4double G4QuasiElRatios::lastSRatio
private

Definition at line 105 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastTRatio

G4double* G4QuasiElRatios::lastTRatio
private

Definition at line 118 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), and GetQF2IN_Ratio().

◆ lastXtot

std::pair<G4double,G4double>* G4QuasiElRatios::lastXtot
private

Definition at line 131 of file G4QuasiElRatios.hh.

Referenced by FetchElTot(), and G4QuasiElRatios().

◆ NCSmanager

G4ChipsNeutronElasticXS* G4QuasiElRatios::NCSmanager
private

Definition at line 92 of file G4QuasiElRatios.hh.

Referenced by ChExer(), G4QuasiElRatios(), and Scatter().

◆ PCSmanager

G4ChipsProtonElasticXS* G4QuasiElRatios::PCSmanager
private

Definition at line 91 of file G4QuasiElRatios.hh.

Referenced by ChExer(), G4QuasiElRatios(), and Scatter().

◆ vARatio

std::vector<G4int> G4QuasiElRatios::vARatio
private

Definition at line 107 of file G4QuasiElRatios.hh.

Referenced by GetQF2IN_Ratio().

◆ vHRatio

std::vector<G4double> G4QuasiElRatios::vHRatio
private

Definition at line 108 of file G4QuasiElRatios.hh.

Referenced by GetQF2IN_Ratio().

◆ vItot

std::vector<G4int> G4QuasiElRatios::vItot
private

Definition at line 125 of file G4QuasiElRatios.hh.

Referenced by FetchElTot().

◆ vKRatio

std::vector<G4int> G4QuasiElRatios::vKRatio
private

Definition at line 111 of file G4QuasiElRatios.hh.

Referenced by GetQF2IN_Ratio().

◆ vKtot

std::vector<G4int> G4QuasiElRatios::vKtot
private

Definition at line 127 of file G4QuasiElRatios.hh.

Referenced by FetchElTot().

◆ vL

std::vector<G4double*>* G4QuasiElRatios::vL
private

Definition at line 102 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), GetQF2IN_Ratio(), and ~G4QuasiElRatios().

◆ vMRatio

std::vector<G4double> G4QuasiElRatios::vMRatio
private

Definition at line 110 of file G4QuasiElRatios.hh.

Referenced by GetQF2IN_Ratio().

◆ vMtot

std::vector<G4double> G4QuasiElRatios::vMtot
private

Definition at line 126 of file G4QuasiElRatios.hh.

Referenced by FetchElTot().

◆ vNRatio

std::vector<G4int> G4QuasiElRatios::vNRatio
private

Definition at line 109 of file G4QuasiElRatios.hh.

Referenced by GetQF2IN_Ratio().

◆ vT

std::vector<G4double*>* G4QuasiElRatios::vT
private

Definition at line 101 of file G4QuasiElRatios.hh.

Referenced by G4QuasiElRatios(), GetQF2IN_Ratio(), and ~G4QuasiElRatios().

◆ vX

std::vector<std::pair<G4double,G4double>*>* G4QuasiElRatios::vX
private

Definition at line 103 of file G4QuasiElRatios.hh.

Referenced by FetchElTot(), G4QuasiElRatios(), and ~G4QuasiElRatios().


The documentation for this class was generated from the following files: