Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
G4SandiaTable Class Reference

#include <G4SandiaTable.hh>

Public Member Functions

 G4SandiaTable ()
 
 G4SandiaTable (__void__ &)
 
 G4SandiaTable (const G4Material *)
 
 G4SandiaTable (G4int matIndex)
 
 G4SandiaTable (G4SandiaTable &)=delete
 
G4bool GetLowerI1 ()
 
G4int GetMatNbOfIntervals () const
 
G4int GetMaxInterval () const
 
G4double GetPhotoAbsorpCof (G4int i, G4int j) const
 
const G4doubleGetSandiaCofForMaterial (G4double energy) const
 
G4double GetSandiaCofForMaterial (G4int, G4int) const
 
const G4doubleGetSandiaCofForMaterialPAI (G4double energy) const
 
void GetSandiaCofPerAtom (G4int Z, G4double energy, std::vector< G4double > &coeff) const
 
void GetSandiaCofWater (G4double energy, std::vector< G4double > &coeff) const
 
G4double GetSandiaMatTable (G4int, G4int) const
 
G4double GetSandiaMatTablePAI (G4int, G4int) const
 
G4double GetWaterCofForMaterial (G4int, G4int) const
 
G4double GetWaterEnergyLimit () const
 
void Initialize (const G4Material *)
 
G4bool operator!= (const G4SandiaTable &) const =delete
 
G4SandiaTableoperator= (const G4SandiaTable &right)=delete
 
G4bool operator== (const G4SandiaTable &) const =delete
 
G4int SandiaIntervals (G4int Z[], G4int el)
 
G4int SandiaMixing (G4int Z[], const G4double *fractionW, G4int el, G4int mi)
 
void SetLowerI1 (G4bool flag)
 
void SetVerbose (G4int ver)
 
 ~G4SandiaTable ()
 

Static Public Member Functions

static G4double GetZtoA (G4int Z)
 

Private Member Functions

void ComputeMatSandiaMatrix ()
 
void ComputeMatSandiaMatrixPAI ()
 
void ComputeMatTable ()
 
G4double ** GetPointerToCof ()
 
G4double GetSandiaPerAtom (G4int Z, G4int, G4int) const
 
void SandiaSort (G4double **da, G4int sz)
 
void SandiaSwap (G4double **da, G4int i, G4int j)
 

Private Attributes

G4bool fLowerI1
 
const G4MaterialfMaterial
 
G4int fMatNbOfIntervals
 
G4OrderedTablefMatSandiaMatrix
 
G4OrderedTablefMatSandiaMatrixPAI
 
G4int fMaxInterval
 
G4double ** fPhotoAbsorptionCof
 
std::vector< G4doublefSandiaCofPerAtom
 
G4int fVerbose
 

Static Private Attributes

static G4int fCumulInterval [101] = {0}
 
static const G4int fH2OlowerInt = 23
 
static const G4int fIntervalLimit = 100
 
static const G4int fNumberOfElements = 100
 
static const G4int fNumberOfIntervals = 980
 
static const G4double fSandiaTable [981][5]
 
static const G4double funitc [5]
 

Detailed Description

Definition at line 63 of file G4SandiaTable.hh.

Constructor & Destructor Documentation

◆ G4SandiaTable() [1/5]

G4SandiaTable::G4SandiaTable ( const G4Material material)

Definition at line 65 of file G4SandiaTable.cc.

67{
68 fMatSandiaMatrix = nullptr;
69 fMatSandiaMatrixPAI = nullptr;
70 fPhotoAbsorptionCof = nullptr;
71
73
74 fMaxInterval = 0;
75 fVerbose = 0;
76
77 //build the CumulInterval array
78 if(0 == fCumulInterval[0]) {
79 fCumulInterval[0] = 1;
80
81 for (G4int Z=1; Z<101; ++Z) {
83 }
84 }
85
86 fMaxInterval = 0;
87 fSandiaCofPerAtom.resize(4,0.0);
88 fLowerI1 = false;
89 //compute macroscopic Sandia coefs for a material
91}
static const G4int fNbOfIntervals[101]
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
G4int fMatNbOfIntervals
void ComputeMatSandiaMatrix()
G4OrderedTable * fMatSandiaMatrix
static G4int fCumulInterval[101]
const G4Material * fMaterial
G4double ** fPhotoAbsorptionCof
G4OrderedTable * fMatSandiaMatrixPAI
std::vector< G4double > fSandiaCofPerAtom
string material
Definition: eplot.py:19

References ComputeMatSandiaMatrix(), fCumulInterval, fLowerI1, fMatNbOfIntervals, fMatSandiaMatrix, fMatSandiaMatrixPAI, fMaxInterval, fNbOfIntervals, fPhotoAbsorptionCof, fSandiaCofPerAtom, fVerbose, and Z.

◆ ~G4SandiaTable()

G4SandiaTable::~G4SandiaTable ( )

Definition at line 111 of file G4SandiaTable.cc.

112{
114 {
116 delete fMatSandiaMatrix;
117 }
119 {
121 delete fMatSandiaMatrixPAI;
122 }
124 {
125 delete [] fPhotoAbsorptionCof;
126 }
127}
void clearAndDestroy()

References G4OrderedTable::clearAndDestroy(), fMatSandiaMatrix, fMatSandiaMatrixPAI, and fPhotoAbsorptionCof.

◆ G4SandiaTable() [2/5]

G4SandiaTable::G4SandiaTable ( __void__ &  )

Definition at line 98 of file G4SandiaTable.cc.

99 : fMaterial(nullptr),fMatSandiaMatrix(nullptr),
101{
102 fMaxInterval = 0;
104 fLowerI1 = false;
105 fVerbose = 0;
106 fSandiaCofPerAtom.resize(4,0.0);
107}

References fLowerI1, fMatNbOfIntervals, fMaxInterval, fSandiaCofPerAtom, and fVerbose.

◆ G4SandiaTable() [3/5]

G4SandiaTable::G4SandiaTable ( G4int  matIndex)

Definition at line 658 of file G4SandiaTable.cc.

659{
660 fMaterial = nullptr;
662 fMatSandiaMatrix = 0;
665
666 fMaxInterval = 0;
667 fVerbose = 0;
668 fLowerI1 = false;
669
670 fSandiaCofPerAtom.resize(4,0.0);
671
672 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
674
675 if ( matIndex >= 0 && matIndex < numberOfMat)
676 {
677 fMaterial = (*theMaterialTable)[matIndex];
678 }
679 else
680 {
681 G4Exception("G4SandiaTable::G4SandiaTable(G4int matIndex)", "mat401",
682 FatalException, "wrong matIndex");
683 }
684}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::vector< G4Material * > G4MaterialTable
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:679
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:672

References FatalException, fLowerI1, fMaterial, fMatNbOfIntervals, fMatSandiaMatrix, fMatSandiaMatrixPAI, fMaxInterval, fPhotoAbsorptionCof, fSandiaCofPerAtom, fVerbose, G4Exception(), G4Material::GetMaterialTable(), and G4Material::GetNumberOfMaterials().

