Geant4  10.02.p03
G4PWATotalXsecZ Class Reference

#include <G4PWATotalXsecTable.hh>

Collaboration diagram for G4PWATotalXsecZ:

Public Member Functions

G4int GetLowestEnergyBinIndex () const
 
G4int GetHighestEnergyBinIndex () const
 
G4double GetLowestEnergy () const
 
G4double GetHighestEnergy () const
 
G4double GetLowestXsecValue (G4int j) const
 
G4double GetHighestXsecValue (G4int j) const
 
G4int GetPWATotalXsecEnergyBinIndex (G4double energy) const
 
G4double GetInterpXsec (G4double energy, G4int elowindex, G4int j) const
 
G4double GetInterpXsec (G4double energy, G4int j) const
 

Private Member Functions

 G4PWATotalXsecZ (G4int Z)
 
 ~G4PWATotalXsecZ ()
 
G4PWATotalXsecZoperator= (const G4PWATotalXsecZ &right)
 
 G4PWATotalXsecZ (const G4PWATotalXsecZ &)
 
void LoadPWATotalXsecZ (G4int Z)
 

Private Attributes

G4double fPWAXsecs [fgNumTotalXsecBins *6]
 
G4double fInterpParamA [fgNumTotalXsecBins *6]
 
G4double fInterpParamB [fgNumTotalXsecBins *6]
 

Static Private Attributes

static const G4int fgNumTotalXsecBins = 106
 
static const G4double fgPWATotalXsecEnergyGrid [fgNumTotalXsecBins]
 

Friends

class G4PWATotalXsecTable
 

Detailed Description

Definition at line 64 of file G4PWATotalXsecTable.hh.

Constructor & Destructor Documentation

◆ G4PWATotalXsecZ() [1/2]

G4PWATotalXsecZ::G4PWATotalXsecZ ( G4int  Z)
private

Definition at line 94 of file G4PWATotalXsecTable.cc.

94  {
96  for(G4int i=0; i<nn; ++i) {
97  fPWAXsecs[i] = 0.0;
98  fInterpParamA[i] = 0.0;
99  fInterpParamB[i] = 0.0;
100  }
102 }
int G4int
Definition: G4Types.hh:78
G4double fInterpParamB[fgNumTotalXsecBins *6]
Float_t Z
void LoadPWATotalXsecZ(G4int Z)
G4double fInterpParamA[fgNumTotalXsecBins *6]
static const G4int fgNumTotalXsecBins
G4double fPWAXsecs[fgNumTotalXsecBins *6]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~G4PWATotalXsecZ()

G4PWATotalXsecZ::~G4PWATotalXsecZ ( )
inlineprivate

Definition at line 104 of file G4PWATotalXsecTable.hh.

104 {};
Here is the call graph for this function:

◆ G4PWATotalXsecZ() [2/2]

G4PWATotalXsecZ::G4PWATotalXsecZ ( const G4PWATotalXsecZ )
private

Member Function Documentation

◆ GetHighestEnergy()

G4double G4PWATotalXsecZ::GetHighestEnergy ( ) const
inline

Definition at line 73 of file G4PWATotalXsecTable.hh.

static const G4double fgPWATotalXsecEnergyGrid[fgNumTotalXsecBins]
static const G4int fgNumTotalXsecBins
Here is the caller graph for this function:

◆ GetHighestEnergyBinIndex()

G4int G4PWATotalXsecZ::GetHighestEnergyBinIndex ( ) const
inline

Definition at line 71 of file G4PWATotalXsecTable.hh.

71 {return fgNumTotalXsecBins-1;}
static const G4int fgNumTotalXsecBins

◆ GetHighestXsecValue()

G4double G4PWATotalXsecZ::GetHighestXsecValue ( G4int  j) const
inline

Definition at line 77 of file G4PWATotalXsecTable.hh.

77 {return fPWAXsecs[(j+1)*fgNumTotalXsecBins-1];}
static const G4int fgNumTotalXsecBins
G4double fPWAXsecs[fgNumTotalXsecBins *6]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInterpXsec() [1/2]

G4double G4PWATotalXsecZ::GetInterpXsec ( G4double  energy,
G4int  elowindex,
G4int  j 
) const

Definition at line 166 of file G4PWATotalXsecTable.cc.

166  {
167  // protection : out of energy grid range
168  if(energy < GetLowestEnergy())
169  return GetLowestXsecValue(j);
170  if(energy >= GetHighestEnergy())
171  return GetHighestXsecValue(j);
172 
173  // normal case log-log linear intrp.
174  G4int k = j*fgNumTotalXsecBins+elowindex;
176 }
G4double GetLowestEnergy() const
G4double GetLowestXsecValue(G4int j) const
G4double GetHighestXsecValue(G4int j) const
int G4int
Definition: G4Types.hh:78
G4double fInterpParamB[fgNumTotalXsecBins *6]
double energy
Definition: plottest35.C:25
G4double GetHighestEnergy() const
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
G4double fInterpParamA[fgNumTotalXsecBins *6]
static const G4int fgNumTotalXsecBins
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInterpXsec() [2/2]

