This commit is contained in:
2021-08-13 17:10:46 +02:00
parent 2548a0bfec
commit 5790e4961b
23 changed files with 192 additions and 91 deletions

View File

@ -414,9 +414,11 @@ int ClientInterface::setup_receiver(Interface &socket) {
std::to_string(arg.quad) +
" due to fifo strucutre memory allocation");
}
impl()->setPartialReadout(arg.partialReadout);
impl()->setThresholdEnergy(arg.thresholdEnergyeV[0]);
}
if (myDetectorType == EIGER || myDetectorType == JUNGFRAU) {
impl()->setPartialReadout(arg.partialReadout);
}
if (myDetectorType == MYTHEN3) {
std::array<int, 3> val;
for (int i = 0; i < 3; ++i) {
@ -1408,6 +1410,9 @@ int ClientInterface::set_partial_readout(Interface &socket) {
auto arg = socket.Receive<int>();
if (arg >= 0) {
verifyIdle(socket);
if (myDetectorType != EIGER && myDetectorType != JUNGFRAU) {
throw RuntimeError("Could not set partial readout. Not implemented for this detector");
}
LOG(logDEBUG1) << "Setting Partial Readout:" << arg;
impl()->setPartialReadout(arg);
}

View File

@ -51,6 +51,7 @@ class GeneralData {
uint32_t vetoPacketSize{0};
uint32_t vetoImageSize{0};
uint32_t vetoHsize{0};
uint32_t maxRowsPerReadout{0};
GeneralData(){};
virtual ~GeneralData(){};
@ -339,6 +340,7 @@ class EigerData : public GeneralData {
threadsPerReceiver = 2;
headerPacketSize = 40;
standardheader = true;
maxRowsPerReadout = 256;
};
/**
@ -384,6 +386,7 @@ class JungfrauData : public GeneralData {
defaultFifoDepth = 2500;
standardheader = true;
defaultUdpSocketBufferSize = (1000 * 1024 * 1024);
maxRowsPerReadout = 512;
};
/**

View File

@ -477,8 +477,8 @@ std::vector<uint64_t> Implementation::getNumMissingPackets() const {
int np = generalData->packetsPerFrame;
uint64_t totnp = np;
// partial readout
if (partialReadout != MAX_EIGER_ROWS_PER_READOUT) {
totnp = ((partialReadout * np) / MAX_EIGER_ROWS_PER_READOUT);
if (partialReadout != generalData->maxRowsPerReadout) {
totnp = ((partialReadout * np) / generalData->maxRowsPerReadout);
}
totnp *= numberOfTotalFrames;
mp[i] = listener[i]->GetNumMissingPacket(stoppedFlag, totnp);

View File

@ -219,7 +219,7 @@ class Implementation : private virtual slsDetectorDefs {
/* [Eiger] */
void setDeactivatedPadding(const bool enable);
int getPartialReadout() const;
/* [Eiger] */
/* [Eiger][Jungfrau] */
void setPartialReadout(const int value);
/** [Eiger] */
void setThresholdEnergy(const int value);
@ -352,7 +352,7 @@ class Implementation : private virtual slsDetectorDefs {
bool activated{true};
std::array<bool, 2> detectorDataStream = {{true, true}};
bool deactivatedPaddingEnable{true};
int partialReadout{MAX_EIGER_ROWS_PER_READOUT};
int partialReadout{0};
int thresholdEnergyeV{-1};
std::array<int, 3> thresholdAllEnergyeV = {{-1, -1, -1}};
std::vector<int64_t> rateCorrections;

View File

@ -336,7 +336,8 @@ class JungfrauMasterAttributes : public MasterAttributes {
oss << MasterAttributes::GetBinaryMasterAttributes()
<< "Exptime : " << sls::ToString(exptime) << '\n'
<< "Period : " << sls::ToString(period) << '\n'
<< "Number of UDP Interfaces : " << numUDPInterfaces << '\n';
<< "Number of UDP Interfaces : " << numUDPInterfaces << '\n'
<< "Partial Readout (rows) : " << partialReadout << '\n';
std::string message = oss.str();
MasterAttributes::WriteBinaryAttributes(fd, message);
};
@ -352,6 +353,13 @@ class JungfrauMasterAttributes : public MasterAttributes {
"Number of UDP Interfaces", PredType::NATIVE_INT, dataspace);
dataset.write(&numUDPInterfaces, PredType::NATIVE_INT);
}
// partialReadout
{
DataSpace dataspace = DataSpace(H5S_SCALAR);
DataSet dataset = group->createDataSet(
"Partial readout (rows)", PredType::NATIVE_INT, dataspace);
dataset.write(&partialReadout, PredType::NATIVE_INT);
}
};
#endif
};

View File

@ -43,7 +43,6 @@
// parameters to calculate fifo depth
#define SAMPLE_TIME_IN_NS (100000000) // 100ms
#define MAX_EIGER_ROWS_PER_READOUT (256)
// to differentiate between gotthard and short gotthard
#define GOTTHARD_PACKET_SIZE (1286)