]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Logics of high gain adding to digits has changed
authorkharlov <kharlov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 14 Jan 2007 20:20:05 +0000 (20:20 +0000)
committerkharlov <kharlov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 14 Jan 2007 20:20:05 +0000 (20:20 +0000)
PHOS/AliPHOSGetter.cxx

index 571ca23de0938a8906f966028d84a2c7cdf08671..c574b3d23690f9ed51b2ec61d81817b50b891e45 100644 (file)
@@ -840,18 +840,17 @@ Int_t AliPHOSGetter::ReadRaw(AliRawReader *rawReader,Bool_t isOldRCUFormat)
          new((*digits)[iDigit]) AliPHOSDigit(-1,absId,(Float_t)energyLG,time);
        energyLG = 0. ; 
       }
-      // Add high gain digit only if the low gain digit does not exist in the digits array
-      // and it is not saturated
+      // Add high gain digit only if it is not saturated;
+      // replace low gain digit by a high gain one
       else {
-       seen = kFALSE;
+       if (energyHG >= 1023) continue;
        for (iOldDigit=iDigit; iOldDigit=0; iOldDigit--) {
          if (dynamic_cast<AliPHOSDigit*>(digits->At(iOldDigit))->GetId() == absId) {
-           seen = kTRUE;
+           digits->RemoveAt(iOldDigit);
+           new((*digits)[iDigit]) AliPHOSDigit(-1,absId,(Float_t)energyHG,time);
            break;
          }
        }
-       if (!seen && energyHG < 1023)
-         new((*digits)[iDigit]) AliPHOSDigit(-1,absId,(Float_t)energyHG,time);
        energyHG = 0. ; 
       }
       iDigit++;