Interpolator::LowEnergyThetaBraggCorrectionReader Class Reference

This will become useless !!! This class is a file reader for a the low energy theta bragg correction. More...

#include <LowEnergyThetaBraggCorrectionReader.h>

Inherits Interpolator::FileReader.

Inheritance diagram for Interpolator::LowEnergyThetaBraggCorrectionReader:

Inheritance graph
[legend]
Collaboration diagram for Interpolator::LowEnergyThetaBraggCorrectionReader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LowEnergyThetaBraggCorrectionReader ()
 Default constructor.
 LowEnergyThetaBraggCorrectionReader (const std::string &sFileName)
 This constructor requires 1 parameter :
  • the name of the file to read.

 LowEnergyThetaBraggCorrectionReader (const std::string &sFileName, long lNbColumns, long lNbLines)
 This constructor requires 3 parameters :
  • the name of the file to read
  • the number of columns of the file
  • the number of lines of the file (without the first line which contains the name of the data).

virtual ~LowEnergyThetaBraggCorrectionReader ()
 Destructor.
virtual void Parse ()
 This method parse the buffer to read the low energy theta bragg correction
The column 1 is the energy value variable column
The column 2 is the theta diff variable column The column 3 is the fit diff variable column The column 4 is the FHWM resolution variable column.
double * getEnergy () const
 Return the energy values array.
double * getThetaDiff () const
 Return the theta difference array to correct theta bragg value.
double * getFitDiff () const
 Return the fit diff values array.
double * getFWHMResolution () const
 Return the FWHM resolution values array.
double getValue (int iColumn, int iIndex) const
 Return the ith value of the iColumn column array
Exceptions:
This method returns a IndexOutOfBoundException if the iColumn is not found.

double getEnergyValue (int i) const
 Return the ith value of energy values array.
double getThetaDiffValue (int i) const
 Return the ith value of theta difference array to correct theta bragg value.
double getFitDiffValue (int i) const
 Return the ith value of fit diff values array.
double getFWHMResolutionValue (int i) const
 Return the ith value of FHWM resolution values array.
std::string getEnergyName () const
 Return the energy column name.
std::string getThetaDiffName () const
 Return the theta diff column name.
std::string getFitDiffName () const
 Return the fit diff column name.
std::string getFWHMResolutionName () const
 Return the FWHM resolution column name.

Private Attributes

double * _mEnergy
double * _mThetaDiff
double * _mFitDiff
double * _mFWHMResolution
std::string _sEnergyName
std::string _sThetaDiffName
std::string _sFitDiffName
std::string _sFWHMResolutionName

Detailed Description

This will become useless !!! This class is a file reader for a the low energy theta bragg correction.

Definition at line 22 of file LowEnergyThetaBraggCorrectionReader.h.


Constructor & Destructor Documentation

Interpolator::LowEnergyThetaBraggCorrectionReader::LowEnergyThetaBraggCorrectionReader  ) 
 

Default constructor.

Definition at line 22 of file LowEnergyThetaBraggCorrectionReader.cpp.

00023 {
00024 
00025 }

Interpolator::LowEnergyThetaBraggCorrectionReader::LowEnergyThetaBraggCorrectionReader const std::string &  sFileName  ) 
 

This constructor requires 1 parameter :

  • the name of the file to read.

Definition at line 56 of file LowEnergyThetaBraggCorrectionReader.cpp.

References Parse().

00056                                                                                                    : FileReader(sFileName) 
00057 {
00058         Parse();
00059 }

Here is the call graph for this function:

Interpolator::LowEnergyThetaBraggCorrectionReader::LowEnergyThetaBraggCorrectionReader const std::string &  sFileName,
long  lNbColumns,
long  lNbLines
 

This constructor requires 3 parameters :

  • the name of the file to read
  • the number of columns of the file
  • the number of lines of the file (without the first line which contains the name of the data).

Definition at line 65 of file LowEnergyThetaBraggCorrectionReader.cpp.

References Parse().

00065                                                                                                                                  : FileReader(sFileName,lNbColumns,lNbLines)
00066 {
00067         Parse();
00068 }

Here is the call graph for this function:

Interpolator::LowEnergyThetaBraggCorrectionReader::~LowEnergyThetaBraggCorrectionReader  )  [virtual]
 

Destructor.

Definition at line 27 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _mEnergy, _mFitDiff, _mFWHMResolution, and _mThetaDiff.

