Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VelocityTable Class Reference

#include <G4VelocityTable.hh>

Public Member Functions

G4double Value (G4double theEnergy)
 

Static Public Member Functions

static G4VelocityTableGetVelocityTable ()
 
static void SetVelocityTableProperties (G4double t_max, G4double t_min, G4int nbin)
 
static G4double GetMaxTOfVelocityTable ()
 
static G4double GetMinTOfVelocityTable ()
 
static G4int GetNbinOfVelocityTable ()
 

Detailed Description

Definition at line 51 of file G4VelocityTable.hh.

Member Function Documentation

G4double G4VelocityTable::GetMaxTOfVelocityTable ( )
static

Definition at line 194 of file G4VelocityTable.cc.

196 {
197  return GetVelocityTable()->maxT;
198 }
static G4VelocityTable * GetVelocityTable()

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4VelocityTable::GetMinTOfVelocityTable ( )
static

Definition at line 201 of file G4VelocityTable.cc.

203 {
204  return GetVelocityTable()->minT;
205 }
static G4VelocityTable * GetVelocityTable()

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4VelocityTable::GetNbinOfVelocityTable ( )
static

Definition at line 208 of file G4VelocityTable.cc.

210 {
211  return GetVelocityTable()->NbinT;
212 }
static G4VelocityTable * GetVelocityTable()

Here is the call graph for this function:

Here is the caller graph for this function:

G4VelocityTable * G4VelocityTable::GetVelocityTable ( )
static

Definition at line 161 of file G4VelocityTable.cc.

163 {
164  if (!theInstance) { theInstance = new G4VelocityTable(); }
165  return theInstance;
166 }

Here is the caller graph for this function:

void G4VelocityTable::SetVelocityTableProperties ( G4double  t_max,
G4double  t_min,
G4int  nbin 
)
static

Definition at line 169 of file G4VelocityTable.cc.

171 {
172  if (theInstance == 0) { theInstance = new G4VelocityTable(); }
173 
175  G4ApplicationState currentState = stateManager->GetCurrentState();
176 
177  // check if state is outside event loop
178  if(!(currentState==G4State_Idle||currentState==G4State_PreInit)){
179  G4Exception("G4VelocityTable::SetVelocityTableProperties",
180  "Track101", JustWarning,
181  "Can modify only in PreInit or Idle state : Method ignored.");
182  return;
183  }
184 
185  if (nbin > 100 ) theInstance->NbinT = nbin;
186  if ((t_min < t_max)&&(t_min>0.)) {
187  theInstance->minT = t_min;
188  theInstance->maxT = t_max;
189  }
190  theInstance->PrepareVelocityTable();
191 }
static G4StateManager * GetStateManager()
G4ApplicationState GetCurrentState() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4ApplicationState

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4VelocityTable::Value ( G4double  theEnergy)

Definition at line 124 of file G4VelocityTable.cc.

125 {
126  // Use cache for speed up - check if the value 'theEnergy' is same as the
127  // last call. If it is same, then use the last bin location. Also the
128  // value 'theEnergy' lies between the last energy and low edge of of the
129  // bin of last call, then the last bin location is used.
130 
131  if( theEnergy == lastEnergy ) {
132 
133  } else if( theEnergy < lastEnergy
134  && theEnergy >= binVector[lastBin]) {
135  lastEnergy = theEnergy;
136  lastValue = Interpolation();
137 
138  } else if( theEnergy <= edgeMin ) {
139  lastBin = 0;
140  lastEnergy = edgeMin;
141  lastValue = dataVector[0];
142 
143  } else if( theEnergy >= edgeMax ){
144  lastBin = numberOfNodes-1;
145  lastEnergy = edgeMax;
146  lastValue = dataVector[lastBin];
147 
148  } else {
149  lastBin = FindBinLocation(theEnergy);
150  lastEnergy = theEnergy;
151  lastValue = Interpolation();
152 
153  }
154  return lastValue;
155 }

Here is the caller graph for this function:


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