diff --git a/slsDetectorCalibration/moench02ModuleData.h b/slsDetectorCalibration/moench02ModuleData.h index 20ad2ae3f..34b4f1783 100644 --- a/slsDetectorCalibration/moench02ModuleData.h +++ b/slsDetectorCalibration/moench02ModuleData.h @@ -18,7 +18,8 @@ class moench02ModuleData : public slsReceiverData { */ - moench02ModuleData(double c=0): slsReceiverData(160, 160, 40, 1286), xtalk(c) { + moench02ModuleData(double c=0): slsReceiverData(160, 160, 40, 1286), + xtalk(c) { @@ -96,8 +97,9 @@ class moench02ModuleData : public slsReceiverData { */ double getValue(char *data, int ix, int iy=0) { + // cout << "##" << (void*)data << " " << ix << " " <::getValue(data, ix, iy); else return slsDetectorData::getValue(data, ix, iy)-xtalk*slsDetectorData::getValue(data, ix-1, iy); }; diff --git a/slsDetectorCalibration/moenchReadData.C b/slsDetectorCalibration/moenchReadData.C index a948c3e2c..ff57c9b12 100644 --- a/slsDetectorCalibration/moenchReadData.C +++ b/slsDetectorCalibration/moenchReadData.C @@ -134,6 +134,7 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb //calculate pedestals and common modes if (cmsub) { + // cout << "cm" << endl; for (ix=xmin-1; ixgetEventType(buff, ix, iy,0); @@ -141,10 +142,11 @@ THStack *moenchReadData(char *fformat, char *tit, int runmin, int runmax, int nb } - + // cout << "new frame " << endl; for (ix=xmin-1; ixgetEventType(buff, ix, iy, cmsub); #ifdef MY_DEBUG diff --git a/slsDetectorCalibration/singlePhotonDetector.h b/slsDetectorCalibration/singlePhotonDetector.h index 03d2585d8..e28fe8eb4 100644 --- a/slsDetectorCalibration/singlePhotonDetector.h +++ b/slsDetectorCalibration/singlePhotonDetector.h @@ -118,7 +118,15 @@ class singlePhotonDetector { \param ix pixel x coordinate \param iy pixel y coordinate */ - virtual void addToPedestal(double val, int ix, int iy){ if (ix>=0 && ix=0 && iyisGood(ix, iy) ) cmSub->addToCommonMode(val, ix, iy);}}; + virtual void addToPedestal(double val, int ix, int iy){ + // cout << "*"<< ix << " " << iy << " " << val << endl; + if (ix>=0 && ix=0 && iyisGood(ix, iy) ) + cmSub->addToCommonMode(val, ix, iy); + }; + }; /** gets pedestal (and common mode) @@ -177,10 +185,14 @@ class singlePhotonDetector { // eventType ret=PEDESTAL; double tot=0, max=0; - + // cout << iframe << endl; + if (iframe { public: /** - - slsReceiver data structure. Works for data acquired using the slsDetectorReceiver subdivided in different packets with headers and footers. Inherits and implements slsDetectorData. @@ -69,12 +67,13 @@ class slsReceiverData : public slsDetectorData { while (dd<=(dsize-packetSize)) { pnum=getPacketNumber(p); fn=getFrameNumber(p); - if (pnum<0 || pnum>=nPackets) { + + + if (pnum<1 || pnum>nPackets) { cout << "Bad packet number " << pnum << " frame "<< fn << endl; retval=NULL; - continue; - } - if (pnum==1) { + np=0; + } else if (pnum==1) { fnum=fn; retval=p; if (np>0) @@ -90,21 +89,23 @@ class slsReceiverData : public slsDetectorData { p+=packetSize; dd+=packetSize; np++; + // cout << pnum << " " << fn << " " << np << " " << dd << " " << dsize << endl; if (np==nPackets) - if (pnum==nPackets) + if (pnum==nPackets) { + // cout << "Frame found!" << endl; break; - else { + } else { cout << "Too many packets for this frame! "<< fnum << " " << pnum << endl; retval=NULL; } } - if (np<40) { + if (np0) cout << "Too few packets for this frame! "<< fnum << " " << pnum << endl; } ndata=np*packetSize; - + // cout << "return " << ndata << endl; return retval; }; @@ -128,14 +129,19 @@ class slsReceiverData : public slsDetectorData { retval=findNextFrame(data,nd,packetSize*nPackets); np=nd/packetSize; + // cout << np << endl; - if (retval==data && np==nPackets) + + if (retval==data && np==nPackets) { + // cout << "-" << endl; return data; - else if (np>nPackets) { - cout << "too many packets!!!!!!!!!!" << endl; + + } else if (np>nPackets) { + cout << "too many packets!!!!!!!!!!" << endl; delete [] data; return NULL; - } else { + } else if (retval!=NULL) { + // cout << "+" << endl;; for (int ip=0; ip { delete [] data; return NULL; } else { + // cout << "." << endl;; np++; } }