This commit is contained in:
maliakal_d 2021-07-05 15:20:34 +02:00
parent 5ad2299e83
commit fdf6632356
16 changed files with 119 additions and 24 deletions

View File

@ -479,19 +479,21 @@ int Beb_SetDataStream(int left, int enable) {
(left ? XPAR_GPIO_LFT_STRM_DSBL_MSK : XPAR_GPIO_RGHT_STRM_DSBL_MSK); (left ? XPAR_GPIO_LFT_STRM_DSBL_MSK : XPAR_GPIO_RGHT_STRM_DSBL_MSK);
u_int32_t value = Beb_Read32(csp0base, reg); u_int32_t value = Beb_Read32(csp0base, reg);
LOG(logDEBUG, ("data streaming register value before:%d\n", value)); LOG(logINFO, ("data streaming register value before:0x%x\n", value));
if (enable) // disabling in firmware
if (!enable)
value |= mask; value |= mask;
else else
value &= ~mask; value &= ~mask;
LOG(logINFO, ("Going to set data streaming register value:0x%x\n", value));
u_int32_t retval = Beb_Write32(csp0base, reg, value); u_int32_t retval = Beb_Write32(csp0base, reg, value);
if (retval != value) { /*if (retval != value) {
LOG(logERROR, LOG(logERROR,
("Could not %s %s fpga datastream. Wrote 0x%x, read 0x%x\n", ("Could not %s %s fpga datastream. Wrote 0x%x, read 0x%x\n",
(enable ? "enable" : "disable"), (left ? "left" : "right"), (enable ? "enable" : "disable"), (left ? "left" : "right"),
value, retval)); value, retval));
Beb_close(fd, csp0base); Beb_close(fd, csp0base);
} }*/
} }
Beb_close(fd, csp0base); Beb_close(fd, csp0base);
return 1; return 1;
@ -516,7 +518,8 @@ int Beb_GetDataStream(int left, int *retval) {
(left ? XPAR_GPIO_LFT_STRM_DSBL_MSK : XPAR_GPIO_RGHT_STRM_DSBL_MSK); (left ? XPAR_GPIO_LFT_STRM_DSBL_MSK : XPAR_GPIO_RGHT_STRM_DSBL_MSK);
u_int32_t value = Beb_Read32(csp0base, reg); u_int32_t value = Beb_Read32(csp0base, reg);
*retval = (value & mask) ? 1 : 0; // disabling in firmware
*retval = (value & mask) ? 0 : 1;
} }
Beb_close(fd, csp0base); Beb_close(fd, csp0base);
return 1; return 1;

View File

@ -7055,6 +7055,28 @@ int get_receiver_parameters(int file_des) {
if (n < 0) if (n < 0)
return printSocketReadError(); return printSocketReadError();
// data stream left
#ifdef EIGERD
i32 = 0;
getDataStream(1, &i32);
#else
i32 = 0;
#endif
n += sendData(file_des, &i32, sizeof(i32), INT32);
if (n < 0)
return printSocketReadError();
// data stream right
#ifdef EIGERD
i32 = 0;
getDataStream(0, &i32);
#else
i32 = 0;
#endif
n += sendData(file_des, &i32, sizeof(i32), INT32);
if (n < 0)
return printSocketReadError();
// quad // quad
#ifdef EIGERD #ifdef EIGERD
i32 = getQuad(); i32 = getQuad();
@ -8300,7 +8322,7 @@ int set_datastream(int file_des) {
if (ret == FAIL) { if (ret == FAIL) {
sprintf(mess, "Could not %s\n", msg); sprintf(mess, "Could not %s\n", msg);
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} else { } /*else {
int retval = -1; int retval = -1;
ret = getDataStream(leftFpga, &retval); ret = getDataStream(leftFpga, &retval);
LOG(logDEBUG1, ("%s retval: %u\n", msg, retval)); LOG(logDEBUG1, ("%s retval: %u\n", msg, retval));
@ -8310,7 +8332,7 @@ int set_datastream(int file_des) {
LOG(logERROR, (mess)); LOG(logERROR, (mess));
} }
validate(&ret, mess, enable, retval, msg, DEC); validate(&ret, mess, enable, retval, msg, DEC);
} }*/
} }
} }
#endif #endif