◆ G4SandiaTable() [4/5]

G4SandiaTable::G4SandiaTable ( )

Definition at line 688 of file G4SandiaTable.cc.

689{
690 fMaterial = nullptr;
692 fMatSandiaMatrix = 0;
695
696 fMaxInterval = 0;
697 fVerbose = 0;
698 fLowerI1 = false;
699
700 fSandiaCofPerAtom.resize(4,0.0);
701}

References fLowerI1, fMaterial, fMatNbOfIntervals, fMatSandiaMatrix, fMatSandiaMatrixPAI, fMaxInterval, fPhotoAbsorptionCof, fSandiaCofPerAtom, and fVerbose.

◆ G4SandiaTable() [5/5]

G4SandiaTable::G4SandiaTable ( G4SandiaTable )
delete

Member Function Documentation

◆ ComputeMatSandiaMatrix()

void G4SandiaTable::ComputeMatSandiaMatrix ( )
private

Definition at line 246 of file G4SandiaTable.cc.

247{
248 //get list of elements
249 const G4int NbElm = fMaterial->GetNumberOfElements();
250 const G4ElementVector* ElementVector = fMaterial->GetElementVector();
251
252 G4int* Z = new G4int[NbElm]; //Atomic number
253
254 //determine the maximum number of energy-intervals for this material
255 G4int MaxIntervals = 0;
256 G4int elm, z;
257
258 // here we compute only for a mixture, so no waring or exception
259 // if z is out of validity interval
260 for (elm = 0; elm < NbElm; ++elm)
261 {
262 z = G4lrint((*ElementVector)[elm]->GetZ());
263 if(z < 1) { z = 1; }
264 else if(z > 100) { z = 100; }
265 Z[elm] = z;
266 MaxIntervals += fNbOfIntervals[z];
267 }
268
269 //copy the Energy bins in a tmp1 array
270 //(take care of the Ionization Potential of each element)
271 G4double* tmp1 = new G4double[MaxIntervals];
272 G4double IonizationPot;
273 G4int interval1 = 0;
274
275 for (elm = 0; elm < NbElm; ++elm)
276 {
277 z = Z[elm];
278 IonizationPot = fIonizationPotentials[z]*CLHEP::eV;
279 for(G4int row = fCumulInterval[z-1]; row<fCumulInterval[z]; ++row)
280 {
281 tmp1[interval1] = std::max(fSandiaTable[row][0]*CLHEP::keV,
282 IonizationPot);
283 ++interval1;
284 }
285 }
286 //sort the energies in strickly increasing values in a tmp2 array
287 //(eliminate redondances)
288
289 G4double* tmp2 = new G4double[MaxIntervals];
291 G4int interval2 = 0;
292
293 do
294 {
295 Emin = DBL_MAX;
296
297 for ( G4int i1 = 0; i1 < MaxIntervals; ++i1)
298 {
299 Emin = std::min(Emin, tmp1[i1]); //find the minimum
300 }
301 if (Emin < DBL_MAX) {
302 tmp2[interval2] = Emin;
303 ++interval2;
304 }
305 //copy Emin in tmp2
306 for ( G4int j1 = 0; j1 < MaxIntervals; ++j1)
307 {
308 if (tmp1[j1] <= Emin) { tmp1[j1] = DBL_MAX; } //eliminate from tmp1
309 }
310 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
311 } while (Emin < DBL_MAX);
312
313 //create the sandia matrix for this material
314
316 G4int interval;
317
318 for (interval = 0; interval < interval2; ++interval)
319 {
320 fMatSandiaMatrix->push_back( new G4DataVector(5,0.) );
321 }
322
323 //ready to compute the Sandia coefs for the material
324
325 const G4double* NbOfAtomsPerVolume = fMaterial->GetVecNbOfAtomsPerVolume();
326
327 static const G4double prec = 1.e-03*CLHEP::eV;
328 G4double coef, oldsum(0.), newsum(0.);
330
331 for ( interval = 0; interval < interval2; ++interval)
332 {
333 Emin = (*(*fMatSandiaMatrix)[fMatNbOfIntervals])[0] = tmp2[interval];
334
335 for ( G4int k = 1; k < 5; ++k ) {
336 (*(*fMatSandiaMatrix)[fMatNbOfIntervals])[k] = 0.;
337 }
338 newsum = 0.;
339
340 for ( elm = 0; elm < NbElm; elm++ )
341 {
343
344 for ( G4int j = 1; j < 5; ++j )
345 {
346 coef = NbOfAtomsPerVolume[elm]*fSandiaCofPerAtom[j-1];
347 (*(*fMatSandiaMatrix)[fMatNbOfIntervals])[j] += coef;
348 newsum += std::abs(coef);
349 }
350 }
351 //check for null or redondant intervals
352
353 if (newsum != oldsum) { oldsum = newsum; ++fMatNbOfIntervals;}
354 }
355 delete [] Z;
356 delete [] tmp1;
357 delete [] tmp2;
358
359 if ( fVerbose > 0 )
360 {
361 G4cout<<"G4SandiaTable::ComputeMatSandiaMatrix(), mat = "
363
364 for( G4int i = 0; i < fMatNbOfIntervals; ++i)
365 {
366 G4cout<<i<<"\t"<<GetSandiaCofForMaterial(i,0)/keV<<" keV \t"
368 <<"\t"<< GetSandiaCofForMaterial(i,2)
369 <<"\t"<< GetSandiaCofForMaterial(i,3)
370 <<"\t"<< GetSandiaCofForMaterial(i,4)<<G4endl;
371 }
372 }
373}
std::vector< const G4Element * > G4ElementVector
static const G4double Emin
static constexpr double keV
Definition: G4SIunits.hh:202
static const G4double fIonizationPotentials[101]
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:186
size_t GetNumberOfElements() const
Definition: G4Material.hh:182
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:202
const G4String & GetName() const
Definition: G4Material.hh:173
G4double GetSandiaCofForMaterial(G4int, G4int) const
static const G4double fSandiaTable[981][5]
void GetSandiaCofPerAtom(G4int Z, G4double energy, std::vector< G4double > &coeff) const
static const double prec
Definition: RanecuEngine.cc:61
static constexpr double keV
static constexpr double eV
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
int G4lrint(double ad)
Definition: templates.hh:134
#define DBL_MAX
Definition: templates.hh:62

References DBL_MAX, Emin, CLHEP::eV, fCumulInterval, fIonizationPotentials, fMaterial, fMatNbOfIntervals, fMatSandiaMatrix, fNbOfIntervals, fSandiaCofPerAtom, fSandiaTable, fVerbose, G4cout, G4endl, G4lrint(), G4Material::GetElementVector(), G4Material::GetName(), G4Material::GetNumberOfElements(), GetSandiaCofForMaterial(), GetSandiaCofPerAtom(), G4Material::GetVecNbOfAtomsPerVolume(), CLHEP::keV, keV, G4INCL::Math::max(), G4INCL::Math::min(), CLHEP::prec, and Z.

Referenced by G4SandiaTable().

