]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDarrayADC.cxx
jet embedding with the lego train
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayADC.cxx
index 4116907d3bd6aaf578c94342f3e68b2147ea7801..0a8b3e4a9d474124e7151e58c66e7a77fe19bc9a 100644 (file)
@@ -28,6 +28,8 @@
 #include "Cal/AliTRDCalPadStatus.h"
 #include "AliTRDfeeParam.h"
 #include "AliTRDSignalIndex.h"
+#include "AliLog.h"
+
 ClassImp(AliTRDarrayADC)
 
 Short_t *AliTRDarrayADC::fgLutPadNumbering = 0x0;
@@ -98,11 +100,8 @@ AliTRDarrayADC::~AliTRDarrayADC()
   // AliTRDarrayADC destructor
   //
 
-  if(fADC)
-    {
-      delete [] fADC;
-      fADC=0;
-    }
+  delete [] fADC;
+  fADC=0;
 
 }
 
@@ -168,7 +167,7 @@ Short_t AliTRDarrayADC::GetDataBits(Int_t row, Int_t col, Int_t time) const
   // Get the ADC value for a given position: row, col, time
   // Taking bit masking into account
   //
-  // Adapted from code of the class AliTRDdataArrayDigits 
+  // Adapted from code of the class AliTRDclusterizer 
   //
 
   Short_t tempval = GetData(row,col,time);
@@ -194,7 +193,7 @@ UChar_t AliTRDarrayADC::GetPadStatus(Int_t row, Int_t col, Int_t time) const
   //               Bridged Right Masking    8
   //               Not Connected Masking Digits
   //
-  // Adapted from code of the class AliTRDdataArrayDigits
+  // Adapted from code of the class AliTRDclusterizer
   //
 
   UChar_t padstatus = 0;
@@ -235,7 +234,7 @@ void AliTRDarrayADC::SetPadStatus(Int_t row, Int_t col, Int_t time, UChar_t stat
   //               Bridged Left masking:    Bit 11(0), Bit 12(1)
   //               Bridged Right masking:   Bit 11(1), Bit 12(1)
   // 
-  // Adapted from code of the class AliTRDdataArrayDigits
+  // Adapted from code of the class AliTRDclusterizer
   //
 
   Short_t signal = GetData(row,col,time);
@@ -281,7 +280,7 @@ Bool_t AliTRDarrayADC::IsPadCorrupted(Int_t row, Int_t col, Int_t time)
   // 
   // Checks if the pad has any masking as corrupted (Bit 10 in signal set)
   // 
-  // Adapted from code of the class AliTRDdataArrayDigits
+  // Adapted from code of the class AliTRDclusterizer
   //
 
   Short_t signal = GetData(row,col,time);
@@ -296,6 +295,12 @@ void AliTRDarrayADC::Compress()
   // Compress the array
   //
 
+  if(fNAdim!=fNrow*fNumberOfChannels*fNtime)
+    {
+      AliDebug(1,"The ADC array is already compressed");
+      return;
+    }
+
   Int_t counter=0;
   Int_t newDim=0;
   Int_t j;                  
@@ -418,8 +423,15 @@ void AliTRDarrayADC::Compress()
           buffer=0;
         } 
 
+    }
+
+  if (longz)
+    {
       delete [] longz;
       longz=0;
+    }
+  if (longm)
+    {
       delete [] longm;
       longm=0;
 
@@ -449,7 +461,7 @@ void AliTRDarrayADC::Expand()
   
       if(verif==0)
         {
-          //AliDebug(1,"Nothing to expand");
+          AliDebug(1,"Nothing to expand");
           return;
         }