From 10e57319bf0373ac7fb798b6d1dfc613577c330d Mon Sep 17 00:00:00 2001 From: Anna Bergamaschi Date: Thu, 12 Oct 2017 10:31:11 +0200 Subject: [PATCH] moench03OnTheFlyAnalysis multipthreaded with interpolation works --- slsDetectorCalibration/Makefile.moench | 4 +- slsDetectorCalibration/MovingStat.h | 33 +- slsDetectorCalibration/analogDetector.h | 220 ++++++++- .../etaVEL/etaInterpolationBase.h | 118 ++++- .../etaVEL/etaInterpolationPosXY.h | 41 +- .../etaVEL/linearInterpolation.h | 18 +- .../etaVEL/noInterpolation.h | 16 +- .../etaVEL/slsInterpolation.h | 98 +++- .../interpolatingDetector.h | 140 ++++-- .../moench03Ctb10GbT1Data.h | 28 +- .../moench03OnTheFlyAnalysis.C | 124 +++-- .../multiThreadedDetector.h | 427 ++++++++++++++++++ slsDetectorCalibration/pedestalSubtraction.h | 13 +- slsDetectorCalibration/singlePhotonDetector.h | 73 ++- slsDetectorCalibration/tiffIO.h | 4 +- 15 files changed, 1189 insertions(+), 168 deletions(-) create mode 100644 slsDetectorCalibration/multiThreadedDetector.h diff --git a/slsDetectorCalibration/Makefile.moench b/slsDetectorCalibration/Makefile.moench index af52c45ff..b49a76212 100644 --- a/slsDetectorCalibration/Makefile.moench +++ b/slsDetectorCalibration/Makefile.moench @@ -13,8 +13,8 @@ all: moench03OnTheFlyAnalysis -moench03OnTheFlyAnalysis: $(MAIN) $(INCS) - g++ -o moench03OnTheFlyAnalysis $(MAIN) -lm -ltiff -lstdc++ $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) +moench03OnTheFlyAnalysis: $(MAIN) $(INCS) clean + g++ -o moench03OnTheFlyAnalysis $(MAIN) -lm -ltiff -lstdc++ $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL clean: rm -f moench03OnTheFlyAnalysis diff --git a/slsDetectorCalibration/MovingStat.h b/slsDetectorCalibration/MovingStat.h index dd8ad7e8a..35249b1c9 100755 --- a/slsDetectorCalibration/MovingStat.h +++ b/slsDetectorCalibration/MovingStat.h @@ -29,28 +29,41 @@ class MovingStat /** clears the moving average number of samples parameter, mean and standard deviation */ - void Set(double val, double rms=0) + void Set(double val, double rms=0, int m=-1) { - m_n = n; - m_newM=val*n; - if (rms<=0) - m_newM2=val*val*n; - else - m_newM2=(n*rms*rms+m_newM*m_newM/n); + if (m>=0) m_n = m; else m_n = n; + m_newM=val*m_n; + SetRMS(rms); + } + /** + clears the moving average number of samples parameter, mean and standard deviation + */ + void SetRMS(double rms) + { + if (rms<=0) { + m_newM2=m_newM*m_newM/n; + m_n=0; + } else { + if (m_n>0) + m_newM2=(m_n*rms*rms+m_newM*m_newM/m_n); + else { + m_newM2=(m_n*rms*rms+m_newM*m_newM/n); + m_n=0; + } + } } - /** sets number of samples parameter \param i number of samples parameter to be set */ - void SetN(int i) {if (i>=1) n=i;}; + int SetN(int i) {if (i>=1) n=i; return n;}; /** gets number of samples parameter \returns actual number of samples parameter */ - int GetN() {return n;}; + int GetN() {return m_n;}; /** calculates the moving average i.e. adds if number of elements is lower than number of samples parameter, pushes otherwise \param x value to calculate the moving average diff --git a/slsDetectorCalibration/analogDetector.h b/slsDetectorCalibration/analogDetector.h index d8789f788..3fb9e7f5f 100644 --- a/slsDetectorCalibration/analogDetector.h +++ b/slsDetectorCalibration/analogDetector.h @@ -5,6 +5,11 @@ #include "slsDetectorData.h" #include "pedestalSubtraction.h" #include "commonModeSubtraction.h" +#include "tiffIO.h" +#ifndef FRAMEMODE_DEF +#define FRAMEMODE_DEF + enum frameMode { eFrame, ePedestal, eFlat }; +#endif template class analogDetector { @@ -13,6 +18,7 @@ template class analogDetector { public: + /** @@ -30,7 +36,7 @@ template class analogDetector { analogDetector(slsDetectorData *d, int sign=1, - commonModeSubtraction *cm=NULL, int nnx=-1, int nny=-1) : det(d), nx(nnx), ny(nny), stat(NULL), cmSub(cm), iframe(-1), dataSign(sign){ + commonModeSubtraction *cm=NULL, int nped=1000, int nnx=-1, int nny=-1, double *gm=NULL) : det(d), nx(nnx), ny(nny), stat(NULL), cmSub(cm), iframe(-1), dataSign(sign), gmap(gm) { if (det) det->getDetectorSize(nx,ny); @@ -38,6 +44,9 @@ template class analogDetector { stat=new pedestalSubtraction*[ny]; for (int i=0; i class analogDetector { /** destructor. Deletes the cluster structure and the pdestalSubtraction array */ - virtual ~analogDetector() {for (int i=0; idet; + nx=orig->nx; + ny=orig->ny; + dataSign=orig->dataSign; + iframe=orig->iframe; + gmap=orig->gmap; + cmSub=orig->cmSub; + stat=new pedestalSubtraction*[ny]; + for (int i=0; iSetNPedestals(); + //cout << nped << " " << orig->getPedestal(ix,iy) << orig->getPedestalRMS(ix,iy) << endl; + for (int iy=0; iygetPedestal(ix,iy),orig->getPedestalRMS(ix,iy),orig->GetNPedestals(ix,iy)); + } + } + } + + virtual analogDetector *Clone() { + return new analogDetector(this); + } + + int getDataSize(){return det->getDataSize();}; + + /** + set gain map + */ + double *setGainMap(double *gm) {gmap=gm; return gmap;}; + + /** + return gain map + */ + double *getGainMap() {return gmap;}; + + double *readGainMap(const char * imgname) { + uint32 nnx, nny; + float *gm=ReadFromTiff( imgname, nny, nnx); + if (gm) { + if (gmap) delete [] gmap; + gmap=new double[nnx*nny]; + for (int ix=0; ixClear(); }; @@ -108,11 +192,91 @@ template class analogDetector { \param iy pixel y coordinate \param val value to set */ - virtual void setPedestal(int ix, int iy, double val, double rms=0){if (ix>=0 && ix=0 && iy=0 && ix=0 && iy=0 && ix=0 && iygetCommonMode(); + else + gm[iy*nx+ix]=stat[iy][ix].getPedestal(); + } + } + WriteToTiff(gm, imgname, ny, nx); + delete [] gm; + return NULL; + } + + int readPedestals(const char * imgname) { + uint32 nnx, nny; + float *gm=ReadFromTiff( imgname, nny, nnx); + if (nnx>nx) nnx=nx; + if (nny>ny) nny=ny; + + + if (gm) { + for (int ix=0; ixnx) nnx=nx; + if (nny>ny) nny=ny; + if (gm) { + for (int ix=0; ix class analogDetector { double val; if (ix>=0 && ix=0 && iygetValue(data, ix, iy); else @@ -165,30 +330,42 @@ template class analogDetector { return val; }; - + virtual double subtractPedestal(char *data, int ix, int iy=0) { + double g=1.; if (ix>=0 && ix=0 && iygetValue(data, ix, iy)-getPedestal(ix,iy); + return (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy))/g; else - return ((double*)data)[iy*nx+ix]-getPedestal(ix,iy); + return (((double*)data)[iy*nx+ix]-getPedestal(ix,iy))/g; } }; virtual int getNPhotons(char *data, int ix, int iy=0, int thr=-1) { - - if (ix>=0 && ix=0 && iy=0 && ix=0 && iygetValue(data, ix, iy)-getPedestal(ix,iy))/thr; + return (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy))/g/thr; else - return (((double*)data)[(iy)*nx+ix]-getPedestal(ix,iy))/thr; + return (((double*)data)[(iy)*nx+ix]-getPedestal(ix,iy))/g/thr; } return 0; @@ -226,6 +403,13 @@ template class analogDetector { return stat[0][0].SetNPedestals(); }; + int GetNPedestals(int ix, int iy) { + if (ix>=0 && ix=0 && iy class analogDetector { val+=subtractPedestal(data, ix, iy); return val; - } + }; + virtual void processData(char *data, frameMode i=eFrame, int *val=NULL) { + switch(i) { + case ePedestal: + addToPedestal(data); + break; + default: + getNPhotons(data,-1,val); + } + }; + protected: @@ -248,7 +442,7 @@ template class analogDetector { commonModeSubtraction *cmSub;/**< commonModeSubtraction class */ int dataSign; /**< sign of the data i.e. 1 if photon is positive, -1 if negative */ int iframe; /**< frame number (not from file but incremented within the dataset every time newFrame is called */ - + double *gmap; }; #endif diff --git a/slsDetectorCalibration/etaVEL/etaInterpolationBase.h b/slsDetectorCalibration/etaVEL/etaInterpolationBase.h index d396fa809..aac4b409c 100644 --- a/slsDetectorCalibration/etaVEL/etaInterpolationBase.h +++ b/slsDetectorCalibration/etaVEL/etaInterpolationBase.h @@ -9,6 +9,7 @@ #endif #include "slsInterpolation.h" +#include "tiffIO.h" class etaInterpolationBase : public slsInterpolation { @@ -35,6 +36,38 @@ class etaInterpolationBase : public slsInterpolation { }; + etaInterpolationBase(etaInterpolationBase *orig): slsInterpolation(orig){ + nbeta=orig->nbeta; + etamin=orig->etamin; + etamax=orig->etamax; + + etastep=(etamax-etamin)/nbeta; +#ifdef MYROOT1 + heta=(TH2D*)(orig->heta)->Clone("heta"); + hhx=(TH2D*)(orig->hhx)->Clone("hhx"); + hhy=(TH2D*)(orig->hhy)->Clone("hhy"); +#endif + +#ifndef MYROOT1 + heta=new int[nbeta*nbeta]; + memcpy(heta,orig->heta,nbeta*nbeta*sizeof(int)); + hhx=new int[nbeta*nbeta]; + memcpy(hhx,orig->hhx,nbeta*nbeta*sizeof(int)); + hhy=new int[nbeta*nbeta]; + memcpy(hhy,orig->hhy,nbeta*nbeta*sizeof(int)); + +#endif + + + }; + virtual etaInterpolationBase* Clone() { + + return new etaInterpolationBase(this); + + }; + + + #ifdef MYROOT1 TH2D *setEta(TH2D *h, int nb=-1, double emin=1, double emax=0) { @@ -65,12 +98,74 @@ class etaInterpolationBase : public slsInterpolation { } return heta; }; + int *getFlatField(){return setEta(NULL);}; + + + + + void *writeFlatField(const char * imgname) { + float *gm=NULL; + gm=new float[nbeta*nbeta]; + for (int ix=0; ix=1) etamax=emax; + if (emin<=0) etamin=emin; + + if (etamin>=etamax) { + etamin=-0.1; + etamax=1.1; + } + + etastep=(etamax-etamin)/nbeta; + uint32 nnx; + uint32 nny; + float *gm=ReadFromTiff(imgname, nnx, nny); + if (nnx!=nny) { + cout << "different number of bins in x " << nnx << " and y " << nny<< " !"<< endl; + cout << "Aborting read"<< endl; + return NULL; + } + nbeta=nnx; + if (gm) { + if (heta) { + delete [] heta; + delete [] hhx; + delete [] hhy; + } + + heta=new int[nbeta*nbeta]; + hhx=new int[nbeta*nbeta]; + hhy=new int[nbeta*nbeta]; + + for (int ix=0; ix=nSubPixels) ex=nSubPixels-1; + if (ex>=nbeta) ex=nbeta-1; if (ey<0) ey=0; - if (ey>=nSubPixels) ey=nSubPixels-1; + if (ey>=nbeta) ey=nbeta-1; - xpos_eta=(((double)hhx[(int)(ey*nbeta+ex)]))/((double)nSubPixels); - ypos_eta=(((double)hhy[(int)(ey*nbeta+ex)]))/((double)nSubPixels); + xpos_eta=(((double)hhx[(ey*nbeta+ex)]))/((double)nSubPixels); + ypos_eta=(((double)hhy[(ey*nbeta+ex)]))/((double)nSubPixels); //else //return 0; @@ -173,6 +268,7 @@ int *gethhx() int_x=((double)x) + 0.5*dX + xpos_eta; int_y=((double)y) + 0.5*dY + ypos_eta; + // cout << etax << " " << ex << " " << etay << " " << ey << " " << xpos_eta << " " << int_x << " " << ypos_eta << " " << int_y << endl; //return 1; } @@ -205,11 +301,12 @@ int *gethhx() ey=(eta3y-etamin)/etastep; if (ex<0) ex=0; - if (ex>=nSubPixels) ex=nSubPixels-1; + if (ex>=nbeta) ex=nbeta-1; if (ey<0) ey=0; - if (ey>=nSubPixels) ey=nSubPixels-1; - xpos_eta=(((double)hhx[(int)(ey*nbeta+ex)]))/((double)nSubPixels); - ypos_eta=(((double)hhy[(int)(ey*nbeta+ex)]))/((double)nSubPixels); + if (ey>=nbeta) ey=nbeta-1; + + xpos_eta=(((double)hhx[(int)(ey*nbeta+ex)]))/((double)nSubPixels); + ypos_eta=(((double)hhy[(int)(ey*nbeta+ex)]))/((double)nSubPixels); #endif int_x=((double)x) + xpos_eta; @@ -246,6 +343,7 @@ int *gethhx() #ifndef MYROOT1 ex=(etax-etamin)/etastep; ey=(etay-etamin)/etastep; + // cout << etax << " " << ex << " " << etay << " " << ey << " " << ey*nbeta+ex << endl; if (ey=0 && ey>=0) heta[ey*nbeta+ex]++; #endif diff --git a/slsDetectorCalibration/etaVEL/etaInterpolationPosXY.h b/slsDetectorCalibration/etaVEL/etaInterpolationPosXY.h index e7e70e092..8b90a2267 100644 --- a/slsDetectorCalibration/etaVEL/etaInterpolationPosXY.h +++ b/slsDetectorCalibration/etaVEL/etaInterpolationPosXY.h @@ -2,16 +2,24 @@ #define ETA_INTERPOLATION_POSXY_H +#include "tiffIO.h" #include "etaInterpolationBase.h" class etaInterpolationPosXY : public etaInterpolationBase{ public: etaInterpolationPosXY(int nx=400, int ny=400, int ns=25, int nb=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny,ns, nb, emin,emax){}; - + etaInterpolationPosXY(etaInterpolationPosXY *orig): etaInterpolationBase(orig){}; + + virtual etaInterpolationPosXY* Clone() { + + return new etaInterpolationPosXY(this); + + }; virtual void prepareInterpolation(int &ok) { + cout <<"?"<< endl; ok=1; #ifdef MYROOT1 if (hhx) delete hhx; @@ -40,7 +48,6 @@ class etaInterpolationPosXY : public etaInterpolationBase{ double hix[nbeta]; //integral of projection x double hiy[nbeta]; //integral of projection y int ii=0; - for (int ib=0; ibUniform(-0.5,0.5); @@ -30,13 +38,13 @@ class noInterpolation : public slsInterpolation{ return ; }; - virtual void getInterpolatedPosition(Int_t x, Int_t y, double etax, double etay, int corner, double &int_x, double &int_y) + virtual void getInterpolatedPosition(int x, int y, double etax, double etay, int corner, double &int_x, double &int_y) { return getInterpolatedPosition(x, y, NULL, int_x, int_y); }; ////////////////////////////////////////////////////////////////////////////////////// - virtual void getPositionETA3(Int_t x, Int_t y, double *data, double &int_x, double &int_y) + virtual void getPositionETA3(int x, int y, double *data, double &int_x, double &int_y) { //Random coordinate in the Pixel reference int_x = x + ((double)rand())/((double)RAND_MAX) -0.5;//eventGenerator->Uniform(-0.5,0.5); diff --git a/slsDetectorCalibration/etaVEL/slsInterpolation.h b/slsDetectorCalibration/etaVEL/slsInterpolation.h index 53248bba3..7bdd1e488 100644 --- a/slsDetectorCalibration/etaVEL/slsInterpolation.h +++ b/slsDetectorCalibration/etaVEL/slsInterpolation.h @@ -7,6 +7,7 @@ #include #endif +#include "tiffIO.h" #ifndef DEF_QUAD #define DEF_QUAD enum quadrant { @@ -25,7 +26,7 @@ class slsInterpolation { public: - slsInterpolation(int nx=400, int ny=400, int ns=25) :nPixelsX(nx), nPixelsY(ny), nSubPixels(ns) { + slsInterpolation(int nx=400, int ny=400, int ns=25) :nPixelsX(nx), nPixelsY(ny), nSubPixels(ns), id(0) { #ifdef MYROOT1 hint=new TH2F("hint","hint",ns*nx, 0, nx, ns*ny, 0, ny); @@ -37,7 +38,33 @@ hint=new TH2F("hint","hint",ns*nx, 0, nx, ns*ny, 0, ny); }; + slsInterpolation(slsInterpolation *orig){ + nPixelsX=orig->nPixelsX; + nPixelsY=orig->nPixelsY; + nSubPixels=orig->nSubPixels; +#ifdef MYROOT1 + hint=(TH2F*)(orig->hint)->Clone("hint"); +#endif + +#ifndef MYROOT1 + hint=new int[nSubPixels*nPixelsX*nSubPixels*nPixelsY]; + memcpy(hint, orig->hint,nSubPixels*nPixelsX*nSubPixels*nPixelsY*sizeof(int)); +#endif + + }; + + virtual int setId(int i) {id=i; return id;}; + + virtual slsInterpolation* Clone() = 0; + int getNSubPixels() {return nSubPixels;}; + + int getImageSize(int &nnx, int &nny, int &ns) { + nnx=nSubPixels*nPixelsX; + nny=nSubPixels*nPixelsY; + ns=nSubPixels; + return nSubPixels*nSubPixels*nPixelsX*nPixelsY; + }; //create eta distribution, eta rebinnining etc. @@ -53,18 +80,52 @@ hint=new TH2F("hint","hint",ns*nx, 0, nx, ns*ny, 0, ny); #ifndef MYROOT1 virtual int *getInterpolatedImage(){return hint;}; #endif + + + + + void *writeInterpolatedImage(const char * imgname) { + cout << "!" <Fill(int_x, int_y); return hint;}; #endif #ifndef MYROOT1 virtual int *addToImage(double int_x, double int_y){ int iy=nSubPixels*int_y; int ix=nSubPixels*int_x; - if (ix>=0 && ix<(nPixelsX*nSubPixels) && iy<(nSubPixels*nPixelsY) && iy>=0 )(*(hint+ix+iy*nPixelsX))+=1; + if (ix>=0 && ix<(nPixelsX*nSubPixels) && iy<(nSubPixels*nPixelsY) && iy>=0 )(*(hint+ix+iy*nPixelsX*nSubPixels))+=1; return hint; }; #endif @@ -75,10 +136,14 @@ hint=new TH2F("hint","hint",ns*nx, 0, nx, ns*ny, 0, ny); #ifdef MYROOT1 virtual TH2D *getFlatField(){return NULL;}; + virtual TH2D *setFlatField(TH2D *h){return NULL;}; #endif #ifndef MYROOT1 virtual int *getFlatField(){return NULL;}; + virtual int *setFlatField(int *h){return NULL;}; + void *writeFlatField(const char * imgname){return NULL;}; + void *readFlatField(const char * imgname, int nb=-1, double emin=1, double emax=0){return NULL;}; #endif //virtual void Streamer(TBuffer &b); @@ -165,40 +230,44 @@ hint=new TH2F("hint","hint",ns*nx, 0, nx, ns*ny, 0, ny); if (totquad>0) { switch(corner) { case TOP_LEFT: - t = sDum[1][1] ; + t = sDum[1][1]; r = sDum[0][1] ; - toth=sDum[1][1]+sDum[1][0]; + toth=sDum[0][1]+sDum[0][0]; totv=sDum[0][1]+sDum[1][1]; break; case TOP_RIGHT: t = sDum[1][0] ; r = sDum[0][1] ; - toth=sDum[0][0]+t; - totv=sDum[0][0]+r; + toth=sDum[0][1]+sDum[0][0]; + totv=sDum[1][0]+sDum[0][0]; break; case BOTTOM_LEFT: r = sDum[1][1] ; t = sDum[1][1] ; - toth=sDum[1][0]+t; - totv=sDum[0][1]+r; + toth=sDum[1][0]+sDum[1][1]; + totv=sDum[0][1]+sDum[1][1]; break; case BOTTOM_RIGHT: t = sDum[1][0] ; r = sDum[1][1] ; - toth=sDum[1][1]+t; - totv=sDum[0][1]+r; + toth=sDum[1][0]+sDum[1][1]; + totv=sDum[1][0]+sDum[0][0]; break; default: - etax=-1; - etay=-1; + etax=-1000; + etay=-1000; return 0; } - etax=r/totv; - etay=t/toth; + //etax=r/totquad; + //etay=t/totquad; + etax=r/toth; + etay=t/totv; } return 0; } + + static int calcEtaL(double *cl, double &etax, double &etay, double &sum, double &totquad, double sDum[2][2]) { int corner = calcQuad(cl,sum,totquad,sDum); calcEtaL(totquad, corner, sDum, etax, etay); @@ -263,6 +332,7 @@ hint=new TH2F("hint","hint",ns*nx, 0, nx, ns*ny, 0, ny); #ifndef MYROOT1 int *hint; #endif + int id; }; diff --git a/slsDetectorCalibration/interpolatingDetector.h b/slsDetectorCalibration/interpolatingDetector.h index dc1e50da6..0f92ea618 100644 --- a/slsDetectorCalibration/interpolatingDetector.h +++ b/slsDetectorCalibration/interpolatingDetector.h @@ -46,10 +46,50 @@ class interpolatingDetector : public singlePhotonDetector { commonModeSubtraction *cm=NULL, int nped=1000, int nd=100, int nnx=-1, int nny=-1) : - singlePhotonDetector(d, 3,nsigma,sign, cm, nped, nd, nnx, nny) , interp(inte) {}; + singlePhotonDetector(d, 3,nsigma,sign, cm, nped, nd, nnx, nny) , interp(inte), id(0) {}; + interpolatingDetector(interpolatingDetector *orig) : singlePhotonDetector(orig) { + interp=(orig->interp)->Clone(); + id=orig->id; + } + + + virtual interpolatingDetector *Clone() { + return new interpolatingDetector(this); + } + + virtual int setId(int i) {id=i; interp->setId(id); return id;}; + + virtual void prepareInterpolation(int &ok) { + cout << "*"<< endl; +#ifdef SAVE_ALL + char tit[1000]; + sprintf(tit,"/scratch/ped_%d.tiff",id); + writePedestals(tit); + sprintf(tit,"/scratch/ped_rms_%d.tiff",id); + writePedestalRMS(tit); + if (gmap) { + sprintf(tit,"/scratch/gmap_%d.tiff",id); + writeGainMap(tit); + } +#endif + interp->prepareInterpolation(ok); + } + + int getImageSize(int &nnx, int &nny, int &ns) {return interp->getImageSize(nnx, nny, ns);}; + #ifdef MYROOT1 + virtual TH2F *getInterpolatedImage() +#endif +#ifndef MYROOT1 + virtual int *getInterpolatedImage() +#endif + { + if (interp) + return interp->getInterpolatedImage(); + } + #ifdef MYROOT1 virtual TH2F *addToInterpolatedImage(char *data, single_photon_hit *clusters, int &nph) #endif @@ -79,13 +119,23 @@ class interpolatingDetector : public singlePhotonDetector { return NULL; }; + void *writeInterpolatedImage(const char * imgname) { + cout << id << "=" << imgname<< endl; + interp->writeInterpolatedImage(imgname); + return NULL; + } - - int addFrame(char *data, single_photon_hit *clusters, int ff=0) { - + int addFrame(char *data, single_photon_hit *clusters=NULL, int ff=0) { + single_photon_hit *cl; + single_photon_hit clust; + if (clusters) + cl=clusters; + else + cl=&clust; + double int_x,int_y, eta_x, eta_y; int nph=0; double val[ny][nx]; @@ -118,8 +168,8 @@ class interpolatingDetector : public singlePhotonDetector { - - (clusters+nph)->rms=getPedestalRMS(ix,iy); + cl->rms=getPedestalRMS(ix,iy); + //(clusters+nph)->rms=getPedestalRMS(ix,iy); // cout << iframe << " " << nph << " " << ix << " " << iy << endl; @@ -147,7 +197,7 @@ class interpolatingDetector : public singlePhotonDetector { v=&(val[iy+ir][ix+ic]); if (ir==0 && ic==0) { - if (*v<-nSigma*(clusters+nph)->rms) { + if (*v<-nSigma*cl->rms) { eventMask[iy][ix]=NEGATIVE_PEDESTAL; // cout << "neg ped" << endl; } @@ -173,74 +223,79 @@ class interpolatingDetector : public singlePhotonDetector { } if (bl>=br && bl>=tl && bl>=tr) { - (clusters+nph)->quad=BOTTOM_LEFT; - (clusters+nph)->quadTot=bl; + cl->quad=BOTTOM_LEFT; + cl->quadTot=bl; xoff=0; yoff=0; } else if (br>=bl && br>=tl && br>=tr) { - (clusters+nph)->quad=BOTTOM_RIGHT; - (clusters+nph)->quadTot=br; + cl->quad=BOTTOM_RIGHT; + cl->quadTot=br; xoff=1; yoff=0; } else if (tl>=br && tl>=bl && tl>=tr) { - (clusters+nph)->quad=TOP_LEFT; - (clusters+nph)->quadTot=tl; + cl->quad=TOP_LEFT; + cl->quadTot=tl; xoff=0; yoff=1; } else if (tr>=bl && tr>=tl && tr>=br) { - (clusters+nph)->quad=TOP_RIGHT; - (clusters+nph)->quadTot=tr; + cl->quad=TOP_RIGHT; + cl->quadTot=tr; xoff=1; yoff=1; } - if (max>nSigma*(clusters+nph)->rms || tot>sqrt(clusterSizeY*clusterSize)*nSigma*(clusters+nph)->rms || ((clusters+nph)->quadTot)>sqrt(cy*cs)*nSigma*(clusters+nph)->rms) { + if (max>nSigma*cl->rms || tot>sqrt(clusterSizeY*clusterSize)*nSigma*cl->rms || (cl->quadTot)>sqrt(cy*cs)*nSigma*cl->rms) { if (val[iy][ix]>=max) { // cout << "max" << endl; eventMask[iy][ix]=PHOTON_MAX; - (clusters+nph)->tot=tot; - (clusters+nph)->x=ix; - (clusters+nph)->y=iy; - (clusters+nph)->ped=getPedestal(ix,iy, 0); + cl->tot=tot; + cl->x=ix; + cl->y=iy; + cl->ped=getPedestal(ix,iy, 0); // cout << iframe << " " << ix << " " << iy << " "<< (clusters+nph)->tot << " " << (clusters+nph)->quadTot << " " << (clusters+nph)->ped<< " " << (clusters+nph)->rms << endl; 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); - cout << val[iy+ir][ix+ic] << " " ; + cl->set_data(val[iy+ir][ix+ic],ic,ir); + + + // cout << val[iy+ir][ix+ic] << " " ; } } - cout << endl << " " ; + // cout << endl << " " ; } - cout << endl << " " ; + // cout << endl << " " ; - cc[0][0]=(clusters+nph)->get_data(-1+xoff,-1+yoff); - cc[1][0]=(clusters+nph)->get_data(-1+xoff,0+yoff); - cc[0][1]=(clusters+nph)->get_data(0+xoff,-1+yoff); - cc[1][1]=(clusters+nph)->get_data(0+xoff,0+yoff); + cc[0][0]=cl->get_data(-1+xoff,-1+yoff); + cc[1][0]=cl->get_data(-1+xoff,0+yoff); + cc[0][1]=cl->get_data(0+xoff,-1+yoff); + cc[1][1]=cl->get_data(0+xoff,0+yoff); - cout << cc[0][0] << " " << cc[0][1] << endl; - cout << cc[1][0] << " " << cc[1][1] << endl; + // cout << cc[0][0] << " " << cc[0][1] << endl; + // cout << cc[1][0] << " " << cc[1][1] << endl; - cout << endl << " " ; + // cout << endl << " " ; if (interp) { - interp->calcEta((clusters+nph)->quadTot,cc,eta_x, eta_y); - cout << eta_x << " " << eta_y << endl; - cout << "**************************************************************************"<< endl; + //interp->calcEta((clusters+nph)->quadTot,cc,eta_x, eta_y); + interp->calcEtaL(cl->quadTot,cl->quad,cc,eta_x, eta_y); + // cout << eta_x << " " << eta_y << endl; // cout << "eta" << endl; if (ff) { interp->addToFlatField(eta_x,eta_y); + // cout << "**************************************************************************"<< endl; } else { // cout << "interp" << endl; - interp->getInterpolatedPosition(ix,iy,eta_x,eta_y,(clusters+nph)->quad,int_x,int_y); + interp->getInterpolatedPosition(ix,iy,eta_x,eta_y,cl->quad,int_x,int_y); // cout << "add" << endl; interp->addToImage(int_x, int_y); } // cout << "done" << endl; } + if (clusters) cl=(clusters+nph); + nph++; } else { // cout << "ph" << endl; @@ -259,12 +314,25 @@ class interpolatingDetector : public singlePhotonDetector { }; + virtual void processData(char *data, frameMode i=eFrame, int *val=NULL) { + switch(i) { + case ePedestal: + addToPedestal(data); + break; + case eFlat: + addFrame(data,NULL,1); + break; + default: + addFrame(data); + } + }; + protected: slsInterpolation *interp; - + int id; }; diff --git a/slsDetectorCalibration/moench03Ctb10GbT1Data.h b/slsDetectorCalibration/moench03Ctb10GbT1Data.h index 7fe5b4f87..b1e1932c7 100644 --- a/slsDetectorCalibration/moench03Ctb10GbT1Data.h +++ b/slsDetectorCalibration/moench03Ctb10GbT1Data.h @@ -188,6 +188,13 @@ class moench03Ctb10GbT1Data : public slsReceiverData { virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) { char *data=new char[packetSize*nPackets]; + char *d=readNextFrame(filebin, ff, np, data); + if (d==NULL) {delete [] data; data=NULL;} + return data; + + } + + virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) { char *retval=0; int nd; int fnum = -1; @@ -215,7 +222,7 @@ class moench03Ctb10GbT1Data : public slsReceiverData { if (getFrameNumber(packet) !=fnum) { if (np==0){ - delete [] data; + // delete [] data; return NULL; } else filebin.seekg(-8208,ios_base::cur); @@ -240,7 +247,7 @@ class moench03Ctb10GbT1Data : public slsReceiverData { } if (np==0){ - delete [] data; + // delete [] data; return NULL; } @@ -249,6 +256,23 @@ class moench03Ctb10GbT1Data : public slsReceiverData { }; + + + + + + + + + + + + + + + + + int getPacketNumber(int x, int y) {return dataMap[y][x]/8208;}; diff --git a/slsDetectorCalibration/moench03OnTheFlyAnalysis.C b/slsDetectorCalibration/moench03OnTheFlyAnalysis.C index 6396f7aba..b247a9892 100644 --- a/slsDetectorCalibration/moench03OnTheFlyAnalysis.C +++ b/slsDetectorCalibration/moench03OnTheFlyAnalysis.C @@ -13,7 +13,9 @@ #include "interpolatingDetector.h" #include "etaInterpolationPosXY.h" - +#include "linearInterpolation.h" +#include "noInterpolation.h" +#include "multiThreadedDetector.h" #include @@ -27,13 +29,14 @@ void *moenchProcessFrame() { char fname[10000]; strcpy(fname,"/mnt/moench_data/m03-15_mufocustube/plant_40kV_10uA/m03-15_100V_g4hg_300us_dtf_0.raw"); - + int nthreads=3; + int nph, nph1; single_photon_hit clusters[NR*NC]; // cout << "hits "<< endl; - int etabins=250; - double etamin=-0.1, etamax=1.1; - int nsubpix=5; + int etabins=550; + double etamin=-1, etamax=2; + int nsubpix=4; float *etah=new float[etabins*etabins]; // cout << "etah "<< endl; cout << "image size "<< nsubpix*nsubpix*NC*NR << endl; @@ -44,11 +47,15 @@ void *moenchProcessFrame() { // cout << "decoder "<< endl; etaInterpolationPosXY *interp=new etaInterpolationPosXY(NC, NR, nsubpix, etabins, etamin, etamax); // cout << "interp "<< endl; - - interpolatingDetector *filter=new interpolatingDetector(decoder,interp, 5, 1, 0, 10000, 10000); + //linearInterpolation *interp=new linearInterpolation(NC, NR, nsubpix); + //noInterpolation *interp=new noInterpolation(NC, NR, nsubpix); + interp->readFlatField("/scratch/eta_100.tiff",etamin,etamax); + interpolatingDetector *filter=new interpolatingDetector(decoder,interp, 5, 1, 0, 1000, 10); + filter->readPedestals("/scratch/ped_100.tiff"); cout << "filter "<< endl; + char *buff; int nf=0; int ok=0; @@ -62,8 +69,10 @@ void *moenchProcessFrame() { filter->newDataSet(); + multiThreadedDetector *mt=new multiThreadedDetector(filter,nthreads,100); nph=0; nph1=0; + //int np; int iph; cout << "file name " << fname << endl; @@ -72,55 +81,76 @@ void *moenchProcessFrame() { cout << "Opened file " << fname<< endl; else cout << "Could not open file " << fname<< endl; - while ((buff=decoder->readNextFrame(filebin, iFrame)) && nf<5E4) { - if (nf<1.1E4) - filter->addToFlatField(buff,clusters,nph1); - else { - if (ok==0) { - cout << "**************************************************************************"<< endl; - heta=interp->getFlatField(); - for (int ii=0; iisetFrameMode(eFrame); + mt->prepareInterpolation(ok); + mt->StartThreads(); + mt->popFree(buff); + + while ((decoder->readNextFrame(filebin, iFrame, np, buff)) && nf<1.5E4) { + if (nf<9E3) + ; + else { + + // if (nf>1.1E4 && ok==0) { + // mt->prepareInterpolation(ok); + // mt->setFrameMode(eFrame); + // //ok=1; + // } - interp->prepareInterpolation(ok); - cout << "**************************************************************************"<< endl; - std::time(&end_time); - cout << std::ctime(&end_time) << " " << nf << " " << nph1 << " " << nph << endl; - } - filter->addToInterpolatedImage(buff,clusters,nph1); - } + mt->pushData(buff); + mt->nextThread(); + // cout << " " << (void*)buff; + mt->popFree(buff); + + // if (ok==0) { + // cout << "**************************************************************************"<< endl; + // heta=interp->getFlatField(); + // // for (int ii=0; iiprepareInterpolation(ok); + // cout << "**************************************************************************"<< endl; + // std::time(&end_time); + // cout << std::ctime(&end_time) << " " << nf << endl; + // } + // filter->processData(buff,eFrame); + // } - nph+=nph1; + // nph+=nph1; + } if (nf%1000==0) { std::time(&end_time); - cout << std::ctime(&end_time) << " " << nf << " " << nph1 << " " << nph << endl; + cout << std::ctime(&end_time) << " " << nf << endl; } + nf++; - delete [] buff; + //delete [] buff; iFrame=-1; - } + } - if (filebin.is_open()) - filebin.close(); - else - cout << "could not open file " << fname << endl; + if (filebin.is_open()) + filebin.close(); + else + cout << "could not open file " << fname << endl; - - himage=interp->getInterpolatedImage(); - for (int ii=0; iiStopThreads(); + + char tit[10000]; + sprintf(tit,"/scratch/int_image_mt%d.tiff",nthreads); + + mt->writeInterpolatedImage(tit); + // delete [] etah; + + // delete interp; + //delete decoder; + //cout << "Read " << nf << " frames" << endl; + return NULL; } int main(int argc, char *argv[]){ diff --git a/slsDetectorCalibration/multiThreadedDetector.h b/slsDetectorCalibration/multiThreadedDetector.h new file mode 100644 index 000000000..df13e7fa4 --- /dev/null +++ b/slsDetectorCalibration/multiThreadedDetector.h @@ -0,0 +1,427 @@ +#include +#include +#include +#include +#include +#include +//#include +//#include +//#include +#include + +#include + +#include "interpolatingDetector.h" +#include "circularFifo.h" + + + + + +class threadedDetector +{ +public: + threadedDetector(interpolatingDetector *d, int fs=10000) { + char *mem, *mm; + det=d; + fifoFree=new CircularFifo(fs); + fifoData=new CircularFifo(fs); + mem=(char*)malloc(fs*det->getDataSize()); + for (int i=0; igetDataSize(); + fifoFree->push(mm); + } + stop=1; + fMode=eFrame; + } + + + int setFrameMode(int fm) {if (fMode>=0) fMode=fm; return fMode;} + + void prepareInterpolation(int &ok) { + cout << "-" << endl; + det->prepareInterpolation(ok); + }; + + int *getInterpolatedImage() { + return det->getInterpolatedImage(); + } + int getImageSize(int &nnx, int &nny, int &ns) {return det->getImageSize(nnx, nny, ns);}; + virtual ~threadedDetector() {StopThread(); free(mem); delete fifoFree; delete fifoData;} + + /** Returns true if the thread was successfully started, false if there was an error starting the thread */ + bool StartThread() + { stop=0; + return (pthread_create(&_thread, NULL, processData, this) == 0); + } + + void StopThread() + { stop=1; + (void) pthread_join(_thread, NULL); + } + + + bool pushData(char* &ptr) { + fifoData->push(ptr); + } + bool popFree(char* &ptr) { + fifoFree->pop(ptr); + } + + //protected: + /** Implement this method in your subclass with the code you want your thread to run. */ + //virtual void InternalThreadEntry() = 0; + void *writeInterpolatedImage(const char * imgname) {cout << "a" <writeInterpolatedImage(imgname);}; +private: + interpolatingDetector *det; + int fMode; + int *dataSize; + pthread_t _thread; + char *mem; + CircularFifo *fifoFree; + CircularFifo *fifoData; + int stop; + char *data; + + static void * processData(void * ptr) { + threadedDetector *This=((threadedDetector *)ptr); + return This->processData(); + } + + void * processData() { + while (!stop) { + if (fifoData->isEmpty()) { + usleep(100); + } else { + fifoData->pop(data); //blocking! + det->processData(data,(frameMode)fMode); + fifoFree->push(data); + } + } + return NULL; + } + + + + + + +}; + + + +class multiThreadedDetector +{ +public: + multiThreadedDetector(interpolatingDetector *d, int n, int fs=1000) : nThreads(n), ithread(0) { + dd[0]=d; + if (nThreads==1) + dd[0]->setId(100); + else + dd[0]->setId(0); + for (int i=1; iClone(); + dd[i]->setId(i); + } + + for (int i=0; igetImageSize(nnx, nny,ns); + image=new int[nn]; + + } + + ~multiThreadedDetector() { + StopThreads(); + for (int i=0; isetFrameMode(fm); return ret;}; + + void prepareInterpolation(int &ok) { + int oo; + ok=1; + for (int i=0; iprepareInterpolation(oo); + //if (oo<1) ok=0; + } + }; + + int *getInterpolatedImage() { + int *img; + int nnx, nny, ns; + int nn=dets[0]->getImageSize(nnx, nny, ns); + //for (i=0; igetInterpolatedImage(); + for (int i=0; iwriteInterpolatedImage(tit); + } +#endif + getInterpolatedImage(); + int nnx, nny, ns; + int nn=dets[0]->getImageSize(nnx, nny, ns); + float *gm=new float[ nn]; + if (gm) { + for (int ix=0; ixStartThread(); + + } + + + + void StopThreads() { + for (int i=0; iStopThread(); + + } + + + bool pushData(char* &ptr) { + dets[ithread]->pushData(ptr); + } + + bool popFree(char* &ptr) { + dets[ithread]->popFree(ptr); + } + + int nextThread() { + ithread++; + if (ithread==nThreads) ithread=0; + return ithread; + } + +private: + bool stop; + const int nThreads; + threadedDetector *dets[20]; + interpolatingDetector *dd[20]; + int ithread; + int *image; + }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* void *moenchProcessFrame() { */ +/* char fname[10000]; */ +/* strcpy(fname,"/mnt/moench_data/m03-15_mufocustube/plant_40kV_10uA/m03-15_100V_g4hg_300us_dtf_0.raw"); */ + + +/* int nph, nph1; */ +/* single_photon_hit clusters[NR*NC]; */ +/* // cout << "hits "<< endl; */ +/* int etabins=550; */ +/* double etamin=-1, etamax=2; */ +/* int nsubpix=2; */ +/* float *etah=new float[etabins*etabins]; */ +/* // cout << "etah "<< endl; */ +/* cout << "image size "<< nsubpix*nsubpix*NC*NR << endl; */ +/* float *image=new float[nsubpix*nsubpix*NC*NR]; */ +/* int *heta, *himage; */ + +/* moench03Ctb10GbT1Data *decoder=new moench03Ctb10GbT1Data(); */ +/* // cout << "decoder "<< endl; */ +/* etaInterpolationPosXY *interp=new etaInterpolationPosXY(NC, NR, nsubpix, etabins, etamin, etamax); */ +/* // cout << "interp "<< endl; */ +/* // linearInterpolation *interp=new linearInterpolation(NC, NR, nsubpix); */ + +/* interpolatingDetector *filter=new interpolatingDetector(decoder,interp, 5, 1, 0, 1000, 100); */ +/* cout << "filter "<< endl; */ + + +/* char *buff; */ +/* int nf=0; */ +/* int ok=0; */ +/* ifstream filebin; */ +/* std::time_t end_time; */ + +/* int iFrame=-1; */ +/* int np=-1; */ + + +/* filter->newDataSet(); */ + + +/* nph=0; */ +/* nph1=0; */ +/* int iph; */ + +/* cout << "file name " << fname << endl; */ +/* filebin.open((const char *)(fname), ios::in | ios::binary); */ +/* if (filebin.is_open()) */ +/* cout << "Opened file " << fname<< endl; */ +/* else */ +/* cout << "Could not open file " << fname<< endl; */ +/* while ((buff=decoder->readNextFrame(filebin, iFrame)) && nf<1.5E4) { */ +/* if (nf<9E3) */ +/* ; */ +/* else if (nf<1.1E4) { */ +/* filter->processData(buff,eFlat); */ +/* } else { */ +/* if (ok==0) { */ +/* cout << "**************************************************************************"<< endl; */ +/* heta=interp->getFlatField(); */ +/* // for (int ii=0; iiprepareInterpolation(ok); */ +/* cout << "**************************************************************************"<< endl; */ +/* std::time(&end_time); */ +/* cout << std::ctime(&end_time) << " " << nf << endl; */ +/* } */ +/* filter->processData(buff,eFrame); */ +/* } */ + +/* nph+=nph1; */ + +/* if (nf%1000==0) { */ +/* std::time(&end_time); */ +/* cout << std::ctime(&end_time) << " " << nf << endl; */ +/* } */ + +/* nf++; */ +/* delete [] buff; */ +/* iFrame=-1; */ +/* } */ + +/* if (filebin.is_open()) */ +/* filebin.close(); */ +/* else */ +/* cout << "could not open file " << fname << endl; */ + + +/* himage=interp->getInterpolatedImage(); */ +/* for (int ii=0; ii0) stat.SetN(i); return stat.GetN();}; + virtual int SetNPedestals(int i=-1) {return stat.SetN(i);}; + + /**sets/gets the number of samples for the moving average + \returns actual number of samples for the moving average + */ + virtual int GetNPedestals() {return stat.GetN();}; /** sets the moving average */ - virtual void setPedestal(double val, double rms=0) {stat.Set(val, rms);} + virtual void setPedestal(double val, double rms=0, int m=-1) {stat.Set(val, rms, m);} + + + /** sets the moving average */ + virtual void setPedestalRMS(double rms) {stat.SetRMS(rms);} diff --git a/slsDetectorCalibration/singlePhotonDetector.h b/slsDetectorCalibration/singlePhotonDetector.h index 9d4ea487e..c053c0ad2 100644 --- a/slsDetectorCalibration/singlePhotonDetector.h +++ b/slsDetectorCalibration/singlePhotonDetector.h @@ -57,7 +57,7 @@ public analogDetector { int sign=1, commonModeSubtraction *cm=NULL, int nped=1000, - int nd=100, int nnx=-1, int nny=-1) : analogDetector(d, sign, cm, nnx, nny), nDark(nd), eventMask(NULL),nSigma (nsigma), clusterSize(csize), clusterSizeY(csize), cluster(NULL), quad(UNDEFINED_QUADRANT), tot(0), quadTot(0) { + int nd=100, int nnx=-1, int nny=-1, double *gm=NULL) : analogDetector(d, sign, cm, nped, nnx, nny, gm), nDark(nd), eventMask(NULL),nSigma (nsigma), clusterSize(csize), clusterSizeY(csize), cluster(NULL), quad(UNDEFINED_QUADRANT), tot(0), quadTot(0) { @@ -65,9 +65,6 @@ public analogDetector { eventMask=new eventType*[ny]; for (int i=0; i { /** destructor. Deletes the cluster structure and the pdestalSubtraction array */ - virtual ~singlePhotonDetector() {delete cluster;}; + virtual ~singlePhotonDetector() {delete cluster; for (int i=0; i { + singlePhotonDetector(singlePhotonDetector *orig) : analogDetector(orig) { + nDark=orig->nDark; + + + eventMask=new eventType*[ny]; + for (int i=0; inSigma; + clusterSize=orig->clusterSize; + clusterSizeY=orig->clusterSizeY; + cluster=new single_photon_hit(clusterSize,clusterSizeY); + quad=UNDEFINED_QUADRANT; + tot=0; + quadTot=0; + + } + virtual singlePhotonDetector *Clone() { + return new singlePhotonDetector(this); + } /** sets/gets number of rms threshold to detect photons \param n number of sigma to be set (0 or negative gets) \returns actual number of sigma parameter @@ -118,22 +138,23 @@ public analogDetector { - virtual int *getNPhotons(char *data, double thr=-1) { + virtual int *getNPhotons(char *data, double thr=-1, int *nph=NULL) { double val; - int *nph=new int[nx*ny]; + if (nph==NULL) + nph=new int[nx*ny]; double rest[ny][nx]; int cy=(clusterSizeY+1)/2; int cs=(clusterSize+1)/2; - + double g=-1.; int ccs=clusterSize; int ccy=clusterSizeY; double tthr=thr; - int nn; + int nn=0; double max=0, tl=0, tr=0, bl=0,br=0, v; @@ -148,13 +169,23 @@ public analogDetector { for (int ix=0; ix::getNPhotons(data,ix,iy,tthr); + tthr=nSigma*getPedestalRMS(ix,iy)/g; + + } + + + val=subtractPedestal(data,ix,iy); + nn=analogDetector::getNPhotons(data,ix,iy,tthr); + nph[ix+nx*iy]+=nn; - rest[iy][ix]=subtractPedestal(data,ix,iy)-nph[ix+nx*iy]*tthr; + rest[iy][ix]=(val-nn*tthr); } @@ -185,7 +216,7 @@ public analogDetector { if (ir>=0 && ic<=0) tl+=v; if (ir>=0 && ic>=0) - tr+=v; + tr+=v; if (v>max) { max=v; @@ -205,7 +236,7 @@ public analogDetector { quadTot=bl; } else if (br>=bl && br>=tl && br>=tr) { quad=BOTTOM_RIGHT; - quadTot=br; + quadTot=br; } else if (tl>=br && tl>=bl && tl>=tr) { quad=TOP_LEFT; quadTot=tl; @@ -519,6 +550,16 @@ int getClusters(char *data, single_photon_hit *clusters) { #endif + virtual void processData(char *data, frameMode i=eFrame, int *val=NULL) { + switch(i) { + case ePedestal: + addToPedestal(data); + break; + default: + getNPhotons(data,-1,val); + } + }; + protected: diff --git a/slsDetectorCalibration/tiffIO.h b/slsDetectorCalibration/tiffIO.h index 48bb7ad1c..3076d641d 100644 --- a/slsDetectorCalibration/tiffIO.h +++ b/slsDetectorCalibration/tiffIO.h @@ -32,13 +32,13 @@ void *WriteToTiff(float * imgData, const char * imgname, int nrow, int ncol){ int sampleperpixel=1; // unsigned char * buff=NULL; tsize_t linebytes; - + cout << "--" <