added Matterhorn data class

This commit is contained in:
2026-05-29 15:54:32 +02:00
parent ff9f7c2795
commit 008c09cf04
8 changed files with 99 additions and 21 deletions
@@ -450,6 +450,7 @@ void ClientInterface::setDetectorType(detectorType arg) {
case MOENCH:
case MYTHEN3:
case GOTTHARD2:
case MATTERHORN:
break;
default:
throw RuntimeError("Unknown detector type: " + std::to_string(arg));
+62
View File
@@ -468,6 +468,68 @@ class Mythen3Data : public GeneralData {
};
};
class MatterhornData : public GeneralData {
public:
MatterhornData() {
detType = slsDetectorDefs::MATTERHORN;
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
framesPerFile = 10000; // TODO: dummy value
fifoDepth = 50000; // TODO: dummy value
standardheader = true;
// udpSocketBufferSize = 0; // TODO: dummy value
dynamicRange = 16; // default
tengigaEnable = true; // TODO: not sure
SetCounterMask(0xf); // default all 4 counters enabled
UpdateImageSize();
};
void SetDynamicRange(int dr) {
dynamicRange = dr;
UpdateImageSize();
};
void SetCounterMask(const int mask) {
int n = __builtin_popcount(mask);
if (n < 1 || n > 4) {
throw RuntimeError("Invalid number of counters " +
std::to_string(n) + ". Expected 1-4.");
}
counterMask = mask;
ncounters = n;
UpdateImageSize();
};
private:
void UpdateImageSize() {
nPixelsX = (nChannelsX * ncounters);
nPixelsY = (nChannelsY * ncounters);
imageSize = nPixelsX * nPixelsY * GetPixelDepth();
LOG(logINFO) << "imageSize: " << imageSize;
actualImageSize = imageSize;
// 10g
// TODO: dont know what to do here
/*
if (tengigaEnable) {
}
// 1g
else {
}
*/
LOG(logINFO) << "Packets Per Frame: " << packetsPerFrame;
packetSize = headerSizeinPacket + dataSize;
LOG(logINFO) << "PacketSize: " << packetSize;
};
private:
int ncounters{0};
int nChannelsX{1024};
int nChannelsY{512};
};
class Gotthard2Data : public GeneralData {
public:
Gotthard2Data() {
@@ -118,6 +118,7 @@ void Implementation::setDetectorType(const detectorType d) {
case XILINX_CHIPTESTBOARD:
case MYTHEN3:
case GOTTHARD2:
case MATTERHORN:
LOG(logINFO) << " ***** " << ToString(d) << " Receiver *****";
break;
default:
@@ -151,6 +152,9 @@ void Implementation::setDetectorType(const detectorType d) {
case GOTTHARD2:
generalData = new Gotthard2Data();
break;
case MATTERHORN:
generalData = new MatterhornData();
break;
default:
break;
}