Geant4  10.02.p03
G4ChipsKaonMinusInelasticXS Class Reference

#include <G4ChipsKaonMinusInelasticXS.hh>

Inheritance diagram for G4ChipsKaonMinusInelasticXS:
Collaboration diagram for G4ChipsKaonMinusInelasticXS:

Public Member Functions

 G4ChipsKaonMinusInelasticXS ()
 
 ~G4ChipsKaonMinusInelasticXS ()
 
virtual void CrossSectionDescription (std::ostream &) const
 
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)
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Static Public Member Functions

static const char * Default_Name ()
 

Private Member Functions

G4double CalculateCrossSection (G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
 
G4double CrossSectionLin (G4int targZ, G4int targN, G4double P)
 
G4double CrossSectionLog (G4int targZ, G4int targN, G4double lP)
 
G4double CrossSectionFormula (G4int targZ, G4int targN, G4double P, G4double lP)
 
G4double EquLinearFit (G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
 

Private Attributes

G4doublelastLEN
 
G4doublelastHEN
 
G4int lastN
 
G4int lastZ
 
G4double lastP
 
G4double lastTH
 
G4double lastCS
 
G4int lastI
 
std::vector< G4double * > * LEN
 
std::vector< G4double * > * HEN
 
G4int j
 
std::vector< G4intcolN
 
std::vector< G4intcolZ
 
std::vector< G4doublecolP
 
std::vector< G4doublecolTH
 
std::vector< G4doublecolCS
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 45 of file G4ChipsKaonMinusInelasticXS.hh.

Constructor & Destructor Documentation

◆ G4ChipsKaonMinusInelasticXS()

G4ChipsKaonMinusInelasticXS::G4ChipsKaonMinusInelasticXS ( )

Definition at line 66 of file G4ChipsKaonMinusInelasticXS.cc.

67 {
68  lastLEN=0; // Pointer to lastArray of LowEn CS
69  lastHEN=0; // Pointer to lastArray of HighEn CS
70  lastN=0; // The last N of calculated nucleus
71  lastZ=0; // The last Z of calculated nucleus
72  lastP=0.; // Last used in CrossSection Momentum
73  lastTH=0.; // Last threshold momentum
74  lastCS=0.; // Last value of the Cross Section
75  lastI=0; // The last position in the DAMDB
76  LEN = new std::vector<G4double*>;
77  HEN = new std::vector<G4double*>;
78 }
G4VCrossSectionDataSet(const G4String &nam="")

◆ ~G4ChipsKaonMinusInelasticXS()

G4ChipsKaonMinusInelasticXS::~G4ChipsKaonMinusInelasticXS ( )

Definition at line 80 of file G4ChipsKaonMinusInelasticXS.cc.

81 {
82  G4int lens=LEN->size();
83  for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
84  delete LEN;
85 
86  G4int hens=HEN->size();
87  for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
88  delete HEN;
89 }
int G4int
Definition: G4Types.hh:78

Member Function Documentation

◆ CalculateCrossSection()

G4double G4ChipsKaonMinusInelasticXS::CalculateCrossSection ( G4int  F,
G4int  I,
G4int  PDG,
G4int  Z,
G4int  N,
G4double  Momentum 
)
private

Definition at line 193 of file G4ChipsKaonMinusInelasticXS.cc.

195 {
196  G4double sigma=0.;
197  if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
198  //G4double A=targN+targZ; // A of the target
199  if(F<=0) // This isotope was not the last used isotop
200  {
201  if(F<0) // This isotope was found in DAMDB =-----=> RETRIEVE
202  {
203  G4int sync=LEN->size();
204  if(sync<=I) G4cerr<<"*!*G4QPiMinusNuclCS::CalcCrosSect:Sync="<<sync<<"<="<<I<<G4endl;
205  lastLEN=(*LEN)[I]; // Pointer to prepared LowEnergy cross sections
206  lastHEN=(*HEN)[I]; // Pointer to prepared High Energy cross sections
207  }
208  else // This isotope wasn't calculated before => CREATE
209  {
210  lastLEN = new G4double[nL]; // Allocate memory for the new LEN cross sections
211  lastHEN = new G4double[nH]; // Allocate memory for the new HEN cross sections
212  // --- Instead of making a separate function ---
213  G4double P=THmiG; // Table threshold in GeV/c
214  for(G4int k=0; k<nL; k++)
215  {
216  lastLEN[k] = CrossSectionLin(targZ, targN, P);
217  P+=dPG;
218  }
219  G4double lP=milPG;
220  for(G4int n=0; n<nH; n++)
221  {
222  lastHEN[n] = CrossSectionLog(targZ, targN, lP);
223  lP+=dlP;
224  }
225  // --- End of possible separate function
226  // *** The synchronization check ***
227  G4int sync=LEN->size();
228  if(sync!=I)
229  {
230  G4cerr<<"***G4ChipsKaonMinusCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
231  <<", N="<<targN<<", F="<<F<<G4endl;
232  //G4Exception("G4PiMinusNuclearCS::CalculateCS:","39",FatalException,"DBoverflow");
233  }
234  LEN->push_back(lastLEN); // remember the Low Energy Table
235  HEN->push_back(lastHEN); // remember the High Energy Table
236  } // End of creation of the new set of parameters
237  } // End of parameters udate
238  // =------------------= NOW the Magic Formula =--------------------------=
239  if (Momentum<lastTH) return 0.; // It must be already checked in the interface class
240  else if (Momentum<Pmin) // High Energy region
241  {
242  sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
243  }
244  else if (Momentum<Pmax) // High Energy region
245  {
246  G4double lP=std::log(Momentum);
247  sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
248  }
249  else // UHE region (calculation, not frequent)
250  {
251  G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
252  sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
253  }
254  if(sigma<0.) return 0.;
255  return sigma;
256 }
static const G4int nH
static const G4int nL
int G4int
Definition: G4Types.hh:78
static double P[]
G4double CrossSectionLin(G4int targZ, G4int targN, G4double P)
Char_t n[5]
G4double CrossSectionFormula(G4int targZ, G4int targN, G4double P, G4double lP)
G4double CrossSectionLog(G4int targZ, G4int targN, G4double lP)
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static const G4double THmin
G4GLOB_DLL std::ostream G4cerr
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CrossSectionDescription()

void G4ChipsKaonMinusInelasticXS::CrossSectionDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 92 of file G4ChipsKaonMinusInelasticXS.cc.

93 {
94  outFile << "G4ChipsKaonMinusInelasticXS provides the inelastic cross\n"
95  << "section for K- nucleus scattering as a function of incident\n"
96  << "momentum. The cross section is calculated using M. Kossov's\n"
97  << "CHIPS parameterization of cross section data.\n";
98 }
Here is the caller graph for this function:

◆ CrossSectionFormula()

G4double G4ChipsKaonMinusInelasticXS::CrossSectionFormula ( G4int  targZ,
G4int  targN,
G4double  P,
G4double  lP 
)
private

Definition at line 272 of file G4ChipsKaonMinusInelasticXS.cc.

274 {
275  G4double sigma=0.;
276  if(tZ==1 && !tN) // PiMin-Proton interaction from G4QuasiElRatios
277  {
278  G4double ld=lP-3.5;
279  G4double ld2=ld*ld;
280  G4double p2=P*P;
281  G4double p4=p2*p2;
282  G4double sp=std::sqrt(P);
283  G4double psp=P*sp;
284  G4double lm=P-.39;
285  G4double md=lm*lm+.000156;
286  G4double lh=P-1.;
287  G4double hd=lh*lh+.0156;
288  G4double El=(.0557*ld2+2.23)/(1.-.7/sp+.075/p4);
289  G4double To=(.3*ld2+19.5)/(1.-.21/sp+.52/p4);
290  sigma=8.8/psp+(To-El)+.002/md+.15/hd;
291  }
292  else if(tZ==1 && tN==1) // kmp_tot
293  {
294  G4double p2=P*P;
295  G4double dX=lP-3.7;
296  G4double dR=P-.94;
297  G4double sp=std::sqrt(P);
298  sigma=(.6*dX*dX+36.)/(1.-.11/sp+.52/p2/p2)+.7/(dR*dR+.0256)+18./P/sp;
299  }
300  else if(tZ<97 && tN<152) // General solution
301  {
302  G4double d=lP-4.2;
303  G4double sp=std::sqrt(P);
304  G4double p2=P*P;
305  G4double a=tN+tZ; // A of the target
306  G4double sa=std::sqrt(a);
307  G4double al=std::log(a);
308  G4double a2=a*a;
309  G4double c=52.*std::exp(al*0.6)*(1.+97./a2)/(1.+9.8/a)/(1.+47./a2);
310  G4double gg=-.2-.003*a;
311  G4double h=.5+.07*a;
312  G4double v=P-1.;
313  G4double f=.6*a*sa/(1.+.00002*a2);
314  G4double u=.125+.127*al;
315  sigma=(c+d*d)/(1.+gg/sp+h/p2/p2)+f/(v*v+u*u)+20.*sa/P/sp;
316  }
317  else
318  {
319  G4cerr<<"-Warning-G4ChipsKMinusNuclearCroSect::CSForm:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
320  sigma=0.;
321  }
322  if(sigma<0.) return 0.;
323  return sigma;
324 }
Float_t d
static double P[]
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static const G4double a2
G4GLOB_DLL std::ostream G4cerr
Here is the caller graph for this function:

◆ CrossSectionLin()

G4double G4ChipsKaonMinusInelasticXS::CrossSectionLin ( G4int  targZ,
G4int  targN,
G4double  P 
)
private

Definition at line 259 of file G4ChipsKaonMinusInelasticXS.cc.

260 {
261  G4double lP=std::log(P);
262  return CrossSectionFormula(tZ, tN, P, lP);
263 }
static double P[]
G4double CrossSectionFormula(G4int targZ, G4int targN, G4double P, G4double lP)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CrossSectionLog()

G4double G4ChipsKaonMinusInelasticXS::CrossSectionLog ( G4int  targZ,
G4int  targN,
G4double  lP 
)
private

Definition at line 266 of file G4ChipsKaonMinusInelasticXS.cc.

267 {
268  G4double P=std::exp(lP);
269  return CrossSectionFormula(tZ, tN, P, lP);
270 }
static double P[]
G4double CrossSectionFormula(G4int targZ, G4int targN, G4double P, G4double lP)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Default_Name()

static const char* G4ChipsKaonMinusInelasticXS::Default_Name ( )
inlinestatic

Definition at line 54 of file G4ChipsKaonMinusInelasticXS.hh.

54 {return "ChipsKaonMinusInelasticXS";}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EquLinearFit()

G4double G4ChipsKaonMinusInelasticXS::EquLinearFit ( G4double  X,
G4int  N,
G4double  X0,
G4double  DX,
G4double Y 
)
private

Definition at line 326 of file G4ChipsKaonMinusInelasticXS.cc.

327 {
328  if(DX<=0. || N<2)
329  {
330  G4cerr<<"***G4ChipsKaonMinusInelasticXS::EquLinearFit: DX="<<DX<<", N="<<N<<G4endl;
331  return Y[0];
332  }
333 
334  G4int N2=N-2;
335  G4double d=(X-X0)/DX;
336  G4int jj=static_cast<int>(d);
337  if (jj<0) jj=0;
338  else if(jj>N2) jj=N2;
339  d-=jj; // excess
340  G4double yi=Y[jj];
341  G4double sigma=yi+(Y[jj+1]-yi)*d;
342 
343  return sigma;
344 }
Float_t d
Float_t Y
int G4int
Definition: G4Types.hh:78
Float_t X
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
double G4double
Definition: G4Types.hh:76
G4GLOB_DLL std::ostream G4cerr
Here is the caller graph for this function:

◆ GetChipsCrossSection()

G4double G4ChipsKaonMinusInelasticXS::GetChipsCrossSection ( G4double  momentum,
G4int  Z,
G4int  N,
G4int  pdg 
)
virtual

!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)

Definition at line 121 of file G4ChipsKaonMinusInelasticXS.cc.

122 {
123  G4bool in=false; // By default the isotope must be found in the AMDB
124  if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
125  {
126  in = false; // By default the isotope haven't be found in AMDB
127  lastP = 0.; // New momentum history (nothing to compare with)
128  lastN = tgN; // The last N of the calculated nucleus
129  lastZ = tgZ; // The last Z of the calculated nucleus
130  lastI = colN.size(); // Size of the Associative Memory DB in the heap
131  j = 0; // A#0f records found in DB for this projectile
132  if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
133  {
134  if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
135  {
136  lastI=i; // Remember the index for future fast/last use
137  lastTH =colTH[i]; // The last THreshold (A-dependent)
138  if(pMom<=lastTH)
139  {
140  return 0.; // Energy is below the Threshold value
141  }
142  lastP =colP [i]; // Last Momentum (A-dependent)
143  lastCS =colCS[i]; // Last CrossSect (A-dependent)
144  in = true; // This is the case when the isotop is found in DB
145  // Momentum pMom is in IU ! @@ Units
146  lastCS=CalculateCrossSection(-1,j,-321,lastZ,lastN,pMom); // read & update
147  if(lastCS<=0. && pMom>lastTH) // Correct the threshold (@@ No intermediate Zeros)
148  {
149  lastCS=0.;
150  lastTH=pMom;
151  }
152  break; // Go out of the LOOP
153  }
154  j++; // Increment a#0f records found in DB
155  }
156  if(!in) // This isotope has not been calculated previously
157  {
159  lastCS=CalculateCrossSection(0,j,-321,lastZ,lastN,pMom); //calculate & create
160  //if(lastCS>0.) // It means that the AMBD was initialized
161  //{
162 
163  // lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
164 
165  lastTH = 0; // WP - to be checked!!!
166  colN.push_back(tgN);
167  colZ.push_back(tgZ);
168  colP.push_back(pMom);
169  colTH.push_back(lastTH);
170  colCS.push_back(lastCS);
171  //} // M.K. Presence of H1 with high threshold breaks the syncronization
172  return lastCS*millibarn;
173  } // End of creation of the new set of parameters
174  else
175  {
176  colP[lastI]=pMom;
177  colCS[lastI]=lastCS;
178  }
179  } // End of parameters udate
180  else if(pMom<=lastTH)
181  {
182  return 0.; // Momentum is below the Threshold Value -> CS=0
183  }
184  else // It is the last used -> use the current tables
185  {
186  lastCS=CalculateCrossSection(1,j,-321,lastZ,lastN,pMom); // Only read and UpdateDB
187  lastP=pMom;
188  }
189  return lastCS*millibarn;
190 }
ifstream in
Definition: comparison.C:7
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
G4double CalculateCrossSection(G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
static const double millibarn
Definition: G4SIunits.hh:105
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIsoCrossSection()

G4double G4ChipsKaonMinusInelasticXS::GetIsoCrossSection ( const G4DynamicParticle Pt,
G4int  tgZ,
G4int  A,
const G4Isotope iso = 0,
const G4Element elm = 0,
const G4Material mat = 0 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 110 of file G4ChipsKaonMinusInelasticXS.cc.

114 {
115  G4double pMom=Pt->GetTotalMomentum();
116  G4int tgN = A - tgZ;
117 
118  return GetChipsCrossSection(pMom, tgZ, tgN, -321);
119 }
G4double GetTotalMomentum() const
int G4int
Definition: G4Types.hh:78
double A(double temperature)
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsIsoApplicable()

G4bool G4ChipsKaonMinusInelasticXS::IsIsoApplicable ( const G4DynamicParticle Pt,
G4int  Z,
G4int  A,
const G4Element elm,
const G4Material mat 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 100 of file G4ChipsKaonMinusInelasticXS.cc.

103 {
104  return true;
105 }
Here is the caller graph for this function:

Member Data Documentation

◆ colCS

std::vector<G4double> G4ChipsKaonMinusInelasticXS::colCS
private

Definition at line 97 of file G4ChipsKaonMinusInelasticXS.hh.

◆ colN

std::vector<G4int> G4ChipsKaonMinusInelasticXS::colN
private

Definition at line 93 of file G4ChipsKaonMinusInelasticXS.hh.

◆ colP

std::vector<G4double> G4ChipsKaonMinusInelasticXS::colP
private

Definition at line 95 of file G4ChipsKaonMinusInelasticXS.hh.

◆ colTH

std::vector<G4double> G4ChipsKaonMinusInelasticXS::colTH
private

Definition at line 96 of file G4ChipsKaonMinusInelasticXS.hh.

◆ colZ

std::vector<G4int> G4ChipsKaonMinusInelasticXS::colZ
private

Definition at line 94 of file G4ChipsKaonMinusInelasticXS.hh.

◆ HEN

std::vector<G4double*>* G4ChipsKaonMinusInelasticXS::HEN
private

Definition at line 90 of file G4ChipsKaonMinusInelasticXS.hh.

◆ j

G4int G4ChipsKaonMinusInelasticXS::j
private

Definition at line 92 of file G4ChipsKaonMinusInelasticXS.hh.

◆ lastCS

G4double G4ChipsKaonMinusInelasticXS::lastCS
private

Definition at line 87 of file G4ChipsKaonMinusInelasticXS.hh.

◆ lastHEN

G4double* G4ChipsKaonMinusInelasticXS::lastHEN
private

Definition at line 82 of file G4ChipsKaonMinusInelasticXS.hh.

◆ lastI

G4int G4ChipsKaonMinusInelasticXS::lastI
private

Definition at line 88 of file G4ChipsKaonMinusInelasticXS.hh.

◆ lastLEN

G4double* G4ChipsKaonMinusInelasticXS::lastLEN
private

Definition at line 81 of file G4ChipsKaonMinusInelasticXS.hh.

◆ lastN

G4int G4ChipsKaonMinusInelasticXS::lastN
private

Definition at line 83 of file G4ChipsKaonMinusInelasticXS.hh.

◆ lastP

G4double G4ChipsKaonMinusInelasticXS::lastP
private

Definition at line 85 of file G4ChipsKaonMinusInelasticXS.hh.

◆ lastTH

G4double G4ChipsKaonMinusInelasticXS::lastTH
private

Definition at line 86 of file G4ChipsKaonMinusInelasticXS.hh.

◆ lastZ

G4int G4ChipsKaonMinusInelasticXS::lastZ
private

Definition at line 84 of file G4ChipsKaonMinusInelasticXS.hh.

◆ LEN

std::vector<G4double*>* G4ChipsKaonMinusInelasticXS::LEN
private

Definition at line 89 of file G4ChipsKaonMinusInelasticXS.hh.


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