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

#include <G4QHyperonElasticCrossSection.hh>

+ Inheritance diagram for G4QHyperonElasticCrossSection:

Public Member Functions

 ~G4QHyperonElasticCrossSection ()
 
virtual G4double GetCrossSection (G4bool fCS, G4double pMom, G4int tgZ, G4int tgN, G4int pPDG=3122)
 
G4double CalculateCrossSection (G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N, G4double pP)
 
G4double GetSlope (G4int tZ, G4int tN, G4int pPDG)
 
G4double GetExchangeT (G4int tZ, G4int tN, G4int pPDG)
 
G4double GetHMaxT ()
 
- 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

 G4QHyperonElasticCrossSection ()
 
- 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 47 of file G4QHyperonElasticCrossSection.hh.

Constructor & Destructor Documentation

◆ G4QHyperonElasticCrossSection()

G4QHyperonElasticCrossSection::G4QHyperonElasticCrossSection ( )
protected

Definition at line 100 of file G4QHyperonElasticCrossSection.cc.

101{
102}

◆ ~G4QHyperonElasticCrossSection()

G4QHyperonElasticCrossSection::~G4QHyperonElasticCrossSection ( )

Definition at line 104 of file G4QHyperonElasticCrossSection.cc.

105{
106 std::vector<G4double*>::iterator pos;
107 for (pos=CST.begin(); pos<CST.end(); pos++)
108 { delete [] *pos; }
109 CST.clear();
110 for (pos=PAR.begin(); pos<PAR.end(); pos++)
111 { delete [] *pos; }
112 PAR.clear();
113 for (pos=SST.begin(); pos<SST.end(); pos++)
114 { delete [] *pos; }
115 SST.clear();
116 for (pos=S1T.begin(); pos<S1T.end(); pos++)
117 { delete [] *pos; }
118 S1T.clear();
119 for (pos=B1T.begin(); pos<B1T.end(); pos++)
120 { delete [] *pos; }
121 B1T.clear();
122 for (pos=S2T.begin(); pos<S2T.end(); pos++)
123 { delete [] *pos; }
124 S2T.clear();
125 for (pos=B2T.begin(); pos<B2T.end(); pos++)
126 { delete [] *pos; }
127 B2T.clear();
128 for (pos=S3T.begin(); pos<S3T.end(); pos++)
129 { delete [] *pos; }
130 S3T.clear();
131 for (pos=B3T.begin(); pos<B3T.end(); pos++)
132 { delete [] *pos; }
133 B3T.clear();
134 for (pos=S4T.begin(); pos<S4T.end(); pos++)
135 { delete [] *pos; }
136 S4T.clear();
137 for (pos=B4T.begin(); pos<B4T.end(); pos++)
138 { delete [] *pos; }
139 B4T.clear();
140}

Member Function Documentation

◆ CalculateCrossSection()

G4double G4QHyperonElasticCrossSection::CalculateCrossSection ( G4bool  CS,
G4int  F,
G4int  I,
G4int  pPDG,
G4int  Z,
G4int  N,
G4double  pP 
)
virtual

Implements G4VQCrossSection.

Definition at line 286 of file G4QHyperonElasticCrossSection.cc.

