mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-20 04:11:05 +01:00
formatted slsDetectorCalibration
This commit is contained in:
@@ -3,65 +3,61 @@
|
||||
#ifndef GHOSTSUMMATION_H
|
||||
#define GHOSTSUMMATION_H
|
||||
|
||||
#include <cmath>
|
||||
#include "slsDetectorData.h"
|
||||
#include <cmath>
|
||||
|
||||
template <class dataType> class ghostSummation {
|
||||
|
||||
/** @short virtual calss to handle ghosting*/
|
||||
/** @short virtual calss to handle ghosting*/
|
||||
|
||||
public:
|
||||
|
||||
/** constructor
|
||||
\param xt crosstalk
|
||||
*/
|
||||
ghostSummation(slsDetectorData<dataType> *d, double xt) : xtalk(xt),det(d), nx(1), ny(1) {
|
||||
if (det)
|
||||
det->getDetectorSize(nx,ny);
|
||||
ghost=new double[nx*ny];
|
||||
};
|
||||
public:
|
||||
/** constructor
|
||||
\param xt crosstalk
|
||||
*/
|
||||
ghostSummation(slsDetectorData<dataType> *d, double xt)
|
||||
: xtalk(xt), det(d), nx(1), ny(1) {
|
||||
if (det)
|
||||
det->getDetectorSize(nx, ny);
|
||||
ghost = new double[nx * ny];
|
||||
};
|
||||
|
||||
ghostSummation(ghostSummation *orig) {
|
||||
xtalk=orig->xtalk;
|
||||
det=orig->det;
|
||||
nx=1;
|
||||
ny=1;
|
||||
det->getDetectorSize(nx,ny);
|
||||
ghost=new double[nx*ny];
|
||||
|
||||
}
|
||||
virtual ~ghostSummation() {delete [] ghost;};
|
||||
ghostSummation(ghostSummation *orig) {
|
||||
xtalk = orig->xtalk;
|
||||
det = orig->det;
|
||||
nx = 1;
|
||||
ny = 1;
|
||||
det->getDetectorSize(nx, ny);
|
||||
ghost = new double[nx * ny];
|
||||
}
|
||||
virtual ~ghostSummation() { delete[] ghost; };
|
||||
|
||||
virtual ghostSummation *Clone() {
|
||||
return new ghostSummation(this);
|
||||
}
|
||||
virtual ghostSummation *Clone() { return new ghostSummation(this); }
|
||||
|
||||
double getXTalk(){return xtalk;};
|
||||
void setXTalk(double g) {xtalk=g;};
|
||||
double getXTalk() { return xtalk; };
|
||||
void setXTalk(double g) { xtalk = g; };
|
||||
|
||||
virtual double calcGhost(char *data, int ix, int iy=1){ghost[iy*nx+ix]=0; return 0;};
|
||||
virtual double calcGhost(char *data, int ix, int iy = 1) {
|
||||
ghost[iy * nx + ix] = 0;
|
||||
return 0;
|
||||
};
|
||||
|
||||
virtual void calcGhost(char *data){
|
||||
for (int iy=0; iy<ny; iy++)
|
||||
for (int ix=0; ix<nx; ix++)
|
||||
ghost[iy*nx+ix]=calcGhost(data, ix, iy);
|
||||
}
|
||||
virtual void calcGhost(char *data) {
|
||||
for (int iy = 0; iy < ny; iy++)
|
||||
for (int ix = 0; ix < nx; ix++)
|
||||
ghost[iy * nx + ix] = calcGhost(data, ix, iy);
|
||||
}
|
||||
|
||||
virtual double getGhost(int ix, int iy) {
|
||||
if (ix<0 || ix>=nx || iy<0 || iy>=ny) return 0;
|
||||
return ghost[iy*nx+ix];
|
||||
}
|
||||
virtual double getGhost(int ix, int iy) {
|
||||
if (ix < 0 || ix >= nx || iy < 0 || iy >= ny)
|
||||
return 0;
|
||||
return ghost[iy * nx + ix];
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
double xtalk;
|
||||
slsDetectorData<dataType> *det;
|
||||
double *ghost;
|
||||
int nx, ny;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user