G4double G4PWATotalXsecZ::GetInterpXsec ( G4double  energy,
G4int  j 
) const

Definition at line 179 of file G4PWATotalXsecTable.cc.

179  {
180  // protection : out of energy grid range
181  if(energy < GetLowestEnergy())
182  return GetLowestXsecValue(j);
183  if(energy >= GetHighestEnergy())
184  return GetHighestXsecValue(j);
185 
186  // normal case log-log linear intrp.
188  G4int k = j*fgNumTotalXsecBins+elowindex;
190 }
G4double GetLowestEnergy() const
G4double GetLowestXsecValue(G4int j) const
G4double GetHighestXsecValue(G4int j) const
int G4int
Definition: G4Types.hh:78
G4double fInterpParamB[fgNumTotalXsecBins *6]
double energy
Definition: plottest35.C:25
G4double GetHighestEnergy() const
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
G4int GetPWATotalXsecEnergyBinIndex(G4double energy) const
G4double fInterpParamA[fgNumTotalXsecBins *6]
static const G4int fgNumTotalXsecBins
Here is the call graph for this function:

◆ GetLowestEnergy()

G4double G4PWATotalXsecZ::GetLowestEnergy ( ) const
inline

Definition at line 72 of file G4PWATotalXsecTable.hh.

72 {return fgPWATotalXsecEnergyGrid[0];}
static const G4double fgPWATotalXsecEnergyGrid[fgNumTotalXsecBins]
Here is the caller graph for this function:

◆ GetLowestEnergyBinIndex()

G4int G4PWATotalXsecZ::GetLowestEnergyBinIndex ( ) const
inline

Definition at line 70 of file G4PWATotalXsecTable.hh.

70 {return 0;}

◆ GetLowestXsecValue()

G4double G4PWATotalXsecZ::GetLowestXsecValue ( G4int  j) const
inline

Definition at line 76 of file G4PWATotalXsecTable.hh.

76 {return fPWAXsecs[j*fgNumTotalXsecBins];}
static const G4int fgNumTotalXsecBins
G4double fPWAXsecs[fgNumTotalXsecBins *6]
Here is the caller graph for this function:

◆ GetPWATotalXsecEnergyBinIndex()

G4int G4PWATotalXsecZ::GetPWATotalXsecEnergyBinIndex ( G4double  energy) const

Definition at line 154 of file G4PWATotalXsecTable.cc.

154  {
155  // log(fgPWATotalXsecEnergyGrid[0]);
156  const G4double lne0 = -9.21034037197618e+00;
157  // 1./log(fgPWATotalXsecEnergyGrid[i+1]/fgPWATotalXsecEnergyGrid[i]);
158  const G4double invlnde = 6.51441722854880e+00;
159 
160  return (G4int)((G4Log(energy)-lne0)*invlnde);
161 }
int G4int
Definition: G4Types.hh:78
double energy
Definition: plottest35.C:25
G4double G4Log(G4double x)
Definition: G4Log.hh:230
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadPWATotalXsecZ()

void G4PWATotalXsecZ::LoadPWATotalXsecZ ( G4int  Z)
private

Definition at line 105 of file G4PWATotalXsecTable.cc.

105  {
106  G4double dum;
107  char fname[512];
108  char* path = getenv("G4LEDATA");
109  if (!path) {
110  G4Exception("G4PWATotalXsecZ::LoadPWATotalXsecZ()","em0006",
112  "Environment variable G4LEDATA not defined");
113  return;
114  }
115 
116  std::string pathString(path);
117  sprintf(fname,"%s/msc_GS/xsecs/xsecs_%d",path,Z);
118  std::ifstream infile(fname,std::ios::in);
119  if(!infile.is_open()){
120  char msgc[512];
121  sprintf(msgc," Total PWA xsection %s not found.",fname);
122  G4Exception("G4PWATotalXsecZ::LoadPWATotalXsecZ()","em0006",
124  msgc);
125  return;
126  }
127  G4double dummy;
128 
129  for(G4int i=0; i<fgNumTotalXsecBins; ++i)
130  for(G4int j=0; j<7; ++j)
131  if(j==0) infile >> dum;
132  else {
133  // load pwa xsection that are stored in cm2 units in file and change to
134  // Geant4 internal length2 units
135  infile >> dummy;
136  fPWAXsecs[(j-1)*fgNumTotalXsecBins+i] = dummy*CLHEP::cm2;
137  }
138  infile.close();
139 
140  // compute log-log linear intrp. parameters
141  for(G4int i=0; i<fgNumTotalXsecBins-1; ++i)
142  for(G4int k=0; k<6; ++k) {
143  G4int j = k*fgNumTotalXsecBins+i;
144  G4double val2 = fPWAXsecs[j+1];
145  G4double val1 = fPWAXsecs[j];
146 
149  }
150 }
ifstream in
Definition: comparison.C:7
static const G4double fgPWATotalXsecEnergyGrid[fgNumTotalXsecBins]
int G4int
Definition: G4Types.hh:78
G4double fInterpParamB[fgNumTotalXsecBins *6]
Float_t Z
static const double cm2
Definition: SystemOfUnits.h:99
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
G4double fInterpParamA[fgNumTotalXsecBins *6]
double G4double
Definition: G4Types.hh:76
static const G4int fgNumTotalXsecBins
G4double fPWAXsecs[fgNumTotalXsecBins *6]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

