diff --git a/examples/moench03_T1_lab.config b/examples/moench03_T1_lab.config index 3d54a1acc..a8eb078a5 100644 --- a/examples/moench03_T1_lab.config +++ b/examples/moench03_T1_lab.config @@ -1,4 +1,4 @@ -hostname bchip071+ +hostname bchip135+ patword 0000 0000000000000000 patword 0001 0000000000000000 diff --git a/slsDetectorCalibration/analogDetector.h b/slsDetectorCalibration/analogDetector.h index 984271305..9f372ea06 100644 --- a/slsDetectorCalibration/analogDetector.h +++ b/slsDetectorCalibration/analogDetector.h @@ -226,8 +226,11 @@ template class analogDetector { \returns pointer to current gain map is file reading succeeded, NULL is file reading didn't work. */ double *readGainMap(const char * imgname) { - uint32 nnx, nny; - float *gm=ReadFromTiff( imgname, nny, nnx); + uint32 unnx, unny; + int nnx, nny; + float *gm=ReadFromTiff( imgname, unny, unnx); + nnx=unnx; + nny=unny; if (gm) { if (gmap) delete [] gmap; gmap=new double[nnx*nny]; diff --git a/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNew.h b/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNew.h index dbc412ca0..62fe17db0 100644 --- a/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNew.h +++ b/slsDetectorCalibration/dataStructures/moench03T1ReceiverDataNew.h @@ -77,9 +77,9 @@ class moench03T1ReceiverDataNew : public slsDetectorData { int row, col; - int isample; + // int isample; int iadc; - int ix, iy; + // int ix, iy; int npackets=40; int i; @@ -110,35 +110,35 @@ class moench03T1ReceiverDataNew : public slsDetectorData { } } - int ipacket; - int ibyte; - int ii=0; - for (ibyte=0; ibyte { virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) { - char *retval=0; - int nd; - int fnum = -1; - np=0; - int pn; + //char *retval=0; + // int nd; + //int fnum = -1; + // np=0; + // int pn; // cout << dataSize << endl; - if (ff>=0) - fnum=ff; + // if (ff>=0) + // fnum=ff; if (filebin.is_open()) { if (filebin.read(data, dataSize) ){ diff --git a/slsDetectorCalibration/dataStructures/slsDetectorData.h b/slsDetectorCalibration/dataStructures/slsDetectorData.h index b0a3a4ef0..7b49392be 100644 --- a/slsDetectorCalibration/dataStructures/slsDetectorData.h +++ b/slsDetectorCalibration/dataStructures/slsDetectorData.h @@ -253,12 +253,13 @@ class slsDetectorData { */ virtual dataType getChannel(char *data, int ix, int iy=0) { - dataType m=0, d=0; + dataType m=0, d=0, *p; if (ix>=0 && ix=0 && iy=0 && dataMap[iy][ix] +// bin/moenchClusterFinder moench03_25022020 moench_fluo_outputs flat_27keV_d0_f000000%d00000_1 0 10 //#include "moench03T1ZmqData.h" #ifdef NEWRECEIVER @@ -33,7 +34,9 @@ #include "multiThreadedAnalogDetector.h" #include "singlePhotonDetector.h" //#include "interpolatingDetector.h" - + +#include +#include #include #include #include @@ -50,20 +53,20 @@ int main(int argc, char *argv[]) { cout << "Usage is " << argv[0] << "indir outdir fname runmin runmax " << endl; return 1; } - int p=10000; + //int p=10000; int fifosize=1000; - int nthreads=1; - int nsubpix=25; - int etabins=nsubpix*10; - double etamin=-1, etamax=2; + int nthreads=16; + //int nsubpix=25; + //int etabins=nsubpix*10; + //double etamin=-1, etamax=2; int csize=3; int nx=400, ny=400; - int save=1; - int nsigma=1; + //int save=1; + int nsigma=5; int nped=1000; - int ndark=100; - int ok; - int iprog=0; + //int ndark=100; + //int ok; + //int iprog=0; @@ -108,9 +111,9 @@ int main(int argc, char *argv[]) { // cout << "filter "<< endl; - int size = 327680;////atoi(argv[3]); + //int size = 327680;////atoi(argv[3]); - int* image; + //int* image; //int* image =new int[327680/sizeof(int)]; filter->newDataSet(); @@ -120,21 +123,21 @@ int main(int argc, char *argv[]) { cout << " data size is " << dsize; - char data[dsize]; + //char data[dsize]; ifstream filebin; - char *indir=argv[1]; - char *outdir=argv[2]; - char *fformat=argv[3]; + string indir=string(argv[1]); + string outdir=string(argv[2]); + string fformat=string(argv[3]); int runmin=atoi(argv[4]); int runmax=atoi(argv[5]); - char fname[10000]; - char outfname[10000]; - char imgfname[10000]; - char pedfname[10000]; + string fname; + string outfname; + string imgfname; + //char pedfname[10000]; // strcpy(pedfname,argv[6]); - char fn[10000]; + char fn[10000]; std::time_t end_time; @@ -148,12 +151,6 @@ int main(int argc, char *argv[]) { cout << std::ctime(&end_time) << endl; - - - - - - char* buff; multiThreadedAnalogDetector *mt=new multiThreadedAnalogDetector(filter,nthreads,fifosize); @@ -170,17 +167,26 @@ int main(int argc, char *argv[]) { for (int irun=runmin; irunsetFilePointer(of); // cout << "file pointer set " << endl; @@ -212,7 +218,7 @@ int main(int argc, char *argv[]) { } ff=-1; } - cout << "--" << endl; + cout << "--" << endl; filebin.close(); // //close file // //join threads @@ -220,7 +226,7 @@ int main(int argc, char *argv[]) { if (of) fclose(of); - mt->writeImage(imgfname); + mt->writeImage(imgfname.c_str()); mt->clearImage(); std::time(&end_time); diff --git a/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp b/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp index 1032256a8..9b98ecd34 100644 --- a/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp +++ b/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp @@ -50,9 +50,9 @@ int main(int argc, char *argv[]) { #endif int iarg=4; char infname[10000]; - char fname[10000]; char outfname[10000]; #ifndef FF + char fname[10000]; iarg=4; #endif @@ -74,23 +74,46 @@ int main(int argc, char *argv[]) { cout << "Energy min: " << cmin << endl; cout << "Energy max: " << cmax << endl; //int etabins=500; +#ifndef NOINTERPOLATION int etabins=1000;//nsubpix*2*100; int etabinsY=etabins;//nsubpix*2*100; +#ifndef ETA3 double etamin=-1, etamax=2; //double etamin=-0.1, etamax=1.1; + double etax=0, etay=0; +#ifndef FF + double int_x, int_y; + // double d_x, d_y, res=5, xx, yy; + int ok; +#endif +#endif +#ifdef ETA3 double eta3min=-2, eta3max=2; + double eta3x, eta3y; + +#ifndef FF + double int3_x, int3_y; +#endif +#endif + #endif +#ifndef FF int quad; +#endif double sum, totquad; double sDum[2][2]; - double etax, etay, int_x, int_y; - double eta3x, eta3y, int3_x, int3_y, noint_x, noint_y; - int ok; + +#ifdef NOINTERPOLATION +#ifndef FF + double noint_x, noint_y; +#endif +#endif int f0=-1; int ix, iy, isx, isy; int nframes=0, lastframe=-1; - double d_x, d_y, res=5, xx, yy; - int nph=0, badph=0, totph=0; - FILE *f=NULL; + + //badph=0, + int nph=0, totph=0; + FILE *f=NULL; #ifdef DOUBLE_SPH single_photon_hit_double cl(3,3); @@ -120,6 +143,7 @@ int main(int argc, char *argv[]) { #ifndef FF + int *img; #ifndef NOINTERPOLATION cout << "read ff " << argv[2] << endl; sprintf(fname,"%s",argv[2]); @@ -132,7 +156,6 @@ int main(int argc, char *argv[]) { cout << "Will write eta file " << argv[2] << endl; #endif - int *img; float *totimg=new float[NC*NR*nSubPixels*nSubPixelsY]; for (ix=0; ixcalcEta(cl.get_cluster(), etax, etay, sum, totquad, sDum); +#endif +#ifdef FF + interp->calcEta(cl.get_cluster(), etax, etay, sum, totquad, sDum); +#endif + if (sum>cmin && totquad/sum>0.8 && totquad/sum<1.2 && sum200 && sum<580) { @@ -263,9 +292,9 @@ int main(int argc, char *argv[]) { #ifdef RECT1 WriteToTiff(rectimg, outfname,NC,NR*nSubPixelsY); #endif - cout << "Read " << nframes << " frames (first frame: " << f0 << " last frame: " << lastframe << " delta:" << lastframe-f0 << ") nph="<< nph <clearInterpolatedImage(); #endif + cout << "Read " << nframes << " frames (first frame: " << f0 << " last frame: " << lastframe << " delta:" << lastframe-f0 << ") nph="<< nph < #include #include - +#include #include using namespace std; @@ -58,19 +58,19 @@ int main(int argc, char *argv[]) { return 1; } - int p=10000; + //int p=10000; int fifosize=1000; int nthreads=10; - int nsubpix=25; - int etabins=nsubpix*10; - double etamin=-1, etamax=2; + //int nsubpix=25; + //int etabins=nsubpix*10; + //double etamin=-1, etamax=2; int csize=3; - int save=1; + //int save=1; int nsigma=5; int nped=10000; - int ndark=100; - int ok; - int iprog=0; + //int ndark=100; + //int ok; + //int iprog=0; int cf=0; @@ -101,13 +101,13 @@ int main(int argc, char *argv[]) { moench03CommonMode *cm=NULL; moench03GhostSummation *gs; double *gainmap=NULL; - float *gm; + //float *gm; - int size = 327680;////atoi(argv[3]); + //int size = 327680;////atoi(argv[3]); - int* image; + //int* image; //int* image =new int[327680/sizeof(int)]; int ff, np; @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) { char fname[10000]; char imgfname[10000]; char cfname[10000]; - char fn[10000]; + //char fn[10000]; std::time_t end_time; @@ -185,9 +185,9 @@ int main(int argc, char *argv[]) { cout << "pedestal file is " << pedfile << endl; if (thr>0) cout << "threshold is " << thr << endl; - - uint32 nnx, nny; - double *gmap; + uint32 unnx, unny; + int nnx, nny; + //double *gmap; // if (gainfname) { // gm=ReadFromTiff(gainfname, nny, nnx); @@ -221,10 +221,10 @@ int main(int argc, char *argv[]) { } else thr=0.15*thr; filter->newDataSet(); - int dsize=decoder->getDataSize(); + //int dsize=decoder->getDataSize(); - char data[dsize]; + //char data[dsize]; @@ -270,12 +270,14 @@ int main(int argc, char *argv[]) { mt->StartThreads(); mt->popFree(buff); - + DIR *dir; + struct dirent *ent; + // cout << "mt " << endl; int ifr=0; - double ped[nx*ny], *ped1; + double ped[nx*ny];//, *ped1; if (pedfile) { @@ -314,7 +316,9 @@ int main(int argc, char *argv[]) { } else cout << "Could not open pedestal file "<< fname << " for reading " << endl; } else { - float *pp=ReadFromTiff(pedfile, nny, nnx); + float *pp=ReadFromTiff(pedfile, unny, unnx); + nny=unny; + nnx=unnx; if (pp && nnx==nx && nny==ny) { for (int i=0; isetFrameMode(eFrame); - for (int irun=runmin; irun<=runmax; irun++) { cout << "DATA " ; // sprintf(fn,fformat,irun); - sprintf(ffname,"%s/%s.raw",indir,fformat); - sprintf(fname,ffname,irun); - sprintf(ffname,"%s/%s.tiff",outdir,fformat); - sprintf(imgfname,ffname,irun); - sprintf(ffname,"%s/%s.clust",outdir,fformat); - sprintf(cfname,ffname,irun); - cout << fname << " " ; + sprintf(ext,"_%d.raw",irun); + + + sprintf(imgfname,"%s/%s_%d.tiff",outdir,fformat,irun); + // sprintf(imgfname,ffname,irun); + sprintf(cfname,"%s/%s_%d.clust",outdir,fformat, irun); + //sprintf(cfname,ffname,irun); + cout << cfname << " " ; cout << imgfname << endl; - std::time(&end_time); - cout << std::ctime(&end_time) << endl; - // cout << fname << " " << outfname << " " << imgfname << endl; - filebin.open((const char *)(fname), ios::in | ios::binary); - // //open file - ifile=0; - if (filebin.is_open()){ - if (thr<=0 && cf!=0) { //cluster finder + + + if (thr<=0 && cf!=0) { //cluster finder if (of==NULL) { of=fopen(cfname,"w"); if (of) { @@ -375,6 +374,33 @@ int main(int argc, char *argv[]) { } } } + + if ((dir = opendir (indir)) != NULL) { + /* print all the files and directories within directory */ + while ((ent = readdir (dir)) != NULL) { + printf ("----------- %s\n", ent->d_name); + // printf ("************** %s", ent->d_name); + // cout << string(ent->d_name).find(fformat) << endl; + if (string(ent->d_name).find(string(fformat)+"_d0_f0")==0) { + printf ("+++++++++++++++ %s\n", ent->d_name); + if (string(ent->d_name).find(ext)!= string::npos) { + printf ("**************8 %s\n", ent->d_name); + + + + sprintf(fname,"%s/%s",indir,ent->d_name); + //sprintf(fname,ffname,irun); + cout << fname << endl; + + + std::time(&end_time); + cout << std::ctime(&end_time) << endl; + // cout << fname << " " << outfname << " " << imgfname << endl; + filebin.open((const char *)(fname), ios::in | ios::binary); + // //open file + ifile=0; + if (filebin.is_open()){ + // //while read frame ff=-1; ifr=0; @@ -412,18 +438,28 @@ int main(int argc, char *argv[]) { } cout << "--" << endl; filebin.close(); + } else + cout << "Could not open "<< fname << " for reading " << endl; + + } + + } // //close file // //join threads - while (mt->isBusy()) {;} - if (nframes>=0) { - if (nframes>0) { - sprintf(ffname,"%s/%s_f%05d.tiff",outdir,fformat,ifile); - sprintf(imgfname,ffname,irun); - } else { - sprintf(ffname,"%s/%s.tiff",outdir,fformat); + + + } + + while (mt->isBusy()) {;} + if (nframes>=0) { + if (nframes>0) { + sprintf(ffname,"%s/%s_f%05d.tiff",outdir,fformat,ifile); sprintf(imgfname,ffname,irun); - } - cout << "Writing tiff to " << imgfname << " " << thr1 <writeImage(imgfname, thr1); mt->clearImage(); if (of) { @@ -431,21 +467,27 @@ int main(int argc, char *argv[]) { of=NULL; mt->setFilePointer(NULL); } - } - std::time(&end_time); - cout << std::ctime(&end_time) << endl; - } else - cout << "Could not open "<< fname << " for reading " << endl; + } + std::time(&end_time); + cout << std::ctime(&end_time) << endl; + + closedir (dir); + } else { + /* could not open directory */ + cout << "could not open directory " << indir << endl; } + + } + if (nframes<0){ sprintf(ffname,"%s/%s.tiff",outdir,fformat); strcpy(imgfname,ffname); cout << "Writing tiff to " << imgfname << " " << thr1 <writeImage(imgfname, thr1); } - - - + + + return 0; } diff --git a/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp b/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp index bc9812acb..277da4d3f 100644 --- a/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp +++ b/slsDetectorCalibration/moenchExecutables/moenchZmqProcess.cpp @@ -1,4 +1,4 @@ -#define WRITE_QUAD +//#define WRITE_QUAD #define MOENCH_BRANCH #define C_GHOST 0.0004 @@ -139,8 +139,12 @@ int main(int argc, char *argv[]) { int ncol_cm=CM_ROWS; double xt_ghost=C_GHOST; - moench03CommonMode *cm=new moench03CommonMode(ncol_cm); - moench03GhostSummation *gs=new moench03GhostSummation(det, xt_ghost); + moench03CommonMode *cm=NULL; + moench03GhostSummation *gs=NULL; +#ifdef CORR + gs=new moench03GhostSummation(det, xt_ghost); + cm=new moench03CommonMode(ncol_cm); +#endif double *gainmap=NULL; float *gm; double *gmap=NULL; diff --git a/slsDetectorCalibration/multiThreadedAnalogDetector.h b/slsDetectorCalibration/multiThreadedAnalogDetector.h index eb1a64b5f..a873029cf 100644 --- a/slsDetectorCalibration/multiThreadedAnalogDetector.h +++ b/slsDetectorCalibration/multiThreadedAnalogDetector.h @@ -322,31 +322,39 @@ public: virtual int *getImage(int &nnx, int &nny, int &ns, int &nsy) { int *img; + cout << "get image "<< image << endl; // int nnx, nny, ns; // int nnx, nny, ns; int nn=dets[0]->getImageSize(nnx, nny,ns, nsy); if (image) { - delete image; + cout << "del image "<< image << endl; + delete [] image; image=NULL; } image=new int[nn]; + cout << "new image" << image << endl; //int nn=dets[0]->getImageSize(nnx, nny, ns); //for (i=0; igetImage(); - for (int i=0; igetImage(); + for (int i=0; i0) image[i]=img[i]; - // else - // image[i]=0; - else //if (img[i]>0) - image[i]+=img[i]; - //if (img[i]) cout << "det " << ii << " pix " << i << " val " << img[i] << " " << image[i] << endl; + // else + // image[i]=0; + else //if (img[i]>0) + image[i]+=img[i]; + /*** + gdb runtime error + ../multiThreadedAnalogDetector.h:349:14: runtime error: signed integer overflow: -1094794611 + -1094795013 cannot be rep + **/ + //if (img[i]) cout << "det " << ii << " pix " << i << " val " << img[i] << " " << image[i] << endl; + } + } - } return image; @@ -369,29 +377,32 @@ public: /* dets[ii]->writeImage(tit); */ /* } */ /* #endif */ + cout << "write image" << endl; int nnx, nny, ns, nsy; getImage(nnx, nny, ns, nsy); //int nnx, nny, ns; - int nn=dets[0]->getImageSize(nnx, nny, ns, nsy); - float *gm=new float[nn]; - if (gm) { - for (int ix=0; ixgetImageSize(nnx, nny, ns, nsy); + float *gm=new float[nn]; + if (gm) { + for (int ix=0; ix0 && ix/nnx<350) cout << ix/nnx << " " << ix%nnx << " " << image[ix]<< " " << gm[ix] << endl; - } - //cout << "image " << nnx << " " << nny << endl; - WriteToTiff(gm,imgname ,nnx, nny); - delete [] gm; - } else cout << "Could not allocate float image " << endl; - return NULL; - } + //if (image[ix]>0 && ix/nnx<350) cout << ix/nnx << " " << ix%nnx << " " << image[ix]<< " " << gm[ix] << endl; + } + cout << "image " << nnx << " " << nny << endl; + WriteToTiff(gm,imgname ,nnx, nny); + cout << imgname << endl; + delete [] gm; + cout << "del" << endl; + } else cout << "Could not allocate float image " << endl; + return NULL; + } virtual void StartThreads() { @@ -560,7 +571,7 @@ public: int *ff; double *ped; pthread_mutex_t fmutex; -}; + }; #endif diff --git a/slsDetectorCalibration/singlePhotonDetector.h b/slsDetectorCalibration/singlePhotonDetector.h index f863bc28a..a3cb7f318 100644 --- a/slsDetectorCalibration/singlePhotonDetector.h +++ b/slsDetectorCalibration/singlePhotonDetector.h @@ -4,7 +4,7 @@ #include "analogDetector.h" #include "single_photon_hit.h" - +#include //#define MYROOT1 @@ -62,8 +62,8 @@ public analogDetector { - - fm=new pthread_mutex_t ; + fm=new mutex; + // fm=new pthread_mutex_t ; eventMask=new eventType*[ny]; for (int i=0; i { setClusterSize(clusterSize); fm=orig->fm; + //setMutex(orig->fm); + + quad=UNDEFINED_QUADRANT; tot=0; @@ -350,7 +353,7 @@ int *getClusters(char *data, int *ph=NULL) { int cy=(clusterSizeY+1)/2; int cs=(clusterSize+1)/2; //int ir, ic; - + int iframe=det->getFrameNumber(data); double max=0, tl=0, tr=0, bl=0,br=0, *v; int cm=0; int good=1; @@ -394,9 +397,9 @@ int *getClusters(char *data, int *ph=NULL) { for (int ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) { for (int ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) { - if ((iy+ir)>=iy && (iy+ir)=ix && (ix+ic)=0 && (iy+ir)>=iy && (iy+ir)=0 &&(ix+ic)>=ix && (ix+ic)set_data(val[iy+ir][ix+ic],ic,ir); v=&(val[iy+ir][ix+ic]); tot+=*v; @@ -420,6 +423,9 @@ int *getClusters(char *data, int *ph=NULL) { eventMask[iy][ix]=PHOTON; } + } else + (clusters+nph)->set_data(0,ic,ir); + } } if (eventMask[iy][ix]==PHOTON && val[iy][ix]nSigma*(clusters+nph)->rms || tot>sqrt(clusterSizeY*clusterSize)*nSigma*(clusters+nph)->rms || ((clusters+nph)->quadTot)>sqrt(cy*cs)*nSigma*(clusters+nph)->rms) { if (val[iy][ix]>=max) { - eventMask[iy][ix]=PHOTON_MAX; - (clusters+nph)->tot=tot; - (clusters+nph)->x=ix; - (clusters+nph)->y=iy; - // (clusters+nph)->iframe=det->getFrameNumber(data); + eventMask[iy][ix]=PHOTON_MAX; + // (clusters+nph)->tot=tot; + (clusters+nph)->x=ix; + (clusters+nph)->y=iy; + (clusters+nph)->iframe=iframe; // cout << det->getFrameNumber(data) << " " << (clusters+nph)->iframe << endl; - (clusters+nph)->ped=getPedestal(ix,iy,0); - for (int ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) { - for (int ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) { - (clusters+nph)->set_data(val[iy+ir][ix+ic],ic,ir); + // (clusters+nph)->ped=getPedestal(ix,iy,0); + // for (int ir=-(clusterSizeY/2); ir<(clusterSizeY/2)+1; ir++) { + // for (int ic=-(clusterSize/2); ic<(clusterSize/2)+1; ic++) { + // if ((iy+ir)>=0 && (iy+ir)=0 && (ix+ic)set_data(val[iy+ir][ix+ic],ic,ir); + // else + // (clusters+nph)->set_data(0,ic,ir); + + // } + // } + good=1; + if (eMin>0 && tot0 && tot>eMax) good=0; + if (good) { + nph++; + image[iy*nx+ix]++; } - } - good=1; - if (eMin>0 && tot0 && tot>eMax) good=0; - if (good) { - nph++; - image[iy*nx+ix]++; - } } else { @@ -474,8 +484,9 @@ int *getClusters(char *data, int *ph=NULL) { nphFrame=nph; nphTot+=nph; //cout << nphFrame << endl; - // cout <<"**********************************"<< det->getFrameNumber(data) << " " << nphFrame << endl; - writeClusters(det->getFrameNumber(data)); + if (iframe%10000==0) + cout <<"**********************************"<< iframe << " " << nphFrame << endl; + writeClusters(iframe); return image; }; @@ -576,12 +587,15 @@ int *getClusters(char *data, int *ph=NULL) { void writeClusters(int fn){ if (myFile) { //cout << "++" << endl; - pthread_mutex_lock(fm); - // cout <<"**********************************"<< fn << " " << nphFrame << endl; + //pthread_mutex_lock(fm); + fm->lock(); + // cout <write(myFile); - pthread_mutex_unlock(fm); + // cout << "--" << endl; + fm->unlock(); + //pthread_mutex_unlock(fm); //cout << "--" << endl; } }; @@ -613,7 +627,8 @@ int *getClusters(char *data, int *ph=NULL) { void setEnergyRange(double emi, double ema){eMin=emi; eMax=ema;}; void getEnergyRange(double &emi, double &ema){emi=eMin; ema=eMax;}; - void setMutex(pthread_mutex_t *m){fm=m;}; + // void setMutex(pthread_mutex_t *m){fm=m;}; + void setMutex(mutex *m){fm=m;}; protected: @@ -631,8 +646,8 @@ int *getClusters(char *data, int *ph=NULL) { int nphTot; int nphFrame; - pthread_mutex_t *fm; - + // pthread_mutex_t *fm; + mutex *fm; };