diff --git a/slsDetectorSoftware/Makefile b/slsDetectorSoftware/Makefile index 867d67e6f..6955d865c 100644 --- a/slsDetectorSoftware/Makefile +++ b/slsDetectorSoftware/Makefile @@ -1,7 +1,7 @@ CFLAGS= -g -DC_ONLY -fPIC #FLAGS+= #-DVERBOSE -DVERYVERBOSE -DFLAGS= -g -DDACS_INT -DTHIS_PATH='"$(shell pwd)"' -DSLS_RECEIVER_FUNCTION_LIST $(shell root-config --cflags --glibs) -DMYROOT1 -DALLFILE #-DMYROOT1 `root-config --cflags --glibs` +DFLAGS= -g -DDACS_INT -DTHIS_PATH='"$(shell pwd)"' -DSLS_RECEIVER_FUNCTION_LIST $(shell root-config --cflags --glibs) #-DALLFILE_DEBUG #-DMYROOT1 -DALLFILE #-DMYROOT1 `root-config --cflags --glibs` #ASM=$(shell echo "/lib/modules/`uname -r`/build/include") diff --git a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp index 3e7e5dd26..37265f6cd 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp +++ b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp @@ -110,18 +110,17 @@ slsReceiverFunctionList::slsReceiverFunctionList(detectorType det): strcpy(filePath,""); strcpy(fileName,"run"); + cmSub = NULL; for(int i=0;i(receiverdata[i], csize, sigma, sign, cmSub); -#endif } @@ -764,6 +754,8 @@ int slsReceiverFunctionList::setupWriter(){ //creating first file + + //mask pthread_mutex_lock(&status_mutex); for(int i=0;igetFrameNumber(buff); +#ifdef MYROOT1 myTree[ithread]->Fill(); //cout << "Fill in event: frmNr: " << iFrame << " ix " << ix << " iy " << iy << " type " << thisEvent << endl; +#else + pthread_mutex_lock(&write_mutex); + if((enableFileWrite) && (sfilefd)) + singlePhotonDet[ithread]->writeCluster(sfilefd); + pthread_mutex_unlock(&write_mutex); +#endif } } } @@ -1523,7 +1499,10 @@ int slsReceiverFunctionList::startWriting(){ packetsInFile += packetsPerFrame; packetsCaught += packetsPerFrame; totalPacketsCaught += packetsPerFrame; + if(packetsInFile >= maxPacketsPerFile) + createNewFile(); pthread_mutex_unlock(&progress_mutex); + #endif if(!once){ copyFrameToGui(buff); @@ -1537,7 +1516,7 @@ int slsReceiverFunctionList::startWriting(){ cout <<" **************ERROR SHOULD NOT COME HERE, Error 142536!"<push(wbuf)); #ifdef VERYVERBOSE cout<<"buf freed:"<<(void*)wbuf< #include #endif @@ -511,13 +513,13 @@ private: /** File Descriptor */ FILE *sfilefd; -#ifdef MYROOT1 //filter singlePhotonDetector *singlePhotonDet[MAX_NUM_WRITER_THREADS]; slsReceiverData *receiverdata[MAX_NUM_WRITER_THREADS]; moenchCommonMode *cmSub; bool commonModeSubtractionEnable; +#ifdef MYROOT1 /** Tree where the hits are stored */ TTree *myTree[MAX_NUM_WRITER_THREADS]; @@ -526,6 +528,7 @@ private: #endif + /** callback arguments are filepath