]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCcalibDB.cxx
"attached you can find a fix in AliTPCcalibDB which I sent around a few days ago...
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibDB.cxx
index 2091e1c9098ca18eeced2dc4584c422fc40c2798..9b496613d40ce67227f15a3a82b6c026a8d8eaa3 100644 (file)
@@ -1462,15 +1462,17 @@ Float_t AliTPCcalibDB::GetDCSSensorValue(AliDCSSensorArray *arr, Int_t timeStamp
     if (val==0 ){
       Double_t x,y;
       gr->GetPoint(0,x,y);
-      Int_t time=TMath::Nint(sensor->GetStartTime()+x*3600); //time in graph is hours
-      if ((time-timeStamp)<5*60) val=y;
+      const Int_t time=TMath::Nint(sensor->GetStartTime()+x*3600); //time in graph is hours
+      const Int_t dtime=time-timeStamp;
+      if ( (dtime>0) && (dtime<5*60) ) val=y;
     }
     //last point
     if (val==0 ){
       Double_t x,y;
       gr->GetPoint(gr->GetN()-1,x,y);
-      Int_t time=TMath::Nint(sensor->GetStartTime()+x*3600); //time in graph is hours
-      if ((timeStamp-time)<5*60) val=y;
+      const Int_t time=TMath::Nint(sensor->GetStartTime()+x*3600); //time in graph is hours
+      const Int_t dtime=timeStamp-time;
+      if ( (dtime>0) && (dtime<5*60) ) val=y;
     }
   } else {
     val=sensor->GetValue(timeStamp);