◆ ComputeMatSandiaMatrixPAI()

void G4SandiaTable::ComputeMatSandiaMatrixPAI ( )
private

Definition at line 379 of file G4SandiaTable.cc.

380{
381 G4int MaxIntervals = 0;
382 G4int elm, c, i, j, jj, k, k1, k2, c1, n1, z;
383
384 const G4int noElm = fMaterial->GetNumberOfElements();
385 const G4ElementVector* ElementVector = fMaterial->GetElementVector();
386
387 std::vector<G4int> Z(noElm); //Atomic number
388
389 for ( elm = 0; elm < noElm; elm++ )
390 {
391 z = G4lrint((*ElementVector)[elm]->GetZ());
392 if(z < 1) { z = 1; }
393 else if(z > 100) { z = 100; }
394 Z[elm] = z;
395 MaxIntervals += fNbOfIntervals[Z[elm]];
396 }
397 fMaxInterval = MaxIntervals + 2;
398
399 if ( fVerbose > 0 )
400 {
401 G4cout<<"G4SandiaTable::ComputeMatSandiaMatrixPAI: fMaxInterval = "
403 }
404
405 G4DataVector fPhotoAbsorptionCof0(fMaxInterval);
406 G4DataVector fPhotoAbsorptionCof1(fMaxInterval);
407 G4DataVector fPhotoAbsorptionCof2(fMaxInterval);
408 G4DataVector fPhotoAbsorptionCof3(fMaxInterval);
409 G4DataVector fPhotoAbsorptionCof4(fMaxInterval);
410
411 for( c = 0; c < fMaxInterval; ++c ) // just in case
412 {
413 fPhotoAbsorptionCof0[c] = 0.;
414 fPhotoAbsorptionCof1[c] = 0.;
415 fPhotoAbsorptionCof2[c] = 0.;
416 fPhotoAbsorptionCof3[c] = 0.;
417 fPhotoAbsorptionCof4[c] = 0.;
418 }
419 c = 1;
420
421 for(i = 0; i < noElm; ++i)
422 {
423 G4double I1 = fIonizationPotentials[Z[i]]*CLHEP::keV; // I1 in keV
424 n1 = 1;
425
426 for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
427
428 G4int n2 = n1 + fNbOfIntervals[Z[i]];
429
430 for( k1 = n1; k1 < n2; k1++ )
431 {
432 if( I1 > fSandiaTable[k1][0] )
433 {
434 continue; // no ionization for energies smaller than I1 (first
435 } // ionisation potential)
436 break;
437 }
438 G4int flag = 0;
439
440 for( c1 = 1; c1 < c; c1++ )
441 {
442 if( fPhotoAbsorptionCof0[c1] == I1 ) // this value already has existed
443 {
444 flag = 1;
445 break;
446 }
447 }
448 if(flag == 0)
449 {
450 fPhotoAbsorptionCof0[c] = I1;
451 ++c;
452 }
453 for( k2 = k1; k2 < n2; k2++ )
454 {
455 flag = 0;
456
457 for( c1 = 1; c1 < c; c1++ )
458 {
459 if( fPhotoAbsorptionCof0[c1] == fSandiaTable[k2][0] )
460 {
461 flag = 1;
462 break;
463 }
464 }
465 if(flag == 0)
466 {
467 fPhotoAbsorptionCof0[c] = fSandiaTable[k2][0];
468 ++c;
469 }
470 }
471 } // end for(i)
472 // sort out
473
474 for( i = 1; i < c; ++i )
475 {
476 for( j = i + 1; j < c; ++j )
477 {
478 if( fPhotoAbsorptionCof0[i] > fPhotoAbsorptionCof0[j] )
479 {
480 G4double tmp = fPhotoAbsorptionCof0[i];
481 fPhotoAbsorptionCof0[i] = fPhotoAbsorptionCof0[j];
482 fPhotoAbsorptionCof0[j] = tmp;
483 }
484 }
485 if ( fVerbose > 0)
486 {
487 G4cout<<i<<"\t energy = "<<fPhotoAbsorptionCof0[i]<<G4endl;
488 }
489 }
490 fMaxInterval = c;
491
492 const G4double* fractionW = fMaterial->GetFractionVector();
493
494 if ( fVerbose > 0)
495 {
496 for( i = 0; i < noElm; ++i )
497 G4cout<<i<<" = elN, fraction = "<<fractionW[i]<<G4endl;
498 }
499
500 for( i = 0; i < noElm; ++i )
501 {
502 n1 = 1;
504
505 for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
506
507 G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
508
509 for(k = n1; k < n2; ++k)
510 {
511 G4double B1 = fSandiaTable[k][0];
512 G4double B2 = fSandiaTable[k+1][0];
513
514 for(G4int q = 1; q < fMaxInterval-1; q++)
515 {
516 G4double E1 = fPhotoAbsorptionCof0[q];
517 G4double E2 = fPhotoAbsorptionCof0[q+1];
518
519 if ( fVerbose > 0 )
520 {
521 G4cout<<"k = "<<k<<", q = "<<q<<", B1 = "<<B1<<", B2 = "<<B2
522 <<", E1 = "<<E1<<", E2 = "<<E2<<G4endl;
523 }
524 if( B1 > E1 || B2 < E2 || E1 < I1 )
525 {
526 if ( fVerbose > 0 )
527 {
528 G4cout<<"continue for: B1 = "<<B1<<", B2 = "<<B2<<", E1 = "
529 <<E1<<", E2 = "<<E2<<G4endl;
530 }
531 continue;
532 }
533 fPhotoAbsorptionCof1[q] += fSandiaTable[k][1]*fractionW[i];
534 fPhotoAbsorptionCof2[q] += fSandiaTable[k][2]*fractionW[i];
535 fPhotoAbsorptionCof3[q] += fSandiaTable[k][3]*fractionW[i];
536 fPhotoAbsorptionCof4[q] += fSandiaTable[k][4]*fractionW[i];
537 }
538 }
539 // Last interval
540
541 fPhotoAbsorptionCof1[fMaxInterval-1] += fSandiaTable[k][1]*fractionW[i];
542 fPhotoAbsorptionCof2[fMaxInterval-1] += fSandiaTable[k][2]*fractionW[i];
543 fPhotoAbsorptionCof3[fMaxInterval-1] += fSandiaTable[k][3]*fractionW[i];
544 fPhotoAbsorptionCof4[fMaxInterval-1] += fSandiaTable[k][4]*fractionW[i];
545 } // for(i)
546 c = 0; // Deleting of first intervals where all coefficients = 0
547
548 do
549 {
550 ++c;
551
552 if( fPhotoAbsorptionCof1[c] != 0.0 ||
553 fPhotoAbsorptionCof2[c] != 0.0 ||
554 fPhotoAbsorptionCof3[c] != 0.0 ||
555 fPhotoAbsorptionCof4[c] != 0.0 ) continue;
556
557 if ( fVerbose > 0 )
558 {
559 G4cout<<c<<" = number with zero cofs"<<G4endl;
560 }
561 for( jj = 2; jj < fMaxInterval; ++jj )
562 {
563 fPhotoAbsorptionCof0[jj-1] = fPhotoAbsorptionCof0[jj];
564 fPhotoAbsorptionCof1[jj-1] = fPhotoAbsorptionCof1[jj];
565 fPhotoAbsorptionCof2[jj-1] = fPhotoAbsorptionCof2[jj];
566 fPhotoAbsorptionCof3[jj-1] = fPhotoAbsorptionCof3[jj];
567 fPhotoAbsorptionCof4[jj-1] = fPhotoAbsorptionCof4[jj];
568 }
569 --fMaxInterval;
570 --c;
571 }
572 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
573 while( c < fMaxInterval - 1 );
574
575 if( fPhotoAbsorptionCof0[fMaxInterval-1] == 0.0 ) fMaxInterval--;
576
577 // create the sandia matrix for this material
578
580
581 G4double density = fMaterial->GetDensity();
582
583 for (i = 0; i < fMaxInterval; ++i) // -> G4units
584 {
585 fPhotoAbsorptionCof0[i+1] *= funitc[0];
586 fPhotoAbsorptionCof1[i+1] *= funitc[1]*density;
587 fPhotoAbsorptionCof2[i+1] *= funitc[2]*density;
588 fPhotoAbsorptionCof3[i+1] *= funitc[3]*density;
589 fPhotoAbsorptionCof4[i+1] *= funitc[4]*density;
590 }
591 if(fLowerI1)
592 {
593 if( fMaterial->GetName() == "G4_WATER")
594 {
596
597 for (i = 0; i < fMaxInterval; ++i) // init vector table
598 {
599 fMatSandiaMatrixPAI->push_back( new G4DataVector(5,0.) );
600 }
601 for (i = 0; i < fH2OlowerInt; ++i)
602 {
603 (*(*fMatSandiaMatrixPAI)[i])[0] = fH2OlowerI1[i][0];
604 (*(*fMatSandiaMatrixPAI)[i])[1] = fH2OlowerI1[i][1];
605 (*(*fMatSandiaMatrixPAI)[i])[2] = fH2OlowerI1[i][2];
606 (*(*fMatSandiaMatrixPAI)[i])[3] = fH2OlowerI1[i][3];
607 (*(*fMatSandiaMatrixPAI)[i])[4] = fH2OlowerI1[i][4];
608 }
609 for (i = fH2OlowerInt; i < fMaxInterval; ++i)
610 {
611 (*(*fMatSandiaMatrixPAI)[i])[0] = fPhotoAbsorptionCof0[i+1-fH2OlowerInt];
612 (*(*fMatSandiaMatrixPAI)[i])[1] = fPhotoAbsorptionCof1[i+1-fH2OlowerInt];
613 (*(*fMatSandiaMatrixPAI)[i])[2] = fPhotoAbsorptionCof2[i+1-fH2OlowerInt];
614 (*(*fMatSandiaMatrixPAI)[i])[3] = fPhotoAbsorptionCof3[i+1-fH2OlowerInt];
615 (*(*fMatSandiaMatrixPAI)[i])[4] = fPhotoAbsorptionCof4[i+1-fH2OlowerInt];
616 }
617 }
618 }
619 else
620 {
621 for (i = 0; i < fMaxInterval; ++i) // init vector table
622 {
623 fMatSandiaMatrixPAI->push_back( new G4DataVector(5,0.) );
624 }
625 for (i = 0; i < fMaxInterval; ++i)
626 {
627 (*(*fMatSandiaMatrixPAI)[i])[0] = fPhotoAbsorptionCof0[i+1];
628 (*(*fMatSandiaMatrixPAI)[i])[1] = fPhotoAbsorptionCof1[i+1]; // *density;
629 (*(*fMatSandiaMatrixPAI)[i])[2] = fPhotoAbsorptionCof2[i+1]; // *density;
630 (*(*fMatSandiaMatrixPAI)[i])[3] = fPhotoAbsorptionCof3[i+1]; // *density;
631 (*(*fMatSandiaMatrixPAI)[i])[4] = fPhotoAbsorptionCof4[i+1]; // *density;
632 }
633 }
634 // --fMaxInterval;
635 // to avoid duplicate at 500 keV or extra zeros in last interval
636
637 if ( fVerbose > 0 )
638 {
639 G4cout<<"G4SandiaTable::ComputeMatSandiaMatrixPAI(), mat = "
641
642 for( i = 0; i < fMaxInterval; ++i)
643 {
644 G4cout<<i<<"\t"<<GetSandiaMatTablePAI(i,0)/keV<<" keV \t"
646 <<"\t"<<GetSandiaMatTablePAI(i,2)
647 <<"\t"<<GetSandiaMatTablePAI(i,3)
648 <<"\t"<<GetSandiaMatTablePAI(i,4)<<G4endl;
649 }
650 }
651 return;
652}
static const G4double fH2OlowerI1[23][5]
G4double GetDensity() const
Definition: G4Material.hh:176
const G4double * GetFractionVector() const
Definition: G4Material.hh:190
static const G4double funitc[5]
G4double GetSandiaMatTablePAI(G4int, G4int) const
static const G4int fH2OlowerInt

