]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCMonitorAltro.h
fix for mem leak
[u/mrichter/AliRoot.git] / TPC / AliTPCMonitorAltro.h
index 3d32ec13e26e869963f3e12fa461e62325d08ec2..99b6b0d04a2241778571c46096fa83068df2dd9d 100755 (executable)
@@ -17,7 +17,8 @@
 ////       
 /////////////////////////////////////////////////////////////////////////
 
-#include "TNamed.h"
+#include <TString.h>
+#include <TNamed.h>
 
 class AliTPCMonitorAltro : public TNamed {
  public:
@@ -33,12 +34,13 @@ class AliTPCMonitorAltro : public TNamed {
     void         Decodeto10Bit(Int_t equipment = -1); 
 
     Int_t        DecodeTrailer(Int_t pos);
-
+    Int_t        DecodeTrailerVbb(Int_t pos);
+    
     Long64_t*    Get40BitArray();
-    Short_t     *Get10BitArray();
-    Int_t        Get40BitArraySize()
-    Int_t        Get10BitArraySize();  
-    Char_t*      GetActFileName()        const { return ffilename;}
+    Short_t     *Get10BitArray();     
+    Int_t        Get40BitArraySize()     const { return fmemory[fsize-GetRCUTrailerSize()];}   //hier �ndern
+    Int_t        Get10BitArraySize()     const { return fmemory[fsize-GetRCUTrailerSize()]*4;}  //number of 10 bit words from trailer
+    const Char_t* GetActFileName()        const { return ffilename.Data();}
     
     static Int_t GetHwMaskFEC()                { return fgkHwMaskFEC;}
     static Int_t GetHwMaskBranch()             { return fgkHwMaskBranch;}
@@ -56,11 +58,15 @@ class AliTPCMonitorAltro : public TNamed {
     Int_t        GetTrailerBlockPos()    const { return fTrailerBlockPos ;}
     Int_t        GetTrailerPos()         const { return fTrailerPos      ;} 
 
+  Int_t        GetRCUTrailerSize()     const { Int_t ts=(GetAltroVersion()==0xaaaa||GetAltroVersion()==0xaabb)*
+      (fmemory[fsize-1]&0x3F); return (ts>0)?ts:1;}
+  UInt_t        GetAltroVersion()       const { return fmemory[fsize-1]>>16; }
+
     void         SetDataOffset(Int_t val){ foffset     =val ;} 
     void         SetWrite10Bit(Int_t wr) { fwrite10bit =wr  ;}
     
   
-    void         SetActFilename(Char_t* name){ sprintf(ffilename,"%s",name); } 
+    void         SetActFilename(const Char_t* name){ ffilename=name; }
     void         SetVerbose(Int_t val)   { fverb=val;}
      
  private:
@@ -82,9 +88,9 @@ class AliTPCMonitorAltro : public TNamed {
     Int_t                    fTrailerDataPos;                                           // from Trailer: position of first adc value 
     Int_t                    fTrailerBlockPos;                                          // from Trailer: number of 40 bit words for channel
     Int_t                    fTrailerPos;                                               // trailer position
-    
+
     Int_t                    fNextPos;                                                  // position of next trailer
-    Char_t*                  ffilename;                                                 // name of processed file
+    TString                  ffilename;                                                 // name of processed file
     
     static const Int_t       fgk24BitOn                = 16777215;                        // bit masks for first 24 bits of 32  for decoding 32 bit words
     static const Int_t       fgk16BitOn                = 65535;                           // bit masks for first 24 bits of 24
@@ -97,7 +103,8 @@ class AliTPCMonitorAltro : public TNamed {
     static const Long64_t    fgkmask40                 = (Long64_t)0x000000FFC0000000ULL; // mask fourth  10 bit out of 4o0 bit word 
     
     static const Long64_t    fgkTrailerTail            = (Long64_t)0x0000000000002AAAULL; // Tail of the Trailer set to 2AAA 
-    static const Long64_t    fgkTrailerMaskTail        = (Long64_t)0x000000fffC000000ULL; // mask for trailer 
+    static const Long64_t    fgkTrailerTailErr         = (Long64_t)0x0000000000002AEEULL; // Tail of the Trailer set to 2AEE if an error occured
+    static const Long64_t    fgkTrailerMaskTail        = (Long64_t)0x000000fffC000000ULL; // mask for trailer
     static const Long64_t    fgkTrailerMaskHardw       = (Long64_t)0x0000000000000FFFULL; // mask for hardware address
     static const Long64_t    fgkTrailerMaskNWords      = (Long64_t)0x0000000003FF0000ULL; // mask for nwords  (number of 40 bit data words)