Added a protection in case the raw data signal (channel) has a read out error (neg...
authorsrossegg <srossegg@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Nov 2010 10:04:54 +0000 (10:04 +0000)
committersrossegg <srossegg@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Nov 2010 10:04:54 +0000 (10:04 +0000)
TPC/AliTPCAltroEmulator.cxx

index 7bcadc7..a34b5e4 100644 (file)
@@ -475,13 +475,14 @@ void AliTPCAltroEmulator::BaselineCorrection1(Int_t mode, Int_t ValuePeDestal, I
   // take first and last bins to calculate a mean pedestal value
   Int_t window = 3;
   Int_t meanPeDestal = 0;
-  for(Int_t i = 0; i < window; i++) {
-    meanPeDestal += fChannelShort[i];
-    meanPeDestal += fChannelShort[ftimebins-1-i];
+  if (mode == kDINxMPD && ftimebins>=6) {
+    for(Int_t i = 0; i < window; i++) {
+      meanPeDestal += fChannelShort[i];
+      meanPeDestal += fChannelShort[ftimebins-1-i];
+    }
+    meanPeDestal /= (window*2);
   }
-  meanPeDestal /= (window*2);
-  
-
+    
   if(polarity ==1){
     for(Int_t i = 0; i < ftimebins; i++){
       fChannelShort[i]  = 1023 - fChannelShort[i];