288{
289 // *** Begin of Associative Memory DB for acceleration of the cross section calculations
290 static std::vector <G4double> PIN; // Vector of max initialized log(P) in the table
291 // *** End of Static Definitions (Associative Memory Data Base) ***
292 G4double pMom=pIU/GeV; // All calculations are in GeV
293 onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
294#ifdef pdebug
295 G4cout<<"G4QHyperonElasticCS::CalcCS:->onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
296#endif
297 lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
298 if(F) // This isotope was found in AMDB =>RETRIEVE/UPDATE
299 {
300 if(F<0) // the AMDB must be loded
301 {
302 lastPIN = PIN[I]; // Max log(P) initialised for this table set
303 lastPAR = PAR[I]; // Pointer to the parameter set
304 lastCST = CST[I]; // Pointer to the total sross-section table
305 lastSST = SST[I]; // Pointer to the first squared slope
306 lastS1T = S1T[I]; // Pointer to the first mantissa
307 lastB1T = B1T[I]; // Pointer to the first slope
308 lastS2T = S2T[I]; // Pointer to the second mantissa
309 lastB2T = B2T[I]; // Pointer to the second slope
310 lastS3T = S3T[I]; // Pointer to the third mantissa
311 lastB3T = B3T[I]; // Pointer to the rhird slope
312 lastS4T = S4T[I]; // Pointer to the 4-th mantissa
313 lastB4T = B4T[I]; // Pointer to the 4-th slope
314#ifdef pdebug
315 G4cout<<"G4QHyperonElCS::CalcCS: DB's updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
316#endif
317 }
318#ifdef pdebug
319 G4cout<<"G4QHyperonElasticCS::CalcCS:*read*, LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
320#endif
321 if(lastLP>lastPIN && lastLP<lPMax)
322 {
323 lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
324#ifdef pdebug
325 G4cout<<"G4QHyElCS::CalcCS:updated(I),LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
326#endif
327 PIN[I]=lastPIN; // Remember the new P-Limit of the tables
328 }
329 }
330 else // This isotope wasn't initialized => CREATE
331 {
332 lastPAR = new G4double[nPoints]; // Allocate memory for parameters of CS function
333 lastPAR[nLast]=0; // Initialization for VALGRIND
334 lastCST = new G4double[nPoints]; // Allocate memory for Tabulated CS function
335 lastSST = new G4double[nPoints]; // Allocate memory for Tabulated first sqaredSlope
336 lastS1T = new G4double[nPoints]; // Allocate memory for Tabulated first mantissa
337 lastB1T = new G4double[nPoints]; // Allocate memory for Tabulated first slope
338 lastS2T = new G4double[nPoints]; // Allocate memory for Tabulated second mantissa
339 lastB2T = new G4double[nPoints]; // Allocate memory for Tabulated second slope
340 lastS3T = new G4double[nPoints]; // Allocate memory for Tabulated third mantissa
341 lastB3T = new G4double[nPoints]; // Allocate memory for Tabulated third slope
342 lastS4T = new G4double[nPoints]; // Allocate memory for Tabulated 4-th mantissa
343 lastB4T = new G4double[nPoints]; // Allocate memory for Tabulated 4-th slope
344#ifdef pdebug
345 G4cout<<"G4QHyperonElasticCrosS::CalcCS:*ini*,lastLP="<<lastLP<<",min="<<lPMin<<G4endl;
346#endif
347 lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
348#ifdef pdebug
349 G4cout<<"G4QHypElCS::CCS:i, Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
350#endif
351 PIN.push_back(lastPIN); // Fill parameters of CS function to AMDB
352 PAR.push_back(lastPAR); // Fill parameters of CS function to AMDB
353 CST.push_back(lastCST); // Fill Tabulated CS function to AMDB
354 SST.push_back(lastSST); // Fill Tabulated first sq.slope to AMDB
355 S1T.push_back(lastS1T); // Fill Tabulated first mantissa to AMDB
356 B1T.push_back(lastB1T); // Fill Tabulated first slope to AMDB
357 S2T.push_back(lastS2T); // Fill Tabulated second mantissa to AMDB
358 B2T.push_back(lastB2T); // Fill Tabulated second slope to AMDB
359 S3T.push_back(lastS3T); // Fill Tabulated third mantissa to AMDB
360 B3T.push_back(lastB3T); // Fill Tabulated third slope to AMDB
361 S4T.push_back(lastS4T); // Fill Tabulated 4-th mantissa to AMDB
362 B4T.push_back(lastB4T); // Fill Tabulated 4-th slope to AMDB
363 } // End of creation/update of the new set of parameters and tables
364 // =-----------= NOW Update (if necessary) and Calculate the Cross Section =-----------=
365#ifdef pdebug
366 G4cout<<"G4QHypElCS::CalCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
367#endif
368 if(lastLP>lastPIN && lastLP<lPMax)
369 {
370 lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
371#ifdef pdebug
372 G4cout<<"G4QHyperionElCS::CalcCS:*updated(O)*, LP="<<lastLP<<" < IN="<<lastPIN<<G4endl;
373#endif
374 }
375#ifdef pdebug
376 G4cout<<"G4QHypElCS::CalcCS: lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
377#endif
378 if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
379#ifdef pdebug
380 G4cout<<"G4QHyperElCrosSec::CalcCS:oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
381#endif
382 if(lastLP>lPMin && lastLP<=lastPIN) // Linear fit is made using precalculated tables
383 {
384 if(lastLP==lastPIN)
385 {
386 G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
387 G4int blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
388 if(blast<0 || blast>=nLast)G4cout<<"G4QHyperElCS::CCS:b="<<blast<<","<<nLast<<G4endl;
389 lastSIG = lastCST[blast];
390 if(!onlyCS) // Skip the differential cross-section parameters
391 {
392 theSS = lastSST[blast];
393 theS1 = lastS1T[blast];
394 theB1 = lastB1T[blast];
395 theS2 = lastS2T[blast];
396 theB2 = lastB2T[blast];
397 theS3 = lastS3T[blast];
398 theB3 = lastB3T[blast];
399 theS4 = lastS4T[blast];
400 theB4 = lastB4T[blast];
401 }
402#ifdef pdebug
403 G4cout<<"G4QHyperonElasticCS::CalculateCS:(E) S1="<<theS1<<", B1="<<theB1<<G4endl;
404#endif
405 }
406 else
407 {
408 G4double shift=(lastLP-lPMin)/dlnP; // a shift from the beginning of the table
409 G4int blast=static_cast<int>(shift); // the lower bin number
410 if(blast<0) blast=0;
411 if(blast>=nLast) blast=nLast-1; // low edge of the last bin
412 shift-=blast; // step inside the unit bin
413 G4int lastL=blast+1; // the upper bin number
414 G4double SIGL=lastCST[blast]; // the basic value of the cross-section
415 lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
416#ifdef pdebug
417 G4cout<<"G4QHyperonElasticCrossSection::CalcCrossSection:Sig="<<lastSIG<<",P="
418 <<pMom<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",onlyCS="<<onlyCS<<G4endl;
419#endif
420 if(!onlyCS) // Skip the differential cross-section parameters
421 {
422 G4double SSTL=lastSST[blast]; // the low bin of the first squared slope
423 theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
424 G4double S1TL=lastS1T[blast]; // the low bin of the first mantissa
425 theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
426 G4double B1TL=lastB1T[blast]; // the low bin of the first slope
427#ifdef pdebug
428 G4cout<<"G4QHyperonElasticCS::CalcCrossSection:b="<<blast<<",ls="<<lastL<<",SL="
429 <<S1TL<<",SU="<<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
430#endif
431 theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
432 G4double S2TL=lastS2T[blast]; // the low bin of the second mantissa
433 theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
434 G4double B2TL=lastB2T[blast]; // the low bin of the second slope
435 theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
436 G4double S3TL=lastS3T[blast]; // the low bin of the third mantissa
437 theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
438#ifdef pdebug
439 G4cout<<"G4QHyperonElasticCrossSection::CCS:s3l="<<S3TL<<",sh3="<<shift<<",s3h="
440 <<lastS3T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
441#endif
442 G4double B3TL=lastB3T[blast]; // the low bin of the third slope
443 theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
444 G4double S4TL=lastS4T[blast]; // the low bin of the 4-th mantissa
445 theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
446#ifdef pdebug
447 G4cout<<"G4QHyperonElasticCrossSection::CCS:s4l="<<S4TL<<",sh4="<<shift<<",s4h="
448 <<lastS4T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
449#endif
450 G4double B4TL=lastB4T[blast]; // the low bin of the 4-th slope
451 theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
452 }
453#ifdef pdebug
454 G4cout<<"G4QHyperonElasticCS::CalculateCS:(I) S1="<<theS1<<", B1="<<theB1<<G4endl;
455#endif
456 }
457 }
458 else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
459 if(lastSIG<0.) lastSIG = 0.; // @@ a Warning print can be added
460#ifdef pdebug
461 G4cout<<"G4QHyperonElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
462#endif
463 return lastSIG;
464}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by GetCrossSection().