G4PWATotalXsecZ& G4PWATotalXsecZ::operator= ( const G4PWATotalXsecZ right)
private
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ G4PWATotalXsecTable

friend class G4PWATotalXsecTable
friend

Definition at line 66 of file G4PWATotalXsecTable.hh.

Member Data Documentation

◆ fgNumTotalXsecBins

const G4int G4PWATotalXsecZ::fgNumTotalXsecBins = 106
staticprivate

Definition at line 114 of file G4PWATotalXsecTable.hh.

◆ fgPWATotalXsecEnergyGrid

const G4double G4PWATotalXsecZ::fgPWATotalXsecEnergyGrid
staticprivate
Initial value:
={
1.00000000e-04, 1.16591440e-04, 1.35935639e-04, 1.58489319e-04, 1.84784980e-04, 2.15443469e-04, 2.51188643e-04, 2.92864456e-04,
3.41454887e-04, 3.98107171e-04, 4.64158883e-04, 5.41169527e-04, 6.30957344e-04, 7.35642254e-04, 8.57695899e-04, 1.00000000e-03,
1.16591440e-03, 1.35935639e-03, 1.58489319e-03, 1.84784980e-03, 2.15443469e-03, 2.51188643e-03, 2.92864456e-03, 3.41454887e-03,
3.98107171e-03, 4.64158883e-03, 5.41169527e-03, 6.30957344e-03, 7.35642254e-03, 8.57695899e-03, 1.00000000e-02, 1.16591440e-02,
1.35935639e-02, 1.58489319e-02, 1.84784980e-02, 2.15443469e-02, 2.51188643e-02, 2.92864456e-02, 3.41454887e-02, 3.98107171e-02,
4.64158883e-02, 5.41169527e-02, 6.30957344e-02, 7.35642254e-02, 8.57695899e-02, 1.00000000e-01, 1.16591440e-01, 1.35935639e-01,
1.58489319e-01, 1.84784980e-01, 2.15443469e-01, 2.51188643e-01, 2.92864456e-01, 3.41454887e-01, 3.98107171e-01, 4.64158883e-01,
5.41169527e-01, 6.30957344e-01, 7.35642254e-01, 8.57695899e-01, 1.00000000e+00, 1.16591440e+00, 1.35935639e+00, 1.58489319e+00,
1.84784980e+00, 2.15443469e+00, 2.51188643e+00, 2.92864456e+00, 3.41454887e+00, 3.98107171e+00, 4.64158883e+00, 5.41169527e+00,
6.30957344e+00, 7.35642254e+00, 8.57695899e+00, 1.00000000e+01, 1.16591440e+01, 1.35935639e+01, 1.58489319e+01, 1.84784980e+01,
2.15443469e+01, 2.51188643e+01, 2.92864456e+01, 3.41454887e+01, 3.98107171e+01, 4.64158883e+01, 5.41169527e+01, 6.30957344e+01,
7.35642254e+01, 8.57695899e+01, 1.00000000e+02, 1.16591440e+02, 1.35935639e+02, 1.58489319e+02, 1.84784980e+02, 2.15443469e+02,
2.51188643e+02, 2.92864456e+02, 3.41454887e+02, 3.98107171e+02, 4.64158883e+02, 5.41169527e+02, 6.30957344e+02, 7.35642254e+02,
8.57695899e+02, 1.00000000e+03
}

Definition at line 118 of file G4PWATotalXsecTable.hh.

◆ fInterpParamA

G4double G4PWATotalXsecZ::fInterpParamA[fgNumTotalXsecBins *6]
private

Definition at line 124 of file G4PWATotalXsecTable.hh.

◆ fInterpParamB

G4double G4PWATotalXsecZ::fInterpParamB[fgNumTotalXsecBins *6]
private

Definition at line 125 of file G4PWATotalXsecTable.hh.

◆ fPWAXsecs

G4double G4PWATotalXsecZ::fPWAXsecs[fgNumTotalXsecBins *6]
private

Definition at line 122 of file G4PWATotalXsecTable.hh.


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