#include <MagneticField/Layers/src/MagBinFinders.h>
Public Member Functions | |
virtual int | binIndex (int i) const |
Returns an index in the valid range. | |
virtual int | binIndex (T R) const |
Returns an index in the valid range for the bin that contains AND is closest to R. | |
virtual T | binPosition (int ind) const |
The middle of the bin. | |
GeneralBinFinderInR (std::vector< T > &borders) | |
GeneralBinFinderInR () | |
Private Attributes | |
std::vector< T > | theBins |
std::vector< T > | theBorders |
int | theNbins |
Definition at line 29 of file MagBinFinders.h.
MagBinFinders::GeneralBinFinderInR< T >::GeneralBinFinderInR | ( | ) | [inline] |
MagBinFinders::GeneralBinFinderInR< T >::GeneralBinFinderInR | ( | std::vector< T > & | borders | ) | [inline] |
Definition at line 34 of file MagBinFinders.h.
00034 : 00035 theNbins(borders.size()), 00036 theBorders(borders) { 00037 // FIXME: compute bin positions. 00038 // for (vector<T>::const_iterator i=theBorders.begin(); 00039 // i<theBorders.end(); ++i) { 00040 // theBorders.push_back(((*i) + (*(i+1))) / 2.); 00041 00042 // cout << "GeneralBinFinderInR_ " << theNbins << " " << theBorders.size() << " " << (int) this << endl; 00043 }
virtual int MagBinFinders::GeneralBinFinderInR< T >::binIndex | ( | int | i | ) | const [inline, virtual] |
Returns an index in the valid range.
Implements BaseBinFinder< T >.
Definition at line 79 of file MagBinFinders.h.
virtual int MagBinFinders::GeneralBinFinderInR< T >::binIndex | ( | T | R | ) | const [inline, virtual] |
Returns an index in the valid range for the bin that contains AND is closest to R.
Implements BaseBinFinder< T >.
Definition at line 68 of file MagBinFinders.h.
Referenced by MagBinFinders::GeneralBinFinderInR< double >::binIndex(), MagBinFinders::GeneralBinFinderInR< double >::binPosition(), and MagGeometry::findVolume().
00068 { 00069 int i; 00070 for (i = 0; i<theNbins; ++i) { 00071 if (R < theBorders[i]){ // FIXME: one can be skipped? 00072 break; 00073 } 00074 } 00075 return binIndex(i-1); 00076 }
virtual T MagBinFinders::GeneralBinFinderInR< T >::binPosition | ( | int | ind | ) | const [inline, virtual] |
The middle of the bin.
Implements BaseBinFinder< T >.
Definition at line 84 of file MagBinFinders.h.
std::vector<T> MagBinFinders::GeneralBinFinderInR< T >::theBins [private] |
Definition at line 92 of file MagBinFinders.h.
Referenced by MagBinFinders::GeneralBinFinderInR< double >::binPosition().
std::vector<T> MagBinFinders::GeneralBinFinderInR< T >::theBorders [private] |
Definition at line 91 of file MagBinFinders.h.
Referenced by MagBinFinders::GeneralBinFinderInR< double >::binIndex().
int MagBinFinders::GeneralBinFinderInR< T >::theNbins [private] |
Definition at line 90 of file MagBinFinders.h.
Referenced by MagBinFinders::GeneralBinFinderInR< double >::binIndex().