M3vtrim min (#454)

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

* compile fix
This commit is contained in:
Dhanya Thattil 2022-05-12 11:41:05 +02:00 committed by GitHub
parent b122c2fbdf
commit 88649a00b6
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 // check dacs
out_of_range = false; out_of_range = false;
for (auto dac : {M_VTRIM, M_VTH1, M_VTH2, M_VTH3}) { for (int i = 0; i != myMod.ndac; ++i) {
if (myMod.dacs[dac] < 600) { int dacMin = 0;
myMod.dacs[dac] = 600; int dacMax = 2800;
if (i == M_VTH1 || i == M_VTH2 || i == M_VTH3) {
dacMin = 200;
dacMax = 2400;
}
if (myMod.dacs[i] < dacMin) {
myMod.dacs[i] = dacMin;
out_of_range = true; out_of_range = true;
} else if (myMod.dacs[dac] > 2400) { } else if (myMod.dacs[i] > dacMax) {
myMod.dacs[dac] = 2400; myMod.dacs[i] = dacMax;
out_of_range = true; out_of_range = true;
} }
} }