References fH2OlowerI1, fH2OlowerInt, fIonizationPotentials, fLowerI1, fMaterial, fMatSandiaMatrixPAI, fMaxInterval, fNbOfIntervals, fSandiaTable, funitc, fVerbose, G4cout, G4endl, G4lrint(), G4Material::GetDensity(), G4Material::GetElementVector(), G4Material::GetFractionVector(), G4Material::GetName(), G4Material::GetNumberOfElements(), GetSandiaMatTablePAI(), CLHEP::keV, keV, and Z.

Referenced by Initialize().

◆ ComputeMatTable()

void G4SandiaTable::ComputeMatTable ( )
private

Definition at line 1051 of file G4SandiaTable.cc.

1052{
1053 G4int elm, c, i, j, jj, k, kk, k1, k2, c1, n1;
1054
1055 const G4int noElm = fMaterial->GetNumberOfElements();
1056 const G4ElementVector* ElementVector = fMaterial->GetElementVector();
1057 G4int* Z = new G4int[noElm]; //Atomic number
1058
1059 fMaxInterval = 0;
1060 for (elm = 0; elm<noElm; ++elm)
1061 {
1062 Z[elm] = (*ElementVector)[elm]->GetZasInt();
1063 fMaxInterval += fNbOfIntervals[Z[elm]];
1064 }
1065 fMaxInterval += 2;
1066
1067 // G4cout<<"fMaxInterval = "<<fMaxInterval<<G4endl;
1068
1070
1071 for(i = 0; i < fMaxInterval; ++i)
1072 {
1073 fPhotoAbsorptionCof[i] = new G4double[5];
1074 }
1075
1076 // for(c = 0; c < fIntervalLimit; ++c) // just in case
1077
1078 for(c = 0; c < fMaxInterval; ++c) // just in case
1079 {
1080 fPhotoAbsorptionCof[c][0] = 0.;
1081 }
1082 c = 1;
1083
1084 for(i = 0; i < noElm; ++i)
1085 {
1086 G4double I1 = fIonizationPotentials[Z[i]]*keV; // First ionization
1087 n1 = 1; // potential in keV
1088
1089 for(j = 1; j < Z[i]; ++j)
1090 {
1091 n1 += fNbOfIntervals[j];
1092 }
1093 G4int n2 = n1 + fNbOfIntervals[Z[i]];
1094
1095 for(k1 = n1; k1 < n2; ++k1)
1096 {
1097 if(I1 > fSandiaTable[k1][0])
1098 {
1099 continue; // no ionization for energies smaller than I1 (first
1100 } // ionisation potential)
1101 break;
1102 }
1103 G4int flag = 0;
1104
1105 for(c1 = 1; c1 < c; ++c1)
1106 {
1107 if(fPhotoAbsorptionCof[c1][0] == I1) // this value already has existed
1108 {
1109 flag = 1;
1110 break;
1111 }
1112 }
1113 if(flag == 0)
1114 {
1115 fPhotoAbsorptionCof[c][0] = I1;
1116 ++c;
1117 }
1118 for(k2 = k1; k2 < n2; ++k2)
1119 {
1120 flag = 0;
1121
1122 for(c1 = 1; c1 < c; ++c1)
1123 {
1124 if(fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0])
1125 {
1126 flag = 1;
1127 break;
1128 }
1129 }
1130 if(flag == 0)
1131 {
1132 fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0];
1133 ++c;
1134 }
1135 }
1136 } // end for(i)
1137
1139 fMaxInterval = c;
1140
1141 const G4double* fractionW = fMaterial->GetFractionVector();
1142
1143 for(i = 0; i < fMaxInterval; ++i)
1144 {
1145 for(j = 1; j < 5; ++j) fPhotoAbsorptionCof[i][j] = 0.;
1146 }
1147 for(i = 0; i < noElm; ++i)
1148 {
1149 n1 = 1;
1151
1152 for(j = 1; j < Z[i]; ++j)
1153 {
1154 n1 += fNbOfIntervals[j];
1155 }
1156 G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
1157
1158 for(k = n1; k < n2; ++k)
1159 {
1160 G4double B1 = fSandiaTable[k][0];
1161 G4double B2 = fSandiaTable[k+1][0];
1162 for(G4int q = 1; q < fMaxInterval-1; q++)
1163 {
1164 G4double E1 = fPhotoAbsorptionCof[q][0];
1165 G4double E2 = fPhotoAbsorptionCof[q+1][0];
1166 if(B1 > E1 || B2 < E2 || E1 < I1)
1167 {
1168 continue;
1169 }
1170 for(j = 1; j < 5; ++j)
1171 {
1172 fPhotoAbsorptionCof[q][j] += fSandiaTable[k][j]*fractionW[i];
1173 }
1174 }
1175 }
1176 for(j = 1; j < 5; ++j) // Last interval
1177 {
1179 fSandiaTable[k][j]*fractionW[i];
1180 }
1181 } // for(i)
1182
1183 c = 0; // Deleting of first intervals where all coefficients = 0
1184
1185 do
1186 {
1187 ++c;
1188
1189 if( fPhotoAbsorptionCof[c][1] != 0.0 ||
1190 fPhotoAbsorptionCof[c][2] != 0.0 ||
1191 fPhotoAbsorptionCof[c][3] != 0.0 ||
1192 fPhotoAbsorptionCof[c][4] != 0.0 ) continue;
1193
1194 for(jj = 2; jj < fMaxInterval; ++jj)
1195 {
1196 for(kk = 0; kk < 5; ++kk)
1197 {
1198 fPhotoAbsorptionCof[jj-1][kk]= fPhotoAbsorptionCof[jj][kk];
1199 }
1200 }
1201 --fMaxInterval;
1202 --c;
1203 }
1204 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
1205 while( c < fMaxInterval - 1 );
1206
1207 // create the sandia matrix for this material
1208
1209 --fMaxInterval; // vmg 20.11.10
1210
1212
1213 for (i = 0; i < fMaxInterval; ++i)
1214 {
1215 fMatSandiaMatrix->push_back(new G4DataVector(5,0.));
1216 }
1217 for ( i = 0; i < fMaxInterval; ++i )
1218 {
1219 for( j = 0; j < 5; ++j )
1220 {
1221 (*(*fMatSandiaMatrix)[i])[j] = fPhotoAbsorptionCof[i+1][j];
1222 }
1223 }
1225
1226 if ( fVerbose > 0 )
1227 {
1228 G4cout<<"vmg, G4SandiaTable::ComputeMatTable(), mat = "
1229 <<fMaterial->GetName()<<G4endl;
1230
1231 for ( i = 0; i < fMaxInterval; ++i )
1232 {
1233 // G4cout<<i<<"\t"<<(*(*fMatSandiaMatrix)[i])[0]<<" keV \t"
1234 // <<(*(*fMatSandiaMatrix)[i])[1]
1235 // <<"\t"<<(*(*fMatSandiaMatrix)[i])[2]<<"\t"
1236 // <<(*(*fMatSandiaMatrix)[i])[3]
1237 // <<"\t"<<(*(*fMatSandiaMatrix)[i])[4]<<G4endl;
1238
1239 G4cout<<i<<"\t"<<GetSandiaCofForMaterial(i,0)/keV
1240 <<" keV \t"<<this->GetSandiaCofForMaterial(i,1)
1241 <<"\t"<<this->GetSandiaCofForMaterial(i,2)
1242 <<"\t"<<this->GetSandiaCofForMaterial(i,3)
1243 <<"\t"<<this->GetSandiaCofForMaterial(i,4)<<G4endl;
1244 }
1245 }
1246 delete [] Z;
1247 return;
1248}
void SandiaSort(G4double **da, G4int sz)

