mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
some changes for JF with LGADs
This commit is contained in:
parent
36a1159f38
commit
9efb19a9b5
@ -3,33 +3,33 @@
|
|||||||
### edit with hostname or IP address of your detector
|
### edit with hostname or IP address of your detector
|
||||||
############################################
|
############################################
|
||||||
#hostname bchip181+
|
#hostname bchip181+
|
||||||
hostname bchip119.psi.ch
|
hostname bchip135
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
### edit with hostname or 1Gbs IP address of your server
|
### 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
|
### 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)
|
### edit with any number in the subnet of your server (first 3 numbers as above)
|
||||||
############################################
|
############################################
|
||||||
udp_srcip 10.1.2.19
|
udp_srcip 10.1.1.19
|
||||||
udp_dstport 32000
|
udp_dstport 32411
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
### edit with 10 Gbs IP of your server
|
### edit with 10 Gbs IP of your server
|
||||||
############################################
|
############################################
|
||||||
rx_zmqip 10.1.2.102
|
rx_zmqip 10.1.1.102
|
||||||
rx_zmqport 77000
|
rx_zmqport 50003
|
||||||
#############################################
|
#############################################
|
||||||
### edit with 1 Gbs IP of PC where you will run the GUI
|
### edit with 1 Gbs IP of PC where you will run the GUI
|
||||||
############################################
|
############################################
|
||||||
zmqip 129.129.202.132
|
zmqip 129.129.202.57
|
||||||
zmqport 77001
|
zmqport 50001
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ rx_zmqstream 1
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
frames 1000
|
frames 100000
|
||||||
period 0.0006
|
period 0.0006
|
||||||
exptime 0.00035
|
exptime 0.00035
|
||||||
|
|
||||||
@ -62,9 +62,3 @@ highvoltage 90
|
|||||||
#adcreg 0x14 0x40
|
#adcreg 0x14 0x40
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
frames 10
|
|
||||||
period 0.1
|
|
||||||
rx_jsonpara subframes 1
|
|
||||||
rx_jsonpara frameMode raw
|
|
||||||
rx_jsonpara detectorMode analog
|
|
||||||
|
@ -171,17 +171,19 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
|
|||||||
/* return NULL; */
|
/* return NULL; */
|
||||||
/* }; */
|
/* }; */
|
||||||
|
|
||||||
virtual char *readNextFrame(ifstream &filebin) {
|
// not present in base class
|
||||||
int ff = -1, np = -1;
|
|
||||||
return readNextFrame(filebin, ff, np);
|
|
||||||
};
|
|
||||||
|
|
||||||
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;
|
int np = -1;
|
||||||
return readNextFrame(filebin, ff, np);
|
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 *data = new char[dataSize];
|
||||||
char *d = readNextFrame(filebin, ff, np, data);
|
char *d = readNextFrame(filebin, ff, np, data);
|
||||||
if (d == NULL) {
|
if (d == NULL) {
|
||||||
@ -191,18 +193,10 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
|
|||||||
return data;
|
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 *data) {
|
||||||
char *retval = 0;
|
|
||||||
int nd;
|
|
||||||
int fnum = -1;
|
|
||||||
np = 0;
|
np = 0;
|
||||||
int pn;
|
|
||||||
|
|
||||||
// cout << dataSize << endl;
|
|
||||||
if (ff >= 0)
|
|
||||||
fnum = ff;
|
|
||||||
|
|
||||||
if (filebin.is_open()) {
|
if (filebin.is_open()) {
|
||||||
if (filebin.read(data, dataSize)) {
|
if (filebin.read(data, dataSize)) {
|
||||||
ff = getFrameNumber(data);
|
ff = getFrameNumber(data);
|
||||||
@ -210,8 +204,8 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@ -225,7 +219,7 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
|
|||||||
found
|
found
|
||||||
|
|
||||||
*/
|
*/
|
||||||
virtual char *findNextFrame(char *data, int &ndata, int dsize) {
|
char *findNextFrame(char *data, int &ndata, int dsize) override {
|
||||||
if (dsize < dataSize)
|
if (dsize < dataSize)
|
||||||
ndata = dsize;
|
ndata = dsize;
|
||||||
else
|
else
|
||||||
@ -233,6 +227,7 @@ class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
|
// int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,7 +2,36 @@
|
|||||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||||
#ifndef MOENCH03T1RECDATANEW_H
|
#ifndef MOENCH03T1RECDATANEW_H
|
||||||
#define MOENCH03T1RECDATANEW_H
|
#define MOENCH03T1RECDATANEW_H
|
||||||
|
//#define MYROOT
|
||||||
|
|
||||||
|
#ifndef MYROOT
|
||||||
#include "sls/sls_detector_defs.h"
|
#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"
|
#include "slsDetectorData.h"
|
||||||
|
|
||||||
class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
|
class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
|
||||||
@ -17,8 +46,12 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
|
|||||||
double ghost[200][25];
|
double ghost[200][25];
|
||||||
|
|
||||||
// Single point of definition if we need to customize
|
// Single point of definition if we need to customize
|
||||||
|
#ifndef MYROOT
|
||||||
using header = sls::defs::sls_receiver_header;
|
using header = sls::defs::sls_receiver_header;
|
||||||
|
#endif
|
||||||
|
#ifdef MYROOT
|
||||||
|
sls_receiver_header header;
|
||||||
|
#endif
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
Implements the slsReceiverData structure for the moench02 prototype read
|
Implements the slsReceiverData structure for the moench02 prototype read
|
||||||
@ -47,7 +80,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
|
|||||||
int npackets = 40;
|
int npackets = 40;
|
||||||
int i;
|
int i;
|
||||||
int adc4(0);
|
int adc4(0);
|
||||||
|
int off=sizeof(header);
|
||||||
for (int ip = 0; ip < npackets; ip++) {
|
for (int ip = 0; ip < npackets; ip++) {
|
||||||
for (int is = 0; is < 128; is++) {
|
for (int is = 0; is < 128; is++) {
|
||||||
|
|
||||||
@ -62,13 +95,13 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
|
|||||||
} else {
|
} else {
|
||||||
row = 200 + i / sc_width;
|
row = 200 + i / sc_width;
|
||||||
}
|
}
|
||||||
dataMap[row][col] = sizeof(header) +
|
dataMap[row][col] = off +
|
||||||
(nadc * i + iadc) * 2; //+16*(ip+1);
|
(nadc * i + iadc) * 2; //+16*(ip+1);
|
||||||
#ifdef HIGHZ
|
#ifdef HIGHZ
|
||||||
dataMask[row][col] = 0x3fff; // invert data
|
dataMask[row][col] = 0x3fff; // invert data
|
||||||
#endif
|
#endif
|
||||||
if (dataMap[row][col] < 0 ||
|
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]
|
std::cout << "Error: pointer " << dataMap[row][col]
|
||||||
<< " out of range " << std::endl;
|
<< " out of range " << std::endl;
|
||||||
}
|
}
|
||||||
@ -88,7 +121,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
|
|||||||
xmap[ibyte] = -1;
|
xmap[ibyte] = -1;
|
||||||
ymap[ibyte] = -1;
|
ymap[ibyte] = -1;
|
||||||
}
|
}
|
||||||
int off = sizeof(header) / 2;
|
off = sizeof(header) / 2;
|
||||||
for (ipacket = 0; ipacket < npackets; ipacket++) {
|
for (ipacket = 0; ipacket < npackets; ipacket++) {
|
||||||
for (ibyte = 0; ibyte < 8192 / 2; ibyte++) {
|
for (ibyte = 0; ibyte < 8192 / 2; ibyte++) {
|
||||||
i = ipacket * 8208 / 2 + ibyte;
|
i = ipacket * 8208 / 2 + ibyte;
|
||||||
@ -175,7 +208,7 @@ class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int getFrameNumber(char *buff) {
|
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) {
|
int getPacketNumber(char *buff) {
|
||||||
return ((header *)buff)->detHeader.packetNumber;
|
return ((sls_receiver_header *)buff)->detHeader.packetNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *readNextFrame(std::ifstream &filebin) override {
|
char *readNextFrame(std::ifstream &filebin) override {
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||||
#module add CBFlib/0.9.5
|
#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
|
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
|
jungfrauClusterFinder: jungfrauClusterFinder.cpp $(INCS) clean
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user