65 const G4double dlP=(malP-milP)/(nH-1);
66 const G4double milPG=std::log(.001*Pmin);
92 LEN =
new std::vector<G4double*>;
93 HEN =
new std::vector<G4double*>;
98 G4int lens=LEN->size();
99 for(
G4int i=0; i<lens; ++i)
delete[] (*LEN)[i];
102 G4int hens=HEN->size();
103 for(
G4int i=0; i<hens; ++i)
delete[] (*HEN)[i];
134 static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ;
if (!colN_G4MT_TLS_) colN_G4MT_TLS_ =
new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_;
135 static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ;
if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ =
new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_;
136 static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ;
if (!colP_G4MT_TLS_) colP_G4MT_TLS_ =
new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_;
137 static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ;
if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ =
new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_;
138 static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ;
if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ =
new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_;
142 if(tgN!=lastN || tgZ!=lastZ)
151 if(lastI)
for(
G4int i=0; i<lastI; i++)
153 if(colN[i]==tgN && colZ[i]==tgZ)
166 lastCS=CalculateCrossSection(-1,j,321,lastZ,lastN,pMom);
168 if(lastCS<=0. && pMom>lastTH)
180 lastCS=CalculateCrossSection(0,j,321,lastZ,lastN,pMom);
188 colP.push_back(pMom);
189 colTH.push_back(lastTH);
190 colCS.push_back(lastCS);
200 else if(pMom<=lastTH)
206 lastCS=CalculateCrossSection(1,j,321,lastZ,lastN,pMom);
224 G4int sync=LEN->size();
225 if(sync<=I)
G4cerr<<
"*!*G4ChipsKPlusNuclCS::CalcCrosSect:Sync="<<sync<<
"<="<<I<<
G4endl;
235 for(
G4int k=0; k<nL; k++)
237 lastLEN[k] = CrossSectionLin(targZ, targN, P);
243 lastHEN[
n] = CrossSectionLog(targZ, targN, lP);
248 G4int sync=LEN->size();
251 G4cerr<<
"***G4ChipsKPlusNuclCS::CalcCrossSect: Sinc="<<sync<<
"#"<<I<<
", Z=" <<targZ
252 <<
", N="<<targN<<
", F="<<F<<
G4endl;
255 LEN->push_back(lastLEN);
256 HEN->push_back(lastHEN);
261 if (Momentum<lastTH)
return 0.;
262 else if (Momentum<Pmin)
264 if(A<=1. && Momentum < 600.) sigma=0.;
265 else sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
267 else if (Momentum<Pmax)
270 sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
275 sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
277 if(sigma<0.)
return 0.;
285 if(tZ<.99 || tN<0.)
return 0.;
288 if(tZ==1 && tN==0) tM=prM;
289 else dE=tZ/(1.+std::pow(tA,third));
292 return std::sqrt(T*(tpM+T));
299 return CrossSectionFormula(tZ, tN, P, lP);
306 return CrossSectionFormula(tZ, tN, P, lP);
322 G4double El=(.0557*ld2+2.23)/(1.-.7/sp+.1/p4);
323 G4double To=(.3*ld2+19.5)/(1.+.46/sp+1.6/p4);
326 else if(tZ<97 && tN<152)
352 c=52.*std::exp(al*.6)*(1.+95./a2)/(1.+9./a)/(1.+46./a2);
353 ss=(40.+.14*
a)/(1.+12./a);
355 t=.185*y/(1.+.00012*
y);
356 u=(1.+80./asa)/(1.+200./asa);
357 v=(1.+3.E-6*a4*(1.+6.E-7*a3+4.E10/a12))/a3/20000.;
364 sigma=(f*d*d+
c)/(1.+r/std::sqrt(P)+1./p4)+(rD+rR)/(1+v/p4/p4);
368 G4cerr<<
"-Warning-G4ChipsKaonPlusNuclearCroSect::CSForm:Bad A, Z="<<tZ<<
", N="<<tN<<
G4endl;
371 if(sigma<0.)
return 0.;
379 G4cerr<<
"***G4ChipsKaonPlusInelasticXS::EquLinearFit: DX="<<DX<<
", N="<<N<<
G4endl;
385 G4int j=
static_cast<int>(
d);
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
G4ChipsKaonPlusInelasticXS()
~G4ChipsKaonPlusInelasticXS()
G4ParticleDefinition * GetDefinition() const
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int tgZ, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
#define G4MUTEX_INITIALIZER
G4double GetTotalMomentum() const
static G4Proton * Proton()
static G4PionPlus * PionPlus()
#define G4_DECLARE_XS_FACTORY(cross_section)
G4double GetPDGMass() const
static G4KaonPlus * KaonPlus()
virtual G4bool IsIsoApplicable(const G4DynamicParticle *Pt, G4int Z, G4int A, const G4Element *elm, const G4Material *mat)
G4GLOB_DLL std::ostream G4cerr