Remove the vtrim min 600 check when setting threshold energy. vth1-3:200 - 2400, others 0-2800 (#452)

This commit is contained in:
Dhanya Thattil 2022-05-12 11:06:14 +02:00 committed by GitHub
parent 466d431081
commit 7d574375b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -407,12 +407,18 @@ void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
// check dacs
out_of_range = false;
for (auto dac : {M_VTRIM, M_VTH1, M_VTH2, M_VTH3}) {
if (myMod.dacs[dac] < 600) {
myMod.dacs[dac] = 600;
for (int i = 0; i != myMod.ndac; ++i) {
int dacMin = 0;
int dacMax = 2800;
if (i == M_VTH1 || i == M_VTH2 || i == M_VTH3) {
dacMin = 200;
dacMax = 2400;
}
if (myMod.dacs[dac] < dacMin) {
myMod.dacs[dac] = dacMin;
out_of_range = true;
} else if (myMod.dacs[dac] > 2400) {
myMod.dacs[dac] = 2400;
} else if (myMod.dacs[dac] > dacMax) {
myMod.dacs[dac] = dacMax;
out_of_range = true;
}
}