References fIonizationPotentials, fMaterial, fMatNbOfIntervals, fMatSandiaMatrix, fMaxInterval, fNbOfIntervals, fPhotoAbsorptionCof, fSandiaTable, fVerbose, G4cout, G4endl, G4Material::GetElementVector(), G4Material::GetFractionVector(), G4Material::GetName(), G4Material::GetNumberOfElements(), GetSandiaCofForMaterial(), keV, SandiaSort(), and Z.

Referenced by GetPointerToCof().

◆ GetLowerI1()

G4bool G4SandiaTable::GetLowerI1 ( )
inline

Definition at line 150 of file G4SandiaTable.hh.

150{return fLowerI1;};

References fLowerI1.

Referenced by G4PAIxSection::Initialize().

◆ GetMatNbOfIntervals()

G4int G4SandiaTable::GetMatNbOfIntervals ( ) const

Definition at line 946 of file G4SandiaTable.cc.

947{
948 return fMatNbOfIntervals;
949}

References fMatNbOfIntervals.

◆ GetMaxInterval()

G4int G4SandiaTable::GetMaxInterval ( ) const

◆ GetPhotoAbsorpCof()

G4double G4SandiaTable::GetPhotoAbsorpCof ( G4int  i,
G4int  j 
) const

Definition at line 739 of file G4SandiaTable.cc.