◆ GetCrossSection()

G4double G4QHyperonElasticCrossSection::GetCrossSection ( G4bool  fCS,
G4double  pMom,
G4int  tgZ,
G4int  tgN,
G4int  pPDG = 3122 
)
virtual

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

Reimplemented from G4VQCrossSection.

Definition at line 151 of file G4QHyperonElasticCrossSection.cc.

153{
154 static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
155 static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
156 static std::vector <G4double> colP; // Vector of last momenta for the reaction
157 static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
158 static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
159 // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
160 G4double pEn=pMom;
161 onlyCS=fCS;
162#ifdef pdebug
163 G4cout<<"G4QHyperElCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
164 <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
165 //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
166#endif
167 if(pPDG==3222 || pPDG<3000 || pPDG>3334)
168 {
169 G4cout<<"*Warning*G4QHyperonElaCS::GetCS:**> Found pPDG="<<pPDG<<" =--=> CS=0"<<G4endl;
170 //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
171 return 0.; // projectile PDG=0 is a mistake (?!) @@
172 }
173 G4bool in=false; // By default the isotope must be found in the AMDB
174 lastP = 0.; // New momentum history (nothing to compare with)
175 lastN = tgN; // The last N of the calculated nucleus
176 lastZ = tgZ; // The last Z of the calculated nucleus
177 lastI = colN.size(); // Size of the Associative Memory DB in the heap
178 if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
179 { // The nucleus with projPDG is found in AMDB
180 if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
181 {
182 lastI=i;
183 lastTH =colTH[i]; // Last THreshold (A-dependent)
184#ifdef pdebug
185 G4cout<<"G4QHyElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
186 //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
187#endif
188 if(pEn<=lastTH)
189 {
190#ifdef pdebug
191 G4cout<<"G4QHyElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
192 //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
193#endif
194 return 0.; // Energy is below the Threshold value
195 }
196 lastP =colP [i]; // Last Momentum (A-dependent)
197 lastCS =colCS[i]; // Last CrossSect (A-dependent)
198 // if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
199 if(lastP == pMom) // Do not recalculate
200 {
201#ifdef pdebug
202 G4cout<<"G4QHyperonElasticCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
203#endif
204 CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
205 return lastCS*millibarn; // Use theLastCS
206 }
207 in = true; // This is the case when the isotop is found in DB
208 // Momentum pMom is in IU ! @@ Units
209#ifdef pdebug
210 G4cout<<"G4QHyElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
211#endif
212 lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
213#ifdef pdebug
214 G4cout<<"G4QHyperElCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
215 //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
216#endif
217 if(lastCS<=0. && pEn>lastTH) // Correct the threshold
218 {
219#ifdef pdebug
220 G4cout<<"G4QHyperonElCS::GetCS: NewT="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
221#endif
222 lastTH=pEn;
223 }
224 break; // Go out of the LOOP with found lastI
225 }
226#ifdef pdebug
227 G4cout<<"---G4QHyperonElCrossSection::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="<<colN[i]
228 <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
229 //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
230#endif
231 } // End of attampt to find the nucleus in DB
232 if(!in) // This nucleus has not been calculated previously
233 {
234#ifdef pdebug
235 G4cout<<"G4QHyElCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
236#endif
237 //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
238 lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
239 if(lastCS<=0.)
240 {
241 lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
242#ifdef pdebug
243 G4cout<<"G4QHyperonElasticCrossSection::GetCS:NewThres="<<lastTH<<",T="<<pEn<<G4endl;
244#endif
245 if(pEn>lastTH)
246 {
247#ifdef pdebug
248 G4cout<<"G4QHyperonElCS::GetCS:1st T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
249#endif
250 lastTH=pEn;
251 }
252 }
253#ifdef pdebug
254 G4cout<<"G4QHyElCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
255 //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
256#endif
257 colN.push_back(tgN);
258 colZ.push_back(tgZ);
259 colP.push_back(pMom);
260 colTH.push_back(lastTH);
261 colCS.push_back(lastCS);
262#ifdef pdebug
263 G4cout<<"G4QHyElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
264 //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
265#endif
266 return lastCS*millibarn;
267 } // End of creation of the new set of parameters
268 else
269 {
270#ifdef pdebug
271 G4cout<<"G4QHyperonElasticCrossSection::GetCS: Update lastI="<<lastI<<G4endl;
272#endif
273 colP[lastI]=pMom;
274 colCS[lastI]=lastCS;
275 }
276#ifdef pdebug
277 G4cout<<"G4QHyElCS::GetCSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
278 //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
279 G4cout<<"G4QHyperonElasticCrossSection::GetCrosSec:***End***,onlyCS="<<onlyCS<<G4endl;
280#endif
281 return lastCS*millibarn;
282}
bool G4bool
Definition: G4Types.hh:67
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N, G4double pP)
virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0)

