From 2e894f33ce07b03fb59433ec9ed1f10167720ca0 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Mon, 18 Jul 2016 11:06:29 +0200 Subject: [PATCH] fixed bug of pointing to wrong missing packet header fo 10g and 1g32 bit --- slsDetectorCalibration/eigerHalfModuleData.h | 46 ++++++++++++-------- slsDetectorCalibration/slsDetectorData.h | 36 +++------------ 2 files changed, 32 insertions(+), 50 deletions(-) diff --git a/slsDetectorCalibration/eigerHalfModuleData.h b/slsDetectorCalibration/eigerHalfModuleData.h index ed0893387..0a3fc4b84 100644 --- a/slsDetectorCalibration/eigerHalfModuleData.h +++ b/slsDetectorCalibration/eigerHalfModuleData.h @@ -22,6 +22,9 @@ public: eigerHalfModuleData(int dr, int np, int bsize, int dsize, bool top, double c=0): slsReceiverData(xpixels, ypixels, np, bsize), xtalk(c), bufferSize(bsize), actualDataSize(dsize), dynamicRange(dr), numberOfPackets(np), top(top),header_t(0), footer_t(0){ + tenGiga = false; + if(actualDataSize == TEN_GIGA_PACKET_SIZE) + tenGiga = true; int **dMap; uint32_t **dMask; @@ -203,7 +206,6 @@ public: - /** Returns the frame number for the given dataset. \param buff pointer to the dataset \returns frame number @@ -217,8 +219,6 @@ public: - - /** gets the packets number \param buff pointer to the memory \returns packet number @@ -241,9 +241,9 @@ public: double getValue(char *data, int ix, int iy=0) { // cout << "##" << (void*)data << " " << ix << " " <>4)^m; return (n & 0xf)^m; } - else if(dr == 8) return (n & 0xff)^m; - else if(dr == 16) return (n & 0xffff)^m; + else if(dynamicRange == 8) return (n & 0xff)^m; + else if(dynamicRange == 16) return (n & 0xffff)^m; else return (n & 0xffffffff)^m; @@ -353,6 +359,8 @@ private: const int dynamicRange; const int numberOfPackets; bool top; + bool tenGiga; + static const int TEN_GIGA_PACKET_SIZE = 4096; /** structure of an eiger packet*/ diff --git a/slsDetectorCalibration/slsDetectorData.h b/slsDetectorCalibration/slsDetectorData.h index 34941a6da..3a6fae403 100644 --- a/slsDetectorCalibration/slsDetectorData.h +++ b/slsDetectorCalibration/slsDetectorData.h @@ -88,10 +88,7 @@ class slsDetectorData { /** defines the data map (as offset) - no error checking if datasize and offsets are compatible! \param dMap array of size nx*ny storing the pointers to the data in the dataset (as offset). If NULL (default),the data are arranged as if read out row by row (dataMap[iy][ix]=(iy*nx+ix)*sizeof(dataType);) - */ - - void setDataMap(int **dMap=NULL) { /* int ip;*/ @@ -123,8 +120,6 @@ class slsDetectorData { \param dMask Array of size nx*ny storing the polarity of the data in the dataset (should be 0 if no inversion is required, 0xffffffff is inversion is required) */ - - void setDataMask(dataType **dMask=NULL){ if (dMask!=NULL) { @@ -143,7 +138,6 @@ class slsDetectorData { \param dROI Array of size nx*ny. The lements are 1s if the channel is good or in the ROI, 0 is bad or out of the ROI. NULL (default) means all 1s. */ - void setDataROIMask(int **dROI=NULL){ if (dROI!=NULL) { @@ -188,12 +182,12 @@ class slsDetectorData { /** Returns the size of the data frame */ int getDataSize() {return dataSize;}; + /** changes the size of the data frame */ int setDataSize(int d) {dataSize=d; return dataSize;}; /** - Returns the value of the selected channel for the given dataset. Virtual function, can be overloaded. \param data pointer to the dataset (including headers etc) \param ix pixel number in the x direction @@ -201,8 +195,6 @@ class slsDetectorData { \returns data for the selected channel, with inversion if required */ - - virtual dataType getChannel(char *data, int ix, int iy=0) { dataType m=0, d=0; if (ix>=0 && ix=0 && iy=0 && dataMap[iy][ix]