fixed bug in pedestal cloning and changed cluster finder file format- tested only for 3x3

This commit is contained in:
2020-03-24 12:03:29 +01:00
parent a108a4df4c
commit ed20e17c3a
9 changed files with 349 additions and 244 deletions

View File

@ -39,13 +39,13 @@ class single_photon_hit {
//fwrite((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), myFile);
// if (fwrite((void*)this, 1, sizeof(int)+2*sizeof(int16_t), myFile))
//#ifdef OLDFORMAT
#ifdef OLDFORMAT
if (fwrite((void*)&iframe, 1, sizeof(int), myFile)) {};
//#endif
#endif
#ifndef WRITE_QUAD
//printf("no quad ");
if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
return fwrite((void*)data, 1, dx*dy*sizeof(int), myFile);
//if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
return fwrite((void*)&x, 1, dx*dy*sizeof(int)+2*sizeof(int16_t), myFile);
#endif
#ifdef WRITE_QUAD
// printf("quad ");
@ -91,7 +91,7 @@ class single_photon_hit {
default:
;
}
if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
if (fwrite((void*)&x, 2, sizeof(int16_t), myFile))
return fwrite((void*)qq, 1, 4*sizeof(int), myFile);
#endif
return 0;
@ -104,9 +104,9 @@ class single_photon_hit {
size_t read(FILE *myFile) {
//fread((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad), myFile);
//#ifdef OLDFORMAT
#ifdef OLDFORMAT
if (fread((void*)&iframe, 1, sizeof(int), myFile)) {}
//#endif
#endif
#ifndef WRITE_QUAD
// printf( "no quad \n");
if (fread((void*)&x, 2, sizeof(int16_t), myFile))
@ -246,15 +246,15 @@ class single_photon_hit {
int *get_cluster() {return data;};
int iframe; /**< frame number */
int16_t x; /**< x-coordinate of the center of hit */
int16_t y; /**< x-coordinate of the center of hit */
double rms; /**< noise of central pixel l -- at some point it can be removed*/
double ped; /**< pedestal of the central pixel -- at some point it can be removed*/
double tot; /**< sum of the 3x3 cluster */
quadrant quad; /**< quadrant where the photon is located */
double quadTot; /**< sum of the maximum 2x2cluster */
int dx; /**< size of data cluster in x */
int dy; /**< size of data cluster in y */
int dy; /**< size of data cluster in y */
int16_t x; /**< x-coordinate of the center of hit */
int16_t y; /**< x-coordinate of the center of hit */
int *data; /**< pointer to data */
};