"attached you can find a fix in AliTPCcalibDB which I sent around a few days ago...
authormivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Nov 2012 13:22:21 +0000 (13:22 +0000)
committermivanov <mivanov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Nov 2012 13:22:21 +0000 (13:22 +0000)
Currently AliTPCcalibDB::GetDCSSensorValue returns wrong values in case the timestamp is outside the time range of the sensor.

The patch should fix it."

(Jens)

TPC/AliTPCcalibDB.cxx

index 2091e1c..9b49661 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);