Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // The lust update: M.V. Kossov, CERN/ITEP(Mos 28 // 29 // ******************************************* 30 // Short description: Cross-sections extracted 31 // Hyperon-nuclear interactions. Original aut 32 // ------------------------------------------- 33 // 34 35 #include "G4ChipsHyperonInelasticXS.hh" 36 #include "G4SystemOfUnits.hh" 37 #include "G4DynamicParticle.hh" 38 #include "G4ParticleDefinition.hh" 39 #include "G4Lambda.hh" 40 #include "G4SigmaPlus.hh" 41 #include "G4SigmaMinus.hh" 42 #include "G4SigmaZero.hh" 43 #include "G4XiMinus.hh" 44 #include "G4XiZero.hh" 45 #include "G4OmegaMinus.hh" 46 #include "G4Log.hh" 47 #include "G4Exp.hh" 48 49 // factory 50 #include "G4CrossSectionFactory.hh" 51 // 52 G4_DECLARE_XS_FACTORY(G4ChipsHyperonInelasticX 53 54 G4ChipsHyperonInelasticXS::G4ChipsHyperonInela 55 { 56 // Initialization of the 57 lastLEN=0; // Pointer to the lastArray of Lo 58 lastHEN=0; // Pointer to the lastArray of Hi 59 lastN=0; // The last N of calculated nucle 60 lastZ=0; // The last Z of calculated nucle 61 lastP=0.; // Last used in cross section Mom 62 lastTH=0.; // Last threshold momentum 63 lastCS=0.; // Last value of the Cross Sectio 64 lastI=0; // The last position in the DAMDB 65 LEN = new std::vector<G4double*>; 66 HEN = new std::vector<G4double*>; 67 } 68 69 G4ChipsHyperonInelasticXS::~G4ChipsHyperonInel 70 { 71 std::size_t lens=LEN->size(); 72 for(std::size_t i=0; i<lens; ++i) delete[] 73 delete LEN; 74 75 std::size_t hens=HEN->size(); 76 for(std::size_t i=0; i<hens; ++i) delete[] 77 delete HEN; 78 } 79 80 void G4ChipsHyperonInelasticXS::CrossSectionDe 81 { 82 outFile << "G4ChipsHyperonInelasticXS provid 83 << "section for hyperon nucleus scat 84 << "momentum. The cross section is c 85 << "CHIPS parameterization of cross 86 } 87 88 G4bool G4ChipsHyperonInelasticXS::IsIsoApplica 89 const G4Element*, 90 const G4Material*) 91 { 92 return true; 93 } 94 95 // The main member function giving the collisi 96 // Make pMom in independent units ! (Now it is 97 G4double G4ChipsHyperonInelasticXS::GetIsoCros 98 const G4Isotope*, 99 const G4Element*, 100 const G4Material*) 101 { 102 G4double pMom=Pt->GetTotalMomentum(); 103 G4int tgN = A - tgZ; 104 G4int pdg = Pt->GetDefinition()->GetPDGEncod 105 106 return GetChipsCrossSection(pMom, tgZ, tgN, 107 } 108 109 G4double G4ChipsHyperonInelasticXS::GetChipsCr 110 { 111 112 G4bool in=false; // By d 113 if(tgN!=lastN || tgZ!=lastZ) // The 114 { 115 in = false; // By d 116 lastP = 0.; // New 117 lastN = tgN; // The 118 lastZ = tgZ; // The 119 lastI = (G4int)colN.size(); // Size 120 j = 0; // A#0f 121 122 if(lastI) for(G4int i=0; i<lastI; ++i) // 123 { 124 if(colN[i]==tgN && colZ[i]==tgZ) // Try 125 { 126 lastI=i; // Reme 127 lastTH =colTH[i]; // The 128 129 if(pMom<=lastTH) 130 { 131 return 0.; // Ener 132 } 133 lastP =colP [i]; // Last 134 lastCS =colCS[i]; // Last 135 in = true; // This 136 // Momentum pMom is in IU ! @@ Units 137 lastCS=CalculateCrossSection(-1,j,PDG, 138 139 if(lastCS<=0. && pMom>lastTH) // Corr 140 { 141 lastCS=0.; 142 lastTH=pMom; 143 } 144 break; // Go o 145 } 146 j++; // Incr 147 } 148 if(!in) // This 149 { 150 //!!The slave functions must provide cro 151 lastCS=CalculateCrossSection(0,j,PDG,las 152 153 lastTH = 0; //ThresholdEnergy(tgZ, tgN); 154 colN.push_back(tgN); 155 colZ.push_back(tgZ); 156 colP.push_back(pMom); 157 colTH.push_back(lastTH); 158 colCS.push_back(lastCS); 159 //} // M.K. Presence of H1 with high thresho 160 return lastCS*millibarn; 161 } // End of creation of the new set of par 162 else 163 { 164 colP[lastI]=pMom; 165 colCS[lastI]=lastCS; 166 } 167 } // End of parameters udate 168 else if(pMom<=lastTH) 169 { 170 return 0.; // Mome 171 } 172 else // It i 173 { 174 lastCS=CalculateCrossSection(1,j,PDG,lastZ 175 lastP=pMom; 176 } 177 return lastCS*millibarn; 178 } 179 180 // The main member function giving the gamma-A 181 G4double G4ChipsHyperonInelasticXS::CalculateC 182 G4int, G4int targZ, G4int targ 183 { 184 static const G4double THmin=27.; // defa 185 static const G4double THmiG=THmin*.001; // m 186 static const G4double dP=10.; // step 187 static const G4double dPG=dP*.001; // step 188 static const G4int nL=105; // A#of 189 static const G4double Pmin=THmin+(nL-1)*dP; 190 static const G4double Pmax=227000.; // maxP 191 static const G4int nH=224; // A#of 192 static const G4double milP=G4Log(Pmin);// Lo 193 static const G4double malP=G4Log(Pmax);// Hi 194 static const G4double dlP=(malP-milP)/(nH-1) 195 static const G4double milPG=G4Log(.001*Pmin) 196 197 if(F<=0) // This 198 { 199 if(F<0) // This 200 { 201 G4int sync=(G4int)LEN->size(); 202 if(sync<=I) G4cerr<<"*!*G4QPiMinusNuclCS 203 lastLEN=(*LEN)[I]; // Poin 204 lastHEN=(*HEN)[I]; // Poin 205 } 206 else // This 207 { 208 lastLEN = new G4double[nL]; // Allo 209 lastHEN = new G4double[nH]; // Allo 210 // --- Instead of making a separate func 211 G4double P=THmiG; // Tabl 212 for(G4int k=0; k<nL; k++) 213 { 214 lastLEN[k] = CrossSectionLin(targZ, ta 215 P+=dPG; 216 } 217 G4double lP=milPG; 218 for(G4int n=0; n<nH; n++) 219 { 220 lastHEN[n] = CrossSectionLog(targZ, ta 221 lP+=dlP; 222 } 223 // --- End of possible separate function 224 // *** The synchronization check *** 225 G4int sync=(G4int)LEN->size(); 226 if(sync!=I) 227 { 228 G4cerr<<"***G4QHyperNuclCS::CalcCrossS 229 <<", N="<<targN<<", F="<<F<<G4en 230 //G4Exception("G4PiMinusNuclearCS::Cal 231 } 232 LEN->push_back(lastLEN); // reme 233 HEN->push_back(lastHEN); // reme 234 } // End of creation of the new set of par 235 } // End of parameters udate 236 // =--------------------------= NOW the Magi 237 G4double sigma; 238 if (Momentum<lastTH) return 0.; // It m 239 else if (Momentum<Pmin) // High 240 { 241 sigma=EquLinearFit(Momentum,nL,THmin,dP,la 242 } 243 else if (Momentum<Pmax) // High 244 { 245 G4double lP=G4Log(Momentum); 246 sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN) 247 } 248 else // UHE 249 { 250 G4double P=0.001*Momentum; // Appr 251 sigma=CrossSectionFormula(targZ, targN, P, 252 } 253 if (sigma<0.) return 0.; 254 return sigma; 255 } 256 257 // Calculation formula for piMinus-nuclear ine 258 G4double G4ChipsHyperonInelasticXS::CrossSecti 259 { 260 G4double lP=G4Log(P); 261 return CrossSectionFormula(tZ, tN, P, lP); 262 } 263 264 // Calculation formula for piMinus-nuclear ine 265 G4double G4ChipsHyperonInelasticXS::CrossSecti 266 { 267 G4double P=G4Exp(lP); 268 return CrossSectionFormula(tZ, tN, P, lP); 269 } 270 // Calculation formula for piMinus-nuclear ine 271 G4double G4ChipsHyperonInelasticXS::CrossSecti 272 273 { 274 G4double sigma=0.; 275 276 //AR-24Apr2018 Switch to allow transuranic e 277 const G4bool isHeavyElementAllowed = true; 278 279 if(tZ==1 && !tN) // H 280 { 281 G4double ld=lP-3.5; 282 G4double ld2=ld*ld; 283 G4double p2=P*P; 284 G4double p4=p2*p2; 285 G4double sp=std::sqrt(P); 286 G4double El=(.0557*ld2+6.72+99./p2)/(1.+2. 287 G4double To=(.3*ld2+38.2+900./sp)/(1.+27./ 288 sigma=To-El; 289 } 290 else if((tZ<97 && tN<152) || isHeavyElementA 291 { 292 G4double d=lP-4.2; 293 G4double p2=P*P; 294 G4double p4=p2*p2; 295 G4double sp=std::sqrt(P); 296 G4double ssp=std::sqrt(sp); 297 G4double a=tN+tZ; // 298 G4double al=G4Log(a); 299 G4double sa=std::sqrt(a); 300 G4double a2=a*a; 301 G4double a2s=a2*sa; 302 G4double a4=a2*a2; 303 G4double a8=a4*a4; 304 G4double c=(170.+3600./a2s)/(1.+65./a2s); 305 G4double gg=42.*(G4Exp(al*0.8)+4.E-8*a4)/( 306 G4double e=390.; // 307 G4double r=0.27; 308 G4double h=2.E-7; 309 G4double t=0.3; 310 if(tZ>1 || tN>1) 311 { 312 e=380.+18.*a2/(1.+a2/60.)/(1.+2.E-19*a8) 313 r=0.15; 314 h=1.E-8*a2/(1.+a2/17.)/(1.+3.E-20*a8); 315 t=(.2+.00056*a2)/(1.+a2*.0006); 316 } 317 sigma=(c+d*d)/(1.+t/ssp+r/p4)+(gg+e*G4Exp( 318 #ifdef pdebug 319 G4cout<<"G4QHyperonNucCS::CSForm: A="<<a<< 320 <<",d="<<d<<",r="<<r<<",e="<<e<<",h= 321 #endif 322 } 323 else 324 { 325 G4cerr<<"-Warning-G4QHyperonNuclearCroSect 326 sigma=0.; 327 } 328 if(sigma<0.) return 0.; 329 return sigma; 330 } 331 332 G4double G4ChipsHyperonInelasticXS::EquLinearF 333 { 334 if(DX<=0. || N<2) 335 { 336 G4cerr<<"***G4ChipsHyperonInelasticXS::E 337 return Y[0]; 338 } 339 340 G4int N2=N-2; 341 G4double d=(X-X0)/DX; 342 G4int jj=static_cast<int>(d); 343 if (jj<0) jj=0; 344 else if(jj>N2) jj=N2; 345 d-=jj; // excess 346 G4double yi=Y[jj]; 347 G4double sigma=yi+(Y[jj+1]-yi)*d; 348 349 return sigma; 350 } 351