mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
reg for m3 is reserved only for gaincaps and not settings. Fixed in set threshold and setall threshold
This commit is contained in:
@ -214,9 +214,21 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
|||||||
myMod.iodelay = myMod1.iodelay;
|
myMod.iodelay = myMod1.iodelay;
|
||||||
myMod.tau =
|
myMod.tau =
|
||||||
linearInterpolation(e_eV, trim1, trim2, myMod1.tau, myMod2.tau);
|
linearInterpolation(e_eV, trim1, trim2, myMod1.tau, myMod2.tau);
|
||||||
|
// m3, reg is used for gaincaps
|
||||||
|
if (shm->detType == Mythen3) {
|
||||||
|
if (myMod1.reg != myMod2.reg) {
|
||||||
|
throw RuntimeError(
|
||||||
|
"setThresholdEnergyAndSettings: gaincaps do not "
|
||||||
|
"match between files");
|
||||||
|
}
|
||||||
|
myMod.reg = myMod1.reg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// m3, reg is used for gaincaps
|
||||||
|
if (shm->detType != Mythen3) {
|
||||||
|
myMod.reg = isettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
myMod.reg = isettings;
|
|
||||||
myMod.eV[0] = e_eV;
|
myMod.eV[0] = e_eV;
|
||||||
setModule(myMod, trimbits);
|
setModule(myMod, trimbits);
|
||||||
if (getSettings() != isettings) {
|
if (getSettings() != isettings) {
|
||||||
@ -231,6 +243,7 @@ void Module::setThresholdEnergy(int e_eV, detectorSettings isettings,
|
|||||||
|
|
||||||
void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
||||||
detectorSettings isettings, bool trimbits) {
|
detectorSettings isettings, bool trimbits) {
|
||||||
|
// only mythen3
|
||||||
if (shm()->trimEnergies.empty()) {
|
if (shm()->trimEnergies.empty()) {
|
||||||
throw RuntimeError(
|
throw RuntimeError(
|
||||||
"Trim energies have not been defined for this module yet!");
|
"Trim energies have not been defined for this module yet!");
|
||||||
@ -311,6 +324,13 @@ void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
|||||||
|
|
||||||
myMods[i] = interpolateTrim(&myMod1, &myMod2, energy[i], trim1,
|
myMods[i] = interpolateTrim(&myMod1, &myMod2, energy[i], trim1,
|
||||||
trim2, trimbits);
|
trim2, trimbits);
|
||||||
|
// gaincaps
|
||||||
|
if (myMod1.reg != myMod2.reg) {
|
||||||
|
throw RuntimeError("setAllThresholdEnergy: gaincaps do not "
|
||||||
|
"match between files for energy (eV) " +
|
||||||
|
to_string(energy[i]));
|
||||||
|
}
|
||||||
|
myMods[i].reg = myMod1.reg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,6 +377,11 @@ void Module::setAllThresholdEnergy(std::array<int, 3> e_eV,
|
|||||||
for (int i = 0; i < myMod.nchan; ++i) {
|
for (int i = 0; i < myMod.nchan; ++i) {
|
||||||
myMod.chanregs[i] = myMods[i % 3].chanregs[i];
|
myMod.chanregs[i] = myMods[i % 3].chanregs[i];
|
||||||
}
|
}
|
||||||
|
// gain caps
|
||||||
|
if (myMods[0].reg != myMods[1].reg || myMods[1].reg != myMods[2].reg) {
|
||||||
|
throw RuntimeError("setAllThresholdEnergy: gaincaps do not "
|
||||||
|
"match between files for all energies");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myMod.reg = isettings;
|
myMod.reg = isettings;
|
||||||
@ -3330,9 +3355,9 @@ sls_detector_module Module::interpolateTrim(sls_detector_module *a,
|
|||||||
dacs_to_copy.end(),
|
dacs_to_copy.end(),
|
||||||
{E_SVP, E_SVN, E_VTGSTV, E_RXB_RB, E_RXB_LB, E_VCN, E_VIS});
|
{E_SVP, E_SVN, E_VTGSTV, E_RXB_RB, E_RXB_LB, E_VCN, E_VIS});
|
||||||
// interpolate vrf, vcmp, vcp
|
// interpolate vrf, vcmp, vcp
|
||||||
dacs_to_interpolate.insert(
|
dacs_to_interpolate.insert(dacs_to_interpolate.end(),
|
||||||
dacs_to_interpolate.end(),
|
{E_VTR, E_VRF, E_VCMP_LL, E_VCMP_LR,
|
||||||
{E_VTR, E_VRF, E_VCMP_LL, E_VCMP_LR, E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS});
|
E_VCMP_RL, E_VCMP_RR, E_VCP, E_VRS});
|
||||||
} else {
|
} else {
|
||||||
dacs_to_copy.insert(dacs_to_copy.end(),
|
dacs_to_copy.insert(dacs_to_copy.end(),
|
||||||
{M_VCASSH, M_VRSHAPER, M_VRSHAPER_N, M_VIPRE_OUT,
|
{M_VCASSH, M_VRSHAPER, M_VRSHAPER_N, M_VIPRE_OUT,
|
||||||
|
Reference in New Issue
Block a user