740{
741 return fPhotoAbsorptionCof[i][j]*funitc[j];
742}

References fPhotoAbsorptionCof, and funitc.

Referenced by G4PAIxSection::G4PAIxSection().

◆ GetPointerToCof()

G4double ** G4SandiaTable::GetPointerToCof ( )
private

Definition at line 720 of file G4SandiaTable.cc.

721{
723 return fPhotoAbsorptionCof;
724}
void ComputeMatTable()

References ComputeMatTable(), and fPhotoAbsorptionCof.

◆ GetSandiaCofForMaterial() [1/2]

const G4double * G4SandiaTable::GetSandiaCofForMaterial ( G4double  energy) const

Definition at line 998 of file G4SandiaTable.cc.

999{
1000 G4int interval = 0;
1001 if (energy > (*(*fMatSandiaMatrix)[0])[0]) {
1002 interval = fMatNbOfIntervals - 1;
1003 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
1004 while ((interval>0)&&(energy<(*(*fMatSandiaMatrix)[interval])[0]))
1005 { --interval; }
1006 }
1007 return &((*(*fMatSandiaMatrix)[interval])[1]);
1008}
G4double energy(const ThreeVector &p, const G4double m)

References G4INCL::KinematicsUtils::energy(), fMatNbOfIntervals, and fMatSandiaMatrix.

◆ GetSandiaCofForMaterial() [2/2]

G4double G4SandiaTable::GetSandiaCofForMaterial ( G4int  interval,
G4int  j 
) const

Definition at line 980 of file G4SandiaTable.cc.

981{
982#ifdef G4VERBOSE
983 if(interval<0 || interval>=fMatNbOfIntervals) {
984 PrintErrorV("GetSandiaCofForMaterial");
985 interval = (interval<0) ? 0 : fMatNbOfIntervals-1;
986 }
987 if(j<0 || j>4) {
988 PrintErrorV("GetSandiaCofForMaterial");
989 j = (j<0) ? 0 : 4;
990 }
991#endif
992 return ((*(*fMatSandiaMatrix)[interval])[j]);
993}

References fMatNbOfIntervals, and fMatSandiaMatrix.

Referenced by ComputeMatSandiaMatrix(), ComputeMatTable(), G4VXTRenergyLoss::GetGasLinearPhotoAbs(), G4StrawTubeXTRadiator::GetMediumLinearPhotoAbs(), and G4VXTRenergyLoss::GetPlateLinearPhotoAbs().

◆ GetSandiaCofForMaterialPAI()

const G4double * G4SandiaTable::GetSandiaCofForMaterialPAI ( G4double  energy) const

◆ GetSandiaCofPerAtom()

void G4SandiaTable::GetSandiaCofPerAtom ( G4int  Z,
G4double  energy,
std::vector< G4double > &  coeff 
) const

Definition at line 132 of file G4SandiaTable.cc.

134{
135#ifdef G4VERBOSE
136 if(Z < 1 || Z > 100) {
137 Z = PrintErrorZ(Z, "GetSandiaCofPerAtom");
138 }
139 if(4 > coeff.size()) {
140 PrintErrorV("GetSandiaCofPerAtom(): input vector is resized");
141 coeff.resize(4);
142 }
143#endif
145 //G4double Iopot = fIonizationPotentials[Z]*eV;
146 //if (Emin < Iopot) Emin = Iopot;
147
148 G4int row = 0;
149 if (energy <= Emin) {
150 energy = Emin;
151
152 } else {
153 G4int interval = fNbOfIntervals[Z] - 1;
154 row = fCumulInterval[Z-1] + interval;
155 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
156 while ((interval>0) && (energy<fSandiaTable[row][0]*CLHEP::keV)) {
157 --interval;
158 row = fCumulInterval[Z-1] + interval;
159 }
160 }
161
162 G4double AoverAvo = Z*amu/fZtoAratio[Z];
163
164 coeff[0]=AoverAvo*funitc[1]*fSandiaTable[row][1];
165 coeff[1]=AoverAvo*funitc[2]*fSandiaTable[row][2];
166 coeff[2]=AoverAvo*funitc[3]*fSandiaTable[row][3];
167 coeff[3]=AoverAvo*funitc[4]*fSandiaTable[row][4];
168}
static const G4double fZtoAratio[101]

References source.hepunit::amu, Emin, G4INCL::KinematicsUtils::energy(), fCumulInterval, fNbOfIntervals, fSandiaTable, funitc, fZtoAratio, CLHEP::keV, and Z.

Referenced by G4PEEffectFluoModel::ComputeCrossSectionPerAtom(), and ComputeMatSandiaMatrix().

◆ GetSandiaCofWater()

void G4SandiaTable::GetSandiaCofWater ( G4double  energy,
std::vector< G4double > &  coeff 
) const

Definition at line 173 of file G4SandiaTable.cc.

175{
176#ifdef G4VERBOSE
177 if(4 > coeff.size()) {
178 PrintErrorV("GetSandiaCofWater: input vector is resized");
179 coeff.resize(4);
180 }
181#endif
182 G4int i = 0;
183 if(energy > fH2OlowerI1[0][0]*CLHEP::keV) {
184 i = fH2OlowerInt - 1;
185 for(; i>0; --i) {
186 if(energy >= fH2OlowerI1[i][0]*CLHEP::keV) { break; }
187 }
188 }
189 coeff[0]=funitc[1]*fH2OlowerI1[i][1];
190 coeff[1]=funitc[2]*fH2OlowerI1[i][2];
191 coeff[2]=funitc[3]*fH2OlowerI1[i][3];
192 coeff[3]=funitc[4]*fH2OlowerI1[i][4];
193}

References G4INCL::KinematicsUtils::energy(), fH2OlowerI1, fH2OlowerInt, funitc, and CLHEP::keV.

Referenced by G4LivermorePhotoElectricModel::CrossSectionPerVolume().

◆ GetSandiaMatTable()

G4double G4SandiaTable::GetSandiaMatTable ( G4int  interval,
G4int  j 
) const

Definition at line 1013 of file G4SandiaTable.cc.

1014{
1015#ifdef G4VERBOSE
1016 if(interval<0 || interval>=fMatNbOfIntervals) {
1017 PrintErrorV("GetSandiaCofForMaterial");
1018 interval = (interval<0) ? 0 : fMatNbOfIntervals-1;
1019 }
1020 if(j<0 || j>4) {
1021 PrintErrorV("GetSandiaCofForMaterial");
1022 j = (j<0) ? 0 : 4;
1023 }
1024#endif
1025 return ((*(*fMatSandiaMatrix)[interval])[j])*funitc[j];
1026}

References fMatNbOfIntervals, fMatSandiaMatrix, and funitc.

Referenced by G4InitXscPAI::G4InitXscPAI(), and G4PAIxSection::G4PAIxSection().

◆ GetSandiaMatTablePAI()

G4double G4SandiaTable::GetSandiaMatTablePAI ( G4int  interval,
G4int  j 
) const

