Moench rw3 (#745)

* moench, removed chip version, filter resistor, filter cells, currentsoures, gain mode, setttings(modes), dbitphase, maxdbitphase, autocompdisable, comparatordisabletime, made acq start and stop a pulse, removed unused registers

* added parallel command

* remove gain plot for moench

* moench: updated adc invert val

* moench: update adcoffset to 0xf and adcphase to 140 degrees

* removed sync clock in moench

* updated min fw version

* removing config file in moench server
This commit is contained in:
2023-05-25 11:00:23 +02:00
committed by GitHub
parent 0a7fd0a51a
commit 65b8c9c5c1
30 changed files with 286 additions and 1216 deletions

View File

@ -129,7 +129,7 @@ class Detector {
/** [Jungfrau][Moench][Gotthard][Gotthard2][Mythen3] */
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
/** [Jungfrau][Moench] GAIN0, HIGHGAIN0 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
/** [Jungfrau] GAIN0, HIGHGAIN0 \n [Gotthard] DYNAMICGAIN, HIGHGAIN,
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN,
* FIXGAIN1, FIXGAIN2 \n [Mythen3] STANDARD, FAST,
* HIGHGAIN. Also changes vrshaper and vrpreamp \n [Eiger] Use threshold
@ -352,12 +352,12 @@ class Detector {
Result<defs::speedLevel> getReadoutSpeed(Positions pos = {}) const;
/** [Eiger][Jungfrau][Moench][Gotthard2]
* [Jungfrau][Moench] Options: FULL_SPEED, HALF_SPEED (Default),
* QUARTER_SPEED \n [Eiger] Options: FULL_SPEED (Default), HALF_SPEED,
* QUARTER_SPEED \n [Gotthard2] Options: G2_108MHZ (Default), G2_144MHZ \n
* [Jungfrau][Moench] FULL_SPEED option only available from v2.0 boards and
* is recommended to set number of interfaces to 2. \n Also overwrites
* adcphase to recommended default.
* [Jungfrau] Options: FULL_SPEED, HALF_SPEED (Default),
* QUARTER_SPEED \n [Moench] Options: FULL_SPEED (Default) \n [Eiger]
* Options: FULL_SPEED (Default), HALF_SPEED, QUARTER_SPEED \n [Gotthard2]
* Options: G2_108MHZ (Default), G2_144MHZ \n [Jungfrau][Moench] FULL_SPEED
* option only available from v2.0 boards and is recommended to set number
* of interfaces to 2. \n Also overwrites adcphase to recommended default.
*/
void setReadoutSpeed(defs::speedLevel value, Positions pos = {});
@ -389,21 +389,21 @@ class Detector {
*/
void setADCPhaseInDegrees(int value, Positions pos = {});
/** [CTB][Jungfrau][Moench] */
/** [CTB][Jungfrau] */
Result<int> getDBITPhase(Positions pos = {}) const;
/** [CTB][Jungfrau][Moench] Absolute phase shift \n
/** [CTB][Jungfrau] Absolute phase shift \n
* [CTB] changing dbitclk also resets dbitphase and sets to previous values.
*/
void setDBITPhase(int value, Positions pos = {});
/** [CTB][Jungfrau][Moench] */
/** [CTB][Jungfrau] */
Result<int> getMaxDBITPhaseShift(Positions pos = {}) const;
/** [CTB][Jungfrau][Moench] */
/** [CTB][Jungfrau] */
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const;
/** [CTB][Jungfrau][Moench] Absolute phase shift \n
/** [CTB][Jungfrau] Absolute phase shift \n
* [CTB] changing dbitclk also resets dbitphase and sets to previous values.
*/
void setDBITPhaseInDegrees(int value, Positions pos = {});
@ -529,30 +529,30 @@ class Detector {
void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value,
Positions pos = {});
/** [Eiger][Mythen3][Gotthard2] */
/** [Eiger][Mythen3][Gotthard2][Moench] */
Result<bool> getParallelMode(Positions pos = {}) const;
/** [Eiger][Mythen3][Gotthard2]
/** [Eiger][Mythen3][Gotthard2][Moench]
* [Mythen3] If exposure time is too short, acquisition will return with an
* ERROR and take fewer frames than expected \n
* [Mythen3][Eiger] Default: Non parallel \n
* [Mythen3][Eiger][Moench] Default: Non parallel \n
* [Gotthard2] Default: Parallel. Non parallel mode works only in continuous
* mode.*/
void setParallelMode(bool value, Positions pos = {});
/** [Gotthard2][Jungfrau][Moench] */
/** [Gotthard2][Jungfrau] */
Result<int> getFilterResistor(Positions pos = {}) const;
/** [Gotthard2][Jungfrau][Moench] Set filter resistor. Increasing values for
/** [Gotthard2][Jungfrau] Set filter resistor. Increasing values for
* increasing resistance.\n[Gotthard2] Options: [0|1|2|3]. Default is
* 0.\n[Jungfrau][Moench] Options: [0|1]. Default is 1.*/
* 0.\n[Jungfrau] Options: [0|1]. Default is 1.*/
void setFilterResistor(int value, Positions pos = {});
/** [Gotthard2][Jungfrau][Moench] */
/** [Gotthard2][Jungfrau] */
Result<defs::currentSrcParameters>
getCurrentSource(Positions pos = {}) const;
/** [Gotthard2][Jungfrau][Moench] Please refer documentation on
/** [Gotthard2][Jungfrau] Please refer documentation on
* currentSrcParameters (sls_detector_defs.h) on the structure and its
* members */
void setCurrentSource(defs::currentSrcParameters par, Positions pos = {});
@ -1250,7 +1250,7 @@ class Detector {
* *
* ************************************************/
/** [Jungfrau][Moench] */
/** [Jungfrau] */
Result<double> getChipVersion(Positions pos = {}) const;
/** [Jungfrau][Moench] */
@ -1279,10 +1279,10 @@ class Detector {
/** [Jungfrau][Moench] refer to setThresdholdTemperature */
void resetTemperatureEvent(Positions pos = {});
/** [Jungfrau][Moench] */
/** [Jungfrau] */
Result<bool> getAutoComparatorDisable(Positions pos = {}) const;
/** [Jungfrau][Moench] Advanced
/** [Jungfrau] Advanced
* //TODO naming
* By default, the on-chip gain switching is active during the
* entire exposure. This mode disables the on-chip gain switching comparator
@ -1294,10 +1294,10 @@ class Detector {
*/
void setAutoComparatorDisable(bool value, Positions pos = {});
/** [Jungfrau][Moench] */
/** [Jungfrau] */
Result<ns> getComparatorDisableTime(Positions pos = {}) const;
/** [Jungfrau][Moench] Time before end of exposure when comparator is
/** [Jungfrau] Time before end of exposure when comparator is
* disabled. It is only possible for chipv1.1.*/
void setComparatorDisableTime(ns t, Positions pos = {});
@ -1330,19 +1330,19 @@ class Detector {
/** list of possible gainmode */
std::vector<defs::gainMode> getGainModeList() const;
/** [Jungfrau][Moench]*/
/** [Jungfrau]*/
Result<defs::gainMode> getGainMode(Positions pos = {}) const;
/** [Jungfrau][Moench] Options: DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
/** [Jungfrau] Options: DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2,
* FIX_G1, FIX_G2, FIX_G0 \n\CAUTION: Do not use FIX_G0 without caution, you
* can damage the detector!!!\n
*/
void setGainMode(const defs::gainMode mode, Positions pos = {});
/** [Jungfrau][Moench] Advanced */
/** [Jungfrau] Advanced */
Result<int> getNumberOfFilterCells(Positions pos = {}) const;
/** [Jungfrau][Moench] Advanced Options[0-12], only for chip v1.1
/** [Jungfrau] Advanced Options[0-12], only for chip v1.1
*/
void setNumberOfFilterCells(int cell, Positions pos = {});

View File

@ -702,15 +702,14 @@ std::string CmdProxy::ReadoutSpeed(int action) {
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "\n\t[0 or full_speed|1 or half_speed|2 or "
"quarter_speed]\n\t\t[Eiger][Jungfrau][Moench] Readout "
"speed of chip.\n\t\t[Eiger] Default speed is full_speed."
"\n\t\t[Jungfrau][Moench] Default speed is half_speed. "
"full_speed "
"option only available from v2.0 boards and is recommended to "
"set "
"number of interfaces to 2. Also overwrites "
"quarter_speed]\n\t\t[Eiger][Jungfrau][Moench] Readout speed of "
"chip.\n\t\t[Eiger][Moench] Default speed is "
"full_speed.\n\t\t[Jungfrau] Default speed is half_speed. "
"full_speed option only available from v2.0 boards and is "
"recommended to set number of interfaces to 2. Also overwrites "
"adcphase to recommended default.\n\t [144|108]\n\t\t[Gotthard2] "
"Readout speed of chip in MHz. Default is 108."
"Readout speed of chip in MHz. Default is 108.\n\t\t[Moench] "
"Only Full speed is implemented."
<< '\n';
} else {
defs::detectorType type = det->getDetectorType().squash();
@ -800,8 +799,7 @@ std::string CmdProxy::Dbitphase(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau][Moench] Phase "
"shift of "
os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of "
"clock to latch digital bits. Absolute phase shift. If deg used, "
"then shift in degrees. \n\t[Ctb]Changing dbitclk also resets "
"dbitphase and sets to previous values."
@ -809,7 +807,7 @@ std::string CmdProxy::Dbitphase(int action) {
} else {
auto det_type = det->getDetectorType().squash(defs::GENERIC);
if (det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
det_type == defs::GOTTHARD2 || det_type == defs::MOENCH) {
throw RuntimeError("dbitphase not implemented for this detector");
}
if (action == defs::GET_ACTION) {
@ -1038,8 +1036,7 @@ std::string CmdProxy::CurrentSource(int action) {
os << "\n\t[0|1]\n\t\t[Gotthard2] Enable or disable current source. "
"Default "
"is disabled.\n\t[0|1] [fix|nofix] [select source] [(only for "
"chipv1.1)normal|low]\n\t\t[Jungfrau][Moench] Disable or enable "
"current "
"chipv1.1)normal|low]\n\t\t[Jungfrau] Disable or enable current "
"source with some parameters. The select source is 0-63 for "
"chipv1.0 and a 64 bit mask for chipv1.1. To disable, one needs "
"only one argument '0'."

View File

@ -1281,7 +1281,7 @@ class CmdProxy {
"verylowgain, g1_hg, g1_lg, g2_hc_hg, g2_hc_lg, "
"g2_lc_hg, g2_lc_lg, g4_hg, g4_lg, gain0]"
"\n\t Detector Settings"
"\n\t[Jungfrau][Moench] - [ gain0 | highgain0]"
"\n\t[Jungfrau] - [ gain0 | highgain0]"
"\n\t[Gotthard] - [dynamicgain | highgain | lowgain | "
"mediumgain | veryhighgain]"
"\n\t[Gotthard2] - [dynamicgain | fixgain1 | fixgain2]"
@ -1397,10 +1397,9 @@ class CmdProxy {
"\n\t[Jungfrau][Moench][CTB] Absolute maximum Phase shift of "
"ADC clock.");
GET_COMMAND(
maxdbitphaseshift, getMaxDBITPhaseShift,
"\n\t[CTB][Jungfrau][Moench] Absolute maximum Phase shift of of the "
"clock to latch digital bits.");
GET_COMMAND(maxdbitphaseshift, getMaxDBITPhaseShift,
"\n\t[CTB][Jungfrau] Absolute maximum Phase shift of of the "
"clock to latch digital bits.");
INTEGER_COMMAND_VEC_ID(highvoltage, getHighVoltage, setHighVoltage,
StringTo<int>,
@ -1429,19 +1428,19 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID(
parallel, getParallelMode, setParallelMode, StringTo<int>,
"[0, 1]\n\t[Eiger][Mythen3][Gotthard2] Enable or disable parallel "
"[0, 1]\n\t[Eiger][Mythen3][Gotthard2][Moench] Enable or disable "
"parallel "
"mode.\n\t[Mythen3] If exptime is too short, the "
"acquisition will return ERROR status and take fewer "
"frames than expected.\n\t[Mythen3][Eiger] Default: Non "
"frames than expected.\n\t[Mythen3][Eiger][Moench] Default: Non "
"parallel.\n\t[Gotthard2] Default: Parallel. Non parallel mode works "
"only in continuous mode.");
INTEGER_COMMAND_VEC_ID(
filterresistor, getFilterResistor, setFilterResistor, StringTo<int>,
"[value] [Gotthard2][Jungfrau][Moench] Set filter resistor. Increasing "
"values "
"for increasing resistance.\n\t[Gotthard2] Options: [0|1|2|3]. Default "
"is 0.\n\t[Jungfrau][Moench] Options: [0|1]. Default is 1.");
"[value] [Gotthard2][Jungfrau] Set filter resistor. Increasing "
"values for increasing resistance.\n\t[Gotthard2] Options: [0|1|2|3]. "
"Default is 0.\n\t[Jungfrau] Options: [0|1]. Default is 1.");
INTEGER_COMMAND_VEC_ID(dbitpipeline, getDBITPipeline, setDBITPipeline,
StringTo<int>,
@ -1957,9 +1956,8 @@ class CmdProxy {
/* Jungfrau Specific */
GET_COMMAND(
chipversion, getChipVersion,
"\n\t[Jungfrau][Moench] Returns chip version. Can be 1.0 or 1.1");
GET_COMMAND(chipversion, getChipVersion,
"\n\t[Jungfrau] Returns chip version. Can be 1.0 or 1.1");
INTEGER_COMMAND_VEC_ID(
temp_threshold, getThresholdTemperature, setThresholdTemperature,
@ -1984,21 +1982,20 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID(
autocompdisable, getAutoComparatorDisable, setAutoComparatorDisable,
StringTo<int>,
"[0, 1]\n\t[Jungfrau][Moench] Auto comparator disable mode. By "
"default, the "
"on-chip gain switching is active during the entire exposure.This mode "
"disables the on - chip gain switching comparator automatically after "
"93.75% (only for chipv1.0) of exposure time (only for longer than "
"100us). It is possible to set the duration for chipv1.1 using "
"compdisabletime command.\n\tDefault is 0 or this mode "
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By "
"default, the on-chip gain switching is active during the entire "
"exposure.This mode disables the on - chip gain switching comparator "
"automatically after 93.75% (only for chipv1.0) of exposure time (only "
"for longer than 100us). It is possible to set the duration for "
"chipv1.1 using compdisabletime command.\n\tDefault is 0 or this mode "
"disabled(comparator enabled throughout). 1 enables mode. 0 disables "
"mode. ");
TIME_COMMAND(
compdisabletime, getComparatorDisableTime, setComparatorDisableTime,
"[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau][Moench] Time "
"before end of exposure when comparator is disabled. It is "
"only possible for chipv1.1.");
TIME_COMMAND(compdisabletime, getComparatorDisableTime,
setComparatorDisableTime,
"[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] Time "
"before end of exposure when comparator is disabled. It is "
"only possible for chipv1.1.");
INTEGER_COMMAND_SET_NOID_GET_ID(
extrastoragecells, getNumberOfAdditionalStorageCells,
@ -2026,11 +2023,10 @@ class CmdProxy {
"Jungfrau] Gain mode.\n\tCAUTION: Do not use fixg0 without caution, "
"you can damage the detector!!!");
INTEGER_COMMAND_VEC_ID(
filtercells, getNumberOfFilterCells, setNumberOfFilterCells,
StringTo<int>,
"[0-12]\n\t[Jungfrau][Moench] Set Filter Cell. Only for "
"chipv1.1. Advanced user Command");
INTEGER_COMMAND_VEC_ID(filtercells, getNumberOfFilterCells,
setNumberOfFilterCells, StringTo<int>,
"[0-12]\n\t[Jungfrau] Set Filter Cell. Only for "
"chipv1.1. Advanced user Command");
/* Gotthard Specific */
TIME_GET_COMMAND(exptimel, getExptimeLeft,

View File

@ -191,8 +191,7 @@ std::vector<defs::detectorSettings> Detector::getSettingsList() const {
defs::VERYHIGHGAIN};
case defs::JUNGFRAU:
case defs::MOENCH:
return std::vector<defs::detectorSettings>{defs::GAIN0,
defs::HIGHGAIN0};
return std::vector<defs::detectorSettings>{};
case defs::GOTTHARD2:
return std::vector<defs::detectorSettings>{
defs::DYNAMICGAIN, defs::FIXGAIN1, defs::FIXGAIN2};
@ -507,9 +506,10 @@ std::vector<defs::speedLevel> Detector::getReadoutSpeedList() const {
switch (getDetectorType().squash()) {
case defs::EIGER:
case defs::JUNGFRAU:
case defs::MOENCH:
return std::vector<defs::speedLevel>{defs::FULL_SPEED, defs::HALF_SPEED,
defs::QUARTER_SPEED};
case defs::MOENCH:
return std::vector<defs::speedLevel>{defs::FULL_SPEED};
case defs::GOTTHARD2:
return std::vector<defs::speedLevel>{defs::G2_108MHZ, defs::G2_144MHZ};
default:
@ -1704,7 +1704,6 @@ void Detector::setStorageCellDelay(ns value, Positions pos) {
std::vector<defs::gainMode> Detector::getGainModeList() const {
switch (getDetectorType().squash()) {
case defs::JUNGFRAU:
case defs::MOENCH:
return std::vector<defs::gainMode>{
defs::DYNAMIC, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2,
defs::FIX_G1, defs::FIX_G2, defs::FIX_G0};

View File

@ -226,7 +226,7 @@ TEST_CASE("autocompdisable", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
if (det_type == defs::JUNGFRAU) {
auto prev_val = det.getAutoComparatorDisable();
{
std::ostringstream oss;
@ -256,7 +256,7 @@ TEST_CASE("compdisabletime", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
if (det_type == defs::JUNGFRAU &&
det.getChipVersion().squash() * 10 == 11) {
auto prev_val = det.getComparatorDisableTime();
{
@ -416,7 +416,7 @@ TEST_CASE("gainmode", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
if (det_type == defs::JUNGFRAU) {
auto prev_val = det.getGainMode();
{
std::ostringstream oss;
@ -465,7 +465,7 @@ TEST_CASE("filtercells", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH) {
if (det_type == defs::JUNGFRAU) {
// chip version 1.1
if (det.getChipVersion().squash() * 10 == 11) {
auto prev_val = det.getNumberOfFilterCells();

View File

@ -212,10 +212,11 @@ TEST_CASE("settings", "[.cmd]") {
std::vector<std::string> sett;
switch (det_type) {
case defs::JUNGFRAU:
case defs::MOENCH:
sett.push_back("gain0");
sett.push_back("highgain0");
break;
case defs::MOENCH:
break;
case defs::GOTTHARD:
sett.push_back("highgain");
sett.push_back("dynamicgain");
@ -1195,8 +1196,7 @@ TEST_CASE("dbitphase", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD) {
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD) {
auto prev_val = det.getDBITPhase();
{
std::ostringstream oss1, oss2;
@ -1225,8 +1225,7 @@ TEST_CASE("maxdbitphaseshift", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::MOENCH ||
det_type == defs::CHIPTESTBOARD ||
if (det_type == defs::JUNGFRAU || det_type == defs::CHIPTESTBOARD ||
det_type == defs::MYTHEN3 || // only because clk index of 0 exists
det_type == defs::GOTTHARD2) { // only because clk index of 0 exists
REQUIRE_NOTHROW(proxy.Call("maxdbitphaseshift", {}, -1, GET));
@ -1572,7 +1571,7 @@ TEST_CASE("parallel", "[.cmd]") {
auto det_type = det.getDetectorType().squash();
if (det_type == defs::EIGER || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
det_type == defs::GOTTHARD2 || det_type == defs::MOENCH) {
auto prev_val = det.getParallelMode();
{
std::ostringstream oss;
@ -1604,7 +1603,7 @@ TEST_CASE("filterresistor", "[.cmd]") {
// only for chipv1.1
bool chip11 = false;
if ((det_type == defs::JUNGFRAU || det_type == defs::MOENCH) &&
if (det_type == defs::JUNGFRAU &&
det.getChipVersion().squash() * 10 == 11) {
chip11 = true;
}
@ -1748,8 +1747,7 @@ TEST_CASE("currentsource", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU ||
det_type == defs::MOENCH) {
if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU) {
auto prev_val = det.getCurrentSource();
if (det_type == defs::GOTTHARD2) {
@ -1773,11 +1771,14 @@ TEST_CASE("currentsource", "[.cmd]") {
REQUIRE_THROWS(proxy.Call("currentsource",
{"1", "fix", "42", "normal"}, -1, PUT));
}
// jungfrau/moench
// jungfrau
else {
int chipVersion = det.getChipVersion().tsquash(
int chipVersion = 10;
if (det_type == defs::JUNGFRAU) {
chipVersion = det.getChipVersion().tsquash(
"inconsistent chip versions to test") *
10;
}
if (chipVersion == 10) {
REQUIRE_THROWS(proxy.Call("currentsource", {"1"}, -1, PUT));
REQUIRE_THROWS(