GENIEGenerator
Loading...
Searching...
No Matches
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
void update (const double &newValue)
 update point if changed

Public Attributes

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

Detailed Description

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

Definition at line 78 of file INukeOsetTable.h.

Constructor & Destructor Documentation

◆ PointHandler()

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

References value.

Member Function Documentation

◆ setHandler()

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.

92 {
93 binWidth = width;
94 nBins = bins;
95 }
double binWidth
bin width used to calculate distances
int nBins
nBins to check isEdge

References binWidth, and nBins.

◆ update()

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.

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}
bool isEdge
true if value is on edge of table (should never happen)
double lowWeight
distance from high boundary
double highWeight
distance from low boundary
int index
point index = index of low boundary

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

Member Data Documentation

◆ binWidth

double INukeOsetTable::PointHandler::binWidth

bin width used to calculate distances

Definition at line 84 of file INukeOsetTable.h.

Referenced by setHandler(), and update().

◆ highWeight

double INukeOsetTable::PointHandler::highWeight

distance from low boundary

Definition at line 82 of file INukeOsetTable.h.

Referenced by update().

◆ index

int INukeOsetTable::PointHandler::index

point index = index of low boundary

Definition at line 83 of file INukeOsetTable.h.

Referenced by update().

◆ isEdge

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 update().

◆ lowWeight

double INukeOsetTable::PointHandler::lowWeight

distance from high boundary

Definition at line 81 of file INukeOsetTable.h.

Referenced by update().

◆ nBins

int INukeOsetTable::PointHandler::nBins

nBins to check isEdge

Definition at line 85 of file INukeOsetTable.h.

Referenced by setHandler(), and update().

◆ value

double INukeOsetTable::PointHandler::value

exact value as read from table

Definition at line 80 of file INukeOsetTable.h.

Referenced by PointHandler(), and update().


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