M3settings (#228)

* added temp m3 settings files

* renames settings noise to trim

* get threshold for M3

* some changes to compile on RH7 and in the server to load the default chip status register at startup

* Updated mythen3DeectorServer_developer executable with correct initialization at startup

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Anna Bergamaschi <anna.bergamaschi@psi.ch>
This commit is contained in:
Dhanya Thattil
2021-01-14 12:34:13 +01:00
committed by GitHub
parent a62e068a9a
commit f9f50f1d84
89 changed files with 1715 additions and 8446 deletions

View File

@ -100,6 +100,12 @@ template <typename T, size_t Capacity> class StaticVector {
constexpr const T &front() const noexcept { return data_.front(); }
constexpr const T &back() const noexcept { return data_[current_size - 1]; }
bool anyEqualTo(const T value) {
return std::any_of(
data_.cbegin(), data_.cend(),
[value](const T &element) { return element == value; });
}
// iterators
iterator begin() noexcept { return data_.begin(); }
// auto begin() noexcept -> decltype(data_.begin()) { return data_.begin();

View File

@ -454,7 +454,7 @@ typedef struct {
int activate{0};
int quad{0};
int numLinesReadout{0};
int thresholdEnergyeV{0};
int thresholdEnergyeV[3]{0, 0, 0};
int dynamicRange{16};
timingMode timMode{AUTO_TIMING};
int tenGiga{0};
@ -571,14 +571,14 @@ typedef struct {
int reg; /**< is the module register settings (gain level) */
int iodelay; /**< iodelay */
int tau; /**< tau */
int eV; /**< threshold energy */
int eV[3]; /**< threshold energy */
int *dacs; /**< is the pointer to the array of the dac values (in V) */
int *chanregs; /**< is the pointer to the array of the channel registers */
#ifdef __cplusplus
sls_detector_module()
: serialnumber(0), nchan(0), nchip(0), ndac(0), reg(-1), iodelay(0),
tau(0), eV(-1), dacs(nullptr), chanregs(nullptr) {}
tau(0), eV{-1, -1, -1}, dacs(nullptr), chanregs(nullptr) {}
explicit sls_detector_module(slsDetectorDefs::detectorType type)
: sls_detector_module() {
@ -607,7 +607,7 @@ typedef struct {
reg = other.reg;
iodelay = other.iodelay;
tau = other.tau;
eV = other.eV;
std::copy(other.eV, other.eV + 3, eV);
dacs = new int[ndac];
std::copy(other.dacs, other.dacs + ndac, dacs);
chanregs = new int[nchan];

View File

@ -219,6 +219,7 @@ enum detFuncs {
F_IS_VIRTUAL,
F_GET_PATTERN,
F_LOAD_DEFAULT_PATTERN,
F_GET_ALL_THRESHOLD_ENERGY,
NUM_DET_FUNCTIONS,
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
@ -322,6 +323,7 @@ enum detFuncs {
F_RECEIVER_SET_THRESHOLD,
F_GET_RECEIVER_STREAMING_HWM,
F_SET_RECEIVER_STREAMING_HWM,
F_RECEIVER_SET_ALL_THRESHOLD,
NUM_REC_FUNCTIONS
};
@ -543,7 +545,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_IS_VIRTUAL: return "F_IS_VIRTUAL";
case F_GET_PATTERN: return "F_GET_PATTERN";
case F_LOAD_DEFAULT_PATTERN: return "F_LOAD_DEFAULT_PATTERN";
case F_GET_ALL_THRESHOLD_ENERGY: return "F_GET_ALL_THRESHOLD_ENERGY";
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
@ -645,6 +648,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_RECEIVER_SET_THRESHOLD: return "F_RECEIVER_SET_THRESHOLD";
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_RECEIVER_SET_ALL_THRESHOLD: return "F_RECEIVER_SET_ALL_THRESHOLD";
case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS";

View File

@ -3,10 +3,10 @@
#define APILIB 0x201119
#define APIRECEIVER 0x201119
#define APIGUI 0x201119
#define APICTB 0x201130
#define APIGOTTHARD 0x201130
#define APIJUNGFRAU 0x201130
#define APIEIGER 0x201130
#define APIGOTTHARD2 0x201208
#define APIMOENCH 0x201207
#define APIMYTHEN3 0x201209
#define APICTB 0x201214
#define APIGOTTHARD 0x201214
#define APIGOTTHARD2 0x201214
#define APIJUNGFRAU 0x201214
#define APIMOENCH 0x201214
#define APIEIGER 0x201214
#define APIMYTHEN3 0x201214