GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
INukeOsetTable::PointHandler Struct Reference

handle table's index and weights for given density and energy More...

Public Member Functions

 PointHandler ()
 
void setHandler (const double &width, const int &bins)
 constructor More...
 
void update (const double &newValue)
 update point if changed More...
 

Public Attributes

double value
 exact value as read from table More...
 
double lowWeight
 distance from high boundary More...
 
double highWeight
 distance from low boundary More...
 
int index
 point index = index of low boundary More...
 
double binWidth
 bin width used to calculate distances More...
 
int nBins
 nBins to check isEdge More...
 
bool isEdge
 true if value is on edge of table (should never happen) More...
 

Detailed Description

handle table's index and weights for given density and energy

Definition at line 78 of file INukeOsetTable.h.

Constructor & Destructor Documentation

INukeOsetTable::PointHandler::PointHandler ( )
inline

Definition at line 88 of file INukeOsetTable.h.

88 : value (-1.0) {}; //!< constructor
double value
exact value as read from table

Member Function Documentation

void INukeOsetTable::PointHandler::setHandler ( const double &  width,
const int &  bins 
)
inline

constructor

set up binWidth and nBins

Definition at line 91 of file INukeOsetTable.h.

References binWidth, and nBins.

Referenced by INukeOsetTable::INukeOsetTable().

92  {
93  binWidth = width;
94  nBins = bins;
95  }
double binWidth
bin width used to calculate distances
int nBins
nBins to check isEdge
void INukeOsetTable::PointHandler::update ( const double &  newValue)

update point if changed

set up table index and weights for given point

Definition at line 205 of file INukeOsetTable.cxx.

References binWidth, highWeight, index, isEdge, lowWeight, nBins, and value.

Referenced by INukeOsetTable::setupOset().

206 {
207  value = newValue; // update value
208  index = value / binWidth; // update index
209 
210  // in the case value > max value use max; check if it is on edge
211  if (index >= nBins - 1)
212  {
213  index = nBins - 1;
214  isEdge = true;
215  }
216  else isEdge = false;
217  // calcualte weights for boundary values
218  lowWeight = (index + 1) * binWidth - value;
220 }
double lowWeight
distance from high boundary
double highWeight
distance from low boundary
int index
point index = index of low boundary
bool isEdge
true if value is on edge of table (should never happen)
double binWidth
bin width used to calculate distances
double value
exact value as read from table
int nBins
nBins to check isEdge

Member Data Documentation

double INukeOsetTable::PointHandler::binWidth

bin width used to calculate distances

Definition at line 84 of file INukeOsetTable.h.

Referenced by setHandler(), and update().

double INukeOsetTable::PointHandler::highWeight

distance from low boundary

Definition at line 82 of file INukeOsetTable.h.

Referenced by INukeOsetTable::interpolate(), and update().

int INukeOsetTable::PointHandler::index

point index = index of low boundary

Definition at line 83 of file INukeOsetTable.h.

Referenced by INukeOsetTable::interpolate(), and update().

bool INukeOsetTable::PointHandler::isEdge

true if value is on edge of table (should never happen)

Definition at line 86 of file INukeOsetTable.h.

Referenced by INukeOsetTable::interpolate(), and update().

double INukeOsetTable::PointHandler::lowWeight

distance from high boundary

Definition at line 81 of file INukeOsetTable.h.

Referenced by INukeOsetTable::interpolate(), and update().

int INukeOsetTable::PointHandler::nBins

nBins to check isEdge

Definition at line 85 of file INukeOsetTable.h.

Referenced by setHandler(), and update().

double INukeOsetTable::PointHandler::value

exact value as read from table

Definition at line 80 of file INukeOsetTable.h.

Referenced by update().


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