Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4QAntiBaryonPlusNuclearCrossSection Class Reference

#include <G4QAntiBaryonPlusNuclearCrossSection.hh>

+ Inheritance diagram for G4QAntiBaryonPlusNuclearCrossSection:

Public Member Functions

 ~G4QAntiBaryonPlusNuclearCrossSection ()
 
virtual G4double GetCrossSection (G4bool fCS, G4double pMom, G4int tgZ, G4int tgN, G4int pPDG=-3112)
 
G4double CalculateCrossSection (G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
 
- Public Member Functions inherited from G4VQCrossSection
virtual ~G4VQCrossSection ()
 
virtual G4double GetCrossSection (G4bool, G4double, G4int, G4int, G4int pPDG=0)
 
virtual G4double ThresholdEnergy (G4int Z, G4int N, G4int PDG=0)
 
virtual G4double CalculateCrossSection (G4bool CS, G4int F, G4int I, G4int PDG, G4int tgZ, G4int tgN, G4double pMom)=0
 
virtual G4double GetLastTOTCS ()
 
virtual G4double GetLastQELCS ()
 
virtual G4double GetDirectPart (G4double Q2)
 
virtual G4double GetNPartons (G4double Q2)
 
virtual G4double GetExchangeEnergy ()
 
virtual G4double GetExchangeT (G4int tZ, G4int tN, G4int pPDG)
 
virtual G4double GetSlope (G4int tZ, G4int tN, G4int pPDG)
 
virtual G4double GetHMaxT ()
 
virtual G4double GetExchangeQ2 (G4double nu=0)
 
virtual G4double GetVirtualFactor (G4double nu, G4double Q2)
 
virtual G4double GetQEL_ExchangeQ2 ()
 
virtual G4double GetNQE_ExchangeQ2 ()
 
virtual G4int GetExchangePDGCode ()
 

Static Public Member Functions

static G4VQCrossSectionGetPointer ()
 
- Static Public Member Functions inherited from G4VQCrossSection
static void setTolerance (G4double tol)
 

Protected Member Functions

 G4QAntiBaryonPlusNuclearCrossSection ()
 
- Protected Member Functions inherited from G4VQCrossSection
 G4VQCrossSection ()
 
G4double LinearFit (G4double X, G4int N, G4double *XN, G4double *YN)
 
G4double EquLinearFit (G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
 

Additional Inherited Members

- Static Protected Attributes inherited from G4VQCrossSection
static G4double tolerance =.001
 

Detailed Description

Definition at line 51 of file G4QAntiBaryonPlusNuclearCrossSection.hh.

Constructor & Destructor Documentation

◆ G4QAntiBaryonPlusNuclearCrossSection()

G4QAntiBaryonPlusNuclearCrossSection::G4QAntiBaryonPlusNuclearCrossSection ( )
inlineprotected

Definition at line 55 of file G4QAntiBaryonPlusNuclearCrossSection.hh.

55{}

◆ ~G4QAntiBaryonPlusNuclearCrossSection()

G4QAntiBaryonPlusNuclearCrossSection::~G4QAntiBaryonPlusNuclearCrossSection ( )

Definition at line 71 of file G4QAntiBaryonPlusNuclearCrossSection.cc.

72{
73 G4int lens=LEN->size();
74 for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
75 delete LEN;
76 G4int hens=HEN->size();
77 for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
78 delete HEN;
79}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ CalculateCrossSection()

G4double G4QAntiBaryonPlusNuclearCrossSection::CalculateCrossSection ( G4bool  CS,
G4int  F,
G4int  I,
G4int  PDG,
G4int  Z,
G4int  N,
G4double  Momentum 
)
virtual

Implements G4VQCrossSection.

Definition at line 234 of file G4QAntiBaryonPlusNuclearCrossSection.cc.

236{
237 static const G4double THmin=27.; // default minimum Momentum (MeV/c) Threshold
238 static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
239 static const G4double dP=10.; // step for the LEN (Low ENergy) table MeV/c
240 static const G4double dPG=dP*.001; // step for the LEN (Low ENergy) table GeV/c
241 static const G4int nL=105; // A#of LEN points in E (step 10 MeV/c)
242 static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
243 static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
244 static const G4int nH=224; // A#of HEN points in lnE
245 static const G4double milP=std::log(Pmin);// Low logarithm energy for the HEN part
246 static const G4double malP=std::log(Pmax);// High logarithm energy (each 2.75 percent)
247 static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
248 static const G4double milPG=std::log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
249#ifdef debug
250 G4cout<<"G4QaBPNuCS::CalCS:N="<<targN<<",Z="<<targZ<<",P="<<Momentum<<">"<<THmin<<G4endl;
251#endif
252 G4double sigma=0.;
253 if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
254 //G4double A=targN+targZ; // A of the target
255#ifdef debug
256 G4cout<<"G4QaBarPNucCS::CalCS:A="<<A<<",F="<<F<<",I="<<I<<",nL="<<nL<<",nH="<<nH<<G4endl;
257#endif
258 if(F<=0) // This isotope was not the last used isotop
259 {
260 if(F<0) // This isotope was found in DAMDB =-----=> RETRIEVE
261 {
262 G4int sync=LEN->size();
263 if(sync<=I) G4cerr<<"*!*G4QaBarPNuclCS::CalcCrosSect: Sync="<<sync<<"<="<<I<<G4endl;
264 lastLEN=(*LEN)[I]; // Pointer to prepared LowEnergy cross sections
265 lastHEN=(*HEN)[I]; // Pointer to prepared High Energy cross sections
266 }
267 else // This isotope wasn't calculated before => CREATE
268 {
269 lastLEN = new G4double[nL]; // Allocate memory for the new LEN cross sections
270 lastHEN = new G4double[nH]; // Allocate memory for the new HEN cross sections
271 // --- Instead of making a separate function ---
272 G4double P=THmiG; // Table threshold in GeV/c
273 for(G4int n=0; n<nL; n++)
274 {
275 lastLEN[n] = CrossSectionLin(targZ, targN, P);
276 P+=dPG;
277 }
278 G4double lP=milPG;
279 for(G4int n=0; n<nH; n++)
280 {
281 lastHEN[n] = CrossSectionLog(targZ, targN, lP);
282 lP+=dlP;
283 }
284#ifdef debug
285 G4cout<<"-*->G4QaBarPNucCS::CalCS:Tab for Z="<<targZ<<",N="<<targN<<",I="<<I<<G4endl;
286#endif
287 // --- End of possible separate function
288 // *** The synchronization check ***
289 G4int sync=LEN->size();
290 if(sync!=I)
291 {
292 G4cerr<<"***G4QaBarPNuclCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
293 <<", N="<<targN<<", F="<<F<<G4endl;
294 //G4Exception("G4PiMinusNuclearCS::CalculateCS:","39",FatalException,"DBoverflow");
295 }
296 LEN->push_back(lastLEN); // remember the Low Energy Table
297 HEN->push_back(lastHEN); // remember the High Energy Table
298 } // End of creation of the new set of parameters
299 } // End of parameters udate
300 // =--------------------= NOW the Magic Formula =--------------------=
301#ifdef debug
302 G4cout<<"G4QaBPNCS::CalCS:lTH="<<lastTH<<",Pmi="<<Pmin<<",dP="<<dP<<",dlP="<<dlP<<G4endl;
303#endif
304 if (Momentum<lastTH) return 0.; // It must be already checked in the interface class
305 else if (Momentum<Pmin) // High Energy region
306 {
307#ifdef debug
308 G4cout<<"G4QaBPNCS::CalcCS:bLEN nL="<<nL<<",TH="<<THmin<<",dP="<<dP<<G4endl;
309#endif
310 sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
311#ifdef debugn
312 if(sigma<0.)
313 G4cout<<"G4QaBPNCS::CalcCS: E="<<Momentum<<",T="<<THmin<<",dP="<<dP<<G4endl;
314#endif
315 }
316 else if (Momentum<Pmax) // High Energy region
317 {
318 G4double lP=std::log(Momentum);
319#ifdef debug
320 G4cout<<"G4QaBarPNucCS::CalcCS:before HEN nH="<<nH<<",iE="<<milP<<",dlP="<<dlP<<G4endl;
321#endif
322 sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
323 }
324 else // UHE region (calculation, not frequent)
325 {
326 G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
327 sigma=CrossSectionFormula(targZ, targN, P, std::log(P));
328 }
329#ifdef debug
330 G4cout<<"G4QAntiBaryonPlusNuclearCrossSection::CalcCS: CS="<<sigma<<G4endl;
331#endif
332 if(sigma<0.) return 0.;
333 return sigma;
334}
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double *Y)

Referenced by GetCrossSection().

◆ GetCrossSection()

G4double G4QAntiBaryonPlusNuclearCrossSection::GetCrossSection ( G4bool  fCS,
G4double  pMom,
G4int  tgZ,
G4int  tgN,
G4int  pPDG = -3112 
)
virtual

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

Reimplemented from G4VQCrossSection.

Definition at line 83 of file G4QAntiBaryonPlusNuclearCrossSection.cc.

85{
86 //A.R.23-Oct-2012 Shadowed variable static G4double tolerance=0.001; // Tolerance (0.1%) to consider as "the same mom"
87 static G4int j; // A#0f Z/N-records already tested in AMDB
88 static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
89 static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
90 static std::vector <G4double> colP; // Vector of last momenta for the reaction
91 static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
92 static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
93 // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
94#ifdef debug
95 G4cout<<"G4QaBPCS::GetCS:>>>f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
96 <<"("<<lastN<<"),PDG="<<PDG<<", thresh="<<lastTH<<",Sz="<<colN.size()<<G4endl;
97#endif
98 if(PDG!=-3112 && PDG!=-3312 && PDG!=-3334)
99 G4cout<<"-Warning-G4QAntiBaryonPlusCS::GetCS: Not a PositiveAntiBar,PDG="<<PDG<<G4endl;
100 G4bool in=false; // By default the isotope must be found in the AMDB
101 if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
102 {
103 in = false; // By default the isotope haven't be found in AMDB
104 lastP = 0.; // New momentum history (nothing to compare with)
105 lastN = tgN; // The last N of the calculated nucleus
106 lastZ = tgZ; // The last Z of the calculated nucleus
107 lastI = colN.size(); // Size of the Associative Memory DB in the heap
108 j = 0; // A#0f records found in DB for this projectile
109#ifdef debug
110 G4cout<<"G4QABPNuclCS::GetCS: the amount of records in the AMDB lastI="<<lastI<<G4endl;
111#endif
112 if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
113 {
114 if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
115 {
116 lastI=i; // Remember the index for future fast/last use
117 lastTH =colTH[i]; // The last THreshold (A-dependent)
118#ifdef debug
119 G4cout<<"G4QaBPCS::GetCS:*Found*P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
120#endif
121 if(pMom<=lastTH)
122 {
123#ifdef debug
124 G4cout<<"G4QPCS::GetCS:Found,P="<<pMom<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
125#endif
126 return 0.; // Energy is below the Threshold value
127 }
128 lastP =colP [i]; // Last Momentum (A-dependent)
129 lastCS =colCS[i]; // Last CrossSect (A-dependent)
130 if(std::fabs(lastP-pMom)<tolerance*pMom)
131 //if(lastP==pMom) // VI do not use tolerance
132 {
133#ifdef debug
134 G4cout<<"G4QaBPNCS::GetCS:.DoNothing.P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
135#endif
136 //CalculateCrossSection(fCS,-1,j,PDG,lastZ,lastN,pMom); // Update param's only
137 return lastCS*millibarn; // Use theLastCS
138 }
139 in = true; // This is the case when the isotop is found in DB
140 // Momentum pMom is in IU ! @@ Units
141#ifdef debug
142 G4cout<<"G4QaBPNCS::G:UpdDB,P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
143#endif
144 lastCS=CalculateCrossSection(fCS,-1,j,PDG,lastZ,lastN,pMom); // read & update
145#ifdef debug
146 G4cout<<"G4QaBPNuCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
147#endif
148 if(lastCS<=0. && pMom>lastTH) // Correct the threshold (@@ No intermediate Zeros)
149 {
150#ifdef debug
151 G4cout<<"G4QaBPNuCS::GetCS: New P="<<pMom<<"(CS=0) > Threshold="<<lastTH<<G4endl;
152#endif
153 lastCS=0.;
154 lastTH=pMom;
155 }
156 break; // Go out of the LOOP
157 }
158#ifdef debug
159 G4cout<<"-->G4QaBarPNucCrossSec::GetCrosSec: pPDG="<<PDG<<", j="<<j<<", N="<<colN[i]
160 <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
161#endif
162 j++; // Increment a#0f records found in DB
163 }
164#ifdef debug
165 G4cout<<"-?-G4QaBPNCS::GeCS:R,Z="<<tgZ<<",N="<<tgN<<",in="<<in<<",j="<<j<<" ?"<<G4endl;
166#endif
167 if(!in) // This isotope has not been calculated previously
168 {
169#ifdef debug
170 G4cout<<"^^^G4QaBPCS::GetCS:CalcNewP="<<pMom<<", f="<<fCS<<", lastI="<<lastI<<G4endl;
171#endif
172 //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
173 lastCS=CalculateCrossSection(fCS,0,j,PDG,lastZ,lastN,pMom); //calculate & create
174 //if(lastCS>0.) // It means that the AMBD was initialized
175 //{
176
177 lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
178#ifdef debug
179 G4cout<<"G4QaBPNucCrossSec::GetCrossSect: NewThresh="<<lastTH<<",P="<<pMom<<G4endl;
180#endif
181 colN.push_back(tgN);
182 colZ.push_back(tgZ);
183 colP.push_back(pMom);
184 colTH.push_back(lastTH);
185 colCS.push_back(lastCS);
186#ifdef debug
187 G4cout<<"G4QaBPNCS::GetCrosSec:lCS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
188#endif
189 //} // M.K. Presence of H1 with high threshold breaks the syncronization
190#ifdef pdebug
191 G4cout<<"G4QaBPNCS::GCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
192#endif
193 return lastCS*millibarn;
194 } // End of creation of the new set of parameters
195 else
196 {
197#ifdef debug
198 G4cout<<"G4QaBarPNucCrossSect::GetCrosSect: Update lastI="<<lastI<<",j="<<j<<G4endl;
199#endif
200 colP[lastI]=pMom;
201 colCS[lastI]=lastCS;
202 }
203 } // End of parameters udate
204 else if(pMom<=lastTH)
205 {
206#ifdef debug
207 G4cout<<"G4QaBPNuCS::GetCS:CurrentP="<<pMom<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
208#endif
209 return 0.; // Momentum is below the Threshold Value -> CS=0
210 }
211 else if(std::fabs(lastP-pMom)<tolerance*pMom)
212 //else if(lastP==pMom) // VI do not use tolerance
213 {
214#ifdef debug
215 G4cout<<"G4QaBPCS::GetCS:OldNZ&P="<<lastP<<"="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
216#endif
217 return lastCS*millibarn; // Use theLastCS
218 }
219 else // It is the last used -> use the current tables
220 {
221#ifdef debug
222 G4cout<<"-!-G4QaBPCS::GeCS:UseCurP="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
223#endif
224 lastCS=CalculateCrossSection(fCS,1,j,PDG,lastZ,lastN,pMom); // Only read and UpdateDB
225 lastP=pMom;
226 }
227#ifdef debug
228 G4cout<<"==>G4QaBPCS::GetCroSec:P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
229#endif
230 return lastCS*millibarn;
231}
bool G4bool
Definition: G4Types.hh:67
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0)
static G4double tolerance

◆ GetPointer()

G4VQCrossSection * G4QAntiBaryonPlusNuclearCrossSection::GetPointer ( )
static

Definition at line 65 of file G4QAntiBaryonPlusNuclearCrossSection.cc.

66{
67 static G4QAntiBaryonPlusNuclearCrossSection theCrossSection;//Static body of CrossSection
68 return &theCrossSection;
69}

Referenced by G4QHadronInelasticDataSet::GetIsoCrossSection(), and G4QInelastic::GetMeanFreePath().


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