mythenDetector Class Reference

This calss contains all mythen specific functions. More...

#include <mythenDetector.h>

Inheritance diagram for mythenDetector:

slsDetector List of all members.

Public Member Functions

 mythenDetector (int id=0)
 ~mythenDetector ()
sls_detector_modulereadTrimFile (string fname, sls_detector_module *myMod=NULL)
int writeTrimFile (string fname, sls_detector_module mod)
int writeTrimFile (string fname, int imod)
int writeDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1)
int writeDataFile (string fname, int *data)
int readDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0)
int readDataFile (string fname, int *data)
int readCalibrationFile (string fname, float &gain, float &offset)
int writeCalibrationFile (string fname, float gain, float offset)
int readAngularConversion (string fname="")
int writeAngularConversion (string fname="")
int setAngularConversion (string fname="")
int getAngularConversion (int &direction, angleConversionConstant *angconv=NULL)
float setGlobalOffset (float f)
float setFineOffset (float f)
float getFineOffset ()
float getGlobalOffset ()
int setPositions (int nPos, float *pos)
int getPositions (float *pos=NULL)
float setBinSize (float bs)
float getBinSize ()
float * decodeData (int *datain)
int resetMerging (float *mp, float *mv, float *me, int *mm)
int addToMerging (float *p1, float *v1, float *e1, float *mp, float *mv, float *me, int *mm)
int finalizeMerging (float *mp, float *mv, float *me, int *mm)

Detailed Description

This calss contains all mythen specific functions.

The mythenDetector class contains the functions specific to the mythen detector

Author:
Anna Bergamaschi
Version:
0.1alpha (any string)


Constructor & Destructor Documentation

mythenDetector::mythenDetector ( int  id = 0  ) 

(default) constructor

Parameters:
id is the detector index which is needed to define the shared memory id. Different physical detectors should have different IDs in order to work independently

mythenDetector::~mythenDetector (  )  [inline]

destructor


Member Function Documentation

int mythenDetector::addToMerging ( float *  p1,
float *  v1,
float *  e1,
float *  mp,
float *  mv,
float *  me,
int *  mm 
)

not yet implemented merge dataset

Parameters:
p1 angular positions of dataset
v1 data
e1 errors
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays

Reimplemented from slsDetector.

float* mythenDetector::decodeData ( int *  datain  ) 

decode data from the detector converting them to an array of floats, one for each channle

Parameters:
datain data from the detector
Returns:
pointer to a float array with a data per channel

Reimplemented from slsDetector.

int mythenDetector::finalizeMerging ( float *  mp,
float *  mv,
float *  me,
int *  mm 
)

calculates the "final" positions, data value and errors for the emrged data

Parameters:
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
Returns:
FAIL or the

Reimplemented from slsDetector.

int mythenDetector::getAngularConversion ( int &  direction,
angleConversionConstant angconv = NULL 
)

get angular conversion

Parameters:
reference to diffractometer direction
angconv array that will be filled with the angular conversion constants
Returns:
0 if angular conversion disabled, >0 otherwise

Reimplemented from slsDetector.

float mythenDetector::getBinSize (  )  [inline]

return detector bin size used for merging (approx angular resolution)

Reimplemented from slsDetector.

float mythenDetector::getFineOffset (  )  [inline]

get detector fine offset

Reimplemented from slsDetector.

float mythenDetector::getGlobalOffset (  )  [inline]

get detector global offset

Reimplemented from slsDetector.

int mythenDetector::getPositions ( float *  pos = NULL  )  [inline]

get positions for the acquisition

Parameters:
pos array which will contain the encoder positions
Returns:
number of positions

Reimplemented from slsDetector.

int mythenDetector::readAngularConversion ( string  fname = ""  ) 

reads an angular conversion file

Parameters:
fname file to be read
See also:
angleConversionConstant

Reimplemented from slsDetector.

int mythenDetector::readCalibrationFile ( string  fname,
float &  gain,
float &  offset 
)

int readCalibrationFile(string fname, float &gain, float &offset);

Parameters:
fname file to be read
gain reference to the gain variable reference to the offset variable
See also:
sharedSlsDetector

Reimplemented from slsDetector.

int mythenDetector::readDataFile ( string  fname,
int *  data 
)

reads a data file

Parameters:
name of the file to be read
data array of data values
Returns:
OK or FAIL if it could not read the file or data=NULL

Reimplemented from slsDetector.