00028 {
00029 
00030         if (_mEnergy)
00031         {
00032                 delete [] _mEnergy;
00033                 _mEnergy = 0;
00034         }
00035 
00036         if (_mThetaDiff)
00037         {
00038                 delete [] _mThetaDiff;
00039                 _mThetaDiff = 0;
00040         }
00041         if (_mFitDiff)
00042         {
00043                 delete [] _mFitDiff;
00044                 _mFitDiff = 0;
00045         }
00046         if (_mFWHMResolution)
00047         {
00048                 delete [] _mFWHMResolution;
00049                 _mFWHMResolution = 0;
00050         }
00051 
00052 }


Member Function Documentation

double * Interpolator::LowEnergyThetaBraggCorrectionReader::getEnergy  )  const
 

Return the energy values array.

Exceptions:
This method throw a NullPointerException exception if the energy array is null

Definition at line 181 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _mEnergy.

00182 {
00183         if (_mEnergy == 0) throw NullPointerException("_mEnergy","LowEnergyThetaBraggCorrectionReader::getEnergy()",__FILE__,__LINE__);
00184         return _mEnergy;
00185 }

std::string Interpolator::LowEnergyThetaBraggCorrectionReader::getEnergyName  )  const
 

Return the energy column name.

Definition at line 261 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _sEnergyName.

00262 {
00263         return _sEnergyName;
00264 }

double Interpolator::LowEnergyThetaBraggCorrectionReader::getEnergyValue int  i  )  const
 

Return the ith value of energy values array.

Definition at line 237 of file LowEnergyThetaBraggCorrectionReader.cpp.

References getValue().

00238 {
00239         return getValue(0,i);
00240 }

Here is the call graph for this function:

double * Interpolator::LowEnergyThetaBraggCorrectionReader::getFitDiff  )  const
 

Return the fit diff values array.

Definition at line 195 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _mFitDiff.

00196 {
00197         if (_mFitDiff == 0) throw NullPointerException("_mFitDiff","LowEnergyThetaBraggCorrectionReader::getFitDiff()",__FILE__,__LINE__);
00198         return _mFitDiff;
00199 }

std::string Interpolator::LowEnergyThetaBraggCorrectionReader::getFitDiffName  )  const
 

Return the fit diff column name.

Definition at line 271 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _sFitDiffName.

00272 {
00273         return _sFitDiffName;
00274 }

double Interpolator::LowEnergyThetaBraggCorrectionReader::getFitDiffValue int  i  )  const
 

Return the ith value of fit diff values array.

Definition at line 249 of file LowEnergyThetaBraggCorrectionReader.cpp.

References getValue().

00250 {
00251         return getValue(2,i);
00252 }

Here is the call graph for this function:

double * Interpolator::LowEnergyThetaBraggCorrectionReader::getFWHMResolution  )  const
 

Return the FWHM resolution values array.

Definition at line 202 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _mFWHMResolution.

00203 {
00204         if (_mFWHMResolution == 0) throw NullPointerException("_mFWHMResolution","LowEnergyThetaBraggCorrectionReader::getFWHMResolution()",__FILE__,__LINE__);
00205         return _mFWHMResolution;
00206 }

std::string Interpolator::LowEnergyThetaBraggCorrectionReader::getFWHMResolutionName  )  const
 

Return the FWHM resolution column name.

Definition at line 276 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _sFWHMResolutionName.

00277 {
00278         return _sFWHMResolutionName;
00279 }

double Interpolator::LowEnergyThetaBraggCorrectionReader::getFWHMResolutionValue int  i  )  const
 

Return the ith value of FHWM resolution values array.

Definition at line 255 of file LowEnergyThetaBraggCorrectionReader.cpp.

References getValue().

00256 {
00257         return getValue(3,i);
00258 }

Here is the call graph for this function:

double * Interpolator::LowEnergyThetaBraggCorrectionReader::getThetaDiff  )  const
 

Return the theta difference array to correct theta bragg value.

Definition at line 188 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _mThetaDiff.

00189 {
00190         if (_mThetaDiff == 0) throw NullPointerException("_mThetaDiff","LowEnergyThetaBraggCorrectionReader::getThetaDiff()",__FILE__,__LINE__);
00191         return _mThetaDiff;
00192 }

std::string Interpolator::LowEnergyThetaBraggCorrectionReader::getThetaDiffName  )  const
 

Return the theta diff column name.

Definition at line 266 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _sThetaDiffName.

00267 {
00268         return _sThetaDiffName;
00269 }

double Interpolator::LowEnergyThetaBraggCorrectionReader::getThetaDiffValue int  i  )  const
 

