mythenDetector/mythenDetector.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 #ifndef MYTHEN_DETECTOR_H
00005 #define MYTHEN_DETECTOR_H
00006 
00007 using namespace std;
00008 
00009 
00010 
00022 #include "slsDetector.h"
00023 
00024 class mythenDetector : public slsDetector{
00025 
00026 
00027 
00028  public:
00029   
00030 
00031 
00038   mythenDetector(int id=0);
00039   //slsDetector(string  const fname);
00041   ~mythenDetector(){};
00042 
00043 
00044 
00052   sls_detector_module* readTrimFile(string fname,  sls_detector_module* myMod=NULL);
00053 
00062   int writeTrimFile(string fname, sls_detector_module mod); 
00063   
00071   int writeTrimFile(string fname, int imod);
00072 
00073  
00087   int writeDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=-1); 
00088   
00095   int writeDataFile(string fname, int *data);
00096   
00110   int readDataFile(string fname, float *data, float *err=NULL, float *ang=NULL, char dataformat='f', int nch=0);  
00111 
00118   int readDataFile(string fname, int *data);
00119 
00132   int readCalibrationFile(string fname, float &gain, float &offset);
00133 
00141   int writeCalibrationFile(string fname, float gain, float offset);
00142 
00143 
00149   int readAngularConversion(string fname="");
00155   int writeAngularConversion(string fname="");
00156  
00157 
00158 
00159   /* Communication to server */
00160 
00161   // Tests and identification
00162 
00168   int setAngularConversion(string fname="");
00169 
00176   int getAngularConversion(int &direction,  angleConversionConstant *angconv=NULL);
00177   
00181   float setGlobalOffset(float f){thisDetector->globalOffset=f; return thisDetector->globalOffset;}; 
00182 
00186   float setFineOffset(float f){thisDetector->fineOffset=f; return thisDetector->fineOffset;};
00190   float getFineOffset(){return thisDetector->fineOffset;};
00191   
00195   float getGlobalOffset(){return thisDetector->globalOffset;};
00196 
00203   int setPositions(int nPos, float *pos){thisDetector->numberOfPositions=nPos; for (int ip=0; ip<nPos; ip++) thisDetector->detPositions[ip]=pos[ip]; return thisDetector->numberOfPositions;};
00209   int getPositions(float *pos=NULL){ if (pos ) {for (int ip=0; ip<thisDetector->numberOfPositions; ip++) pos[ip]=thisDetector->detPositions[ip];} return thisDetector->numberOfPositions;};
00210   
00211   
00213   float setBinSize(float bs) {thisDetector->binSize=bs; return thisDetector->binSize;}
00215   float getBinSize() {return thisDetector->binSize;}
00216 
00217 
00218 
00219 
00220 
00221 
00227   float* decodeData(int *datain);
00228 
00229   
00230   
00231   int resetMerging(float *mp, float *mv,float *me, int *mm);
00242   int addToMerging(float *p1, float *v1, float *e1, float *mp, float *mv,float *me, int *mm);
00243 
00252   int finalizeMerging(float *mp, float *mv,float *me, int *mm);
00253 
00254  
00255 
00256  private:
00257  
00258 
00259 };
00260 
00261 
00262 #endif

Generated on Fri Oct 9 16:01:04 2009 by  doxygen 1.4.7