Geant4  10.01.p03
G4ChipsHyperonInelasticXS.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
28 //
29 // ****************************************************************************************
30 // Short description: Cross-sections extracted (by W.Pokorski) from the CHIPS package for
31 // Hyperon-nuclear interactions. Original author: M. Kossov
32 // -------------------------------------------------------------------------------------
33 //
34 
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 
47 // factory
48 #include "G4CrossSectionFactory.hh"
49 //
51 
53 {
54  // Initialization of the
55  lastLEN=0; // Pointer to the lastArray of LowEn CS
56  lastHEN=0; // Pointer to the lastArray of HighEn CS
57  lastN=0; // The last N of calculated nucleus
58  lastZ=0; // The last Z of calculated nucleus
59  lastP=0.; // Last used in cross section Momentum
60  lastTH=0.; // Last threshold momentum
61  lastCS=0.; // Last value of the Cross Section
62  lastI=0; // The last position in the DAMDB
63  LEN = new std::vector<G4double*>;
64  HEN = new std::vector<G4double*>;
65 }
66 
68 {
69  G4int lens=LEN->size();
70  for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
71  delete LEN;
72 
73  G4int hens=HEN->size();
74  for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
75  delete HEN;
76 }
77 
79  const G4Element*,
80  const G4Material*)
81 {
82  /*
83  const G4ParticleDefinition* particle = Pt->GetDefinition();
84  if (particle == G4Lambda::Lambda())
85  {
86  return true;
87  }
88  else if(particle == G4SigmaPlus::SigmaPlus())
89  {
90  return true;
91  }
92  else if(particle == G4SigmaMinus::SigmaMinus())
93  {
94  return true;
95  }
96  else if(particle == G4SigmaZero::SigmaZero())
97  {
98  return true;
99  }
100  else if(particle == G4XiMinus::XiMinus())
101  {
102  return true;
103  }
104  else if(particle == G4XiZero::XiZero())
105  {
106  return true;
107  }
108  else if(particle == G4OmegaMinus::OmegaMinus())
109  {
110  return true;
111  }
112  */
113  return true;
114 }
115 
116 // The main member function giving the collision cross section (P is in IU, CS is in mb)
117 // Make pMom in independent units ! (Now it is MeV)
119  const G4Isotope*,
120  const G4Element*,
121  const G4Material*)
122 {
123  G4double pMom=Pt->GetTotalMomentum();
124  G4int tgN = A - tgZ;
125  G4int pdg = Pt->GetDefinition()->GetPDGEncoding();
126 
127  return GetChipsCrossSection(pMom, tgZ, tgN, pdg);
128 }
129 
131 {
132 
133  G4bool in=false; // By default the isotope must be found in the AMDB
134  if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
135  {
136  in = false; // By default the isotope haven't be found in AMDB
137  lastP = 0.; // New momentum history (nothing to compare with)
138  lastN = tgN; // The last N of the calculated nucleus
139  lastZ = tgZ; // The last Z of the calculated nucleus
140  lastI = colN.size(); // Size of the Associative Memory DB in the heap
141  j = 0; // A#0f records found in DB for this projectile
142 
143  if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
144  {
145  if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
146  {
147  lastI=i; // Remember the index for future fast/last use
148  lastTH =colTH[i]; // The last THreshold (A-dependent)
149 
150  if(pMom<=lastTH)
151  {
152  return 0.; // Energy is below the Threshold value
153  }
154  lastP =colP [i]; // Last Momentum (A-dependent)
155  lastCS =colCS[i]; // Last CrossSect (A-dependent)
156  in = true; // This is the case when the isotop is found in DB
157  // Momentum pMom is in IU ! @@ Units
158  lastCS=CalculateCrossSection(-1,j,PDG,lastZ,lastN,pMom); // read & update
159 
160  if(lastCS<=0. && pMom>lastTH) // Correct the threshold (@@ No intermediate Zeros)
161  {
162  lastCS=0.;
163  lastTH=pMom;
164  }
165  break; // Go out of the LOOP
166  }
167  j++; // Increment a#0f records found in DB
168  }
169  if(!in) // This isotope has not been calculated previously
170  {
172  lastCS=CalculateCrossSection(0,j,PDG,lastZ,lastN,pMom); //calculate & create
173  //if(lastCS>0.) // It means that the AMBD was initialized
174  //{
175 
176  lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
177  colN.push_back(tgN);
178  colZ.push_back(tgZ);
179  colP.push_back(pMom);
180  colTH.push_back(lastTH);
181  colCS.push_back(lastCS);
182  //} // M.K. Presence of H1 with high threshold breaks the syncronization
183  return lastCS*millibarn;
184  } // End of creation of the new set of parameters
185  else
186  {
187  colP[lastI]=pMom;
188  colCS[lastI]=lastCS;
189  }
190  } // End of parameters udate
191  else if(pMom<=lastTH)
192  {
193  return 0.; // Momentum is below the Threshold Value -> CS=0
194  }
195  else // It is the last used -> use the current tables
196  {
197  lastCS=CalculateCrossSection(1,j,PDG,lastZ,lastN,pMom); // Only read and UpdateDB
198  lastP=pMom;
199  }
200  return lastCS*millibarn;
201 }
202 
203 // The main member function giving the gamma-A cross section (E in GeV, CS in mb)
205  G4int, G4int targZ, G4int targN, G4double Momentum)
206 {
207  static const G4double THmin=27.; // default minimum Momentum (MeV/c) Threshold
208  static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
209  static const G4double dP=10.; // step for the LEN (Low ENergy) table MeV/c
210  static const G4double dPG=dP*.001; // step for the LEN (Low ENergy) table GeV/c
211  static const G4int nL=105; // A#of LEN points in E (step 10 MeV/c)
212  static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
213  static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
214  static const G4int nH=224; // A#of HEN points in lnE
215  static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
216  static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
217  static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
218  static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
219  G4double sigma=0.;
220  if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
221  //G4double A=targN+targZ; // A of the target
222  if(F<=0) // This isotope was not the last used isotop
223  {
224  if(F<0) // This isotope was found in DAMDB =-----=> RETRIEVE
225  {
226  G4int sync=LEN->size();
227  if(sync<=I) G4cerr<<"*!*G4QPiMinusNuclCS::CalcCrosSect:Sync="<<sync<<"<="<<I<<G4endl;
228  lastLEN=(*LEN)[I]; // Pointer to prepared LowEnergy cross sections
229  lastHEN=(*HEN)[I]; // Pointer to prepared High Energy cross sections
230  }
231  else // This isotope wasn't calculated before => CREATE
232  {
233  lastLEN = new G4double[nL]; // Allocate memory for the new LEN cross sections
234  lastHEN = new G4double[nH]; // Allocate memory for the new HEN cross sections
235  // --- Instead of making a separate function ---
236  G4double P=THmiG; // Table threshold in GeV/c
237  for(G4int k=0; k<nL; k++)
238  {
239  lastLEN[k] = CrossSectionLin(targZ, targN, P);
240  P+=dPG;
241  }
242  G4double lP=milPG;
243  for(G4int n=0; n<nH; n++)
244  {
245  lastHEN[n] = CrossSectionLog(targZ, targN, lP);
246  lP+=dlP;
247  }
248  // --- End of possible separate function
249  // *** The synchronization check ***
250  G4int sync=LEN->size();
251  if(sync!=I)
252  {
253  G4cerr<<"***G4QHyperNuclCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
254  <<", N="<<targN<<", F="<<F<<G4endl;
255  //G4Exception("G4PiMinusNuclearCS::CalculateCS:","39",FatalException,"DBoverflow");
256  }
257  LEN->push_back(lastLEN); // remember the Low Energy Table
258  HEN->push_back(lastHEN); // remember the High Energy Table
259  } // End of creation of the new set of parameters
260  } // End of parameters udate
261  // =--------------------------= NOW the Magic Formula =------------------------------=
262  if (Momentum<lastTH) return 0.; // It must be already checked in the interface class
263  else if (Momentum<Pmin) // High Energy region
264  {
265  sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
266  }
267  else if (Momentum<Pmax) // High Energy region
268  {
269  G4double lP=std::log(Momentum);
270  sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
271  }
272  else // UHE region (calculation, not frequent)
273  {
274  G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
275  sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
276  }
277  if(sigma<0.) return 0.;
278  return sigma;
279 }
280 
281 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
283 {
284  G4double lP=std::log(P);
285  return CrossSectionFormula(tZ, tN, P, lP);
286 }
287 
288 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
290 {
291  G4double P=std::exp(lP);
292  return CrossSectionFormula(tZ, tN, P, lP);
293 }
294 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
296  G4double P, G4double lP)
297 {
298  G4double sigma=0.;
299  if(tZ==1 && !tN) // Hyperon-P interaction from G4QuasiElastRatios
300  {
301  G4double ld=lP-3.5;
302  G4double ld2=ld*ld;
303  G4double p2=P*P;
304  G4double p4=p2*p2;
305  G4double sp=std::sqrt(P);
306  G4double El=(.0557*ld2+6.72+99./p2)/(1.+2./sp+2./p4);
307  G4double To=(.3*ld2+38.2+900./sp)/(1.+27./sp+3./p4);
308  sigma=To-El;
309  }
310  else if(tZ<97 && tN<152) // General solution
311  {
312  G4double d=lP-4.2;
313  G4double p2=P*P;
314  G4double p4=p2*p2;
315  G4double sp=std::sqrt(P);
316  G4double ssp=std::sqrt(sp);
317  G4double a=tN+tZ; // A of the target
318  G4double al=std::log(a);
319  G4double sa=std::sqrt(a);
320  G4double a2=a*a;
321  G4double a2s=a2*sa;
322  G4double a4=a2*a2;
323  G4double a8=a4*a4;
324  G4double c=(170.+3600./a2s)/(1.+65./a2s);
325  G4double gg=42.*(std::exp(al*0.8)+4.E-8*a4)/(1.+28./a)/(1.+5.E-5*a2);
326  G4double e=390.; // Defolt values for deutrons
327  G4double r=0.27;
328  G4double h=2.E-7;
329  G4double t=0.3;
330  if(tZ>1 || tN>1)
331  {
332  e=380.+18.*a2/(1.+a2/60.)/(1.+2.E-19*a8);
333  r=0.15;
334  h=1.E-8*a2/(1.+a2/17.)/(1.+3.E-20*a8);
335  t=(.2+.00056*a2)/(1.+a2*.0006);
336  }
337  sigma=(c+d*d)/(1.+t/ssp+r/p4)+(gg+e*std::exp(-6.*P))/(1.+h/p4/p4);
338 #ifdef pdebug
339  G4cout<<"G4QHyperonNucCS::CSForm: A="<<a<<",P="<<P<<",CS="<<sigma<<",c="<<c<<",g="<<gg
340  <<",d="<<d<<",r="<<r<<",e="<<e<<",h="<<h<<G4endl;
341 #endif
342  }
343  else
344  {
345  G4cerr<<"-Warning-G4QHyperonNuclearCroSect::CSForm:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
346  sigma=0.;
347  }
348  if(sigma<0.) return 0.;
349  return sigma;
350 }
351 
353 {
354  if(DX<=0. || N<2)
355  {
356  G4cerr<<"***G4ChipsHyperonInelasticXS::EquLinearFit: DX="<<DX<<", N="<<N<<G4endl;
357  return Y[0];
358  }
359 
360  G4int N2=N-2;
361  G4double d=(X-X0)/DX;
362  G4int jj=static_cast<int>(d);
363  if (jj<0) jj=0;
364  else if(jj>N2) jj=N2;
365  d-=jj; // excess
366  G4double yi=Y[jj];
367  G4double sigma=yi+(Y[jj+1]-yi)*d;
368 
369  return sigma;
370 }
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
static const G4int nH
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int tgZ, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
static const G4double a4
G4ParticleDefinition * GetDefinition() const
G4double a
Definition: TRTMaterials.hh:39
static const G4int nL
std::vector< G4double * > * LEN
int G4int
Definition: G4Types.hh:78
G4double GetTotalMomentum() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4double p2
const G4int n
static const G4double A[nN]
G4double CrossSectionLog(G4int targZ, G4int targN, G4double lP)
static const double millibarn
Definition: G4SIunits.hh:96
virtual G4bool IsIsoApplicable(const G4DynamicParticle *Pt, G4int Z, G4int A, const G4Element *elm, const G4Material *mat)
#define G4endl
Definition: G4ios.hh:61
G4_DECLARE_XS_FACTORY(G4ChipsHyperonInelasticXS)
G4double CrossSectionFormula(G4int targZ, G4int targN, G4double P, G4double lP)
G4double CalculateCrossSection(G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
double G4double
Definition: G4Types.hh:76
G4double CrossSectionLin(G4int targZ, G4int targN, G4double P)
static const G4double THmin
static const G4double a2
G4GLOB_DLL std::ostream G4cerr
std::vector< G4double * > * HEN