View File

@ -1516,6 +1516,9 @@ bool Module::getDataStream(const bool left) const {
void Module::setDataStream(const bool left, const bool enable) { void Module::setDataStream(const bool left, const bool enable) {
int args[]{static_cast<int>(left), static_cast<int>(enable)}; int args[]{static_cast<int>(left), static_cast<int>(enable)};
sendToDetector(F_SET_DATASTREAM, args, nullptr); sendToDetector(F_SET_DATASTREAM, args, nullptr);
if (shm()->useReceiverFlag) {
sendToReceiver(F_RECEIVER_SET_DATASTREAM, args, nullptr);
}
} }
// Jungfrau Specific // Jungfrau Specific

View File

@ -209,6 +209,8 @@ int ClientInterface::functionTable(){
flist[F_GET_RECEIVER_STREAMING_HWM] = &ClientInterface::get_streaming_hwm; flist[F_GET_RECEIVER_STREAMING_HWM] = &ClientInterface::get_streaming_hwm;
flist[F_SET_RECEIVER_STREAMING_HWM] = &ClientInterface::set_streaming_hwm; flist[F_SET_RECEIVER_STREAMING_HWM] = &ClientInterface::set_streaming_hwm;
flist[F_RECEIVER_SET_ALL_THRESHOLD] = &ClientInterface::set_all_threshold; flist[F_RECEIVER_SET_ALL_THRESHOLD] = &ClientInterface::set_all_threshold;
flist[F_RECEIVER_SET_DATASTREAM] = &ClientInterface::set_detector_datastream;
for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) { for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) {
LOG(logDEBUG1) << "function fnum: " << i << " (" << LOG(logDEBUG1) << "function fnum: " << i << " (" <<
@ -401,6 +403,8 @@ int ClientInterface::setup_receiver(Interface &socket) {
impl()->setSubPeriod(std::chrono::nanoseconds(arg.subExpTimeNs) + impl()->setSubPeriod(std::chrono::nanoseconds(arg.subExpTimeNs) +
std::chrono::nanoseconds(arg.subDeadTimeNs)); std::chrono::nanoseconds(arg.subDeadTimeNs));
impl()->setActivate(static_cast<bool>(arg.activate)); impl()->setActivate(static_cast<bool>(arg.activate));
impl()->setDetectorDataStream(1, arg.dataStreamLeft);
impl()->setDetectorDataStream(0, arg.dataStreamRight);
try { try {
impl()->setQuad(arg.quad == 0 ? false : true); impl()->setQuad(arg.quad == 0 ? false : true);
} catch (const RuntimeError &e) { } catch (const RuntimeError &e) {
@ -1695,3 +1699,18 @@ int ClientInterface::set_all_threshold(Interface &socket) {
impl()->setThresholdEnergy(eVs); impl()->setThresholdEnergy(eVs);
return socket.Send(OK); return socket.Send(OK);
} }
int ClientInterface::set_detector_datastream(Interface &socket) {
int args[2]{-1, -1};
socket.Receive(args);
bool left = static_cast<int>(args[0]);
bool enable = static_cast<int>(args[1]);
LOG(logDEBUG1) << "Setting datstream " << (left ? "left" : "right")
<< ") to " << sls::ToString(enable);
if (myDetectorType != EIGER)
functionNotImplemented();
verifyIdle(socket);
impl()->setDetectorDataStream(left, enable);
return socket.Send(OK);
}

View File

@ -162,6 +162,8 @@ class ClientInterface : private virtual slsDetectorDefs {
int get_streaming_hwm(sls::ServerInterface &socket); int get_streaming_hwm(sls::ServerInterface &socket);
int set_streaming_hwm(sls::ServerInterface &socket); int set_streaming_hwm(sls::ServerInterface &socket);
int set_all_threshold(sls::ServerInterface &socket); int set_all_threshold(sls::ServerInterface &socket);
int set_detector_datastream(sls::ServerInterface &socket);
Implementation *impl() { Implementation *impl() {
if (receiver != nullptr) { if (receiver != nullptr) {

View File

@ -151,7 +151,7 @@ void DataProcessor::CreateFirstFiles(
const bool overWriteEnable, const bool silentMode, const int modulePos, const bool overWriteEnable, const bool silentMode, const int modulePos,
const int numUnitsPerReadout, const uint32_t udpPortNumber, const int numUnitsPerReadout, const uint32_t udpPortNumber,
const uint32_t maxFramesPerFile, const uint64_t numImages, const uint32_t maxFramesPerFile, const uint64_t numImages,
const uint32_t dynamicRange) { const uint32_t dynamicRange, const bool detectorDataStream) {
if (dataFile_ == nullptr) { if (dataFile_ == nullptr) {
throw sls::RuntimeError("file object not contstructed"); throw sls::RuntimeError("file object not contstructed");
} }
@ -163,6 +163,16 @@ void DataProcessor::CreateFirstFiles(
overWriteEnable, silentMode, attr); overWriteEnable, silentMode, attr);
} }
// deactivated with padding enabled, dont write file
if (!*activated_ && !*deactivatedPaddingEnable_) {
return;
}
// deactivated port, dont write file
if (!detectorDataStream) {
return;
}
switch (dataFile_->GetFileFormat()) { switch (dataFile_->GetFileFormat()) {
#ifdef HDF5C #ifdef HDF5C
case HDF5: case HDF5:

View File

@ -60,7 +60,9 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
const uint32_t udpPortNumber, const uint32_t udpPortNumber,
const uint32_t maxFramesPerFile, const uint32_t maxFramesPerFile,
const uint64_t numImages, const uint64_t numImages,
const uint32_t dynamicRange); const uint32_t dynamicRange,
const bool detectorDataStream
);
#ifdef HDF5C #ifdef HDF5C
uint32_t GetFilesInAcquisition() const; uint32_t GetFilesInAcquisition() const;
void CreateVirtualFile(const std::string filePath, void CreateVirtualFile(const std::string filePath,

View File

@ -167,7 +167,7 @@ void Implementation::setDetectorType(const detectorType d) {
i, detType, fifo_ptr, &status, &udpPortNum[i], &eth[i], i, detType, fifo_ptr, &status, &udpPortNum[i], &eth[i],
&numberOfTotalFrames, &udpSocketBufferSize, &numberOfTotalFrames, &udpSocketBufferSize,
&actualUDPSocketBufferSize, &framesPerFile, &frameDiscardMode, &actualUDPSocketBufferSize, &framesPerFile, &frameDiscardMode,
&activated, &deactivatedPaddingEnable, &silentMode)); &activated, &detectorDataStream[i], &deactivatedPaddingEnable, &silentMode));
dataProcessor.push_back(sls::make_unique<DataProcessor>( dataProcessor.push_back(sls::make_unique<DataProcessor>(
i, detType, fifo_ptr, &activated, &deactivatedPaddingEnable, i, detType, fifo_ptr, &activated, &deactivatedPaddingEnable,
&dataStreamEnable, &streamingFrequency, &streamingTimerInMs, &dataStreamEnable, &streamingFrequency, &streamingTimerInMs,
@ -610,6 +610,12 @@ void Implementation::stopReceiver() {
if (!activated) { if (!activated) {
LOG(logINFORED) << "Deactivated Receiver"; LOG(logINFORED) << "Deactivated Receiver";
} }
if (!detectorDataStream[0]) {
LOG(logINFORED) << "Deactivated Left Port";
}
if (!detectorDataStream[1]) {
LOG(logINFORED) << "Deactivated Right Port";
}
// callback // callback
if (acquisitionFinishedCallBack) { if (acquisitionFinishedCallBack) {
try { try {
@ -796,7 +802,7 @@ void Implementation::SetupWriter() {
masterAttributes.get(), filePath, fileName, fileIndex, masterAttributes.get(), filePath, fileName, fileIndex,
overwriteEnable, silentMode, modulePos, numThreads, overwriteEnable, silentMode, modulePos, numThreads,
udpPortNum[i], framesPerFile, numberOfTotalFrames, udpPortNum[i], framesPerFile, numberOfTotalFrames,
dynamicRange); dynamicRange, detectorDataStream[i]);
} }
} catch (const sls::RuntimeError &e) { } catch (const sls::RuntimeError &e) {
shutDownUDPSockets(); shutDownUDPSockets();
@ -867,7 +873,7 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
i, detType, fifo_ptr, &status, &udpPortNum[i], &eth[i], i, detType, fifo_ptr, &status, &udpPortNum[i], &eth[i],
&numberOfTotalFrames, &udpSocketBufferSize, &numberOfTotalFrames, &udpSocketBufferSize,
&actualUDPSocketBufferSize, &framesPerFile, &actualUDPSocketBufferSize, &framesPerFile,
&frameDiscardMode, &activated, &deactivatedPaddingEnable, &frameDiscardMode, &activated, &detectorDataStream[i], &deactivatedPaddingEnable,
&silentMode)); &silentMode));
listener[i]->SetGeneralData(generalData); listener[i]->SetGeneralData(generalData);
@ -1497,10 +1503,20 @@ void Implementation::setQuad(const bool b) {
bool Implementation::getActivate() const { return activated; } bool Implementation::getActivate() const { return activated; }
bool Implementation::setActivate(bool enable) { void Implementation::setActivate(bool enable) {
activated = enable; activated = enable;
LOG(logINFO) << "Activation: " << (activated ? "enabled" : "disabled"); LOG(logINFO) << "Activation: " << (activated ? "enabled" : "disabled");
return activated; }
bool Implementation::getDetectorDataStream(const bool leftPort) const {
int index = (leftPort ? 0 : 1);
return detectorDataStream[index];
}
void Implementation::setDetectorDataStream(const bool leftPort, const bool enable) {
int index = (leftPort ? 0 : 1);
detectorDataStream[index] = enable;
LOG(logINFO) << "Detector datastream (" << (leftPort ? "Left" : "Right") << " Port): " << sls::ToString(detectorDataStream[index]);
} }
bool Implementation::getDeactivatedPadding() const { bool Implementation::getDeactivatedPadding() const {

View File

@ -210,7 +210,11 @@ class Implementation : private virtual slsDetectorDefs {
bool getActivate() const; bool getActivate() const;
/** [Eiger] If deactivated, receiver will create dummy data if deactivated /** [Eiger] If deactivated, receiver will create dummy data if deactivated
* padding is enabled (as it will receive nothing from detector) */ * padding is enabled (as it will receive nothing from detector) */
bool setActivate(const bool enable); void setActivate(const bool enable);
bool getDetectorDataStream(const bool leftPort) const;
/** [Eiger] If datastream is disabled, receiver will create dummy data if deactivated
* padding for that port is enabled (as it will receive nothing from detector) */
void setDetectorDataStream(const bool leftPort, const bool enable);
bool getDeactivatedPadding() const; bool getDeactivatedPadding() const;
/* [Eiger] */ /* [Eiger] */
void setDeactivatedPadding(const bool enable); void setDeactivatedPadding(const bool enable);
@ -346,6 +350,7 @@ class Implementation : private virtual slsDetectorDefs {
int flippedDataX{0}; int flippedDataX{0};
bool quadEnable{false}; bool quadEnable{false};
bool activated{true}; bool activated{true};
std::array<bool, 2> detectorDataStream = {{true, true}};
bool deactivatedPaddingEnable{true}; bool deactivatedPaddingEnable{true};
int numLinesReadout{MAX_EIGER_ROWS_PER_READOUT}; int numLinesReadout{MAX_EIGER_ROWS_PER_READOUT};
int thresholdEnergyeV{-1}; int thresholdEnergyeV{-1};

View File

@ -22,11 +22,11 @@ const std::string Listener::TypeName = "Listener";
Listener::Listener(int ind, detectorType dtype, Fifo *f, Listener::Listener(int ind, detectorType dtype, Fifo *f,
std::atomic<runStatus> *s, uint32_t *portno, std::string *e, std::atomic<runStatus> *s, uint32_t *portno, std::string *e,
uint64_t *nf, int *us, int *as, uint32_t *fpf, uint64_t *nf, int *us, int *as, uint32_t *fpf,
frameDiscardPolicy *fdp, bool *act, bool *depaden, bool *sm) frameDiscardPolicy *fdp, bool *act, bool* detds, bool *depaden, bool *sm)
: ThreadObject(ind, TypeName), fifo(f), myDetectorType(dtype), status(s), : ThreadObject(ind, TypeName), fifo(f), myDetectorType(dtype), status(s),
udpPortNumber(portno), eth(e), numImages(nf), udpSocketBufferSize(us), udpPortNumber(portno), eth(e), numImages(nf), udpSocketBufferSize(us),
actualUDPSocketBufferSize(as), framesPerFile(fpf), frameDiscardMode(fdp), actualUDPSocketBufferSize(as), framesPerFile(fpf), frameDiscardMode(fdp),
activated(act), deactivatedPaddingEnable(depaden), silentMode(sm) { activated(act), detectorDataStream(detds), deactivatedPaddingEnable(depaden), silentMode(sm) {
LOG(logDEBUG) << "Listener " << ind << " created"; LOG(logDEBUG) << "Listener " << ind << " created";
} }
@ -94,7 +94,7 @@ void Listener::RecordFirstIndex(uint64_t fnum) {
void Listener::SetGeneralData(GeneralData *g) { generalData = g; } void Listener::SetGeneralData(GeneralData *g) { generalData = g; }
void Listener::CreateUDPSockets() { void Listener::CreateUDPSockets() {
if (!(*activated)) { if (!(*activated) || !(*detectorDataStream)) {
return; return;
} }
@ -144,7 +144,7 @@ void Listener::CreateDummySocketForUDPSocketBufferSize(int s) {
LOG(logINFO) << "Testing UDP Socket Buffer size " << s << " with test port " LOG(logINFO) << "Testing UDP Socket Buffer size " << s << " with test port "
<< *udpPortNumber; << *udpPortNumber;
if (!(*activated)) { if (!(*activated) || !(*detectorDataStream)) {
*actualUDPSocketBufferSize = (s * 2); *actualUDPSocketBufferSize = (s * 2);
return; return;
} }
@ -201,7 +201,7 @@ void Listener::ThreadExecution() {
<< std::hex << (void *)(buffer) << std::dec << ":" << buffer; << std::hex << (void *)(buffer) << std::dec << ":" << buffer;
// udpsocket doesnt exist // udpsocket doesnt exist
if (*activated && !udpSocketAlive && !carryOverFlag) { if (*activated && *detectorDataStream && !udpSocketAlive && !carryOverFlag) {
// LOG(logERROR) << "Listening_Thread " << index << ": UDP Socket not // LOG(logERROR) << "Listening_Thread " << index << ": UDP Socket not
// created or shut down earlier"; // created or shut down earlier";
(*((uint32_t *)buffer)) = 0; (*((uint32_t *)buffer)) = 0;
@ -210,7 +210,7 @@ void Listener::ThreadExecution() {
} }
// get data // get data
if ((*status != TRANSMITTING && (!(*activated) || udpSocketAlive)) || if ((*status != TRANSMITTING && (!(*activated) || !(*detectorDataStream) || udpSocketAlive)) ||
carryOverFlag) { carryOverFlag) {
rc = ListenToAnImage(buffer); rc = ListenToAnImage(buffer);
} }
@ -293,6 +293,10 @@ uint32_t Listener::ListenToAnImage(char *buf) {
memset(buf, 0, fifohsize); memset(buf, 0, fifohsize);
new_header = (sls_receiver_header *)(buf + FIFO_HEADER_NUMBYTES); new_header = (sls_receiver_header *)(buf + FIFO_HEADER_NUMBYTES);
// deactivated port (eiger)
if (!(*detectorDataStream)) {
return 0;
}
// deactivated (eiger) // deactivated (eiger)
if (!(*activated)) { if (!(*activated)) {
// no padding // no padding

View File

@ -37,12 +37,13 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
* @param fpf pointer to frames per file * @param fpf pointer to frames per file
* @param fdp frame discard policy * @param fdp frame discard policy
* @param act pointer to activated * @param act pointer to activated
* @param detds pointer to detector data stream
* @param depaden pointer to deactivated padding enable * @param depaden pointer to deactivated padding enable
* @param sm pointer to silent mode * @param sm pointer to silent mode
*/ */
Listener(int ind, detectorType dtype, Fifo *f, std::atomic<runStatus> *s, Listener(int ind, detectorType dtype, Fifo *f, std::atomic<runStatus> *s,
uint32_t *portno, std::string *e, uint64_t *nf, int *us, int *as, uint32_t *portno, std::string *e, uint64_t *nf, int *us, int *as,
uint32_t *fpf, frameDiscardPolicy *fdp, bool *act, bool *depaden, uint32_t *fpf, frameDiscardPolicy *fdp, bool *act, bool* detds, bool *depaden,
bool *sm); bool *sm);
/** /**
@ -187,6 +188,9 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
/** Activated/Deactivated */ /** Activated/Deactivated */
bool *activated; bool *activated;
/** detector data stream */
bool* detectorDataStream;
/** Deactivated padding enable */ /** Deactivated padding enable */
bool *deactivatedPaddingEnable; bool *deactivatedPaddingEnable;

View File

@ -459,6 +459,8 @@ typedef struct {
int64_t subExpTimeNs{0}; int64_t subExpTimeNs{0};
int64_t subDeadTimeNs{0}; int64_t subDeadTimeNs{0};
int activate{0}; int activate{0};
int dataStreamLeft{0};
int dataStreamRight{0};
int quad{0}; int quad{0};
int numLinesReadout{0}; int numLinesReadout{0};
int thresholdEnergyeV[3]{0, 0, 0}; int thresholdEnergyeV[3]{0, 0, 0};

View File

@ -330,6 +330,7 @@ enum detFuncs {
F_GET_RECEIVER_STREAMING_HWM, F_GET_RECEIVER_STREAMING_HWM,
F_SET_RECEIVER_STREAMING_HWM, F_SET_RECEIVER_STREAMING_HWM,
F_RECEIVER_SET_ALL_THRESHOLD, F_RECEIVER_SET_ALL_THRESHOLD,
F_RECEIVER_SET_DATASTREAM,
NUM_REC_FUNCTIONS NUM_REC_FUNCTIONS
}; };
@ -658,7 +659,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_GET_RECEIVER_STREAMING_HWM: return "F_GET_RECEIVER_STREAMING_HWM"; case F_GET_RECEIVER_STREAMING_HWM: return "F_GET_RECEIVER_STREAMING_HWM";
case F_SET_RECEIVER_STREAMING_HWM: return "F_SET_RECEIVER_STREAMING_HWM"; case F_SET_RECEIVER_STREAMING_HWM: return "F_SET_RECEIVER_STREAMING_HWM";
case F_RECEIVER_SET_ALL_THRESHOLD: return "F_RECEIVER_SET_ALL_THRESHOLD"; case F_RECEIVER_SET_ALL_THRESHOLD: return "F_RECEIVER_SET_ALL_THRESHOLD";
case F_RECEIVER_SET_DATASTREAM: return "F_RECEIVER_SET_DATASTREAM";
case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS"; case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS";
default: return "Unknown Function"; default: return "Unknown Function";

View File

@ -10,4 +10,4 @@
#define APIMYTHEN3 0x210621 #define APIMYTHEN3 0x210621
#define APIMOENCH 0x210621 #define APIMOENCH 0x210621
#define APIEIGER 0x210702 #define APIEIGER 0x210705

View File

@ -52,6 +52,8 @@ std::string ToString(const slsDetectorDefs::rxParameters &r) {
<< "subDeadTime:" << ToString(std::chrono::nanoseconds(r.subDeadTimeNs)) << "subDeadTime:" << ToString(std::chrono::nanoseconds(r.subDeadTimeNs))
<< std::endl << std::endl
<< "activate:" << r.activate << std::endl << "activate:" << r.activate << std::endl
<< "leftDataStream:" << r.dataStreamLeft << std::endl
<< "rightDataStream:" << r.dataStreamRight << std::endl
<< "quad:" << r.quad << std::endl << "quad:" << r.quad << std::endl
<< "numLinesReadout:" << r.numLinesReadout << std::endl << "numLinesReadout:" << r.numLinesReadout << std::endl
<< "thresholdEnergyeV:" << ToString(r.thresholdEnergyeV) << std::endl << "thresholdEnergyeV:" << ToString(r.thresholdEnergyeV) << std::endl