int mythenDetector::readDataFile ( string  fname,
float *  data,
float *  err = NULL,
float *  ang = NULL,
char  dataformat = 'f',
int  nch = 0 
)

reads a data file

Parameters:
name of the file to be read
data array of data values to be filled
err array of arrors on the data. If NULL no errors are expected on the file
ang array of angular values. If NULL data are expected in the form chan-val(-err) otherwise ang-val(-err)
dataformat format of the data: can be 'i' integer or 'f' float (default)
nch number of channels to be written to file. if <=0 defaults to the number of installed channels of the detector
Returns:
OK or FAIL if it could not read the file or data=NULL

Reimplemented from slsDetector.

sls_detector_module* mythenDetector::readTrimFile ( string  fname,
sls_detector_module myMod = NULL 
)

reads a trim file

Parameters:
fname name of the file to be read
myMod pointer to the module structure which has to be set.
If it is NULL a new module structure will be created
Returns:
the pointer to myMod or NULL if reading the file failed

Reimplemented from slsDetector.

int mythenDetector::resetMerging ( float *  mp,
float *  mv,
float *  me,
int *  mm 
)

sets the arrays of the merged data to 0. NB The array should be created with size >= 360./getBinSize();

Parameters:
mp already merged postions
mv already merged data
me already merged errors (squared sum)
mm multiplicity of merged arrays
Returns:
OK or FAIL

Reimplemented from slsDetector.

int mythenDetector::setAngularConversion ( string  fname = ""  ) 

set angular conversion

Parameters:
fname file with angular conversion constants ("" disable)
Returns:
0 if angular conversion disabled, >0 otherwise

Reimplemented from slsDetector.

float mythenDetector::setBinSize ( float  bs  )  [inline]

set detector bin size used for merging (approx angular resolution)

Reimplemented from slsDetector.

float mythenDetector::setFineOffset ( float  f  )  [inline]

set detector fine offset

Reimplemented from slsDetector.

float mythenDetector::setGlobalOffset ( float  f  )  [inline]

set detector global offset

Reimplemented from slsDetector.

int mythenDetector::setPositions ( int  nPos,
float *  pos 
) [inline]

set positions for the acquisition

Parameters:
nPos number of positions
pos array with the encoder positions
Returns:
number of positions

Reimplemented from slsDetector.

int mythenDetector::writeAngularConversion ( string  fname = ""  ) 

writes an angular conversion file

Parameters:
fname file to be written
See also:
angleConversionConstant

Reimplemented from slsDetector.

int mythenDetector::writeCalibrationFile ( string  fname,
float  gain,
float  offset 
)

writes a clibration file

Parameters:
fname file to be written
gain 
offset 
See also:
sharedSlsDetector

Reimplemented from slsDetector.

int mythenDetector::writeDataFile ( string  fname,
int *  data 
)

writes a data file

Parameters:
name of the file to be written
data array of data values
Returns:
OK or FAIL if it could not write the file or data=NULL

Reimplemented from slsDetector.

int mythenDetector::writeDataFile ( string  fname,
float *  data,
float *  err = NULL,
float *  ang = NULL,
char  dataformat = 'f',
int  nch = -1 
)

writes a data file

Parameters:
name of the file to be written
data array of data values
err array of arrors on the data. If NULL no errors will be written
ang array of angular values. If NULL data will be in the form chan-val(-err) otherwise ang-val(-err)
dataformat format of the data: can be 'i' integer or 'f' float (default)
nch number of channels to be written to file. if -1 defaults to the number of installed channels of the detector
Returns:
OK or FAIL if it could not write the file or data=NULL

Reimplemented from slsDetector.

int mythenDetector::writeTrimFile ( string  fname,
int  imod 
)

writes a trim file for module number imod - the values will be read from the current detector structure

Parameters:
fname name of the file to be written
imod module number
Returns:
OK or FAIL if the file could not be written
See also:
sls_detector_module sharedSlsDetector

Reimplemented from slsDetector.

int mythenDetector::writeTrimFile ( string  fname,
sls_detector_module  mod 
)

writes a trim file

Parameters:
fname name of the file to be written
mod module structure which has to be written to file
Returns:
OK or FAIL if the file could not be written
See also:
sls_detector_module

Reimplemented from slsDetector.


The documentation for this class was generated from the following file:
Generated on Fri Oct 9 16:01:04 2009 by  doxygen 1.4.7