#include <mythenDetector.h>
Inheritance diagram for mythenDetector:
Public Member Functions | |
mythenDetector (int id=0) | |
~mythenDetector () | |
sls_detector_module * | readTrimFile (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) |
The mythenDetector class contains the functions specific to the mythen detector
mythenDetector::mythenDetector | ( | int | id = 0 |
) |
(default) constructor
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
int mythenDetector::addToMerging | ( | float * | p1, | |
float * | v1, | |||
float * | e1, | |||
float * | mp, | |||
float * | mv, | |||
float * | me, | |||
int * | mm | |||
) |
not yet implemented merge dataset
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
datain | data from the detector |
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
mp | already merged postions | |
mv | already merged data | |
me | already merged errors (squared sum) | |
mm | multiplicity of merged arrays |
Reimplemented from slsDetector.
int mythenDetector::getAngularConversion | ( | int & | direction, | |
angleConversionConstant * | angconv = NULL | |||
) |
get angular conversion
reference | to diffractometer direction | |
angconv | array that will be filled with the angular conversion constants |
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
pos | array which will contain the encoder positions |
Reimplemented from slsDetector.
int mythenDetector::readAngularConversion | ( | string | fname = "" |
) |
reads an angular conversion file
fname | file to be read |
Reimplemented from slsDetector.
int mythenDetector::readCalibrationFile | ( | string | fname, | |
float & | gain, | |||
float & | offset | |||
) |
int readCalibrationFile(string fname, float &gain, float &offset);
fname | file to be read | |
gain | reference to the gain variable reference to the offset variable |
Reimplemented from slsDetector.
int mythenDetector::readDataFile | ( | string | fname, | |
int * | data | |||
) |
reads a data file
name | of the file to be read | |
data | array of data values |
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
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 |
Reimplemented from slsDetector.
sls_detector_module* mythenDetector::readTrimFile | ( | string | fname, | |
sls_detector_module * | myMod = NULL | |||
) |
reads a trim file
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 |
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();
mp | already merged postions | |
mv | already merged data | |
me | already merged errors (squared sum) | |
mm | multiplicity of merged arrays |
Reimplemented from slsDetector.
int mythenDetector::setAngularConversion | ( | string | fname = "" |
) |
set angular conversion
fname | file with angular conversion constants ("" disable) |
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
nPos | number of positions | |
pos | array with the encoder positions |
Reimplemented from slsDetector.
int mythenDetector::writeAngularConversion | ( | string | fname = "" |
) |
writes an angular conversion file
fname | file to be written |
Reimplemented from slsDetector.
int mythenDetector::writeCalibrationFile | ( | string | fname, | |
float | gain, | |||
float | offset | |||
) |
writes a clibration file
fname | file to be written | |
gain | ||
offset |
Reimplemented from slsDetector.
int mythenDetector::writeDataFile | ( | string | fname, | |
int * | data | |||
) |
writes a data file
name | of the file to be written | |
data | array of data values |
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
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 |
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
fname | name of the file to be written | |
imod | module number |
Reimplemented from slsDetector.
int mythenDetector::writeTrimFile | ( | string | fname, | |
sls_detector_module | mod | |||
) |
writes a trim file
fname | name of the file to be written | |
mod | module structure which has to be written to file |
Reimplemented from slsDetector.