diff --git a/slsDetectorCalibration/moenchExecutables/Makefile.cluster_finder b/slsDetectorCalibration/moenchExecutables/Makefile.cluster_finder index 1a8c79759..a5a10bdac 100644 --- a/slsDetectorCalibration/moenchExecutables/Makefile.cluster_finder +++ b/slsDetectorCalibration/moenchExecutables/Makefile.cluster_finder @@ -8,7 +8,7 @@ LDFLAG= ../tiffIO.cpp -L/usr/lib64/ -lpthread -lm -lstdc++ -pthread -lrt - MAIN=moench03ClusterFinder.cpp -all: moenchClusterFinder moenchMakeEta moenchInterpolation moenchNoInterpolation moenchPhotonCounter moenchAnalog +all: moenchClusterFinder moenchMakeEta moenchMakeEta3 moenchInterpolation moenchInterpolation3 moenchNoInterpolation moenchPhotonCounter moenchAnalog @@ -25,9 +25,15 @@ moenchClusterFinderHighZ: moench03ClusterFinder.cpp $(INCS) clean moenchMakeEta: moench03Interpolation.cpp $(INCS) clean g++ -o moenchMakeEta moench03Interpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DFF +moenchMakeEta3: moench03Interpolation.cpp $(INCS) clean + g++ -o moenchMakeEta3 moench03Interpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DFF -DETA3 + moenchInterpolation: moench03Interpolation.cpp $(INCS) clean g++ -o moenchInterpolation moench03Interpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) +moenchInterpolation3: moench03Interpolation.cpp $(INCS) clean + g++ -o moenchInterpolation3 moench03Interpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DETA3 + moenchNoInterpolation: moench03NoInterpolation.cpp $(INCS) clean g++ -o moenchNoInterpolation moench03NoInterpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) diff --git a/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp b/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp index 9b98ecd34..7f3b57f28 100644 --- a/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp +++ b/slsDetectorCalibration/moenchExecutables/moench03Interpolation.cpp @@ -77,28 +77,24 @@ int main(int argc, char *argv[]) { #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; + etamin=-2; + etamax=2; #endif #endif - #endif -#ifndef FF + //#ifndef FF int quad; -#endif + //#endif double sum, totquad; double sDum[2][2]; @@ -133,7 +129,13 @@ int main(int argc, char *argv[]) { #endif // #endif #ifndef NOINTERPOLATION +#ifndef ETA3 eta2InterpolationPosXY *interp=new eta2InterpolationPosXY(NC, NR, nSubPixels, nSubPixelsY, etabins, etabinsY, etamin, etamax); +#endif +#ifdef ETA3 + eta3InterpolationPosXY *interp=new eta3InterpolationPosXY(NC, NR, nSubPixels, nSubPixelsY, etabins, etabinsY, etamin, etamax); +#endif + //eta2InterpolationCleverAdaptiveBins *interp=new eta2InterpolationCleverAdaptiveBins(NC, NR, nsubpix, etabins, etamin, etamax); #endif #ifdef NOINTERPOLATION @@ -191,12 +193,20 @@ int main(int argc, char *argv[]) { if (nframes==0) f0=lastframe; nframes++; } -#ifndef FF + //#ifndef FF +#ifndef ETA3 quad=interp->calcEta(cl.get_cluster(), etax, etay, sum, totquad, sDum); #endif -#ifdef FF - interp->calcEta(cl.get_cluster(), etax, etay, sum, totquad, sDum); +#ifdef ETA3 + quad=interp->calcEta3(cl.get_cluster(), etax, etay, sum); + totquad=sum; #endif + //#endif +// #ifdef FF +// #ifndef ETA3 +// interp->calcEta(cl.get_cluster(), etax, etay, sum, totquad, sDum); +// #endif +// #endif if (sum>cmin && totquad/sum>0.8 && totquad/sum<1.2 && sumwritePedestal(imgfname); + sprintf(imgfname,"%s/%s_noise.tiff",outdir,fformat); + mt->writePedestalRMS(imgfname); + + return 0; } diff --git a/slsDetectorCalibration/multiThreadedAnalogDetector.h b/slsDetectorCalibration/multiThreadedAnalogDetector.h index a873029cf..7e966b81d 100644 --- a/slsDetectorCalibration/multiThreadedAnalogDetector.h +++ b/slsDetectorCalibration/multiThreadedAnalogDetector.h @@ -479,6 +479,37 @@ public: return ped; }; + virtual double *getPedestalRMS(){ + int nx, ny; + dets[0]->getDetectorSize(nx,ny); + double *rms=new double[nx*ny]; + double *p0=new double[nx*ny]; + + for (int i=0; igetInterpolation(nb,emi,ema); + // cout << i << endl; + p0=dets[i]->getPedestalRMS(p0); + if (p0) { + if (i==0) { + + for (int ib=0; ibgetDetectorSize(nx,ny); + + double *rms=getPedestalRMS(); + float *gm=new float[nx*ny]; + if (gm) { + for (int ix=0; ixgetImageSize(nnx, nny,nsx, nsy); if (image) { - delete image; + delete [] image; image=NULL; } image=new int[nn];