Return the ith value of theta difference array to correct theta bragg value.

Definition at line 243 of file LowEnergyThetaBraggCorrectionReader.cpp.

References getValue().

00244 {
00245         return getValue(1,i);
00246 }

Here is the call graph for this function:

double Interpolator::LowEnergyThetaBraggCorrectionReader::getValue int  iColumn,
int  iIndex
const
 

Return the ith value of the iColumn column array

Exceptions:
This method returns a IndexOutOfBoundException if the iColumn is not found.

Exceptions:
This method returns a IndexOutOfBoundException if the value with the ith index is not found.

Definition at line 212 of file LowEnergyThetaBraggCorrectionReader.cpp.

Referenced by getEnergyValue(), getFitDiffValue(), getFWHMResolutionValue(), and getThetaDiffValue().

00213 {       
00214 
00215         if ( (iIndex<0) || (iIndex>=getNbData())) throw IndexOutOfBoundException("iIndex",iIndex,0,getNbData(),"LowEnergyThetaBraggCorrectionReader::getValue(int iColumn, int iIndex)",__FILE__,__LINE__);
00216         
00217         switch (iColumn) 
00218         {
00219         case 0 :
00220                 return _mEnergy[iIndex];
00221                 break;
00222         case 1 :
00223                 return _mThetaDiff[iIndex];
00224                 break;
00225         case 2 :
00226                 return _mFitDiff[iIndex];
00227                 break;
00228         case 3 :
00229                 return _mFWHMResolution[iIndex];
00230                 break;
00231         default:
00232                 throw IndexOutOfBoundException("iColumn",iColumn,0,getNbVariables(),"LowEnergyThetaBraggCorrectionReader::getValue(int iColumn, int iIndex)",__FILE__,__LINE__);
00233         }       
00234 }

void Interpolator::LowEnergyThetaBraggCorrectionReader::Parse  )  [virtual]
 

This method parse the buffer to read the low energy theta bragg correction
The column 1 is the energy value variable column
The column 2 is the theta diff variable column The column 3 is the fit diff variable column The column 4 is the FHWM resolution variable column.

throw IndexOutOfBoundException("i",i,0,getNbVariables(),"LowEnergyThetaBraggCorrectionReader::getValue(int iColumn, int iIndex)",__FILE__,__LINE__);

Implements Interpolator::FileReader.

Definition at line 75 of file LowEnergyThetaBraggCorrectionReader.cpp.

References _mEnergy, _mFitDiff, _mFWHMResolution, _mThetaDiff, _sEnergyName, _sFitDiffName, _sFWHMResolutionName, _sThetaDiffName, Interpolator::Interpolator::_verb, Interpolator::FileReader::extractDouble(), Interpolator::FileReader::extractString(), Interpolator::FileReader::getNbData(), and Interpolator::FileReader::getNbVariables().

Referenced by LowEnergyThetaBraggCorrectionReader().

