Geant4  10.01.p03
G4ChipsAntiBaryonInelasticXS.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 // G4 Physics class: G4ChipsAntiBaryonInelasticXS for gamma+A cross sections
31 // Created: M.V. Kossov, CERN/ITEP(Moscow), 20-Dec-03
32 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Feb-04
33 //
34 // -------------------------------------------------------------------------------------
35 // Short description: Cross-sections extracted (by W.Pokorski) from the CHIPS package for
36 // anti-baryoninteractions. Original author: M. Kossov
37 // -------------------------------------------------------------------------------------
38 //
39 
41 #include "G4SystemOfUnits.hh"
42 #include "G4DynamicParticle.hh"
43 #include "G4ParticleDefinition.hh"
44 #include "G4AntiNeutron.hh"
45 #include "G4AntiProton.hh"
46 #include "G4AntiLambda.hh"
47 #include "G4AntiSigmaPlus.hh"
48 #include "G4AntiSigmaMinus.hh"
49 #include "G4AntiSigmaZero.hh"
50 #include "G4AntiXiMinus.hh"
51 #include "G4AntiXiZero.hh"
52 #include "G4AntiOmegaMinus.hh"
53 
54 // factory
55 #include "G4CrossSectionFactory.hh"
56 //
58 
60 {
61  lastLEN=0; // Pointer to lastArray of LowEn CS
62  lastHEN=0; // Pointer to lastArray of HighEn CS
63  lastN=0; // The last N of calculated nucleus
64  lastZ=0; // The last Z of calculated nucleus
65  lastP=0.; // Last used Cross Section Momentum
66  lastTH=0.; // Last threshold momentum
67  lastCS=0.; // Last value of the Cross Section
68  lastI=0; // The last position in the DAMDB
69  LEN = new std::vector<G4double*>;
70  HEN = new std::vector<G4double*>;
71 }
72 
74 {
75  G4int lens=LEN->size();
76  for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
77  delete LEN;
78  G4int hens=HEN->size();
79  for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
80  delete HEN;
81 }
82 
84  const G4Element*,
85  const G4Material*)
86 {
87  /*
88  const G4ParticleDefinition* particle = Pt->GetDefinition();
89 
90  if(particle == G4AntiNeutron::AntiNeutron())
91  {
92  return true;
93  }
94  else if(particle == G4AntiProton::AntiProton())
95  {
96  return true;
97  }
98  else if(particle == G4AntiLambda::AntiLambda())
99  {
100  return true;
101  }
102  else if(particle == G4AntiSigmaPlus::AntiSigmaPlus())
103  {
104  return true;
105  }
106  else if(particle == G4AntiSigmaMinus::AntiSigmaMinus())
107  {
108  return true;
109  }
110  else if(particle == G4AntiSigmaZero::AntiSigmaZero())
111  {
112  return true;
113  }
114  else if(particle == G4AntiXiMinus::AntiXiMinus())
115  {
116  return true;
117  }
118  else if(particle == G4AntiXiZero::AntiXiZero())
119  {
120  return true;
121  }
122  else if(particle == G4AntiOmegaMinus::AntiOmegaMinus())
123  {
124  return true;
125  }
126  */
127  return true;
128 }
129 
130 // The main member function giving the collision cross section (P is in IU, CS is in mb)
131 // Make pMom in independent units ! (Now it is MeV)
133  const G4Isotope*,
134  const G4Element*,
135  const G4Material*)
136 {
137  G4double pMom=Pt->GetTotalMomentum();
138  G4int tgN = A - tgZ;
139  G4int pdg = Pt->GetDefinition()->GetPDGEncoding();
140 
141  return GetChipsCrossSection(pMom, tgZ, tgN, pdg);
142 }
143 
145 {
146 
147  G4bool in=false; // By default the isotope must be found in the AMDB
148  if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
149  {
150  in = false; // By default the isotope haven't be found in AMDB
151  lastP = 0.; // New momentum history (nothing to compare with)
152  lastN = tgN; // The last N of the calculated nucleus
153  lastZ = tgZ; // The last Z of the calculated nucleus
154  lastI = colN.size(); // Size of the Associative Memory DB in the heap
155  j = 0; // A#0f records found in DB for this projectile
156  if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
157  {
158  if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
159  {
160  lastI=i; // Remember the index for future fast/last use
161  lastTH =colTH[i]; // The last THreshold (A-dependent)
162  if(pMom<=lastTH)
163  {
164  return 0.; // Energy is below the Threshold value
165  }
166  lastP =colP [i]; // Last Momentum (A-dependent)
167  lastCS =colCS[i]; // Last CrossSect (A-dependent)
168  in = true; // This is the case when the isotop is found in DB
169  // Momentum pMom is in IU ! @@ Units
170  lastCS=CalculateCrossSection(-1,j,cPDG,lastZ,lastN,pMom); // read & update
171  if(lastCS<=0. && pMom>lastTH) // Correct the threshold (@@ No intermediate Zeros)
172  {
173  lastCS=0.;
174  lastTH=pMom;
175  }
176  break; // Go out of the LOOP
177  }
178  j++; // Increment a#0f records found in DB
179  }
180  if(!in) // This isotope has not been calculated previously
181  {
183  lastCS=CalculateCrossSection(0,j,cPDG,lastZ,lastN,pMom); //calculate & create
184  //if(lastCS>0.) // It means that the AMBD was initialized
185  //{
186 
187  lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
188  colN.push_back(tgN);
189  colZ.push_back(tgZ);
190  colP.push_back(pMom);
191  colTH.push_back(lastTH);
192  colCS.push_back(lastCS);
193  //} // M.K. Presence of H1 with high threshold breaks the syncronization
194  return lastCS*millibarn;
195  } // End of creation of the new set of parameters
196  else
197  {
198  colP[lastI]=pMom;
199  colCS[lastI]=lastCS;
200  }
201  } // End of parameters udate
202  else if(pMom<=lastTH)
203  {
204  return 0.; // Momentum is below the Threshold Value -> CS=0
205  }
206  else // It is the last used -> use the current tables
207  {
208  lastCS=CalculateCrossSection(1,j,cPDG,lastZ,lastN,pMom); // Only read and UpdateDB
209  lastP=pMom;
210  }
211  return lastCS*millibarn;
212 }
213 
214 // The main member function giving the gamma-A cross section (E in GeV, CS in mb)
216  G4int, G4int targZ, G4int targN, G4double Momentum)
217 {
218  static const G4double THmin=27.; // default minimum Momentum (MeV/c) Threshold
219  static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
220  static const G4double dP=10.; // step for the LEN (Low ENergy) table MeV/c
221  static const G4double dPG=dP*.001; // step for the LEN (Low ENergy) table GeV/c
222  static const G4int nL=105; // A#of LEN points in E (step 10 MeV/c)
223  static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
224  static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
225  static const G4int nH=224; // A#of HEN points in lnE
226  static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
227  static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
228  static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
229  static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
230  G4double sigma=0.;
231  if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
232  //G4double A=targN+targZ; // A of the target
233  if(F<=0) // This isotope was not the last used isotop
234  {
235  if(F<0) // This isotope was found in DAMDB =-----=> RETRIEVE
236  {
237  G4int sync=LEN->size();
238  if(sync<=I) G4cerr<<"*!*G4QPiMinusNuclCS::CalcCrosSect:Sync="<<sync<<"<="<<I<<G4endl;
239  lastLEN=(*LEN)[I]; // Pointer to prepared LowEnergy cross sections
240  lastHEN=(*HEN)[I]; // Pointer to prepared High Energy cross sections
241  }
242  else // This isotope wasn't calculated before => CREATE
243  {
244  lastLEN = new G4double[nL]; // Allocate memory for the new LEN cross sections
245  lastHEN = new G4double[nH]; // Allocate memory for the new HEN cross sections
246  // --- Instead of making a separate function ---
247  G4double P=THmiG; // Table threshold in GeV/c
248  for(G4int k=0; k<nL; k++)
249  {
250  lastLEN[k] = CrossSectionLin(targZ, targN, P);
251  P+=dPG;
252  }
253  G4double lP=milPG;
254  for(G4int n=0; n<nH; n++)
255  {
256  lastHEN[n] = CrossSectionLog(targZ, targN, lP);
257  lP+=dlP;
258  }
259  // --- End of possible separate function
260  // *** The synchronization check ***
261  G4int sync=LEN->size();
262  if(sync!=I)
263  {
264  G4cerr<<"***G4QPiMinusNuclCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
265  <<", N="<<targN<<", F="<<F<<G4endl;
266  //G4Exception("G4PiMinusNuclearCS::CalculateCS:","39",FatalException,"DBoverflow");
267  }
268  LEN->push_back(lastLEN); // remember the Low Energy Table
269  HEN->push_back(lastHEN); // remember the High Energy Table
270  } // End of creation of the new set of parameters
271  } // End of parameters udate
272  // =-------------------= NOW the Magic Formula =--------------------=
273  if (Momentum<lastTH) return 0.; // It must be already checked in the interface class
274  else if (Momentum<Pmin) // High Energy region
275  {
276  sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
277  }
278  else if (Momentum<Pmax) // High Energy region
279  {
280  G4double lP=std::log(Momentum);
281  sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
282  }
283  else // UHE region (calculation, not frequent)
284  {
285  G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
286  sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
287  }
288  if(sigma<0.) return 0.;
289  return sigma;
290 }
291 
292 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
294 {
295  G4double lP=std::log(P);
296  return CrossSectionFormula(tZ, tN, P, lP);
297 }
298 
299 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
301 {
302  G4double P=std::exp(lP);
303  return CrossSectionFormula(tZ, tN, P, lP);
304 }
305 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
307  G4double P, G4double lP)
308 {
309  G4double sigma=0.;
310  if(tZ==1 && !tN) // AntiBar-Prot interaction from G4QuasiElRatios
311  {
312  G4double ld=lP-3.5;
313  G4double ld2=ld*ld;
314  G4double ye=std::exp(lP*1.25);
315  G4double yt=std::exp(lP*0.35);
316  G4double El=80./(ye+1.);
317  G4double To=(80./yt+.3)/yt;
318  sigma=(To-El)+.2443*ld2+31.48;
319  }
320  else if(tZ==1 && tN==1)
321  {
322  G4double r=lP-3.7;
323  sigma=0.6*r*r+67.+90.*std::exp(-lP*.666);
324  }
325  else if(tZ<97 && tN<152) // General solution
326  {
327  G4double d=lP-4.2;
328  G4double sp=std::sqrt(P);
329  G4double a=tN+tZ; // A of the target
330  G4double sa=std::sqrt(a);
331  G4double a2=a*a;
332  G4double a3=a2*a;
333  G4double a2s=a2*sa;
334  G4double c=(170.+3600./a2s)/(1.+65./a2s)+40.*std::pow(a,0.712)/(1.+12.2/a)/(1.+34./a2);
335  G4double r=(170.+0.01*a3)/(1.+a3/28000.);
336  sigma=c+d*d+r/sp;
337  }
338  else
339  {
340  G4cerr<<"-Warning-G4QAntiBarNuclearCroSect::CSForm:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
341  sigma=0.;
342  }
343  if(sigma<0.) return 0.;
344  return sigma;
345 }
346 
348 {
349  if(DX<=0. || N<2)
350  {
351  G4cerr<<"***G4ChipsAntiBaryonInelasticXS::EquLinearFit: DX="<<DX<<", N="<<N<<G4endl;
352  return Y[0];
353  }
354 
355  G4int N2=N-2;
356  G4double d=(X-X0)/DX;
357  G4int jj=static_cast<int>(d);
358  if (jj<0) jj=0;
359  else if(jj>N2) jj=N2;
360  d-=jj; // excess
361  G4double yi=Y[jj];
362  G4double sigma=yi+(Y[jj+1]-yi)*d;
363 
364  return sigma;
365 }
static const G4int nH
G4double CalculateCrossSection(G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
G4ParticleDefinition * GetDefinition() const
G4double a
Definition: TRTMaterials.hh:39
static const G4int nL
G4double CrossSectionFormula(G4int targZ, G4int targN, G4double P, G4double lP)
int G4int
Definition: G4Types.hh:78
G4double GetTotalMomentum() 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)
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
bool G4bool
Definition: G4Types.hh:79
const G4int n
G4_DECLARE_XS_FACTORY(G4ChipsAntiBaryonInelasticXS)
static const G4double A[nN]
static const G4double a3
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
G4double CrossSectionLin(G4int targZ, G4int targN, G4double P)
static const double millibarn
Definition: G4SIunits.hh:96
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double CrossSectionLog(G4int targZ, G4int targN, G4double lP)
static const G4double THmin
static const G4double a2
G4GLOB_DLL std::ostream G4cerr