fixed threshold returning 1 if a trimbit file missing for eiger, it now returns -1, as both values are different

This commit is contained in:
maliakal_d 2018-02-23 14:49:18 +01:00
parent bacc4073f7
commit c3d6852f97
2 changed files with 7 additions and 4 deletions

View File

@ -1180,7 +1180,7 @@ int multiSlsDetector::getThresholdEnergy(int pos) {
if (ret1==-100)
ret1=ret;
else if (ret<(ret1-200) || ret>(ret1+200))
ret1=FAIL;
ret1=-1;
}
@ -1225,7 +1225,7 @@ int multiSlsDetector::setThresholdEnergy(int e_eV, int pos, detectorSettings ise
if(iret[idet] != NULL){
if (ret==-100)
ret=*iret[idet];
else if (ret<(*iret[idet]-200) || ret>(*iret[idet]+200))
else if (*iret[idet]<(ret-200) || *iret[idet]>(ret+200))
ret=-1;
delete iret[idet];
}else ret=-1;

View File

@ -3149,7 +3149,7 @@ int slsDetector::setModule(int reg, int imod){
int slsDetector::setModule(sls_detector_module module, int iodelay, int tau, int e_eV, int* gainval, int* offsetval, int tb){
int fnum=F_SET_MODULE;
int retval;
int retval=-1;
int ret=FAIL;
char mess[MAX_STR_LENGTH]="";
@ -3255,6 +3255,9 @@ int slsDetector::setModule(sls_detector_module module, int iodelay, int tau, int
offset[i+imod*thisDetector->nOffset]=offsetval[i];
}
if (e_eV != -1)
thisDetector->currentThresholdEV = e_eV;
}
#ifdef VERBOSE
@ -3459,7 +3462,7 @@ int slsDetector::setThresholdEnergy(int e_eV, int imod, detectorSettings isetti
//currently only for eiger
if (thisDetector->myDetectorType == EIGER) {
setThresholdEnergyAndSettings(e_eV,isettings,tb);
return thisDetector->currentThresholdEV;
return thisDetector->currentThresholdEV;
}
int fnum= F_SET_THRESHOLD_ENERGY;