mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
something
This commit is contained in:
@ -2452,7 +2452,7 @@ int multiSlsDetector::setRateCorrection(double t){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getDetectorsType() != MYTHEN){
|
if (getDetectorsType() != MYTHEN){
|
||||||
if (ret1<=0)
|
if (ret1==0)
|
||||||
thisMultiDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
thisMultiDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
||||||
else
|
else
|
||||||
thisMultiDetector->correctionMask|=(1<<RATE_CORRECTION);
|
thisMultiDetector->correctionMask|=(1<<RATE_CORRECTION);
|
||||||
@ -2464,14 +2464,15 @@ int multiSlsDetector::setRateCorrection(double t){
|
|||||||
|
|
||||||
int multiSlsDetector::getRateCorrection(double &t){
|
int multiSlsDetector::getRateCorrection(double &t){
|
||||||
|
|
||||||
|
if (getDetectorsType() != MYTHEN){
|
||||||
|
t = getRateCorrectionTau();
|
||||||
|
return getRateCorrection();
|
||||||
|
}
|
||||||
|
|
||||||
if (thisMultiDetector->correctionMask&(1<<RATE_CORRECTION)) {
|
if (thisMultiDetector->correctionMask&(1<<RATE_CORRECTION)) {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Rate correction is enabled with dead time "<< thisMultiDetector->tDead << std::endl;
|
std::cout<< "Rate correction is enabled with dead time "<< thisMultiDetector->tDead << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (getDetectorsType() != MYTHEN)
|
|
||||||
t = getRateCorrectionTau();
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else
|
} else
|
||||||
t=0;
|
t=0;
|
||||||
@ -2484,20 +2485,36 @@ int multiSlsDetector::getRateCorrection(double &t){
|
|||||||
double multiSlsDetector::getRateCorrectionTau(){
|
double multiSlsDetector::getRateCorrectionTau(){
|
||||||
|
|
||||||
double ret1=-100,ret;
|
double ret1=-100,ret;
|
||||||
if (thisMultiDetector->correctionMask&(1<<RATE_CORRECTION)) {
|
|
||||||
#ifdef VERBOSE
|
|
||||||
std::cout<< "Rate correction is enabled with dead time "<< thisMultiDetector->tDead << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||||
if (detectors[idet]) {
|
if (detectors[idet]) {
|
||||||
ret=detectors[idet]->getRateCorrectionTau();
|
ret=detectors[idet]->getRateCorrectionTau();
|
||||||
if (ret1==-100)
|
if (ret1==-100)
|
||||||
ret1=ret;
|
ret1=ret;
|
||||||
else if (ret!=ret1)
|
else if (ret!=ret1){
|
||||||
ret1=-1;
|
std::cout<< "Rate correction is different for different readouts " << std::endl;
|
||||||
|
if(getDetectorsType() == EIGER)
|
||||||
|
ret1=-2;
|
||||||
|
else
|
||||||
|
ret1=-1; //same settings also return -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getDetectorsType() != MYTHEN){
|
||||||
|
cout<<"ret1:"<<ret1<<endl;
|
||||||
|
//if set by the slsDetector
|
||||||
|
if(ret1 == 0)
|
||||||
|
thisMultiDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
||||||
|
else
|
||||||
|
thisMultiDetector->correctionMask|=(1<<RATE_CORRECTION);
|
||||||
|
return ret1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//only mythen
|
||||||
|
if (thisMultiDetector->correctionMask&(1<<RATE_CORRECTION)) {
|
||||||
|
#ifdef VERBOSE
|
||||||
|
std::cout<< "Rate correction is enabled with dead time "<< thisMultiDetector->tDead << std::endl;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< "Rate correction is disabled " << std::endl;
|
std::cout<< "Rate correction is disabled " << std::endl;
|
||||||
|
@ -5017,12 +5017,18 @@ int slsDetector::setRateCorrection(double t){
|
|||||||
thisDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
thisDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
||||||
thisDetector->tDead = 0;
|
thisDetector->tDead = 0;
|
||||||
}else{
|
}else{
|
||||||
if(retval>0)
|
if(retval>0){
|
||||||
thisDetector->correctionMask|=(1<<RATE_CORRECTION);
|
thisDetector->correctionMask|=(1<<RATE_CORRECTION);
|
||||||
|
if(t < 0)
|
||||||
|
thisDetector->tDead = -1;
|
||||||
else
|
else
|
||||||
|
thisDetector->tDead = (double)retval/(double)1e9;
|
||||||
|
}
|
||||||
|
else{
|
||||||
thisDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
thisDetector->correctionMask&=~(1<<RATE_CORRECTION);
|
||||||
thisDetector->tDead = (double)retval/(double)1e9;
|
thisDetector->tDead = (double)retval/(double)1e9;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
|
Reference in New Issue
Block a user