Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4QuasiElRatios Class Reference

#include <G4QuasiElRatios.hh>

Public Member Functions

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

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()

◆ ~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}

Member Function Documentation

◆ 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}
G4double G4Log(G4double x)
Definition G4Log.hh:227
double G4double
Definition G4Types.hh:83
const G4double A[17]
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
#define N
Definition crc32.c:57

◆ 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
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::HepLorentzVector G4LorentzVector
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:101
static G4Proton * Proton()
Definition G4Proton.cc:90
G4bool RelDecayIn2(G4LorentzVector &theMomentum, G4LorentzVector &f4Mom, G4LorentzVector &s4Mom, G4LorentzVector &dir, G4double maxCost=1., G4double minCost=-1.)

◆ 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=(G4int)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 {
668 lastKtot=nlp;
669 lastMtot=lpa-lpi;
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;
691 G4double lpM=lastMtot+lpi;
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 {
697 lastKtot=nlp;
698 lastMtot=lpa-lpi;
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
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition G4Exp.hh:180
bool G4bool
Definition G4Types.hh:86

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
std::pair< G4double, G4double > FetchElTot(G4double pGeV, G4int PDG, G4bool F)

◆ 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

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}

◆ 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}
std::pair< G4double, G4double > GetElTot(G4double pIU, G4int hPDG, G4int Z, G4int N)

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"
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 &)

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:83
static G4Deuteron * Deuteron()
Definition G4Deuteron.cc:90
static G4He3 * He3()
Definition G4He3.cc:90
static G4Triton * Triton()
Definition G4Triton.cc:90

Referenced by G4QuasiElasticChannel::Scatter().


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