00076 {
00077 
00078 int iNbData = getNbData();
00079 if(Interpolator::_verb == true) cout << "NbData : " << iNbData << endl;
00080 
00081 int iNbVariables = getNbVariables();
00082 if(Interpolator::_verb == true) cout << "NbVariables : " << iNbVariables << endl;
00083 
00084 //Reading of the first line to extract the variables names
00085 std::string sColumnName;
00086  int i=0;
00087 
00088 for (i=0;i<iNbVariables;i++) 
00089 {
00090         sColumnName = extractString();
00091         if(Interpolator::_verb == true) cout << "Column " << i << " --> " << sColumnName << endl;
00092         
00093         switch (i) 
00094         {
00095         case 0 :
00096                 _sEnergyName            = sColumnName;
00097                 break;
00098         case 1 :
00099                 _sThetaDiffName         = sColumnName;
00100                 break;
00101         case 2 :
00102                 _sFitDiffName           = sColumnName;
00103                 break;
00104         case 3 :
00105                 _sFWHMResolutionName= sColumnName;
00106                 break;
00107         }
00108 }
00109 
00110 _mEnergy                        = new double[iNbData];
00111 _mThetaDiff                     = new double[iNbData];
00112 _mFitDiff                       = new double[iNbData];
00113 _mFWHMResolution        = new double[iNbData];
00114 double dValue;
00115 
00116 for (i=0;i<iNbData;i++) 
00117 {
00118         for (int j=0;j<iNbVariables;j++) 
00119         {
00120                 dValue = extractDouble();
00121                         
00122                 switch (j) 
00123                 {
00124                 case 0 :
00125                         _mEnergy[i]                     = dValue/1000.0; // On divise par 1000 car la table est fournie en eV
00126                         break;
00127                 case 1 :
00128                         _mThetaDiff[i]          = DegresToRadians(dValue);
00129                         break;
00130                 case 2 :
00131                         _mFitDiff[i]            = dValue;
00132                         break;
00133                 case 3 :
00134                         _mFWHMResolution[i]     = dValue;
00135                         break;
00136                 default://Trow a ParseException !!!!
00138                         break;
00139                 }
00140         }       
00141 }
00142 
00143 /*if(Interpolator::_verb == true) cout << "_mEnergy" <<endl;
00144 for (int k=0;k<iNbDatas;k++)
00145 {
00146         if(Interpolator::_verb == true) cout.precision(15);
00147         if(Interpolator::_verb == true) cout << k << " --> " << _mEnergy[k] << endl;
00148         
00149 }
00150 getchar();
00151 if(Interpolator::_verb == true) cout << "_mThetaDiff" <<endl;
00152 for (int l=0;l<iNbDatas;l++)
00153 { 
00154         if(Interpolator::_verb == true) cout.precision(15);
00155         if(Interpolator::_verb == true) cout << l << " --> " << (double)_mThetaDiff[l] << endl;
00156         
00157 }
00158 getchar();
00159 if(Interpolator::_verb == true) cout << "_mFitDiff" <<endl;
00160 for (int m=0;m<iNbDatas;m++)
00161 {
00162         if(Interpolator::_verb == true) cout.precision(15);
00163         if(Interpolator::_verb == true) cout << m << " --> " << _mFitDiff[m] << endl;
00164         
00165 }
00166 getchar();      
00167 if(Interpolator::_verb == true) cout << "_mFWHMResolution" <<endl;
00168 for (int n=0;n<iNbDatas;n++)
00169 {
00170         if(Interpolator::_verb == true) cout.precision(15);
00171         if(Interpolator::_verb == true) cout << n << " --> " << _mFWHMResolution[n] << endl;
00172         
00173 }
00174 
00175 getchar();
00176 */
00177 }

Here is the call graph for this function:


Member Data Documentation

double* Interpolator::LowEnergyThetaBraggCorrectionReader::_mEnergy [private]
 

Definition at line 50 of file LowEnergyThetaBraggCorrectionReader.h.

Referenced by getEnergy(), Parse(), and ~LowEnergyThetaBraggCorrectionReader().

double* Interpolator::LowEnergyThetaBraggCorrectionReader::_mFitDiff [private]
 

Definition at line 52 of file LowEnergyThetaBraggCorrectionReader.h.

Referenced by getFitDiff(), Parse(), and ~LowEnergyThetaBraggCorrectionReader().

double* Interpolator::LowEnergyThetaBraggCorrectionReader::_mFWHMResolution [private]
 

Definition at line 53 of file LowEnergyThetaBraggCorrectionReader.h.

Referenced by getFWHMResolution(), Parse(), and ~LowEnergyThetaBraggCorrectionReader().

double* Interpolator::LowEnergyThetaBraggCorrectionReader::_mThetaDiff [private]
 

Definition at line 51 of file LowEnergyThetaBraggCorrectionReader.h.

Referenced by getThetaDiff(), Parse(), and ~LowEnergyThetaBraggCorrectionReader().

std::string Interpolator::LowEnergyThetaBraggCorrectionReader::_sEnergyName [private]
 

Definition at line 55 of file LowEnergyThetaBraggCorrectionReader.h.

Referenced by getEnergyName(), and Parse().

std::string Interpolator::LowEnergyThetaBraggCorrectionReader::_sFitDiffName [private]
 

Definition at line 57 of file LowEnergyThetaBraggCorrectionReader.h.

Referenced by getFitDiffName(), and Parse().

std::string Interpolator::LowEnergyThetaBraggCorrectionReader::_sFWHMResolutionName [private]
 

Definition at line 58 of file LowEnergyThetaBraggCorrectionReader.h.

Referenced by getFWHMResolutionName(), and Parse().

std::string Interpolator::LowEnergyThetaBraggCorrectionReader::_sThetaDiffName [private]
 

Definition at line 56 of file LowEnergyThetaBraggCorrectionReader.h.

Referenced by getThetaDiffName(), and Parse().


The documentation for this class was generated from the following files:
Generated on Tue Apr 14 09:51:37 2009 for Interpolator Library by  doxygen 1.4.5