Definition at line 1031 of file G4SandiaTable.cc.

1032{
1033#ifdef G4VERBOSE
1034 if(interval<0 || interval>=fMaxInterval) {
1035 PrintErrorV("GetSandiaCofForMaterialPAI");
1036 interval = (interval<0) ? 0 : fMaxInterval-1;
1037 }
1038 if(j<0 || j>4) {
1039 PrintErrorV("GetSandiaCofForMaterialPAI");
1040 j = (j<0) ? 0 : 4;
1041 }
1042#endif
1043 return ((*(*fMatSandiaMatrixPAI)[interval])[j]);
1044}

References fMatSandiaMatrixPAI, and fMaxInterval.

Referenced by ComputeMatSandiaMatrixPAI(), G4PAIPhotData::Initialise(), G4PAIModelData::Initialise(), G4PAIxSection::Initialize(), and G4PAIySection::Initialize().

◆ GetSandiaPerAtom()

G4double G4SandiaTable::GetSandiaPerAtom ( G4int  Z,
G4int  interval,
G4int  j 
) const
private

Definition at line 954 of file G4SandiaTable.cc.

955{
956#ifdef G4VERBOSE
957 if(Z < 1 || Z > 100) {
958 Z = PrintErrorZ(Z, "GetSandiaPerAtom");
959 }
960 if(interval<0 || interval>=fNbOfIntervals[Z]) {
961 PrintErrorV("GetSandiaPerAtom");
962 interval = (interval<0) ? 0 : fNbOfIntervals[Z]-1;
963 }
964 if(j<0 || j>4) {
965 PrintErrorV("GetSandiaPerAtom");
966 j = (j<0) ? 0 : 4;
967 }
968#endif
969 G4int row = fCumulInterval[Z-1] + interval;
970 G4double x = fSandiaTable[row][0]*CLHEP::keV;
971 if (j > 0) {
972 x = Z*CLHEP::amu/fZtoAratio[Z]*fSandiaTable[row][j]*funitc[j];
973 }
974 return x;
975}
static constexpr double amu

References CLHEP::amu, fCumulInterval, fNbOfIntervals, fSandiaTable, funitc, fZtoAratio, CLHEP::keV, and Z.

◆ GetWaterCofForMaterial()

G4double G4SandiaTable::GetWaterCofForMaterial ( G4int  i,
G4int  j 
) const

Definition at line 204 of file G4SandiaTable.cc.

205{
206 return fH2OlowerI1[i][j]*funitc[j];
207}

References fH2OlowerI1, and funitc.

◆ GetWaterEnergyLimit()

G4double G4SandiaTable::GetWaterEnergyLimit ( ) const

Definition at line 197 of file G4SandiaTable.cc.

198{
199 return fH2OlowerI1[fH2OlowerInt - 1][0]*CLHEP::keV;
200}

References fH2OlowerI1, fH2OlowerInt, and CLHEP::keV.

◆ GetZtoA()

G4double G4SandiaTable::GetZtoA ( G4int  Z)
static

Definition at line 211 of file G4SandiaTable.cc.

212{
213#ifdef G4VERBOSE
214 if(Z < 1 || Z > 100) {
215 Z = PrintErrorZ(Z, "GetSandiaCofPerAtom");
216 }
217#endif
218 return fZtoAratio[Z];
219}

References fZtoAratio, and Z.

Referenced by G4ParticleHPNames::GetName().

◆ Initialize()

void G4SandiaTable::Initialize ( const G4Material mat)

Definition at line 705 of file G4SandiaTable.cc.

706{
707 fMaterial = mat;
709}
void ComputeMatSandiaMatrixPAI()

References ComputeMatSandiaMatrixPAI(), and fMaterial.

Referenced by G4PAIPhotData::Initialise(), and G4PAIModelData::Initialise().

◆ operator!=()

G4bool G4SandiaTable::operator!= ( const G4SandiaTable ) const
delete

◆ operator=()

G4SandiaTable & G4SandiaTable::operator= ( const G4SandiaTable right)
delete

◆ operator==()

G4bool G4SandiaTable::operator== ( const G4SandiaTable ) const
delete

◆ SandiaIntervals()

G4int G4SandiaTable::SandiaIntervals ( G4int  Z[],
G4int  el 
)

Definition at line 766 of file G4SandiaTable.cc.

767{
768 G4int c, i, flag = 0, n1 = 1;
769 G4int j, c1, k1, k2;
770 G4double I1;
771 fMaxInterval = 0;
772
773 for( i = 0; i < el; ++i ) fMaxInterval += fNbOfIntervals[ Z[i] ];
774
775 fMaxInterval += 2;
776
777 if( fVerbose > 0 ) {
778 G4cout<<"begin sanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
779 }
780
782
783 for( i = 0; i < fMaxInterval; ++i ) {
784 fPhotoAbsorptionCof[i] = new G4double[5];
785 }
786 // for(c = 0; c < fIntervalLimit; ++c) // just in case
787
788 for( c = 0; c < fMaxInterval; ++c ) { fPhotoAbsorptionCof[c][0] = 0.; }
789
790 c = 1;
791
792 for( i = 0; i < el; ++i )
793 {
794 I1 = fIonizationPotentials[ Z[i] ]*keV; // First ionization
795 n1 = 1; // potential in keV
796
797 for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
798
799 G4int n2 = n1 + fNbOfIntervals[Z[i]];
800
801 for( k1 = n1; k1 < n2; k1++ )
802 {
803 if( I1 > fSandiaTable[k1][0] )
804 {
805 continue; // no ionization for energies smaller than I1 (first
806 } // ionisation potential)
807 break;
808 }
809 flag = 0;
810
811 for( c1 = 1; c1 < c; c1++ )
812 {
813 if( fPhotoAbsorptionCof[c1][0] == I1 ) // this value already has existed
814 {
815 flag = 1;
816 break;
817 }
818 }
819 if( flag == 0 )
820 {
821 fPhotoAbsorptionCof[c][0] = I1;
822 ++c;
823 }
824 for( k2 = k1; k2 < n2; k2++ )
825 {
826 flag = 0;
827
828 for( c1 = 1; c1 < c; c1++ )
829 {
830 if( fPhotoAbsorptionCof[c1][0] == fSandiaTable[k2][0] )
831 {
832 flag = 1;
833 break;
834 }
835 }
836 if( flag == 0 )
837 {
838 fPhotoAbsorptionCof[c][0] = fSandiaTable[k2][0];
839 if( fVerbose > 0 ) {
840 G4cout<<"sanInt, c = "<<c<<", E_c = "<<fPhotoAbsorptionCof[c][0]
841 <<G4endl;
842 }
843 ++c;
844 }
845 }
846 } // end for(i)
847
849 fMaxInterval = c;
850 if( fVerbose > 0 ) {
851 G4cout<<"end SanInt, fMaxInterval = "<<fMaxInterval<<G4endl;
852 }
853 return c;
854}

References fIonizationPotentials, fMaxInterval, fNbOfIntervals, fPhotoAbsorptionCof, fSandiaTable, fVerbose, G4cout, G4endl, keV, SandiaSort(), and Z.

