#include <slsDetector.h>
Inheritance diagram for slsDetector:
Public Types | |
typedef slsDetector::sharedSlsDetector | sharedSlsDetector |
Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). | |
GET_ONLINE_FLAG | |
OFFLINE_FLAG | |
ONLINE_FLAG | |
enum | { GET_ONLINE_FLAG, OFFLINE_FLAG, ONLINE_FLAG } |
Public Member Functions | |
slsDetector (detectorType type=GENERIC, int id=0) | |
~slsDetector () | |
int | setOnline (int const online) |
int | exists () |
virtual int | readConfigurationFile (string const fname)=0 |
virtual int | writeConfigurationFile (string const fname)=0 |
virtual int | dumpDetectorSetup (string const fname)=0 |
virtual int | retrieveDetectorSetup (string const fname)=0 |
int | setTCPSocket (string const name="", int const control_port=-1, int const stop_port=-1, int const data_port=-1) |
char * | getHostname () |
int | getControlPort () |
int | getStopPort () |
int | getDataPort () |
char * | getTrimDir () |
char * | setTrimDir (string s) |
int | getTrimEn (int *en=NULL) |
virtual sls_detector_module * | readTrimFile (string fname, sls_detector_module *myMod=NULL)=0 |
virtual int | writeTrimFile (string fname, sls_detector_module mod)=0 |
virtual int | writeTrimFile (string fname, int imod)=0 |
char * | setFilePath (string s) |
char * | setFileName (string s) |
int | setFileIndex (int i) |
char * | getFilePath () |
char * | getFileName () |
int | getFileIndex () |
string | createFileName () |
virtual int | writeDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1)=0 |
virtual int | writeDataFile (string fname, int *data)=0 |
virtual int | readDataFile (string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0)=0 |
virtual int | readDataFile (string fname, int *data)=0 |
char * | getCalDir () |
char * | setCalDir (string s) |
virtual int | readCalibrationFile (string fname, float &gain, float &offset)=0 |
virtual int | writeCalibrationFile (string fname, float gain, float offset)=0 |
virtual int | readAngularConversion (string fname="")=0 |
virtual int | writeAngularConversion (string fname="")=0 |
int | execCommand (string cmd, string answer) |
int | setDetectorType (detectorType type=GET_DETECTOR_TYPE) |
int | setDetectorType (string type) |
void | getDetectorType (char *type) |
int | setNumberOfModules (int n, dimension d=X) |
int | getMaxNumberOfModules (dimension d=X) |
externalSignalFlag | setExternalSignalFlags (externalSignalFlag pol=GET_EXTERNAL_SIGNAL_FLAG, int signalindex=0) |
externalCommunicationMode | setExternalCommunicationMode (externalCommunicationMode pol=GET_EXTERNAL_COMMUNICATION_MODE) |
int64_t | getId (idMode mode, int imod=0) |
int | digitalTest (digitalTestMode mode, int imod=0) |
int * | analogTest (analogTestMode mode) |
int | enableAnalogOutput (int ichan) |
int | enableAnalogOutput (int imod, int ichip, int ichan) |
int | giveCalibrationPulse (float vcal, int npulses) |
int | writeRegister (int addr, int val) |
int | readRegister (int addr) |
float | setDAC (float val, dacIndex index, int imod=-1) |
float | getADC (dacIndex index, int imod=0) |
int | setChannel (int64_t reg, int ichan=-1, int ichip=-1, int imod=-1) |
int | setChannel (sls_detector_channel chan) |
sls_detector_channel | getChannel (int ichan, int ichip, int imod) |
int | setChip (int reg, int ichip=-1, int imod=-1) |
int | setChip (sls_detector_chip chip) |
sls_detector_chip | getChip (int ichip, int imod) |
int | setModule (int reg, int imod=-1) |
int | setModule (sls_detector_module module) |
sls_detector_module * | getModule (int imod) |
int | getThresholdEnergy (int imod=-1) |
int | setThresholdEnergy (int e_eV, int imod=-1, detectorSettings isettings=GET_SETTINGS) |
detectorSettings | getSettings (int imod=-1) |
detectorSettings | setSettings (detectorSettings isettings, int imod=-1) |
int | startAcquisition () |
int | stopAcquisition () |
int | startReadOut () |
int | getRunStatus () |
int * | startAndReadAll () |
int | startAndReadAllNoWait () |
int * | getDataFromDetectorNoWait () |
int * | readFrame () |
int * | readAll () |
int * | popDataQueue () |
detectorData * | popFinalDataQueue () |
int64_t | setTimer (timerIndex index, int64_t t=-1) |
int64_t | getTimeLeft (timerIndex index) |
int | setSpeed (speedVariable sp, int value=-1) |
int | setDynamicRange (int n=-1) |
int | setROI (int nroi=-1, int *xmin=NULL, int *xmax=NULL, int *ymin=NULL, int *ymax=NULL) |
int | setReadOutFlags (readOutFlags flag) |
int | executeTrimming (trimMode mode, int par1, int par2, int imod=-1) |
int | setFlatFieldCorrection (string fname="") |
int | getFlatFieldCorrection (float *corr=NULL, float *ecorr=NULL) |
int | setRateCorrection (float t=0) |
int | getRateCorrection (float &t) |
int | getRateCorrection () |
int | setBadChannelCorrection (string fname="") |
int | getBadChannelCorrection (int *bad=NULL) |
char * | getBadChannelCorrectionFile () |
virtual int | setAngularConversion (string fname="")=0 |
virtual int | getAngularConversion (int &direction, angleConversionConstant *angconv=NULL)=0 |
virtual char * | getAngularConversion ()=0 |
virtual float | setGlobalOffset (float f)=0 |
virtual float | setFineOffset (float f)=0 |
virtual float | getFineOffset ()=0 |
virtual float | getGlobalOffset ()=0 |
virtual int | setPositions (int nPos, float *pos)=0 |
virtual int | getPositions (float *pos=NULL)=0 |
virtual float | setBinSize (float bs)=0 |
virtual float | getBinSize ()=0 |
float * | decodeData (int *datain) |
int | flatFieldCorrect (float datain, float errin, float &dataout, float &errout, float ffcoefficient, float fferr) |
int | flatFieldCorrect (float *datain, float *errin, float *dataout, float *errout) |
int | rateCorrect (float datain, float errin, float &dataout, float &errout, float tau, float t) |
int | rateCorrect (float *datain, float *errin, float *dataout, float *errout) |
virtual int | resetMerging (float *mp, float *mv, float *me, int *mm)=0 |
virtual int | addToMerging (float *p1, float *v1, float *e1, float *mp, float *mv, float *me, int *mm)=0 |
int | finalizeMerging (float *mp, float *mv, float *me, int *mm) |
int | exitServer () |
virtual void * | processData (int delflag=1)=0 |
sls_detector_module * | createModule () |
void | deleteModule (sls_detector_module *myMod) |
virtual void | acquire (int delflag=1)=0 |
Protected Member Functions | |
int * | getDataFromDetector () |
int | initSharedMemory (detectorType type=GENERIC, int id=0) |
int | freeSharedMemory () |
int | initializeDetectorSize (detectorType type) |
int | initializeDetectorStructure () |
int | sendChannel (sls_detector_channel *) |
int | sendChip (sls_detector_chip *) |
int | sendModule (sls_detector_module *) |
int | receiveChannel (sls_detector_channel *) |
int | receiveChip (sls_detector_chip *) |
int | receiveModule (sls_detector_module *) |
void | startThread () |
int | fillBadChannelMask () |
Protected Attributes | |
sharedSlsDetector * | thisDetector |
int | onlineFlag |
int | detId |
int | shmId |
MySocketTCP * | controlSocket |
MySocketTCP * | stopSocket |
MySocketTCP * | dataSocket |
queue< int * > | dataQueue |
queue< detectorData * > | finalDataQueue |
float | currentPosition |
float | currentPositionIndex |
float | currentI0 |
float * | mergingBins |
float * | mergingCounts |
float * | mergingErrors |
int * | mergingMultiplicity |
float * | ffcoefficients |
float * | fferrors |
sls_detector_module * | detectorModules |
float * | dacs |
float * | adcs |
int * | chipregs |
int * | chanregs |
int * | badChannelMask |
Classes | |
struct | sharedSlsDetector |
Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!). More... |
The slsDetector class is expected to become the interface class for all SLS Detectors acquisition (and analysis) software.
typedef struct slsDetector::sharedSlsDetector slsDetector::sharedSlsDetector |
Structure allocated in shared memory to store detector settings and be accessed in parallel by several applications (take care of possible conflicts!).
anonymous enum |
online flags enum
slsDetector::slsDetector | ( | detectorType | type = GENERIC , |
|
int | id = 0 | |||
) |
(default) constructor
type | is needed to define the size of the detector shared memory 9defaults to GENERIC i.e. the largest shared memory needed by any slsDetector is allocated | |
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 |
sets onlineFlag to OFFLINE_FLAG
Initlializes shared memory
Initializes the detector stucture
slsDetector::~slsDetector | ( | ) | [inline] |
destructor
virtual void slsDetector::acquire | ( | int | delflag = 1 |
) | [pure virtual] |
pure virtual function performs the complete acquisition and data processing moves the detector to next position
starts and reads the detector
reads the IC (if required)
reads the encoder (iof required for angualr conversion)
processes the data (flat field, rate, angular conversion and merging processData()) /param delflag if 1 the data are processed, written to file and then deleted. If 0 they are added to the finalDataQueue
Implemented in mythenDetector.
virtual int slsDetector::addToMerging | ( | float * | p1, | |
float * | v1, | |||
float * | e1, | |||
float * | mp, | |||
float * | mv, | |||
float * | me, | |||
int * | mm | |||
) | [pure virtual] |
pure virtual function 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 |
Implemented in mythenDetector.
int* slsDetector::analogTest | ( | analogTestMode | mode | ) |
analog test
modte | test mode |
string slsDetector::createFileName | ( | ) |
generates file name without extension
always appends to file path and file name the run index.
in case also appends the position index
Filenames will be of the form: filepath/filename(_px)_i where x is the position index and i is the run index
sls_detector_module * slsDetector::createModule | ( | ) |
Allocates the memory for a sls_detector_module structure and initializes it
float * slsDetector::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 in eigerDetector.
void slsDetector::deleteModule | ( | sls_detector_module * | myMod | ) |
frees the memory for a sls_detector_module structure
myMod | the pointer to the memory to be freed |
int slsDetector::digitalTest | ( | digitalTestMode | mode, | |
int | imod = 0 | |||
) |
Digital test of the modules
mode | test mode | |
imod | module number for chip test or module firmware test |
virtual int slsDetector::dumpDetectorSetup | ( | string const | fname | ) | [pure virtual] |
Purely virtual function Should be implemented in the specific detector class /sa mythenDetector::dumpDetectorSetup
Implemented in mythenDetector.
int slsDetector::enableAnalogOutput | ( | int | imod, | |
int | ichip, | |||
int | ichan | |||
) |
enable analog output of channel ichan, chip ichip, module imod
not yet implemented
int slsDetector::enableAnalogOutput | ( | int | ichan | ) |
enable analog output of channel ichan
not yet implemented
int slsDetector::execCommand | ( | string | cmd, | |
string | answer | |||
) |
executes a system command on the server e.g. mount an nfs disk, reboot and returns answer etc.
cmd | is the command to be executed | |
answer | is the answer from the detector |
int slsDetector::executeTrimming | ( | trimMode | mode, | |
int | par1, | |||
int | par2, | |||
int | imod = -1 | |||
) |
execute trimming
mode | trim mode | |
par1 | if noise, beam or fixed setting trimming it is count limit, if improve maximum number of iterations | |
par2 | if noise or beam nsigma, if improve par2!=means vthreshold will be optimized, if fixed settings par2<0 trimwith median, par2>=0 trim with level | |
imod | module number (-1 all) |
int slsDetector::exists | ( | ) | [inline] |
sets the onlineFlag
int slsDetector::exitServer | ( | ) |
turns off server
int slsDetector::fillBadChannelMask | ( | ) | [protected] |
fill bad channel mask (0 if channel is good, 1 if bad)
int slsDetector::finalizeMerging | ( | float * | mp, | |
float * | mv, | |||
float * | me, | |||
int * | mm | |||
) |
pure virtual function 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 in mythenDetector.
int slsDetector::flatFieldCorrect | ( | float * | datain, | |
float * | errin, | |||
float * | dataout, | |||
float * | errout | |||
) |
flat field correct data
datain | data array | |
errin | error array on data (if NULL will default to sqrt(datain) | |
dataout | array of corrected data | |
errout | error on corrected data (if not NULL) |
int slsDetector::flatFieldCorrect | ( | float | datain, | |
float | errin, | |||
float & | dataout, | |||
float & | errout, | |||
float | ffcoefficient, | |||
float | fferr | |||
) |
flat field correct data
datain | data | |
errin | error on data (if<=0 will default to sqrt(datain) | |
dataout | corrected data | |
errout | error on corrected data | |
ffcoefficient | flat field correction coefficient | |
fferr | erro on ffcoefficient |
int slsDetector::freeSharedMemory | ( | ) | [protected] |
Frees the shared memory - should not be used
float slsDetector::getADC | ( | dacIndex | index, | |
int | imod = 0 | |||
) |
set dacs value
index | ADC index | |
imod | module number |
virtual char* slsDetector::getAngularConversion | ( | ) | [pure virtual] |
pure virtual function returns the angular conversion file
Implemented in mythenDetector.
virtual int slsDetector::getAngularConversion | ( | int & | direction, | |
angleConversionConstant * | angconv = NULL | |||
) | [pure virtual] |
pure virtual function get angular conversion
reference | to diffractometer direction | |
angconv | array that will be filled with the angular conversion constants |
Implemented in mythenDetector.
int slsDetector::getBadChannelCorrection | ( | int * | bad = NULL |
) |
get bad channels correction
bad | pointer to array that if bad!=NULL will be filled with the bad channel list |
char* slsDetector::getBadChannelCorrectionFile | ( | ) | [inline] |
returns the bad channel list file
virtual float slsDetector::getBinSize | ( | ) | [pure virtual] |
pure virtual function return detector bin size used for merging (approx angular resolution)
Implemented in mythenDetector.
char* slsDetector::getCalDir | ( | ) | [inline] |
returns the location of the calibration files
sls_detector_channel slsDetector::getChannel | ( | int | ichan, | |
int | ichip, | |||
int | imod | |||
) |
get channel
ichan | channel number | |
ichip | chip number | |
imod | module number |
sls_detector_chip slsDetector::getChip | ( | int | ichip, | |
int | imod | |||
) |
get chip
ichip | chip number | |
imod | module number |
int slsDetector::getControlPort | ( | ) | [inline] |
returns the detector control port
int * slsDetector::getDataFromDetector | ( | ) | [protected] |
Receives a data frame from the detector socket
int * slsDetector::getDataFromDetectorNoWait | ( | ) |
receives a data frame from the detector socket
int slsDetector::getDataPort | ( | ) | [inline] |
returns the detector data port
void slsDetector::getDetectorType | ( | char * | type | ) |
gets detector type normally the detector knows what type of detector it is
type | is the string where the detector type will be written ("Mythen", "Pilatus", "XFS", "Gotthard", Agipd") |
int slsDetector::getFileIndex | ( | ) | [inline] |
returns the default output file index
char* slsDetector::getFileName | ( | ) | [inline] |
returns the default output files root name
char* slsDetector::getFilePath | ( | ) | [inline] |
returns the default output files path
virtual float slsDetector::getFineOffset | ( | ) | [pure virtual] |
pure virtual function get detector fine offset
Implemented in mythenDetector.
int slsDetector::getFlatFieldCorrection | ( | float * | corr = NULL , |
|
float * | ecorr = NULL | |||
) |
get flat field corrections
corr | if !=NULL will be filled with the correction coefficients | |
ecorr | if !=NULL will be filled with the correction coefficients errors |
virtual float slsDetector::getGlobalOffset | ( | ) | [pure virtual] |
pure virtual function get detector global offset
Implemented in mythenDetector.
char* slsDetector::getHostname | ( | ) | [inline] |
returns the detector hostname
int64_t slsDetector::getId | ( | idMode | mode, | |
int | imod = 0 | |||
) |
get detector ids/versions for module
mode | which id/version has to be read | |
imod | module number for module serial number |
int slsDetector::getMaxNumberOfModules | ( | dimension | d = X |
) |
get the maximum size of the detector
d | dimension |
sls_detector_module * slsDetector::getModule | ( | int | imod | ) |
get module
imod | module number |
virtual int slsDetector::getPositions | ( | float * | pos = NULL |
) | [pure virtual] |
pure virtual function get positions for the acquisition
pos | array which will contain the encoder positions |
Implemented in mythenDetector.
int slsDetector::getRateCorrection | ( | ) |
get rate correction
int slsDetector::getRateCorrection | ( | float & | t | ) |
get rate correction
t | reference for dead time |
int slsDetector::getRunStatus | ( | ) |
get run status
detectorSettings slsDetector::getSettings | ( | int | imod = -1 |
) |
get detector settings
imod | module number (-1 all) |
int slsDetector::getStopPort | ( | ) | [inline] |
returns the detector stop port
int slsDetector::getThresholdEnergy | ( | int | imod = -1 |
) |
get threshold energy
imod | module number (-1 all) |
int64_t slsDetector::getTimeLeft | ( | timerIndex | index | ) |
get current timer value
index | timer index |
char* slsDetector::getTrimDir | ( | ) | [inline] |
returns the detector trimbit directory
int slsDetector::getTrimEn | ( | int * | en = NULL |
) | [inline] |
returns the number of trim energies and their value
point | to the array that will contain the trim energies (in ev) |
int slsDetector::giveCalibrationPulse | ( | float | vcal, | |
int | npulses | |||
) |
give a train of calibration pulses
vcal | pulse amplitude | |
npulses | number of pulses |
int slsDetector::initializeDetectorSize | ( | detectorType | type | ) | [protected] |
Initializes the thisDetector structure
type | is needed to define the number of channels, chips, modules etc. |
if the shared memory has newly be created, initialize the detector variables
set hostname to default
set ports to defaults
set thisDetector->myDetectorType to type and according to this set nChans, nChips, nDacs, nAdcs, nModMax, dynamicRange, nMod
number of modules is initally the maximum number of modules
calculates the expected data size
set trimDsdir, calDir and filePath to default to home directory
set fileName to default to run
set fileIndex to default to 0
set number of trim energies to 0
set correction mask to 0
set deat time
sets bad channel list file to none
set number of bad chans to 0
set number of bad flat field chans to 0
set angular direction to 1
set fine offset to 0
set global offset to 0
set number of rois to 0
set readoutflags to none
set current settings to uninitialized
set threshold to -1
set clockdivider to 1
set number of positions to 0
sets angular conversion file to none
set binsize
calculates the memory offsets for flat field coefficients and errors, module structures, dacs, adcs, chips and channels
also in case thisDetector alread existed initialize the pointer for flat field coefficients and errors, module structures, dacs, adcs, chips and channels
if thisDetector is new, initialize its structures
fill the BadChannelMask
int slsDetector::initializeDetectorStructure | ( | ) | [protected] |
Initializes the module structures in thisDetector if the detector did not exists before
for each of the detector modules up to the maximum number which can be installed initlialize the sls_detector_module structure
initializes the serial number and register to 0
initializes the dacs values to 0
initializes the adc values to 0
initializes the chip registers to 0
initializes the channel registers to 0
initialize gain and offset to -1
int slsDetector::initSharedMemory | ( | detectorType | type = GENERIC , |
|
int | id = 0 | |||
) | [protected] |
Initializes the shared memory
type | is needed to define the size of the shared memory | |
id | is the detector id needed to define the shared memory id |
the shared memory key is set to DEFAULT_SHM_KEY+id
The size of the shared memory is: size of shared structure + ffcoefficents +fferrors + modules+ dacs+adcs+chips+chans
thisDetector pointer is set to the memory address of the shared memory
shm_id returns -1 is shared memory initialization fails
int * slsDetector::popDataQueue | ( | ) |
pops the data from the data queue
detectorData * slsDetector::popFinalDataQueue | ( | ) |
pops the data from thepostprocessed data queue
virtual void* slsDetector::processData | ( | int | delflag = 1 |
) | [pure virtual] |
pure virtual function function for processing data /param delflag if 1 the data are processed, written to file and then deleted. If 0 they are added to the finalDataQueue
Implemented in mythenDetector.
int slsDetector::rateCorrect | ( | float * | datain, | |
float * | errin, | |||
float * | dataout, | |||
float * | errout | |||
) |
rate correct data
datain | data array | |
errin | error array on data (if NULL will default to sqrt(datain) | |
dataout | array of corrected data | |
errout | error on corrected data (if not NULL) |
int slsDetector::rateCorrect | ( | float | datain, | |
float | errin, | |||
float & | dataout, | |||
float & | errout, | |||
float | tau, | |||
float | t | |||
) |
rate correct data
datain | data | |
errin | error on data (if<=0 will default to sqrt(datain) | |
dataout | corrected data | |
errout | error on corrected data | |
tau | dead time 9in ns) | |
t | acquisition time (in ns) |
int * slsDetector::readAll | ( | ) |
asks and receives all data from the detector and puts them in a data queue
virtual int slsDetector::readAngularConversion | ( | string | fname = "" |
) | [pure virtual] |
Pure virtual function reads an angular conversion file
fname | file to be read |
Implemented in mythenDetector.
virtual int slsDetector::readCalibrationFile | ( | string | fname, | |
float & | gain, | |||
float & | offset | |||
) | [pure virtual] |
Pure virtual function reads a calibration file
fname | file to be read | |
gain | reference to the gain variable reference to the offset variable |
Implemented in mythenDetector, and eigerDetector.
virtual int slsDetector::readConfigurationFile | ( | string const | fname | ) | [pure virtual] |
Purely virtual function Should be implemented in the specific detector class /sa mythenDetector::readConfigurationFile
Implemented in mythenDetector.
virtual int slsDetector::readDataFile | ( | string | fname, | |
int * | data | |||
) | [pure virtual] |
Pure virtual function reads a data file
name | of the file to be read | |
data | array of data values |
Implemented in mythenDetector, and eigerDetector.
virtual int slsDetector::readDataFile | ( | string | fname, | |
float * | data, | |||
float * | err = NULL , |
|||
float * | ang = NULL , |
|||
char | dataformat = 'f' , |
|||
int | nch = 0 | |||
) | [pure virtual] |
Pure virtual function 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 |
Implemented in mythenDetector, and eigerDetector.
int * slsDetector::readFrame | ( | ) |
asks and receives a data frame from the detector
int slsDetector::readRegister | ( | int | addr | ) |
read register
addr | address |
virtual sls_detector_module* slsDetector::readTrimFile | ( | string | fname, | |
sls_detector_module * | myMod = NULL | |||
) | [pure virtual] |
Pure virtual function 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 |
Implemented in mythenDetector, and eigerDetector.
int slsDetector::receiveChannel | ( | sls_detector_channel * | ) | [protected] |
receive a sls_detector_channel structure over socket
int slsDetector::receiveChip | ( | sls_detector_chip * | ) | [protected] |
receive a sls_detector_chip structure over socket
int slsDetector::receiveModule | ( | sls_detector_module * | ) | [protected] |
receive a sls_detector_module structure over socket
virtual int slsDetector::resetMerging | ( | float * | mp, | |
float * | mv, | |||
float * | me, | |||
int * | mm | |||
) | [pure virtual] |
pure virtual function 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 |
Implemented in mythenDetector.
virtual int slsDetector::retrieveDetectorSetup | ( | string const | fname | ) | [pure virtual] |
Purely virtual function Should be implemented in the specific detector class /sa mythenDetector::retrieveDetectorSetup
Implemented in mythenDetector.
int slsDetector::sendChannel | ( | sls_detector_channel * | ) | [protected] |
send a sls_detector_channel structure over socket
int slsDetector::sendChip | ( | sls_detector_chip * | ) | [protected] |
send a sls_detector_chip structure over socket
int slsDetector::sendModule | ( | sls_detector_module * | ) | [protected] |
send a sls_detector_module structure over socket
virtual int slsDetector::setAngularConversion | ( | string | fname = "" |
) | [pure virtual] |
pure virtual function set angular conversion
fname | file with angular conversion constants ("" disable) |
Implemented in mythenDetector.
int slsDetector::setBadChannelCorrection | ( | string | fname = "" |
) |
set bad channels correction
fname | file with bad channel list ("" disable) |
virtual float slsDetector::setBinSize | ( | float | bs | ) | [pure virtual] |
pure virtual function set detector bin size used for merging (approx angular resolution)
bs | bin size in degrees |
Implemented in mythenDetector.
char* slsDetector::setCalDir | ( | string | s | ) | [inline] |
sets the location of the calibration files
int slsDetector::setChannel | ( | sls_detector_channel | chan | ) |
configure channel
chan | channel to be set - must contain correct channel, module and chip number |
int slsDetector::setChannel | ( | int64_t | reg, | |
int | ichan = -1 , |
|||
int | ichip = -1 , |
|||
int | imod = -1 | |||
) |
configure channel
reg | channel register | |
ichan | channel number (-1 all) | |
ichip | chip number (-1 all) | |
imod | module number (-1 all) |
int slsDetector::setChip | ( | sls_detector_chip | chip | ) |
configure chip
chip | chip to be set - must contain correct module and chip number and also channel registers |
int slsDetector::setChip | ( | int | reg, | |
int | ichip = -1 , |
|||
int | imod = -1 | |||
) |
configure chip
reg | chip register | |
ichip | chip number (-1 all) | |
imod | module number (-1 all) |
float slsDetector::setDAC | ( | float | val, | |
dacIndex | index, | |||
int | imod = -1 | |||
) |
set dacs value
val | value (in V) | |
index | DAC index | |
imod | module number (if -1 alla modules) |
int slsDetector::setDetectorType | ( | string | type | ) |
sets/gets detector type normally the detector knows what type of detector it is
type | is the detector type ("Mythen", "Pilatus", "XFS", "Gotthard", Agipd") |
int slsDetector::setDetectorType | ( | detectorType | type = GET_DETECTOR_TYPE |
) |
sets/gets detector type normally the detector knows what type of detector it is
type | is the detector type (defaults to GET_DETECTOR_TYPE) |
int slsDetector::setDynamicRange | ( | int | n = -1 |
) |
set/get dynamic range
n | dynamic range (-1 get) |
externalCommunicationMode slsDetector::setExternalCommunicationMode | ( | externalCommunicationMode | pol = GET_EXTERNAL_COMMUNICATION_MODE |
) |
set/get the external communication mode
obsolete
pol | value to be set |
externalSignalFlag slsDetector::setExternalSignalFlags | ( | externalSignalFlag | pol = GET_EXTERNAL_SIGNAL_FLAG , |
|
int | signalindex = 0 | |||
) |
set/get the use of an external signal
pol | meaning of the signal |
signalIndex | index of the signal |
int slsDetector::setFileIndex | ( | int | i | ) | [inline] |
sets the default output file index
char* slsDetector::setFileName | ( | string | s | ) | [inline] |
sets the default output files root name
char* slsDetector::setFilePath | ( | string | s | ) | [inline] |
sets the default output files path
virtual float slsDetector::setFineOffset | ( | float | f | ) | [pure virtual] |
pure virtual function set detector fine offset
Implemented in mythenDetector.
int slsDetector::setFlatFieldCorrection | ( | string | fname = "" |
) |
set flat field corrections
fname | name of the flat field file (or "" if disable) |
virtual float slsDetector::setGlobalOffset | ( | float | f | ) | [pure virtual] |
pure virtual function set detector global offset
Implemented in mythenDetector.
int slsDetector::setModule | ( | sls_detector_module | module | ) |
configure chip
module | module to be set - must contain correct module number and also channel and chip registers |
int slsDetector::setModule | ( | int | reg, | |
int | imod = -1 | |||
) |
configure module
imod | module number (-1 all) |
int slsDetector::setNumberOfModules | ( | int | n, | |
dimension | d = X | |||
) |
set/get the size of the detector
n | number of modules | |
d | dimension |
int slsDetector::setOnline | ( | int const | online | ) |
sets the onlineFlag
off | can be: GET_ONLINE_FLAG, returns wether the detector is in online or offline state; OFFLINE_FLAG, detector in offline state (i.e. no communication to the detector - using only local structure - no data acquisition possible!); ONLINE_FLAG detector in online state (i.e. communication to the detector updating the local structure) |
virtual int slsDetector::setPositions | ( | int | nPos, | |
float * | pos | |||
) | [pure virtual] |
pure virtual function set positions for the acquisition
nPos | number of positions | |
pos | array with the encoder positions |
Implemented in mythenDetector.
int slsDetector::setRateCorrection | ( | float | t = 0 |
) |
set rate correction
t | dead time in ns - if 0 disable correction, if >0 set dead time to t, if <0 set deadtime to default dead time for current settings |
int slsDetector::setReadOutFlags | ( | readOutFlags | flag | ) |
set/get readout flags
flag | readout flag to be set |
int slsDetector::setROI | ( | int | nroi = -1 , |
|
int * | xmin = NULL , |
|||
int * | xmax = NULL , |
|||
int * | ymin = NULL , |
|||
int * | ymax = NULL | |||
) |
set roi
not yet implemented
detectorSettings slsDetector::setSettings | ( | detectorSettings | isettings, | |
int | imod = -1 | |||
) |
set detector settings
isettings | settings | |
imod | module number (-1 all) |
int slsDetector::setSpeed | ( | speedVariable | sp, | |
int | value = -1 | |||
) |
sets/gets the value of important readout speed parameters
sp | is the parameter to be set/get | |
value | is the value to be set, if -1 get value |
int slsDetector::setTCPSocket | ( | string const | name = "" , |
|
int const | control_port = -1 , |
|||
int const | stop_port = -1 , |
|||
int const | data_port = -1 | |||
) |
configure the socket communication and initializes the socket instances
name | hostname - if "" the current hostname is used | |
control_port | port for control commands - if -1 the current is used | |
stop_port | port for stop command - if -1 the current is used | |
data_port | port for receiving data - if -1 the current is used |
int slsDetector::setThresholdEnergy | ( | int | e_eV, | |
int | imod = -1 , |
|||
detectorSettings | isettings = GET_SETTINGS | |||
) |
set threshold energy
e_eV | threshold in eV | |
imod | module number (-1 all) | |
isettings | ev. change settings |
int64_t slsDetector::setTimer | ( | timerIndex | index, | |
int64_t | t = -1 | |||
) |
set/get timer value
index | timer index | |
t | time in ns or number of...(e.g. frames, gates, probes) |
char* slsDetector::setTrimDir | ( | string | s | ) | [inline] |
sets the detector trimbit directory
int slsDetector::startAcquisition | ( | ) |
start detector acquisition
int * slsDetector::startAndReadAll | ( | ) |
start detector acquisition and read all data putting them a data queue
int slsDetector::startAndReadAllNoWait | ( | ) |
start detector acquisition and read out, but does not read data from socket
int slsDetector::startReadOut | ( | ) |
start readout (without exposure or interrupting exposure)
void slsDetector::startThread | ( | ) | [protected] |
start data processing threas
int slsDetector::stopAcquisition | ( | ) |
stop detector acquisition
virtual int slsDetector::writeAngularConversion | ( | string | fname = "" |
) | [pure virtual] |
Pure virtual function writes an angular conversion file
fname | file to be written |
Implemented in mythenDetector.
virtual int slsDetector::writeCalibrationFile | ( | string | fname, | |
float | gain, | |||
float | offset | |||
) | [pure virtual] |
Pure virtual function writes a calibration file
fname | file to be written | |
gain | ||
offset |
Implemented in mythenDetector, and eigerDetector.
virtual int slsDetector::writeConfigurationFile | ( | string const | fname | ) | [pure virtual] |
Purely virtual function Should be implemented in the specific detector class /sa mythenDetector::writeConfigurationFile
Implemented in mythenDetector.
virtual int slsDetector::writeDataFile | ( | string | fname, | |
int * | data | |||
) | [pure virtual] |
Pure virtual function writes a data file
name | of the file to be written | |
data | array of data values |
Implemented in mythenDetector, and eigerDetector.
virtual int slsDetector::writeDataFile | ( | string | fname, | |
float * | data, | |||
float * | err = NULL , |
|||
float * | ang = NULL , |
|||
char | dataformat = 'f' , |
|||
int | nch = -1 | |||
) | [pure virtual] |
Pure virtual function 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 |
Implemented in mythenDetector, and eigerDetector.
int slsDetector::writeRegister | ( | int | addr, | |
int | val | |||
) |
write register
addr | address value |
virtual int slsDetector::writeTrimFile | ( | string | fname, | |
int | imod | |||
) | [pure virtual] |
Pure virtual function 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 |
Implemented in mythenDetector, and eigerDetector.
virtual int slsDetector::writeTrimFile | ( | string | fname, | |
sls_detector_module | mod | |||
) | [pure virtual] |
Pure virtual function writes a trim file
fname | name of the file to be written | |
mod | module structure which has to be written to file |
Implemented in mythenDetector, and eigerDetector.
float* slsDetector::adcs [protected] |
pointer to adc valuse
int* slsDetector::badChannelMask [protected] |
pointer to bad channel mask 0 is channel is good 1 if it is bad
int* slsDetector::chanregs [protected] |
pointer to channal registers
int* slsDetector::chipregs [protected] |
pointer to chip registers
MySocketTCP* slsDetector::controlSocket [protected] |
socket for control commands
float slsDetector::currentI0 [protected] |
I0 measured
float slsDetector::currentPosition [protected] |
current position of the detector
float slsDetector::currentPositionIndex [protected] |
current position index of the detector
float* slsDetector::dacs [protected] |
pointer to dac valuse
queue<int*> slsDetector::dataQueue [protected] |
data queue
MySocketTCP* slsDetector::dataSocket [protected] |
socket for data acquisition
sls_detector_module* slsDetector::detectorModules [protected] |
pointer to detector module structures
int slsDetector::detId [protected] |
detector ID
float* slsDetector::ffcoefficients [protected] |
pointer to flat field coefficients
float* slsDetector::fferrors [protected] |
pointer to flat field coefficient errors
queue<detectorData*> slsDetector::finalDataQueue [protected] |
queue containing the postprocessed data
float* slsDetector::mergingBins [protected] |
merging bins
float* slsDetector::mergingCounts [protected] |
merging counts
float* slsDetector::mergingErrors [protected] |
merging errors
int* slsDetector::mergingMultiplicity [protected] |
merging multiplicity
int slsDetector::onlineFlag [protected] |
int slsDetector::shmId [protected] |
shared memeory ID
MySocketTCP* slsDetector::stopSocket [protected] |
socket for emergency stop
sharedSlsDetector* slsDetector::thisDetector [protected] |
address of the detector structure in shared memory