Geant4 10.7.0
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=true)
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 1014 of file G4QuasiElRatios.cc.

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

◆ ChExer()

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

Definition at line 902 of file G4QuasiElRatios.cc.

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

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

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

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

Referenced by GetRatios().

◆ GetElTotXS()

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

Definition at line 572 of file G4QuasiElRatios.cc.

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

◆ 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 1037 of file G4QuasiElRatios.cc.

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

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

Referenced by G4QuasiElasticChannel::Scatter().


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