From a7c044ef17b028c2d24c7dd0745e702a0950d6c0 Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Fri, 4 Oct 2013 08:48:50 +0000 Subject: [PATCH] small changes with singlePhotonFilter git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@679 951219d9-93cf-4727-9268-0efd64621fa3 --- .../singlePhotonFilter.cpp | 226 +----------------- 1 file changed, 3 insertions(+), 223 deletions(-) diff --git a/slsDetectorSoftware/slsDetectorAnalysis/singlePhotonFilter.cpp b/slsDetectorSoftware/slsDetectorAnalysis/singlePhotonFilter.cpp index 9869838d1..e349761d3 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/singlePhotonFilter.cpp +++ b/slsDetectorSoftware/slsDetectorAnalysis/singlePhotonFilter.cpp @@ -232,19 +232,7 @@ int singlePhotonFilter::findHits(int16_t *myData, int myDataSize){ } -/* -//inside the receiver -//pop fifo -int16_t myData[160*160]; -if (singlePhotonFilter::verifyFrame(wbuf,rc, myData,firstTimeHere)) -if(firstTimeHere){ - firsttimeHere = 0; - //f0 = fnum; -} -//singlePhotonFilter:SetFrameNumber(fnum - f0); singlePhotonFilter:SetFrameNumber(int i){myPhotonHit.iframe = i;}; - singlePhotonFilter.findhits(myData,1286*40); -*/ void singlePhotonFilter::setupAcquisitionParameters(){ @@ -288,8 +276,6 @@ int singlePhotonFilter::verifyFrame(char *inData){ /*cout << "**Frame number doesnt match:Missing Packet! " << fnum << " " "Expected f " << fnum << " p " << pnum + 1 << " received f " << fIndex << " p " << pIndex << endl;*/ fnum = fIndex; - /* pnum = pIndex - 1; - ptot = 0;*/ pnum = pIndex; ptot = 1; ret = -2; //dont return here.. if is the end of packets, for gotthard uve toreturn -1 @@ -300,7 +286,7 @@ int singlePhotonFilter::verifyFrame(char *inData){ /* cout << "**packet number doesnt match:Missing Packet! " << fnum << " " "Expected f" << fnum << " p " << pnum + 1 << " received f " << fnum << " p " << pIndex << endl;*/ pnum = pIndex; - ptot++;/*ptot = 0;*/ + ptot++; } //no missing packet else{ @@ -309,14 +295,6 @@ int singlePhotonFilter::verifyFrame(char *inData){ } - //copy packet to correct spot in outData - /*myData[pIndex-1] = inData; - cout<<"mydata["<GetEntries() << endl; - filebin.open((const char *)(fname), ios::in | ios::binary); - if (filebin.is_open()) { - while (readNextFrame(filebin, mydata, fnum)) { - //to get rid of the first frame number - if (iii==0) { - f0=fnum; - iii = 1; - } - iframe=fnum-f0; - findHits(mydata, tall); - } - if (filebin.is_open()) - filebin.close(); - } else - cout << "could not open file " << fname << endl; - } -} - -int readNextFrame(ifstream &filebin, int16_t *mydata, int &ifr){ - - char buff[1286]; - int *header=(int*)buff; - char *footer=buff+1284; - // Short_t mydata[160*160];//=(Short_t*)(buff+4); - int pnum; - int fnum; - // int ifr; - int ipa; - int iii=0; - int nrow=160; - int colwidth=40; - // int nsigma=5; - int ncol=colwidth*4;//=160; - int nch=nrow*ncol; - int f0; - char fname[1000]; - int ptot=0; - if (filebin.is_open()) { - while (filebin.read(buff,sizeof(4))) { - // while (filebin.read(buff,sizeof(buff))) { - pnum=(*header)&0xff;//packet num - fnum=((*header)&(0xffffff00))>>8;//frame num - if (pnum==0) - pnum=40; - filebin.read((char*)(mydata+(pnum-1)*640),1280); - filebin.read(footer,2); - if (iii==0) { - // cout << "fnum " << fnum << " pnum " << pnum << coff << endl; - ifr=fnum; - ipa=pnum-1; - f0=fnum;//not used - iii=1; - ptot=0; - } - if (fnum!=ifr) { - cout << "Missing packet! "<< ifr << " "; - cout << "Expected f " <>8; - - if (pnum==0) - pnum=40; - - - filebin.read((char*)(mydata+(pnum-1)*640),1280); - filebin.read(footer,2); - - if (iii==0) { - // cout << "fnum " << fnum << " pnum " << pnum << coff << endl; - ifr=fnum; - ipa=pnum-1; - f0=fnum; - iii=1; - ptot=0; - - } - - if (fnum!=ifr) { - cout << "Missing packet! "<< ifr << " "; - cout << "Expected f " <