mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
fixed virtual function problem in slsDetectorCalibration
This commit is contained in:
parent
63ebc03df0
commit
6793f5e530
@ -149,7 +149,7 @@ class interpolatingDetector : public singlePhotonDetector {
|
|||||||
{
|
{
|
||||||
nph = addFrame(data, val, 1);
|
nph = addFrame(data, val, 1);
|
||||||
if (interp)
|
if (interp)
|
||||||
return interp->getFlatField();
|
return interp->getFlatFieldDistribution();
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
|
@ -238,96 +238,96 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
|
|
||||||
// cout <<"******"<< etax << " " << etay << endl;
|
// cout <<"******"<< etax << " " << etay << endl;
|
||||||
|
|
||||||
return addToFlatField(etax, etay);
|
return addToFlatFieldDistribution(etax, etay);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int addToFlatField(double totquad, int quad, double *cl,
|
/* virtual int addToFlatField(double totquad, int quad, double *cl, */
|
||||||
double &etax, double &etay) {
|
/* double &etax, double &etay) { */
|
||||||
double cc[2][2];
|
/* double cc[2][2]; */
|
||||||
int xoff = 0, yoff = 0;
|
/* int xoff = 0, yoff = 0; */
|
||||||
|
|
||||||
switch (quad) {
|
/* switch (quad) { */
|
||||||
case BOTTOM_LEFT:
|
/* case BOTTOM_LEFT: */
|
||||||
xoff = 0;
|
/* xoff = 0; */
|
||||||
yoff = 0;
|
/* yoff = 0; */
|
||||||
break;
|
/* break; */
|
||||||
case BOTTOM_RIGHT:
|
/* case BOTTOM_RIGHT: */
|
||||||
xoff = 1;
|
/* xoff = 1; */
|
||||||
yoff = 0;
|
/* yoff = 0; */
|
||||||
break;
|
/* break; */
|
||||||
case TOP_LEFT:
|
/* case TOP_LEFT: */
|
||||||
xoff = 0;
|
/* xoff = 0; */
|
||||||
yoff = 1;
|
/* yoff = 1; */
|
||||||
break;
|
/* break; */
|
||||||
case TOP_RIGHT:
|
/* case TOP_RIGHT: */
|
||||||
xoff = 1;
|
/* xoff = 1; */
|
||||||
yoff = 1;
|
/* yoff = 1; */
|
||||||
break;
|
/* break; */
|
||||||
default:;
|
/* default:; */
|
||||||
}
|
/* } */
|
||||||
cc[0][0] = cl[xoff + 3 * yoff];
|
/* cc[0][0] = cl[xoff + 3 * yoff]; */
|
||||||
cc[1][0] = cl[(yoff + 1) * 3 + xoff];
|
/* cc[1][0] = cl[(yoff + 1) * 3 + xoff]; */
|
||||||
cc[0][1] = cl[yoff * 3 + xoff + 1];
|
/* cc[0][1] = cl[yoff * 3 + xoff + 1]; */
|
||||||
cc[1][1] = cl[(yoff + 1) * 3 + xoff + 1];
|
/* cc[1][1] = cl[(yoff + 1) * 3 + xoff + 1]; */
|
||||||
|
|
||||||
/* cout << cl[0] << " " << cl[1] << " " << cl[2] << endl; */
|
/* /\* cout << cl[0] << " " << cl[1] << " " << cl[2] << endl; *\/ */
|
||||||
/* cout << cl[3] << " " << cl[4] << " " << cl[5] << endl; */
|
/* /\* cout << cl[3] << " " << cl[4] << " " << cl[5] << endl; *\/ */
|
||||||
/* cout << cl[6] << " " << cl[7] << " " << cl[8] << endl; */
|
/* /\* cout << cl[6] << " " << cl[7] << " " << cl[8] << endl; *\/ */
|
||||||
/* cout <<"******"<<totquad << " " << quad << endl; */
|
/* /\* cout <<"******"<<totquad << " " << quad << endl; *\/ */
|
||||||
/* cout << cc[0][0]<< " " << cc[0][1] << endl; */
|
/* /\* cout << cc[0][0]<< " " << cc[0][1] << endl; *\/ */
|
||||||
/* cout << cc[1][0]<< " " << cc[1][1] << endl; */
|
/* /\* cout << cc[1][0]<< " " << cc[1][1] << endl; *\/ */
|
||||||
// calcMyEta(totquad,quad,cl,etax, etay);
|
/* // calcMyEta(totquad,quad,cl,etax, etay); */
|
||||||
calcEta(totquad, cc, etax, etay);
|
/* calcEta(totquad, cc, etax, etay); */
|
||||||
|
|
||||||
// cout <<"******"<< etax << " " << etay << endl;
|
/* // cout <<"******"<< etax << " " << etay << endl; */
|
||||||
|
|
||||||
return addToFlatField(etax, etay);
|
/* return addToFlatFieldDistribution(etax, etay); */
|
||||||
}
|
/* } */
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
virtual int addToFlatField(double *cluster, double &etax, double &etay) {
|
/* virtual int addToFlatField(double *cluster, double &etax, double &etay) { */
|
||||||
double sDum[2][2];
|
/* double sDum[2][2]; */
|
||||||
double tot, totquad;
|
/* double tot, totquad; */
|
||||||
// int corner;
|
/* // int corner; */
|
||||||
// corner=
|
/* // corner= */
|
||||||
calcQuad(cluster, tot, totquad, sDum);
|
/* calcQuad(cluster, tot, totquad, sDum); */
|
||||||
|
|
||||||
// double xpos_eta,ypos_eta;
|
/* // double xpos_eta,ypos_eta; */
|
||||||
// double dX,dY;
|
/* // double dX,dY; */
|
||||||
|
|
||||||
calcEta(totquad, sDum, etax, etay);
|
/* calcEta(totquad, sDum, etax, etay); */
|
||||||
|
|
||||||
return addToFlatField(etax, etay);
|
/* return addToFlatField(etax, etay); */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
virtual int addToFlatField(int *cluster, double &etax, double &etay) {
|
/* virtual int addToFlatField(int *cluster, double &etax, double &etay) { */
|
||||||
double sDum[2][2];
|
/* double sDum[2][2]; */
|
||||||
double tot, totquad;
|
/* double tot, totquad; */
|
||||||
// int corner;
|
/* // int corner; */
|
||||||
// corner=
|
/* // corner= */
|
||||||
calcQuad(cluster, tot, totquad, sDum);
|
/* calcQuad(cluster, tot, totquad, sDum); */
|
||||||
|
|
||||||
// double xpos_eta,ypos_eta;
|
/* // double xpos_eta,ypos_eta; */
|
||||||
// double dX,dY;
|
/* // double dX,dY; */
|
||||||
|
|
||||||
calcEta(totquad, sDum, etax, etay);
|
/* calcEta(totquad, sDum, etax, etay); */
|
||||||
|
|
||||||
return addToFlatField(etax, etay);
|
/* return addToFlatField(etax, etay); */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
virtual int addToFlatField(double etax, double etay) {
|
/* virtual int addToFlatFieldDistribution(double etax, double etay) { */
|
||||||
#ifdef MYROOT1
|
/* #ifdef MYROOT1 */
|
||||||
heta->Fill(etax, etay);
|
/* heta->Fill(etax, etay); */
|
||||||
#endif
|
/* #endif */
|
||||||
#ifndef MYROOT1
|
/* #ifndef MYROOT1 */
|
||||||
int ex, ey;
|
/* int ex, ey; */
|
||||||
ex = (etax - etamin) / etastepX;
|
/* ex = (etax - etamin) / etastepX; */
|
||||||
ey = (etay - etamin) / etastepY;
|
/* ey = (etay - etamin) / etastepY; */
|
||||||
if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0)
|
/* if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0) */
|
||||||
heta[ey * nbetaX + ex]++;
|
/* heta[ey * nbetaX + ex]++; */
|
||||||
#endif
|
/* #endif */
|
||||||
return 0;
|
/* return 0; */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
virtual int *getInterpolatedImage() {
|
virtual int *getInterpolatedImage() {
|
||||||
int ipx, ipy;
|
int ipx, ipy;
|
||||||
|
@ -205,44 +205,44 @@ class eta3InterpolationBase : public virtual etaInterpolationBase {
|
|||||||
double &etay) {
|
double &etay) {
|
||||||
|
|
||||||
calcEta3(cl, etax, etay, totquad);
|
calcEta3(cl, etax, etay, totquad);
|
||||||
return addToFlatField(etax, etay);
|
return addToFlatFieldDistribution(etax, etay);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int addToFlatField(double totquad, int quad, double *cl,
|
/* virtual int addToFlatField(double totquad, int quad, double *cl, */
|
||||||
double &etax, double &etay) {
|
/* double &etax, double &etay) { */
|
||||||
|
|
||||||
calcEta3(cl, etax, etay, totquad);
|
/* calcEta3(cl, etax, etay, totquad); */
|
||||||
return addToFlatField(etax, etay);
|
/* return addToFlatField(etax, etay); */
|
||||||
}
|
/* } */
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
virtual int addToFlatField(double *cluster, double &etax, double &etay) {
|
/* virtual int addToFlatField(double *cluster, double &etax, double &etay) { */
|
||||||
double totquad;
|
/* double totquad; */
|
||||||
calcEta3(cluster, etax, etay, totquad);
|
/* calcEta3(cluster, etax, etay, totquad); */
|
||||||
return addToFlatField(etax, etay);
|
/* return addToFlatField(etax, etay); */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
virtual int addToFlatField(int *cluster, double &etax, double &etay) {
|
/* virtual int addToFlatField(int *cluster, double &etax, double &etay) { */
|
||||||
|
|
||||||
double totquad;
|
/* double totquad; */
|
||||||
|
|
||||||
calcEta3(cluster, etax, etay, totquad);
|
/* calcEta3(cluster, etax, etay, totquad); */
|
||||||
return addToFlatField(etax, etay);
|
/* return addToFlatField(etax, etay); */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
virtual int addToFlatField(double etax, double etay) {
|
/* virtual int addToFlatField(double etax, double etay) { */
|
||||||
#ifdef MYROOT1
|
/* #ifdef MYROOT1 */
|
||||||
heta->Fill(etax, etay);
|
/* heta->Fill(etax, etay); */
|
||||||
#endif
|
/* #endif */
|
||||||
#ifndef MYROOT1
|
/* #ifndef MYROOT1 */
|
||||||
int ex, ey;
|
/* int ex, ey; */
|
||||||
ex = (etax - etamin) / etastepX;
|
/* ex = (etax - etamin) / etastepX; */
|
||||||
ey = (etay - etamin) / etastepY;
|
/* ey = (etay - etamin) / etastepY; */
|
||||||
if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0)
|
/* if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0) */
|
||||||
heta[ey * nbetaX + ex]++;
|
/* heta[ey * nbetaX + ex]++; */
|
||||||
#endif
|
/* #endif */
|
||||||
return 0;
|
/* return 0; */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
/* protected: */
|
/* protected: */
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
int readFlatField(const char *imgname, double emin = 1, double emax = 0) {
|
void *readFlatField(const char *imgname, double emin = 1, double emax = 0) {
|
||||||
if (emax >= 1)
|
if (emax >= 1)
|
||||||
etamax = emax;
|
etamax = emax;
|
||||||
if (emin <= 0)
|
if (emin <= 0)
|
||||||
@ -169,9 +169,9 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete[] gm;
|
delete[] gm;
|
||||||
return 1;
|
return heta;
|
||||||
}
|
}
|
||||||
return 0;
|
return NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
float *gethhx() {
|
float *gethhx() {
|
||||||
@ -183,12 +183,17 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
// hhy->Scale((double)nSubPixels);
|
// hhy->Scale((double)nSubPixels);
|
||||||
return hhy;
|
return hhy;
|
||||||
};
|
};
|
||||||
virtual int addToFlatField(double etax, double etay) {
|
virtual int addToFlatFieldDistribution(double etax, double etay) {
|
||||||
|
#ifdef MYROOT1
|
||||||
|
heta->Fill(etax, etay);
|
||||||
|
#endif
|
||||||
|
#ifndef MYROOT1
|
||||||
int ex, ey;
|
int ex, ey;
|
||||||
ex = (etax - etamin) / etastepX;
|
ex = (etax - etamin) / etastepX;
|
||||||
ey = (etay - etamin) / etastepY;
|
ey = (etay - etamin) / etastepY;
|
||||||
if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0)
|
if (ey < nbetaY && ex < nbetaX && ex >= 0 && ey >= 0)
|
||||||
heta[ey * nbetaX + ex]++;
|
heta[ey * nbetaX + ex]++;
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -78,20 +78,20 @@ class noInterpolation : public slsInterpolation {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////
|
||||||
virtual int addToFlatField(double *cluster, double &etax, double &etay) {
|
/* virtual int addToFlatField(double *cluster, double &etax, double &etay) { */
|
||||||
return 0;
|
/* return 0; */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
virtual int addToFlatField(int *cluster, double &etax, double &etay) {
|
/* virtual int addToFlatField(int *cluster, double &etax, double &etay) { */
|
||||||
return 0;
|
/* return 0; */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
virtual int addToFlatField(double etax, double etay) { return 0; };
|
virtual int addToFlatFieldDistribution(double etax, double etay) { return 0; };
|
||||||
|
|
||||||
virtual int addToFlatField(double totquad, int quad, double *cl,
|
/* virtual int addToFlatField(double totquad, int quad, double *cl, */
|
||||||
double &etax, double &etay) {
|
/* double &etax, double &etay) { */
|
||||||
return 0;
|
/* return 0; */
|
||||||
};
|
/* }; */
|
||||||
|
|
||||||
virtual int addToFlatField(double totquad, int quad, int *cl, double &etax,
|
virtual int addToFlatField(double totquad, int quad, int *cl, double &etax,
|
||||||
double &etay) {
|
double &etay) {
|
||||||
|
@ -175,29 +175,31 @@ class slsInterpolation {
|
|||||||
return hint;
|
return hint;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual int addToFlatField(double *cluster, double &etax, double &etay) = 0;
|
//virtual int addToFlatField(double *cluster, double &etax, double &etay) = 0;
|
||||||
virtual int addToFlatField(int *cluster, double &etax, double &etay) = 0;
|
//virtual int addToFlatField(int *cluster, double &etax, double &etay) = 0;
|
||||||
virtual int addToFlatField(double totquad, int quad, int *cl, double &etax,
|
virtual int addToFlatField(double totquad, int quad, int *cl, double &etax,
|
||||||
double &etay) = 0;
|
double &etay) = 0;
|
||||||
virtual int addToFlatField(double totquad, int quad, double *cluster,
|
//virtual int addToFlatField(double totquad, int quad, double *cluster,
|
||||||
double &etax, double &etay) = 0;
|
// double &etax, double &etay) = 0;
|
||||||
virtual int addToFlatField(double etax, double etay) = 0;
|
virtual int addToFlatFieldDistribution(double etax, double etay) = 0;
|
||||||
|
|
||||||
virtual int *getFlatField() { return NULL; };
|
virtual int *getFlatFieldDistribution() { return NULL; };
|
||||||
virtual int *setFlatField(int *h, int nb = -1, double emin = -1,
|
virtual int *setFlatField(int *h, int nbx = -1, int nby = -1,
|
||||||
|
double emin = -1,
|
||||||
double emax = -1) {
|
double emax = -1) {
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
virtual void *writeFlatField(const char *imgname) { return NULL; };
|
virtual void *writeFlatField(const char *imgname) { return NULL; };
|
||||||
virtual void *readFlatField(const char *imgname, int nb = -1,
|
virtual void *readFlatField(const char *imgname,
|
||||||
double emin = 1, double emax = 0) {
|
double emin = 1, double emax = 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
virtual int *getFlatField(int &nb, double &emin, double &emax) {
|
virtual int *getFlatField(int &nbx, int &nby, double &emin, double &emax) {
|
||||||
nb = 0;
|
nbx = 0;
|
||||||
|
nby=0;
|
||||||
emin = 0;
|
emin = 0;
|
||||||
emax = 0;
|
emax = 0;
|
||||||
return getFlatField();
|
return getFlatFieldDistribution();
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void resetFlatField() = 0;
|
virtual void resetFlatField() = 0;
|
||||||
|
@ -47,7 +47,6 @@ int main(int argc, char *argv[]) {
|
|||||||
#endif
|
#endif
|
||||||
int iarg = 4;
|
int iarg = 4;
|
||||||
char infname[10000];
|
char infname[10000];
|
||||||
char fname[10000];
|
|
||||||
char outfname[10000];
|
char outfname[10000];
|
||||||
#ifndef FF
|
#ifndef FF
|
||||||
iarg = 4;
|
iarg = 4;
|
||||||
@ -74,18 +73,17 @@ int main(int argc, char *argv[]) {
|
|||||||
int etabins = 1000; // nsubpix*2*100;
|
int etabins = 1000; // nsubpix*2*100;
|
||||||
double etamin = -1, etamax = 2;
|
double etamin = -1, etamax = 2;
|
||||||
// double etamin=-0.1, etamax=1.1;
|
// double etamin=-0.1, etamax=1.1;
|
||||||
double eta3min = -2, eta3max = 2;
|
// double eta3min = -2, eta3max = 2;
|
||||||
int quad;
|
|
||||||
double sum, totquad;
|
double sum, totquad;
|
||||||
double sDum[2][2];
|
double sDum[2][2];
|
||||||
double etax, etay, int_x, int_y;
|
double etax, etay;
|
||||||
double eta3x, eta3y, int3_x, int3_y, noint_x, noint_y;
|
// double eta3x, eta3y, int3_x, int3_y, noint_x, noint_y;
|
||||||
int ok;
|
|
||||||
int f0 = -1;
|
|
||||||
int ix, iy, isx, isy;
|
int ix, iy, isx, isy;
|
||||||
int nframes = 0, lastframe = -1;
|
int nframes = 0, lastframe = -1;
|
||||||
double d_x, d_y, res = 5, xx, yy;
|
//double d_x, d_y, res = 5, xx, yy;
|
||||||
int nph = 0, badph = 0, totph = 0;
|
int nph = 0, totph = 0;
|
||||||
|
//badph = 0,
|
||||||
FILE *f = NULL;
|
FILE *f = NULL;
|
||||||
|
|
||||||
#ifdef DOUBLE_SPH
|
#ifdef DOUBLE_SPH
|
||||||
@ -96,7 +94,8 @@ int main(int argc, char *argv[]) {
|
|||||||
single_photon_hit cl(3, 3);
|
single_photon_hit cl(3, 3);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int nSubPixels = nsubpix;
|
//int f0 = -1;
|
||||||
|
// int nSubPixels = nsubpix;
|
||||||
#ifndef NOINTERPOLATION
|
#ifndef NOINTERPOLATION
|
||||||
eta2InterpolationPosXY *interp =
|
eta2InterpolationPosXY *interp =
|
||||||
new eta2InterpolationPosXY(NC, NR, nsubpix, etabins, etamin, etamax);
|
new eta2InterpolationPosXY(NC, NR, nsubpix, etabins, etamin, etamax);
|
||||||
@ -109,7 +108,12 @@ int main(int argc, char *argv[]) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FF
|
#ifndef FF
|
||||||
|
int quad;
|
||||||
#ifndef NOINTERPOLATION
|
#ifndef NOINTERPOLATION
|
||||||
|
char fname[10000];
|
||||||
|
int ok;
|
||||||
|
double int_x, int_y;
|
||||||
|
int *img;
|
||||||
cout << "read ff " << argv[2] << endl;
|
cout << "read ff " << argv[2] << endl;
|
||||||
sprintf(fname, "%s", argv[2]);
|
sprintf(fname, "%s", argv[2]);
|
||||||
interp->readFlatField(fname);
|
interp->readFlatField(fname);
|
||||||
@ -121,7 +125,6 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << "Will write eta file " << argv[2] << endl;
|
cout << "Will write eta file " << argv[2] << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int *img;
|
|
||||||
float *totimg = new float[NC * NR * nsubpix * nsubpix];
|
float *totimg = new float[NC * NR * nsubpix * nsubpix];
|
||||||
for (ix = 0; ix < NC; ix++) {
|
for (ix = 0; ix < NC; ix++) {
|
||||||
for (iy = 0; iy < NR; iy++) {
|
for (iy = 0; iy < NR; iy++) {
|
||||||
@ -149,7 +152,7 @@ int main(int argc, char *argv[]) {
|
|||||||
if (f) {
|
if (f) {
|
||||||
cout << infname << endl;
|
cout << infname << endl;
|
||||||
nframes = 0;
|
nframes = 0;
|
||||||
f0 = -1;
|
//f0 = -1;
|
||||||
|
|
||||||
while (cl.read(f)) {
|
while (cl.read(f)) {
|
||||||
totph++;
|
totph++;
|
||||||
@ -157,13 +160,20 @@ int main(int argc, char *argv[]) {
|
|||||||
lastframe = cl.iframe;
|
lastframe = cl.iframe;
|
||||||
// cout << cl.iframe << endl;
|
// cout << cl.iframe << endl;
|
||||||
// f0=cl.iframe;
|
// f0=cl.iframe;
|
||||||
if (nframes == 0)
|
// if (nframes == 0)
|
||||||
f0 = lastframe;
|
// f0 = lastframe;
|
||||||
nframes++;
|
nframes++;
|
||||||
}
|
}
|
||||||
// quad=interp->calcQuad(cl.get_cluster(), sum, totquad, sDum);
|
// quad=interp->calcQuad(cl.get_cluster(), sum, totquad, sDum);
|
||||||
|
#ifndef FF
|
||||||
quad = interp->calcEta(cl.get_cluster(), etax, etay, sum,
|
quad = interp->calcEta(cl.get_cluster(), etax, etay, sum,
|
||||||
totquad, sDum);
|
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 &&
|
if (sum > cmin && totquad / sum > 0.8 && totquad / sum < 1.2 &&
|
||||||
sum < cmax) {
|
sum < cmax) {
|
||||||
nph++;
|
nph++;
|
||||||
@ -199,7 +209,7 @@ int main(int argc, char *argv[]) {
|
|||||||
// if (cl.x>50)
|
// if (cl.x>50)
|
||||||
// #endif
|
// #endif
|
||||||
// if (etax!=0 && etay!=0 && etax!=1 && etay!=1)
|
// if (etax!=0 && etay!=0 && etax!=1 && etay!=1)
|
||||||
interp->addToFlatField(etax, etay);
|
interp->addToFlatFieldDistribution(etax, etay);
|
||||||
// if (etax==0 || etay==0) cout << cl.x << " " << cl.y <<
|
// if (etax==0 || etay==0) cout << cl.x << " " << cl.y <<
|
||||||
// endl;
|
// endl;
|
||||||
|
|
||||||
@ -242,9 +252,9 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cout << "Read " << nframes << " frames (first frame: " << f0
|
// cout << "Read " << nframes << " frames (first frame: " << f0
|
||||||
<< " last frame: " << lastframe << " delta:" << lastframe - f0
|
// << " last frame: " << lastframe << " delta:" << lastframe - f0
|
||||||
<< ") nph=" << nph << endl;
|
// << ") nph=" << nph << endl;
|
||||||
interp->clearInterpolatedImage();
|
interp->clearInterpolatedImage();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -502,13 +502,13 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
#ifdef INTERP
|
#ifdef INTERP
|
||||||
else if (fMode == eFlat) {
|
else if (fMode == eFlat) {
|
||||||
int nb;
|
int nbx, nby;
|
||||||
double emi = 0, ema = 1;
|
double emi = 0, ema = 1;
|
||||||
int *ff = mt->getFlatField(nb, emi, ema);
|
int *ff = mt->getFlatField(nbx, nby, emi, ema);
|
||||||
nnx = nb;
|
nnx = nbx;
|
||||||
nny = nb;
|
nny = nby;
|
||||||
dout = new int32_t[nb * nb];
|
dout = new int32_t[nbx * nby];
|
||||||
for (int ix = 0; ix < nb * nb; ix++) {
|
for (int ix = 0; ix < nbx * nby; ix++) {
|
||||||
dout[ix] = ff[ix];
|
dout[ix] = ff[ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,10 +182,10 @@ class threadedAnalogDetector {
|
|||||||
interp->prepareInterpolation(ok);
|
interp->prepareInterpolation(ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int *getFlatField() {
|
virtual int *getFlatFieldDistribution() {
|
||||||
slsInterpolation *interp = (det)->getInterpolation();
|
slsInterpolation *interp = (det)->getInterpolation();
|
||||||
if (interp)
|
if (interp)
|
||||||
return interp->getFlatField();
|
return interp->getFlatFieldDistribution();
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -208,19 +208,19 @@ class threadedAnalogDetector {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *readFlatField(const char *imgname, int nb = -1, double emin = 1,
|
void *readFlatField(const char *imgname, double emin = 1,
|
||||||
double emax = 0) {
|
double emax = 0) {
|
||||||
slsInterpolation *interp = (det)->getInterpolation();
|
slsInterpolation *interp = (det)->getInterpolation();
|
||||||
if (interp)
|
if (interp)
|
||||||
return interp->readFlatField(imgname, nb, emin, emax);
|
return interp->readFlatField(imgname, emin, emax);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int *getFlatField(int &nb, double emi, double ema) {
|
virtual int *getFlatField(int &nbx, int &nby, double &emi, double &ema) {
|
||||||
slsInterpolation *interp = (det)->getInterpolation();
|
slsInterpolation *interp = (det)->getInterpolation();
|
||||||
int *ff = NULL;
|
int *ff = NULL;
|
||||||
if (interp) {
|
if (interp) {
|
||||||
ff = interp->getFlatField(nb, emi, ema);
|
ff = interp->getFlatField(nbx, nby, emi, ema);
|
||||||
}
|
}
|
||||||
return ff;
|
return ff;
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,10 @@ class multiThreadedInterpolatingDetector
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int *getFlatField() { return (dets[0])->getFlatField(); }
|
virtual int *getFlatFieldDistribution() { return (dets[0])->getFlatFieldDistribution(); }
|
||||||
|
|
||||||
virtual int *getFlatField(int &nb, double emi, double ema) {
|
virtual int *getFlatField(int &nbx, int &nby, double &emi, double &ema) {
|
||||||
return (dets[0])->getFlatField(nb, emi, ema);
|
return (dets[0])->getFlatField(nbx, nby, emi, ema);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int *setFlatField(int *h = NULL, int nb = -1, double emin = 1,
|
virtual int *setFlatField(int *h = NULL, int nb = -1, double emin = 1,
|
||||||
@ -40,9 +40,9 @@ class multiThreadedInterpolatingDetector
|
|||||||
return dets[0]->writeFlatField(imgname);
|
return dets[0]->writeFlatField(imgname);
|
||||||
};
|
};
|
||||||
|
|
||||||
void *readFlatField(const char *imgname, int nb = -1, double emin = 1,
|
void *readFlatField(const char *imgname, double emin = 1,
|
||||||
double emax = 0) {
|
double emax = 0) {
|
||||||
return (dets[0])->readFlatField(imgname, nb, emin, emax);
|
return (dets[0])->readFlatField(imgname, emin, emax);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* virtual int setNSubPixels(int ns) { return
|
/* virtual int setNSubPixels(int ns) { return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user