]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDarrayADC.cxx
CoreEnergy put in proper datamember, Ecross calculation added
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayADC.cxx
index 7f28103a5878a8bf4075cdd2e0d3b8ac9257f3d6..a55ac220876d94895ea330c2186a07070c56ab9b 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;
@@ -73,7 +75,7 @@ AliTRDarrayADC::AliTRDarrayADC(Int_t nrow, Int_t ncol, Int_t ntime)
 
 //____________________________________________________________________________________
 AliTRDarrayADC::AliTRDarrayADC(const AliTRDarrayADC &b)
-               :TObject()
+               :TObject(b)
               ,fNdet(b.fNdet)
                ,fNrow(b.fNrow)
                ,fNcol(b.fNcol)
@@ -98,11 +100,8 @@ AliTRDarrayADC::~AliTRDarrayADC()
   // AliTRDarrayADC destructor
   //
 
-  if(fADC)
-    {
-      delete [] fADC;
-      fADC=0;
-    }
+  delete [] fADC;
+  fADC=0;
 
 }
 
@@ -121,6 +120,7 @@ AliTRDarrayADC &AliTRDarrayADC::operator=(const AliTRDarrayADC &b)
     {
       delete [] fADC;
     }
+  TObject::operator=(b);
   fNdet=b.fNdet;
   fNrow=b.fNrow;
   fNcol=b.fNcol;
@@ -168,7 +168,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 +194,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 +235,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 +281,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 +296,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;                  
@@ -456,7 +462,7 @@ void AliTRDarrayADC::Expand()
   
       if(verif==0)
         {
-          //AliDebug(1,"Nothing to expand");
+          AliDebug(1,"Nothing to expand");
           return;
         }