fix jungfrauModuleData empty if statement

This commit is contained in:
hinger_v 2023-08-04 16:12:27 +02:00
parent 0ee54be252
commit 78cbe8e660
2 changed files with 20 additions and 4 deletions

View File

@ -3,6 +3,7 @@
#ifndef JUNGFRAUMODULEDATA_H #ifndef JUNGFRAUMODULEDATA_H
#define JUNGFRAUMODULEDATA_H #define JUNGFRAUMODULEDATA_H
#include <cstdint> #include <cstdint>
#include "sls/sls_detector_defs.h"
#include "slsDetectorData.h" #include "slsDetectorData.h"
//#define VERSION_V2 //#define VERSION_V2
@ -27,7 +28,7 @@ typedef struct {
uint64_t bunchNumber; /**< is the frame number */ uint64_t bunchNumber; /**< is the frame number */
uint64_t pre; /**< something */ uint64_t pre; /**< something */
} jf_header; } jf_header; //Aldo's header!
using namespace std; using namespace std;
class jungfrauModuleData : public slsDetectorData<uint16_t> { class jungfrauModuleData : public slsDetectorData<uint16_t> {
@ -42,8 +43,15 @@ class jungfrauModuleData : public slsDetectorData<uint16_t> {
1286 large etc.) \param c crosstalk parameter for the output buffer 1286 large etc.) \param c crosstalk parameter for the output buffer
*/ */
#ifdef ALDO
using header = jf_header;
#else
using header = sls::defs::sls_receiver_header;
#endif
#ifndef ZMQ #ifndef ZMQ
#define off sizeof(jf_header) #define off sizeof(header)
#endif #endif
#ifdef ZMQ #ifdef ZMQ
#define off 0 #define off 0
@ -55,10 +63,18 @@ class jungfrauModuleData : public slsDetectorData<uint16_t> {
: slsDetectorData<uint16_t>(1024, 512, : slsDetectorData<uint16_t>(1024, 512,
1024* 512 * 2 + off) { 1024* 512 * 2 + off) {
for (int ix = 0; ix != 1024; ++ix) {
for (int iy = 0; iy != 512; ++iy) {
dataMap[iy][ix] = off;
}
}
if (xmin < xmax && ymin < ymax) { if (xmin < xmax && ymin < ymax) {
int nc_roi = xmax - xmin + 1; int nc_roi = xmax - xmin + 1;
int nr_roi = ymax - ymin + 1;
std::cout << "nc_roi = " << nc_roi << std::endl; std::cout << "nc_roi = " << nc_roi << std::endl;
std::cout << "nr_roi = " << nr_roi << std::endl;
dataSize = dataSize =
(xmax - xmin + 1) * (ymax - ymin + 1) * 2 + off; (xmax - xmin + 1) * (ymax - ymin + 1) * 2 + off;
@ -171,7 +187,7 @@ class jungfrauModuleData : public slsDetectorData<uint16_t> {
//int pn; //int pn;
// cout << dataSize << endl; // cout << dataSize << endl;
if (ff >= 0) //if (ff >= 0)
//fnum = ff; //fnum = ff;
if (filebin.is_open()) { if (filebin.is_open()) {

View File

@ -257,7 +257,7 @@ int main(int argc, char *argv[]) {
std::cout << "Detector size is " << nx << " " << ny << std::endl; std::cout << "Detector size is " << nx << " " << ny << std::endl;
//Cluster finder ROI //Cluster finder ROI
int xmin = 0, xmax = nx, ymin = 0, ymax = ny; int xmin = 0, xmax = nx-1, ymin = 0, ymax = ny-1;
if (argc >= 16) { if (argc >= 16) {
xmin = atoi(argv[12]); xmin = atoi(argv[12]);
xmax = atoi(argv[13]); xmax = atoi(argv[13]);