Referenced by G4PAIxSection::G4PAIxSection().

◆ SandiaMixing()

G4int G4SandiaTable::SandiaMixing ( G4int  Z[],
const G4double fractionW,
G4int  el,
G4int  mi 
)

Definition at line 862 of file G4SandiaTable.cc.

866{
867 G4int i, j, n1, k, c=1, jj, kk;
868 G4double I1, B1, B2, E1, E2;
869
870 for( i = 0; i < mi; ++i )
871 {
872 for( j = 1; j < 5; ++j ) fPhotoAbsorptionCof[i][j] = 0.;
873 }
874 for( i = 0; i < el; ++i )
875 {
876 n1 = 1;
877 I1 = fIonizationPotentials[Z[i]]*keV;
878
879 for( j = 1; j < Z[i]; ++j ) n1 += fNbOfIntervals[j];
880
881 G4int n2 = n1 + fNbOfIntervals[Z[i]] - 1;
882
883 for( k = n1; k < n2; ++k )
884 {
885 B1 = fSandiaTable[k][0];
886 B2 = fSandiaTable[k+1][0];
887
888 for( c = 1; c < mi-1; ++c )
889 {
890 E1 = fPhotoAbsorptionCof[c][0];
891 E2 = fPhotoAbsorptionCof[c+1][0];
892
893 if( B1 > E1 || B2 < E2 || E1 < I1 ) continue;
894
895 for( j = 1; j < 5; ++j )
896 {
897 fPhotoAbsorptionCof[c][j] += fSandiaTable[k][j]*fractionW[i];
898 if( fVerbose > 0 )
899 {
900 G4cout<<"c="<<c<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]
901 <<"; frW="<<fractionW[i]<<G4endl;
902 }
903 }
904 }
905 }
906 for( j = 1; j < 5; ++j ) // Last interval
907 {
908 fPhotoAbsorptionCof[mi-1][j] += fSandiaTable[k][j]*fractionW[i];
909 if( fVerbose > 0 )
910 {
911 G4cout<<"mi-1="<<mi-1<<"; j="<<j<<"; fST="<<fSandiaTable[k][j]
912 <<"; frW="<<fractionW[i]<<G4endl;
913 }
914 }
915 } // for(i)
916 c = 0; // Deleting of first intervals where all coefficients = 0
917
918 do
919 {
920 ++c;
921
922 if( fPhotoAbsorptionCof[c][1] != 0.0 ||
923 fPhotoAbsorptionCof[c][2] != 0.0 ||
924 fPhotoAbsorptionCof[c][3] != 0.0 ||
925 fPhotoAbsorptionCof[c][4] != 0.0 ) continue;
926
927 for( jj = 2; jj < mi; ++jj )
928 {
929 for( kk = 0; kk < 5; ++kk ) {
930 fPhotoAbsorptionCof[jj-1][kk] = fPhotoAbsorptionCof[jj][kk];
931 }
932 }
933 mi--;
934 c--;
935 }
936 // Loop checking, 07-Aug-2015, Vladimir Ivanchenko
937 while( c < mi - 1 );
938
939 if( fVerbose > 0 ) G4cout<<"end SanMix, mi = "<<mi<<G4endl;
940
941 return mi;
942}

References fIonizationPotentials, fNbOfIntervals, fPhotoAbsorptionCof, fSandiaTable, fVerbose, G4cout, G4endl, keV, anonymous_namespace{G4QuasiElRatios.cc}::mi, and Z.

Referenced by G4PAIxSection::G4PAIxSection().

◆ SandiaSort()

void G4SandiaTable::SandiaSort ( G4double **  da,
G4int  sz 
)
private

Definition at line 750 of file G4SandiaTable.cc.

751{
752 for(G4int i = 1;i < sz; ++i )
753 {
754 for(G4int j = i + 1;j < sz; ++j )
755 {
756 if(da[i][0] > da[j][0]) SandiaSwap(da,i,j);
757 }
758 }
759}
void SandiaSwap(G4double **da, G4int i, G4int j)

References SandiaSwap().

Referenced by ComputeMatTable(), and SandiaIntervals().

◆ SandiaSwap()

void G4SandiaTable::SandiaSwap ( G4double **  da,
G4int  i,
G4int  j 
)
private

Definition at line 728 of file G4SandiaTable.cc.

731{
732 G4double tmp = da[i][0] ;
733 da[i][0] = da[j][0] ;
734 da[j][0] = tmp ;
735}

Referenced by SandiaSort().

◆ SetLowerI1()

void G4SandiaTable::SetLowerI1 ( G4bool  flag)
inline

Definition at line 151 of file G4SandiaTable.hh.

151{fLowerI1=flag;};

References fLowerI1.

◆ SetVerbose()

void G4SandiaTable::SetVerbose ( G4int  ver)
inline

Definition at line 92 of file G4SandiaTable.hh.

92{ fVerbose = ver; };

References fVerbose.

Field Documentation

◆ fCumulInterval

G4int G4SandiaTable::fCumulInterval = {0}
staticprivate

◆ fH2OlowerInt

const G4int G4SandiaTable::fH2OlowerInt = 23
staticprivate

◆ fIntervalLimit

const G4int G4SandiaTable::fIntervalLimit = 100
staticprivate

Definition at line 171 of file G4SandiaTable.hh.

◆ fLowerI1

G4bool G4SandiaTable::fLowerI1
private

Definition at line 180 of file G4SandiaTable.hh.

Referenced by ComputeMatSandiaMatrixPAI(), G4SandiaTable(), GetLowerI1(), and SetLowerI1().

◆ fMaterial

const G4Material* G4SandiaTable::fMaterial
private

◆ fMatNbOfIntervals

G4int G4SandiaTable::fMatNbOfIntervals
private

◆ fMatSandiaMatrix

G4OrderedTable* G4SandiaTable::fMatSandiaMatrix
private

◆ fMatSandiaMatrixPAI

G4OrderedTable* G4SandiaTable::fMatSandiaMatrixPAI
private

◆ fMaxInterval

G4int G4SandiaTable::fMaxInterval
private

◆ fNumberOfElements

const G4int G4SandiaTable::fNumberOfElements = 100
staticprivate

Definition at line 170 of file G4SandiaTable.hh.

◆ fNumberOfIntervals

const G4int G4SandiaTable::fNumberOfIntervals = 980
staticprivate

Definition at line 172 of file G4SandiaTable.hh.

◆ fPhotoAbsorptionCof

G4double** G4SandiaTable::fPhotoAbsorptionCof
private

◆ fSandiaCofPerAtom

std::vector<G4double> G4SandiaTable::fSandiaCofPerAtom
private

Definition at line 119 of file G4SandiaTable.hh.

Referenced by ComputeMatSandiaMatrix(), and G4SandiaTable().

◆ fSandiaTable

const G4double G4SandiaTable::fSandiaTable
staticprivate

◆ funitc

const G4double G4SandiaTable::funitc
staticprivate

◆ fVerbose

G4int G4SandiaTable::fVerbose
private

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