◆ GetExchangeT()

G4double G4QHyperonElasticCrossSection::GetExchangeT ( G4int  tZ,
G4int  tN,
G4int  pPDG 
)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 732 of file G4QHyperonElasticCrossSection.cc.

733{
734 static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
735 static const G4double third=1./3.;
736 static const G4double fifth=1./5.;
737 static const G4double sevth=1./7.;
738#ifdef tdebug
739 G4cout<<"G4QHyperElCS::GetExcT:F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
740#endif
741 if(PDG==3222 || PDG<3000 || PDG>3334)G4cout<<"*Warning*G4QHyElCS::GET:PDG="<<PDG<<G4endl;
742 if(onlyCS)G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExchanT: onlyCS=1"<<G4endl;
743 if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
744 G4double q2=0.;
745 if(tgZ==1 && tgN==0) // ===> p+p=p+p
746 {
747#ifdef tdebug
748 G4cout<<"G4QHyperElCS::GetExchangeT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
749 <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
750#endif
751 G4double E1=lastTM*theB1;
752 G4double R1=(1.-std::exp(-E1));
753#ifdef tdebug
754 G4double ts1=-std::log(1.-R1)/theB1;
755 G4double ds1=std::fabs(ts1-lastTM)/lastTM;
756 if(ds1>.0001)
757 G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:1p "<<ts1<<"#"<<lastTM
758 <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
759#endif
760 G4double E2=lastTM*theB2;
761 G4double R2=(1.-std::exp(-E2*E2*E2));
762#ifdef tdebug
763 G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
764 G4double ds2=std::fabs(ts2-lastTM)/lastTM;
765 if(ds2>.0001)
766 G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:2p "<<ts2<<"#"<<lastTM
767 <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
768#endif
769 G4double E3=lastTM*theB3;
770 G4double R3=(1.-std::exp(-E3));
771#ifdef tdebug
772 G4double ts3=-std::log(1.-R3)/theB3;
773 G4double ds3=std::fabs(ts3-lastTM)/lastTM;
774 if(ds3>.0001)
775 G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:3p "<<ts3<<"#"<<lastTM
776 <<",d="<<ds3<<",R3="<<R1<<",E3="<<E3<<G4endl;
777#endif
778 G4double I1=R1*theS1/theB1;
779 G4double I2=R2*theS2;
780 G4double I3=R3*theS3;
781 G4double I12=I1+I2;
782 G4double rand=(I12+I3)*G4UniformRand();
783 if (rand<I1 )
784 {
785 G4double ran=R1*G4UniformRand();
786 if(ran>1.) ran=1.;
787 q2=-std::log(1.-ran)/theB1;
788 }
789 else if(rand<I12)
790 {
791 G4double ran=R2*G4UniformRand();
792 if(ran>1.) ran=1.;
793 q2=-std::log(1.-ran);
794 if(q2<0.) q2=0.;
795 q2=std::pow(q2,third)/theB2;
796 }
797 else
798 {
799 G4double ran=R3*G4UniformRand();
800 if(ran>1.) ran=1.;
801 q2=-std::log(1.-ran)/theB3;
802 }
803 }
804 else
805 {
806 G4double a=tgZ+tgN;
807#ifdef tdebug
808 G4cout<<"G4QHyperonElasticCrossSection::GetExT:a="<<a<<",t="<<lastTM<<",S1="<<theS1
809 <<",B1="<<theB1<<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3
810 <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
811#endif
812 G4double E1=lastTM*(theB1+lastTM*theSS);
813 G4double R1=(1.-std::exp(-E1));
814 G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
815#ifdef tdebug
816 G4double ts1=-std::log(1.-R1)/theB1;
817 if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
818 G4double ds1=(ts1-lastTM)/lastTM;
819 if(ds1>.0001)
820 G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:1a "<<ts1<<"#"<<lastTM
821 <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
822#endif
823 G4double tm2=lastTM*lastTM;
824 G4double E2=lastTM*tm2*theB2; // power 3 for lowA, 5 for HighA (1st)
825 if(a>6.5)E2*=tm2; // for heavy nuclei
826 G4double R2=(1.-std::exp(-E2));
827#ifdef tdebug
828 G4double ts2=-std::log(1.-R2)/theB2;
829 if(a<6.5)ts2=std::pow(ts2,third);
830 else ts2=std::pow(ts2,fifth);
831 G4double ds2=std::fabs(ts2-lastTM)/lastTM;
832 if(ds2>.0001)
833 G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:2a "<<ts2<<"#"<<lastTM
834 <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
835#endif
836 G4double E3=lastTM*theB3;
837 if(a>6.5)E3*=tm2*tm2*tm2; // power 1 for lowA, 7 (2nd) for HighA
838 G4double R3=(1.-std::exp(-E3));
839#ifdef tdebug
840 G4double ts3=-std::log(1.-R3)/theB3;
841 if(a>6.5)ts3=std::pow(ts3,sevth);
842 G4double ds3=std::fabs(ts3-lastTM)/lastTM;
843 if(ds3>.0001)
844 G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:3a "<<ts3<<"#"<<lastTM
845 <<",d="<<ds3<<",R3="<<R3<<",E3="<<E3<<G4endl;
846#endif
847 G4double E4=lastTM*theB4;
848 G4double R4=(1.-std::exp(-E4));
849#ifdef tdebug
850 G4double ts4=-std::log(1.-R4)/theB4;
851 G4double ds4=std::fabs(ts4-lastTM)/lastTM;
852 if(ds4>.0001)
853 G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:4a "<<ts4<<"#"<<lastTM
854 <<",d="<<ds4<<",R4="<<R4<<",E4="<<E4<<G4endl;
855#endif
856 G4double I1=R1*theS1;
857 G4double I2=R2*theS2;
858 G4double I3=R3*theS3;
859 G4double I4=R4*theS4;
860 G4double I12=I1+I2;
861 G4double I13=I12+I3;
862 G4double rand=(I13+I4)*G4UniformRand();
863#ifdef tdebug
864 G4cout<<"G4QHyElCS::GExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
865#endif
866 if(rand<I1)
867 {
868 G4double ran=R1*G4UniformRand();
869 if(ran>1.) ran=1.;
870 q2=-std::log(1.-ran)/theB1;
871 if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
872#ifdef tdebug
873 G4cout<<"G4QHyElCS::GExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
874#endif
875 }
876 else if(rand<I12)
877 {
878 G4double ran=R2*G4UniformRand();
879 if(ran>1.) ran=1.;
880 q2=-std::log(1.-ran)/theB2;
881 if(q2<0.) q2=0.;
882 if(a<6.5) q2=std::pow(q2,third);
883 else q2=std::pow(q2,fifth);
884#ifdef tdebug
885 G4cout<<"G4QHyElCS::GetExT: Q2="<<q2<<",r2="<<R2<<",b2="<<theB2<<",t2="<<ts2<<G4endl;
886#endif
887 }
888 else if(rand<I13)
889 {
890 G4double ran=R3*G4UniformRand();
891 if(ran>1.) ran=1.;
892 q2=-std::log(1.-ran)/theB3;
893 if(q2<0.) q2=0.;
894 if(a>6.5) q2=std::pow(q2,sevth);
895#ifdef tdebug
896 G4cout<<"G4QHyElCS::GetExT: Q2="<<q2<<",r3="<<R2<<",b3="<<theB2<<",t3="<<ts2<<G4endl;
897#endif
898 }
899 else
900 {
901 G4double ran=R4*G4UniformRand();
902 if(ran>1.) ran=1.;
903 q2=-std::log(1.-ran)/theB4;
904 if(a<6.5) q2=lastTM-q2; // u reduced for lightA (starts from 0)
905#ifdef tdebug
906 G4cout<<"G4QHyElCS::GExT:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
907#endif
908 }
909 }
910 if(q2<0.) q2=0.;
911 if(!(q2>=-1.||q2<=1.))G4cout<<"*NAN*G4QHyElasticCrossSect::GetExchangeT:-t="<<q2<<G4endl;
912 if(q2>lastTM)
913 {
914#ifdef tdebug
915 G4cout<<"*Warning*G4QHyperonElasticCrossSection::GExT: -t="<<q2<<" > "<<lastTM<<G4endl;
916#endif
917 q2=lastTM;
918 }
919 return q2*GeVSQ;
920}
#define G4UniformRand()
Definition: Randomize.hh:53

