some changes for JF with LGADs

This commit is contained in:
bergamaschi 2022-10-24 12:07:26 +02:00
parent 36a1159f38
commit 9efb19a9b5
5 changed files with 69 additions and 45 deletions

View File

@ -3,33 +3,33 @@
### edit with hostname or IP address of your detector
############################################
#hostname bchip181+
hostname bchip119.psi.ch
hostname bchip135
#############################################
### edit with hostname or 1Gbs IP address of your server
############################################
rx_hostname mpc2011:1777
rx_hostname mpc2011
#############################################
### edit with 10 Gbs IP of your server
############################################
udp_dstip 10.1.2.102
udp_dstip 10.1.1.102
#############################################
### edit with any number in the subnet of your server (first 3 numbers as above)
############################################
udp_srcip 10.1.2.19
udp_dstport 32000
udp_srcip 10.1.1.19
udp_dstport 32411
#############################################
### edit with 10 Gbs IP of your server
############################################
rx_zmqip 10.1.2.102
rx_zmqport 77000
rx_zmqip 10.1.1.102
rx_zmqport 50003
#############################################
### edit with 1 Gbs IP of PC where you will run the GUI
############################################
zmqip 129.129.202.132
zmqport 77001
zmqip 129.129.202.57
zmqport 50001
@ -38,7 +38,7 @@ rx_zmqstream 1
frames 1000
frames 100000
period 0.0006
exptime 0.00035
@ -62,9 +62,3 @@ highvoltage 90
#adcreg 0x14 0x40
frames 10
period 0.1
rx_jsonpara subframes 1
rx_jsonpara frameMode raw
rx_jsonpara detectorMode analog

View File

@ -171,17 +171,19 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
/* return NULL; */
/* }; */
virtual char *readNextFrame(ifstream &filebin) {
int ff = -1, np = -1;
return readNextFrame(filebin, ff, np);
};
// not present in base class
virtual char *readNextFrame(ifstream &filebin, int &ff) {
virtual char *readNextFrame(std::ifstream &filebin) {
int ff=-1;
return readNextFrame(filebin, ff);
}
virtual char *readNextFrame(std::ifstream &filebin, int &ff) {
int np = -1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff, int &np) {
// not present in base class
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np) {
char *data = new char[dataSize];
char *d = readNextFrame(filebin, ff, np, data);
if (d == NULL) {
@ -191,18 +193,10 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
return data;
}
virtual char *readNextFrame(ifstream &filebin, int &ff, int &np,
// not present in base class
virtual char *readNextFrame(std::ifstream &filebin, int &ff, int &np,
char *data) {
char *retval = 0;
int nd;
int fnum = -1;
np = 0;
int pn;
// cout << dataSize << endl;
if (ff >= 0)
fnum = ff;
if (filebin.is_open()) {
if (filebin.read(data, dataSize)) {
ff = getFrameNumber(data);
@ -210,8 +204,8 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
return data;
}
}
return NULL;
};
return nullptr;
}
/**
@ -225,7 +219,7 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
found
*/
virtual char *findNextFrame(char *data, int &ndata, int dsize) {
char *findNextFrame(char *data, int &ndata, int dsize) override {
if (dsize < dataSize)
ndata = dsize;
else
@ -233,6 +227,7 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
return data;
}
// int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
};

View File

@ -2,7 +2,36 @@
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef MOENCH03T1RECDATANEW_H
#define MOENCH03T1RECDATANEW_H
//#define MYROOT
#ifndef MYROOT
#include "sls/sls_detector_defs.h"
#endif
#ifdef MYROOT
typedef struct {
uint64_t frameNumber;
uint32_t expLength;
uint32_t packetNumber;
uint64_t bunchId;
uint64_t timestamp;
uint16_t modId;
uint16_t row;
uint16_t column;
uint16_t reserved;
uint32_t debug;
uint16_t roundRNumber;
uint8_t detType;
uint8_t version;
} sls_detector_header;
#define MAX_NUM_PACKETS 512
// using sls_bitset = std::bitset<MAX_NUM_PACKETS>;
// using bitset_storage = uint8_t[MAX_NUM_PACKETS / 8];
struct sls_receiver_header {
sls_detector_header detHeader; /**< is the detector header */
uint8_t packetsMask[64]; /**< is the packets caught bit mask */
};
#endif
#include "slsDetectorData.h"
class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
@ -17,8 +46,12 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
double ghost[200][25];
// Single point of definition if we need to customize
#ifndef MYROOT
using header = sls::defs::sls_receiver_header;
#endif
#ifdef MYROOT
sls_receiver_header header;
#endif
public:
/**
Implements the slsReceiverData structure for the moench02 prototype read
@ -47,7 +80,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
int npackets = 40;
int i;
int adc4(0);
int off=sizeof(header);
for (int ip = 0; ip < npackets; ip++) {
for (int is = 0; is < 128; is++) {
@ -62,13 +95,13 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
} else {
row = 200 + i / sc_width;
}
dataMap[row][col] = sizeof(header) +
dataMap[row][col] = off +
(nadc * i + iadc) * 2; //+16*(ip+1);
#ifdef HIGHZ
dataMask[row][col] = 0x3fff; // invert data
#endif
if (dataMap[row][col] < 0 ||
dataMap[row][col] >= nSamples * 2 * 32)
dataMap[row][col] >= off + nSamples * 2 * 32)
std::cout << "Error: pointer " << dataMap[row][col]
<< " out of range " << std::endl;
}
@ -88,7 +121,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
xmap[ibyte] = -1;
ymap[ibyte] = -1;
}
int off = sizeof(header) / 2;
off = sizeof(header) / 2;
for (ipacket = 0; ipacket < npackets; ipacket++) {
for (ibyte = 0; ibyte < 8192 / 2; ibyte++) {
i = ipacket * 8208 / 2 + ibyte;
@ -175,7 +208,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
*/
int getFrameNumber(char *buff) {
return ((header *)buff)->detHeader.frameNumber;
return ((sls_receiver_header *)buff)->detHeader.frameNumber;
}
/**
@ -188,7 +221,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
*/
int getPacketNumber(char *buff) {
return ((header *)buff)->detHeader.packetNumber;
return ((sls_receiver_header *)buff)->detHeader.packetNumber;
}
char *readNextFrame(std::ifstream &filebin) override {

View File

@ -1,15 +1,17 @@
# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
#module add CBFlib/0.9.5
INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/
INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ -I../tiffio/include
LDFLAG= ../tiffIO.cpp -L/usr/lib64/ -lpthread -lm -lstdc++ -pthread -lrt -ltiff -O3 -std=c++11
LDFLAG= ../tiffio/src/tiffIO.cpp -L/usr/lib64/ -lpthread -lm -lstdc++ -pthread -lrt -ltiff -O3 -std=c++11
MAIN=jungfrauClusterFinder.cpp
all: jungfrauClusterFinder jungfrauMakeEta jungfrauInterpolation jungfrauNoInterpolation jungfrauPhotonCounter jungfrauAnalog
all: jungfrauRawDataProcess
jungfrauRawDataProcess: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcess jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL
jungfrauClusterFinder: jungfrauClusterFinder.cpp $(INCS) clean