#include <G4ChipsHyperonElasticXS.hh>
Inheritance diagram for G4ChipsHyperonElasticXS:
Public Member Functions | |
G4ChipsHyperonElasticXS () | |
~G4ChipsHyperonElasticXS () | |
virtual G4bool | IsIsoApplicable (const G4DynamicParticle *Pt, G4int Z, G4int A, const G4Element *elm, const G4Material *mat) |
virtual G4double | GetIsoCrossSection (const G4DynamicParticle *, G4int tgZ, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0) |
virtual G4double | GetChipsCrossSection (G4double momentum, G4int Z, G4int N, G4int pdg) |
G4double | GetExchangeT (G4int tZ, G4int tN, G4int pPDG) |
Static Public Member Functions | |
static const char * | Default_Name () |
Definition at line 47 of file G4ChipsHyperonElasticXS.hh.
G4ChipsHyperonElasticXS::G4ChipsHyperonElasticXS | ( | ) |
Definition at line 60 of file G4ChipsHyperonElasticXS.cc.
00060 :G4VCrossSectionDataSet(Default_Name()), nPoints(128), nLast(nPoints-1) 00061 { 00062 lPMin=-8.; //Min tabulatedLogarithmMomentum(D) 00063 lPMax= 8.; //Max tabulatedLogarithmMomentum(D) 00064 dlnP=(lPMax-lPMin)/nLast;// LogStep inTable (D) 00065 onlyCS=true;//Flag toCalculOnlyCS(not Si/Bi)(L) 00066 lastSIG=0.; //Last calculated cross section (L) 00067 lastLP=-10.;//LastLog(mom_of IncidentHadron)(L) 00068 lastTM=0.; //Last t_maximum (L) 00069 theSS=0.; //TheLastSqSlope of 1st difr.Max(L) 00070 theS1=0.; //TheLastMantissa of 1st difrMax(L) 00071 theB1=0.; //TheLastSlope of 1st difructMax(L) 00072 theS2=0.; //TheLastMantissa of 2nd difrMax(L) 00073 theB2=0.; //TheLastSlope of 2nd difructMax(L) 00074 theS3=0.; //TheLastMantissa of 3d difr.Max(L) 00075 theB3=0.; //TheLastSlope of 3d difruct.Max(L) 00076 theS4=0.; //TheLastMantissa of 4th difrMax(L) 00077 theB4=0.; //TheLastSlope of 4th difructMax(L) 00078 lastTZ=0; // Last atomic number of the target 00079 lastTN=0; // Last # of neutrons in the target 00080 lastPIN=0.; // Last initialized max momentum 00081 lastCST=0; // Elastic cross-section table 00082 lastPAR=0; // ParametersForFunctionCalculation 00083 lastSST=0; // E-dep ofSqardSlope of 1st difMax 00084 lastS1T=0; // E-dep of mantissa of 1st dif.Max 00085 lastB1T=0; // E-dep of the slope of 1st difMax 00086 lastS2T=0; // E-dep of mantissa of 2nd difrMax 00087 lastB2T=0; // E-dep of the slope of 2nd difMax 00088 lastS3T=0; // E-dep of mantissa of 3d difr.Max 00089 lastB3T=0; // E-dep of the slope of 3d difrMax 00090 lastS4T=0; // E-dep of mantissa of 4th difrMax 00091 lastB4T=0; // E-dep of the slope of 4th difMax 00092 lastN=0; // The last N of calculated nucleus 00093 lastZ=0; // The last Z of calculated nucleus 00094 lastP=0.; // LastUsed inCrossSection Momentum 00095 lastTH=0.; // Last threshold momentum 00096 lastCS=0.; // Last value of the Cross Section 00097 lastI=0; // The last position in the DAMDB 00098 }
G4ChipsHyperonElasticXS::~G4ChipsHyperonElasticXS | ( | ) |
Definition at line 100 of file G4ChipsHyperonElasticXS.cc.
00101 { 00102 std::vector<G4double*>::iterator pos; 00103 for (pos=CST.begin(); pos<CST.end(); pos++) 00104 { delete [] *pos; } 00105 CST.clear(); 00106 for (pos=PAR.begin(); pos<PAR.end(); pos++) 00107 { delete [] *pos; } 00108 PAR.clear(); 00109 for (pos=SST.begin(); pos<SST.end(); pos++) 00110 { delete [] *pos; } 00111 SST.clear(); 00112 for (pos=S1T.begin(); pos<S1T.end(); pos++) 00113 { delete [] *pos; } 00114 S1T.clear(); 00115 for (pos=B1T.begin(); pos<B1T.end(); pos++) 00116 { delete [] *pos; } 00117 B1T.clear(); 00118 for (pos=S2T.begin(); pos<S2T.end(); pos++) 00119 { delete [] *pos; } 00120 S2T.clear(); 00121 for (pos=B2T.begin(); pos<B2T.end(); pos++) 00122 { delete [] *pos; } 00123 B2T.clear(); 00124 for (pos=S3T.begin(); pos<S3T.end(); pos++) 00125 { delete [] *pos; } 00126 S3T.clear(); 00127 for (pos=B3T.begin(); pos<B3T.end(); pos++) 00128 { delete [] *pos; } 00129 B3T.clear(); 00130 for (pos=S4T.begin(); pos<S4T.end(); pos++) 00131 { delete [] *pos; } 00132 S4T.clear(); 00133 for (pos=B4T.begin(); pos<B4T.end(); pos++) 00134 { delete [] *pos; } 00135 B4T.clear(); 00136 }
static const char* G4ChipsHyperonElasticXS::Default_Name | ( | ) | [inline, static] |
Definition at line 55 of file G4ChipsHyperonElasticXS.hh.
Referenced by G4ChipsComponentXS::G4ChipsComponentXS().
G4double G4ChipsHyperonElasticXS::GetChipsCrossSection | ( | G4double | momentum, | |
G4int | Z, | |||
G4int | N, | |||
G4int | pdg | |||
) | [virtual] |
Definition at line 188 of file G4ChipsHyperonElasticXS.cc.
Referenced by GetIsoCrossSection().
00189 { 00190 static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops) 00191 static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops) 00192 static std::vector <G4double> colP; // Vector of last momenta for the reaction 00193 static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction 00194 static std::vector <G4double> colCS; // Vector of last cross sections for the reaction 00195 // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---*** 00196 00197 G4bool fCS = false; 00198 G4double pEn=pMom; 00199 00200 onlyCS=fCS; 00201 00202 G4bool in=false; // By default the isotope must be found in the AMDB 00203 lastP = 0.; // New momentum history (nothing to compare with) 00204 lastN = tgN; // The last N of the calculated nucleus 00205 lastZ = tgZ; // The last Z of the calculated nucleus 00206 lastI = colN.size(); // Size of the Associative Memory DB in the heap 00207 if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB 00208 { // The nucleus with projPDG is found in AMDB 00209 if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB 00210 { 00211 lastI=i; 00212 lastTH =colTH[i]; // Last THreshold (A-dependent) 00213 if(pEn<=lastTH) 00214 { 00215 return 0.; // Energy is below the Threshold value 00216 } 00217 lastP =colP [i]; // Last Momentum (A-dependent) 00218 lastCS =colCS[i]; // Last CrossSect (A-dependent) 00219 // if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance) 00220 if(lastP == pMom) // Do not recalculate 00221 { 00222 CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only 00223 return lastCS*millibarn; // Use theLastCS 00224 } 00225 in = true; // This is the case when the isotop is found in DB 00226 // Momentum pMom is in IU ! @@ Units 00227 lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update 00228 if(lastCS<=0. && pEn>lastTH) // Correct the threshold 00229 { 00230 lastTH=pEn; 00231 } 00232 break; // Go out of the LOOP with found lastI 00233 } 00234 } // End of attampt to find the nucleus in DB 00235 if(!in) // This nucleus has not been calculated previously 00236 { 00238 lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create 00239 if(lastCS<=0.) 00240 { 00241 lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last 00242 if(pEn>lastTH) 00243 { 00244 lastTH=pEn; 00245 } 00246 } 00247 colN.push_back(tgN); 00248 colZ.push_back(tgZ); 00249 colP.push_back(pMom); 00250 colTH.push_back(lastTH); 00251 colCS.push_back(lastCS); 00252 return lastCS*millibarn; 00253 } // End of creation of the new set of parameters 00254 else 00255 { 00256 colP[lastI]=pMom; 00257 colCS[lastI]=lastCS; 00258 } 00259 return lastCS*millibarn; 00260 }
Definition at line 634 of file G4ChipsHyperonElasticXS.cc.
References G4cout, and G4UniformRand.
00635 { 00636 static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt; 00637 static const G4double third=1./3.; 00638 static const G4double fifth=1./5.; 00639 static const G4double sevth=1./7.; 00640 if(PDG==3222 || PDG<3000 || PDG>3334)G4cout<<"*Warning*G4QHyElCS::GET:PDG="<<PDG<<G4endl; 00641 if(onlyCS)G4cout<<"*Warning*G4ChipsHyperonElasticXS::GetExchanT: onlyCS=1"<<G4endl; 00642 if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV) 00643 G4double q2=0.; 00644 if(tgZ==1 && tgN==0) // ===> p+p=p+p 00645 { 00646 G4double E1=lastTM*theB1; 00647 G4double R1=(1.-std::exp(-E1)); 00648 G4double E2=lastTM*theB2; 00649 G4double R2=(1.-std::exp(-E2*E2*E2)); 00650 G4double E3=lastTM*theB3; 00651 G4double R3=(1.-std::exp(-E3)); 00652 G4double I1=R1*theS1/theB1; 00653 G4double I2=R2*theS2; 00654 G4double I3=R3*theS3; 00655 G4double I12=I1+I2; 00656 G4double rand=(I12+I3)*G4UniformRand(); 00657 if (rand<I1 ) 00658 { 00659 G4double ran=R1*G4UniformRand(); 00660 if(ran>1.) ran=1.; 00661 q2=-std::log(1.-ran)/theB1; 00662 } 00663 else if(rand<I12) 00664 { 00665 G4double ran=R2*G4UniformRand(); 00666 if(ran>1.) ran=1.; 00667 q2=-std::log(1.-ran); 00668 if(q2<0.) q2=0.; 00669 q2=std::pow(q2,third)/theB2; 00670 } 00671 else 00672 { 00673 G4double ran=R3*G4UniformRand(); 00674 if(ran>1.) ran=1.; 00675 q2=-std::log(1.-ran)/theB3; 00676 } 00677 } 00678 else 00679 { 00680 G4double a=tgZ+tgN; 00681 G4double E1=lastTM*(theB1+lastTM*theSS); 00682 G4double R1=(1.-std::exp(-E1)); 00683 G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check) 00684 G4double tm2=lastTM*lastTM; 00685 G4double E2=lastTM*tm2*theB2; // power 3 for lowA, 5 for HighA (1st) 00686 if(a>6.5)E2*=tm2; // for heavy nuclei 00687 G4double R2=(1.-std::exp(-E2)); 00688 G4double E3=lastTM*theB3; 00689 if(a>6.5)E3*=tm2*tm2*tm2; // power 1 for lowA, 7 (2nd) for HighA 00690 G4double R3=(1.-std::exp(-E3)); 00691 G4double E4=lastTM*theB4; 00692 G4double R4=(1.-std::exp(-E4)); 00693 G4double I1=R1*theS1; 00694 G4double I2=R2*theS2; 00695 G4double I3=R3*theS3; 00696 G4double I4=R4*theS4; 00697 G4double I12=I1+I2; 00698 G4double I13=I12+I3; 00699 G4double rand=(I13+I4)*G4UniformRand(); 00700 if(rand<I1) 00701 { 00702 G4double ran=R1*G4UniformRand(); 00703 if(ran>1.) ran=1.; 00704 q2=-std::log(1.-ran)/theB1; 00705 if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss; 00706 } 00707 else if(rand<I12) 00708 { 00709 G4double ran=R2*G4UniformRand(); 00710 if(ran>1.) ran=1.; 00711 q2=-std::log(1.-ran)/theB2; 00712 if(q2<0.) q2=0.; 00713 if(a<6.5) q2=std::pow(q2,third); 00714 else q2=std::pow(q2,fifth); 00715 } 00716 else if(rand<I13) 00717 { 00718 G4double ran=R3*G4UniformRand(); 00719 if(ran>1.) ran=1.; 00720 q2=-std::log(1.-ran)/theB3; 00721 if(q2<0.) q2=0.; 00722 if(a>6.5) q2=std::pow(q2,sevth); 00723 } 00724 else 00725 { 00726 G4double ran=R4*G4UniformRand(); 00727 if(ran>1.) ran=1.; 00728 q2=-std::log(1.-ran)/theB4; 00729 if(a<6.5) q2=lastTM-q2; // u reduced for lightA (starts from 0) 00730 } 00731 } 00732 if(q2<0.) q2=0.; 00733 if(!(q2>=-1.||q2<=1.))G4cout<<"*NAN*G4QHyElasticCrossSect::GetExchangeT:-t="<<q2<<G4endl; 00734 if(q2>lastTM) 00735 { 00736 q2=lastTM; 00737 } 00738 return q2*GeVSQ; 00739 }
G4double G4ChipsHyperonElasticXS::GetIsoCrossSection | ( | const G4DynamicParticle * | , | |
G4int | tgZ, | |||
G4int | A, | |||
const G4Isotope * | iso = 0 , |
|||
const G4Element * | elm = 0 , |
|||
const G4Material * | mat = 0 | |||
) | [virtual] |
Reimplemented from G4VCrossSectionDataSet.
Definition at line 176 of file G4ChipsHyperonElasticXS.cc.
References GetChipsCrossSection(), G4DynamicParticle::GetDefinition(), G4ParticleDefinition::GetPDGEncoding(), and G4DynamicParticle::GetTotalMomentum().
00180 { 00181 G4double pMom=Pt->GetTotalMomentum(); 00182 G4int tgN = A - tgZ; 00183 G4int pdg = Pt->GetDefinition()->GetPDGEncoding(); 00184 00185 return GetChipsCrossSection(pMom, tgZ, tgN, pdg); 00186 }
G4bool G4ChipsHyperonElasticXS::IsIsoApplicable | ( | const G4DynamicParticle * | Pt, | |
G4int | Z, | |||
G4int | A, | |||
const G4Element * | elm, | |||
const G4Material * | mat | |||
) | [virtual] |
Reimplemented from G4VCrossSectionDataSet.
Definition at line 138 of file G4ChipsHyperonElasticXS.cc.
References G4DynamicParticle::GetDefinition(), G4Lambda::Lambda(), G4OmegaMinus::OmegaMinus(), G4SigmaMinus::SigmaMinus(), G4SigmaPlus::SigmaPlus(), G4SigmaZero::SigmaZero(), G4XiMinus::XiMinus(), and G4XiZero::XiZero().
00141 { 00142 G4ParticleDefinition* particle = Pt->GetDefinition(); 00143 if (particle == G4Lambda::Lambda()) 00144 { 00145 return true; 00146 } 00147 else if(particle == G4SigmaPlus::SigmaPlus()) 00148 { 00149 return true; 00150 } 00151 else if(particle == G4SigmaMinus::SigmaMinus()) 00152 { 00153 return true; 00154 } 00155 else if(particle == G4SigmaZero::SigmaZero()) 00156 { 00157 return true; 00158 } 00159 else if(particle == G4XiMinus::XiMinus()) 00160 { 00161 return true; 00162 } 00163 else if(particle == G4XiZero::XiZero()) 00164 { 00165 return true; 00166 } 00167 else if(particle == G4OmegaMinus::OmegaMinus()) 00168 { 00169 return true; 00170 } 00171 return false; 00172 }