◆ GetHMaxT()

G4double G4QHyperonElasticCrossSection::GetHMaxT ( )
virtual

Reimplemented from G4VQCrossSection.

Definition at line 948 of file G4QHyperonElasticCrossSection.cc.

949{
950 static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
951 return lastTM*HGeVSQ;
952}

◆ GetPointer()

G4VQCrossSection * G4QHyperonElasticCrossSection::GetPointer ( )
static

Definition at line 143 of file G4QHyperonElasticCrossSection.cc.

144{
145 static G4QHyperonElasticCrossSection theCrossSection;//StaticBody ofTheQElCrossSection
146 return &theCrossSection;
147}

Referenced by G4QHadronElasticDataSet::GetIsoCrossSection(), G4QElastic::GetMeanFreePath(), and G4QElastic::PostStepDoIt().

◆ GetSlope()

G4double G4QHyperonElasticCrossSection::GetSlope ( G4int  tZ,
G4int  tN,
G4int  pPDG 
)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 923 of file G4QHyperonElasticCrossSection.cc.

924{
925 static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
926#ifdef tdebug
927 G4cout<<"G4QHyperElCS::GetSlope:"<<onlyCS<<", Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
928#endif
929 if(onlyCS)G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetSlope: onlCS=true"<<G4endl;
930 if(lastLP<-4.3) return 0.; // S-wave for p<14 MeV/c (kinE<.1MeV)
931 if(PDG==3222 || PDG<3000 || PDG>3334)
932 {
933 // G4cout<<"*Error*G4QHyperonElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
934 // <<", N="<<tgN<<", while it is defined only for Hyperons"<<G4endl;
935 // throw G4QException("G4QHyperonElasticCrossSection::GetSlope: HypA are implemented");
937 ed << "PDG = " << PDG << ", Z = " << tgZ << ", N = " << tgN
938 << ", while it is defined only for Hyperons" << G4endl;
939 G4Exception("G4QHyperonElasticCrossSection::GetSlope()", "HAD_CHPS_0000",
940 FatalException, ed);
941 }
942 if(theB1<0.) theB1=0.;
943 if(!(theB1>=-1.||theB1<=1.)) G4cout<<"*NAN*G4QHyElasticCrossS::Getslope:"<<theB1<<G4endl;
944 return theB1/GeVSQ;
945}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76

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