new format for raw data
authorbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Aug 2006 09:58:38 +0000 (09:58 +0000)
committerbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Aug 2006 09:58:38 +0000 (09:58 +0000)
PMD/AliPMDBlockHeader.cxx
PMD/AliPMDBlockHeader.h
PMD/AliPMDDDLRawData.cxx
PMD/AliPMDDspHeader.cxx
PMD/AliPMDDspHeader.h
PMD/AliPMDPatchBusHeader.cxx
PMD/AliPMDPatchBusHeader.h
PMD/AliPMDRawStream.cxx

index bae4812..50f029a 100644 (file)
@@ -26,14 +26,14 @@ const Int_t  AliPMDBlockHeader::fgkHeaderLength = 8;
 //------------------------------------------------------------
 AliPMDBlockHeader::AliPMDBlockHeader()
   :  TObject(),
+     fDataKey(0),
      fTotalLength(0),
      fRawDataLength(0),
      fDspId(0),
-     fTrWord1(0),
-     fTrWord2(0),
-     fTrWord3(0),
-     fTrWord4(0),
-     fPadWord(0)
+     fL0Trigger(0),
+     fMiniEventId(0),
+     fEventId1(0),
+     fEventId2(0)
 {
   //
   // ctor
@@ -52,19 +52,18 @@ AliPMDBlockHeader::~AliPMDBlockHeader()
 //___________________________________________
 AliPMDBlockHeader::AliPMDBlockHeader(const AliPMDBlockHeader & blockh):
   TObject(),
+  fDataKey(blockh.fDataKey),
   fTotalLength(blockh.fTotalLength),
   fRawDataLength(blockh.fRawDataLength),
   fDspId(blockh.fDspId),
-  fTrWord1(blockh.fTrWord1),
-  fTrWord2(blockh.fTrWord2),
-  fTrWord3(blockh.fTrWord3),
-  fTrWord4(blockh.fTrWord4),
-  fPadWord(blockh.fPadWord)
+  fL0Trigger(blockh.fL0Trigger),
+  fMiniEventId(blockh.fMiniEventId),
+  fEventId1(blockh.fEventId1),
+  fEventId2(blockh.fEventId2)
 {
   //
   // copy ctor
   //
-
 }
 
 //___________________________________________
@@ -76,27 +75,26 @@ AliPMDBlockHeader::operator=(const AliPMDBlockHeader &blockh)
   //
   if (this != &blockh)
     {
+      fDataKey       = blockh.fDataKey;
       fTotalLength   = blockh.fTotalLength;
       fRawDataLength = blockh.fRawDataLength;
       fDspId         = blockh.fDspId;
-      fTrWord1       = blockh.fTrWord1;
-      fTrWord2       = blockh.fTrWord2;
-      fTrWord3       = blockh.fTrWord3;
-      fTrWord4       = blockh.fTrWord4;
-      fPadWord       = blockh.fPadWord;
+      fL0Trigger     = blockh.fL0Trigger;
+      fMiniEventId   = blockh.fMiniEventId;
+      fEventId1      = blockh.fEventId1;
+      fEventId2      = blockh.fEventId2;
     }
   return *this;
 }
 void AliPMDBlockHeader::SetHeader(Int_t *header)
 {
-  fTotalLength   = header[0];
-  fRawDataLength = header[1];
-  fDspId         = header[2];
-  fTrWord1       = header[3];
-  fTrWord2       = header[4];
-  fTrWord3       = header[5];
-  fTrWord4       = header[6];
-  fPadWord       = header[7];
-
+  fDataKey       = header[0];
+  fTotalLength   = header[1];
+  fRawDataLength = header[2];
+  fDspId         = header[3];
+  fL0Trigger     = header[4];
+  fMiniEventId   = header[5];
+  fEventId1      = header[6];
+  fEventId2      = header[7];
 }
       
index 1b77525..be28c3f 100644 (file)
@@ -17,40 +17,42 @@ public:
 
    // Block header
 
+   void  SetDataKey(Int_t dkey)            {fDataKey = dkey;}
    void  SetTotalLength(Int_t totlength)   {fTotalLength = totlength;}
    void  SetRawDataLength(Int_t rawlength) {fRawDataLength = rawlength;}
    void  SetDspId(Int_t dspid)             {fDspId = dspid;}
-   void  SetTriggerWord1(Int_t trword1)    {fTrWord1 = trword1;}
-   void  SetTriggerWord2(Int_t trword2)    {fTrWord2 = trword2;}
-   void  SetTriggerWord3(Int_t trword3)    {fTrWord3 = trword3;}
-   void  SetTriggerWord4(Int_t trword4)    {fTrWord4 = trword4;}
-   void  SetPaddingWord(Int_t padword)     {fPadWord = padword;}
+   void  SetL0Trigger(Int_t trword1)       {fL0Trigger = trword1;}
+   void  SetMiniEventId(Int_t trword2)     {fMiniEventId = trword2;}
+   void  SetEventId1(Int_t trword3)        {fEventId1 = trword3;}
+   void  SetEventId2(Int_t trword4)        {fEventId2 = trword4;}
+
    void  SetHeader(Int_t *header);
 
 
    Int_t GetHeaderLength()  const {return fgkHeaderLength;}
+   Int_t GetDataKey()       const {return fDataKey;}
    Int_t GetTotalLength()   const {return fTotalLength;}
    Int_t GetRawDataLength() const {return fRawDataLength;}
    Int_t GetDspId()         const {return fDspId;}
-   Int_t GetTriggerWord1()  const {return fTrWord1;}  
-   Int_t GetTriggerWord2()  const {return fTrWord2;}  
-   Int_t GetTriggerWord3()  const {return fTrWord3;}  
-   Int_t GetTriggerWord4()  const {return fTrWord4;}  
-   Int_t GetPaddingWord()   const {return fPadWord;}  
+   Int_t GetL0Trigger()     const {return fL0Trigger;}  
+   Int_t GetMiniEventId()   const {return fMiniEventId;}  
+   Int_t GetEventId1()      const {return fEventId1;}  
+   Int_t GetEventId2()      const {return fEventId2;}  
+
 
  private:
 
+   Int_t     fDataKey;        // Data key word for CRT header
    Int_t     fTotalLength;    // total length of block structure
    Int_t     fRawDataLength;  // length of raw data
    Int_t     fDspId;          // Dsp id
-   Int_t     fTrWord1;        // 1st trigger word
-   Int_t     fTrWord2;        // 1st trigger word
-   Int_t     fTrWord3;        // 1st trigger word
-   Int_t     fTrWord4;        // 1st trigger word
-   Int_t     fPadWord;        // Padding word
+   Int_t     fL0Trigger;      // L0 trigger word
+   Int_t     fMiniEventId;    // Bunch crossing for mini-event id
+   Int_t     fEventId1;       // Event Id in bunch crossing
+   Int_t     fEventId2;       // Event Id in orbit number
 
    static const Int_t fgkHeaderLength;   // header length in word
 
-   ClassDef(AliPMDBlockHeader,0)  // PMD Block Header
+   ClassDef(AliPMDBlockHeader,1)  // PMD Block Header
 };
 #endif
index 2ff1de9..378f7e1 100644 (file)
@@ -25,6 +25,9 @@
 #include "AliRawDataHeader.h"
 #include "AliBitPacking.h"
 #include "AliPMDdigit.h"
+#include "AliPMDBlockHeader.h"
+#include "AliPMDDspHeader.h"
+#include "AliPMDPatchBusHeader.h"
 #include "AliPMDRawStream.h"
 #include "AliPMDDDLRawData.h"
 #include "AliDAQ.h"
@@ -55,7 +58,6 @@ AliPMDDDLRawData & AliPMDDDLRawData::operator=(const AliPMDDDLRawData& ddlraw)
     }
   return *this;
 }
-
 //____________________________________________________________________________
 
 AliPMDDDLRawData::~AliPMDDDLRawData()
@@ -175,9 +177,9 @@ void AliPMDDDLRawData::WritePMDRawData(TTree *treeD)
          dsp[i] += 4*dspBus[i];
        }
 
-      Int_t dspBlockARDL = 0;
-      Int_t dspBlockBRDL = 0;
-      
+      Int_t dspBlockARDL    = 0;
+      Int_t dspBlockBRDL    = 0;
+
       for (Int_t i = 0; i < 5; i++)
        {
          Int_t ieven = 2*i;
@@ -185,43 +187,60 @@ void AliPMDDDLRawData::WritePMDRawData(TTree *treeD)
          if (dsp[ieven] > 0)
            {
              dspBlockARDL += dsp[ieven];
-             dspBlockARDL += 8;
+             Int_t remainder = dsp[ieven]%2;
+             if (remainder == 1)
+               {
+                 dspBlockARDL++;
+               }
            }
          if (dsp[iodd] > 0)
            {
              dspBlockBRDL += dsp[iodd];
-             dspBlockBRDL += 8;
+             Int_t remainder = dsp[ieven]%2;
+             if (remainder == 1)
+               {
+                 dspBlockARDL++;
+               }
            }
        }
       
       // Start writing the DDL file
+
+      AliPMDBlockHeader blHeader;
+      AliPMDDspHeader   dspHeader;
+      AliPMDPatchBusHeader pbusHeader;
+
+      const Int_t kblHLen   = blHeader.GetHeaderLength();
+      const Int_t kdspHLen  = dspHeader.GetHeaderLength();
+      const Int_t kpbusHLen = pbusHeader.GetHeaderLength();
+
       UInt_t dspRDL = 0;
-      UInt_t dspBlockHeader[8];
-      UInt_t dspHeader[8];
-      UInt_t patchBusHeader[4];
+      UInt_t dspBlockHeaderWord[8];
+      UInt_t dspHeaderWord[10];
+      UInt_t patchBusHeaderWord[4];
       Int_t iskip[5];
 
+
       for (Int_t iblock = 0; iblock < 2; iblock++)
        {
          // DSP Block Header
          
-         for (Int_t i=0; i<8; i++)
+         for (Int_t i=0; i<kblHLen; i++)
            {
-             dspBlockHeader[i] = 0;
-             if (i == 1)
-               {
-                 if (iblock == 0)
-                   {
-                     dspBlockHeader[1] = (UInt_t) dspBlockARDL;
-                   }
-                 else if (iblock == 1)
-                   {
-                     dspBlockHeader[1] = (UInt_t) dspBlockBRDL;
-                   }
-               }
+             dspBlockHeaderWord[i] = 0;
+           }
+         if (iblock == 0)
+           {
+             dspBlockHeaderWord[1] = (UInt_t) (dspBlockARDL + kblHLen);
+             dspBlockHeaderWord[2] = (UInt_t) dspBlockARDL;
+           }
+         else if (iblock == 1)
+           {
+             dspBlockHeaderWord[1] = (UInt_t) (dspBlockBRDL + kblHLen);
+             dspBlockHeaderWord[2] = (UInt_t) dspBlockBRDL;
            }
 
-         outfile.write((char*)(&dspBlockHeader),8*sizeof(UInt_t));
+         outfile.write((char*)dspBlockHeaderWord,kblHLen*sizeof(UInt_t));
 
          if (iblock == 0)
            {
@@ -255,28 +274,43 @@ void AliPMDDDLRawData::WritePMDRawData(TTree *treeD)
                  dspRDL = (UInt_t) dsp[dspno];
                }
 
-             for (Int_t i=0; i<8; i++)
+             for (Int_t i=0; i<kdspHLen; i++)
                {
-                 dspHeader[i] = 0;
+                 dspHeaderWord[i] = 0;
                }
-             dspHeader[1] = dspRDL;
-             dspHeader[6] = dspno;
-             outfile.write((char*)(&dspHeader),8*sizeof(UInt_t));
-             
+             Int_t remainder = dspRDL%2;
+             if (remainder == 1) dspRDL++;
+
+             dspHeaderWord[1] = dspRDL + kdspHLen;
+             dspHeaderWord[2] = dspRDL;
+             dspHeaderWord[3] = dspno;
+             if (remainder == 1) dspHeaderWord[8] = 1; // setting the padding word
+             outfile.write((char*)dspHeaderWord,kdspHLen*sizeof(UInt_t));
+
              for (Int_t ibus = 0; ibus < 5; ibus++)
                {
                  // Patch Bus Header
                  Int_t busno = iskip[idsp] + ibus;
                  Int_t patchbusRDL = contentsBus[busno];
-                 
-                 for (Int_t i=0; i<4; i++)
+
+                 if (patchbusRDL > 0)
                    {
-                     patchBusHeader[i] = 0;
+                     patchBusHeaderWord[0] = 0;
+                     patchBusHeaderWord[1] = (UInt_t) (patchbusRDL + kpbusHLen);
+                     patchBusHeaderWord[2] = (UInt_t) patchbusRDL;
+                     patchBusHeaderWord[3] = (UInt_t) busno;
                    }
-                 patchBusHeader[1] = (UInt_t) patchbusRDL;
-                 patchBusHeader[2] = (UInt_t) busno;
+                 else if (patchbusRDL == 0)
+                   {
+                     patchBusHeaderWord[0] = 0;
+                     patchBusHeaderWord[1] = (UInt_t) kpbusHLen;
+                     patchBusHeaderWord[2] = (UInt_t) 0;
+                     patchBusHeaderWord[3] = (UInt_t) busno;
+                   }
+
+
+                 outfile.write((char*)patchBusHeaderWord,4*sizeof(UInt_t));
 
-                 outfile.write((char*)(&patchBusHeader),4*sizeof(UInt_t));
 
                  for (Int_t iword = 0; iword < patchbusRDL; iword++)
                    {
@@ -284,12 +318,19 @@ void AliPMDDDLRawData::WritePMDRawData(TTree *treeD)
                    }
                  
                  outfile.write((char*)buffer,patchbusRDL*sizeof(UInt_t));
-                 
+
+               } // End of patch bus loop
+
+
+             // Adding a padding word if the total words odd
+             if (remainder == 1)
+               {
+                 UInt_t paddingWord = dspHeader.GetDefaultPaddingWord();
+                 outfile.write((char*)(&paddingWord),sizeof(UInt_t));
                }
            }
        }
-      
-      
+
       // Write real data header
       // take the pointer to the beginning of the data header
       // write the total number of words per ddl and bring the
@@ -419,18 +460,17 @@ void AliPMDDDLRawData::GetUMDigitsData(TTree *treeD, Int_t imodule,
   Int_t nentries = fDigits->GetLast();
   Int_t totword = nentries+1;
 
-  AliPMDdigit *fPMDdigit;
-
+  AliPMDdigit *pmddigit;
 
   for (Int_t ient = 0; ient < totword; ient++)
     {
-      fPMDdigit = (AliPMDdigit*)fDigits->UncheckedAt(ient);
+      pmddigit = (AliPMDdigit*)fDigits->UncheckedAt(ient);
       
-      det    = fPMDdigit->GetDetector();
-      smn    = fPMDdigit->GetSMNumber();
-      irow   = fPMDdigit->GetRow();
-      icol   = fPMDdigit->GetColumn();
-      adc    = (UInt_t) fPMDdigit->GetADC();
+      det    = pmddigit->GetDetector();
+      smn    = pmddigit->GetSMNumber();
+      irow   = pmddigit->GetRow();
+      icol   = pmddigit->GetColumn();
+      adc    = (UInt_t) pmddigit->GetADC();
 
       TransformS2H(smn,irow,icol);
 
index d4c14cf..2c475c7 100644 (file)
 ClassImp(AliPMDDspHeader)
 
 
-const Int_t  AliPMDDspHeader::fgkHeaderLength = 8;
+const Int_t   AliPMDDspHeader::fgkHeaderLength = 10;
+const UInt_t  AliPMDDspHeader::fgkDefaultPaddingWord = 0xFFFFFFFF;
 
 //------------------------------------------------------------
-AliPMDDspHeader::AliPMDDspHeader():
+AliPMDDspHeader::AliPMDDspHeader() :
   TObject(),
+  fDataKey(0),
   fTotalLength(0),
   fRawDataLength(0),
-  fTrWord1(0),
-  fTrWord2(0),
-  fTrWord3(0),
-  fTrWord4(0),
   fDspId(0),
-  fEvtWord(0)
+  fBlkL1ATrigger(0),
+  fMiniEventId(0),
+  fL1ATrigger(0),
+  fL1RTrigger(0),
+  fPaddingWord(0),
+  fErrorWord(0)
 {
   //
   // ctor
@@ -52,14 +55,16 @@ AliPMDDspHeader::~AliPMDDspHeader()
 //___________________________________________
 AliPMDDspHeader::AliPMDDspHeader(const AliPMDDspHeader & dsph):
   TObject(),
+  fDataKey(dsph.fDataKey),
   fTotalLength(dsph.fTotalLength),
   fRawDataLength(dsph.fRawDataLength),
-  fTrWord1(dsph.fTrWord1),
-  fTrWord2(dsph.fTrWord2),
-  fTrWord3(dsph.fTrWord3),
-  fTrWord4(dsph.fTrWord4),
   fDspId(dsph.fDspId),
-  fEvtWord(dsph.fEvtWord)
+  fBlkL1ATrigger(dsph.fBlkL1ATrigger),
+  fMiniEventId(dsph.fMiniEventId),
+  fL1ATrigger(dsph.fL1ATrigger),
+  fL1RTrigger(dsph.fL1RTrigger),
+  fPaddingWord(dsph.fPaddingWord),
+  fErrorWord(dsph.fErrorWord)
 {
   //
   // copy ctor
@@ -74,26 +79,30 @@ AliPMDDspHeader& AliPMDDspHeader::operator=(const AliPMDDspHeader &dsph)
   //
   if (this != &dsph)
     {
+      fDataKey       = dsph.fDataKey;
       fTotalLength   = dsph.fTotalLength;
       fRawDataLength = dsph.fRawDataLength;
-      fTrWord1       = dsph.fTrWord1;
-      fTrWord2       = dsph.fTrWord2;
-      fTrWord3       = dsph.fTrWord3;
-      fTrWord4       = dsph.fTrWord4;
       fDspId         = dsph.fDspId;
-      fEvtWord       = dsph.fEvtWord;
+      fBlkL1ATrigger = dsph.fBlkL1ATrigger;
+      fMiniEventId   = dsph.fMiniEventId;
+      fL1ATrigger    = dsph.fL1ATrigger;
+      fL1RTrigger    = dsph.fL1RTrigger;
+      fPaddingWord   = dsph.fPaddingWord;
+      fErrorWord     = dsph.fErrorWord;
     }
   return *this;
 }
 void AliPMDDspHeader::SetHeader(Int_t *header)
 {
-  fTotalLength   = header[0];
-  fRawDataLength = header[1];
-  fTrWord1       = header[2];
-  fTrWord2       = header[3];
-  fTrWord3       = header[4];
-  fTrWord4       = header[5];
-  fDspId         = header[6];
-  fEvtWord       = header[7];
+  fDataKey        = header[0];
+  fTotalLength    = header[1];
+  fRawDataLength  = header[2];
+  fDspId          = header[3];
+  fBlkL1ATrigger  = header[4];
+  fMiniEventId    = header[5];
+  fL1ATrigger     = header[6];
+  fL1RTrigger     = header[7];
+  fPaddingWord    = header[8];
+  fErrorWord      = header[9];
 }
       
index e591286..c5e5a64 100644 (file)
@@ -16,41 +16,49 @@ public:
    virtual ~AliPMDDspHeader();
 
    // dsp header
-
+   void  SetDataKey(Int_t dkey)            {fDataKey = dkey;}
    void  SetTotalLength(Int_t totlength)   {fTotalLength = totlength;}
    void  SetRawDataLength(Int_t rawlength) {fRawDataLength = rawlength;}
-   void  SetTriggerWord1(Int_t trword1)    {fTrWord1 = trword1;}
-   void  SetTriggerWord2(Int_t trword2)    {fTrWord2 = trword2;}
-   void  SetTriggerWord3(Int_t trword3)    {fTrWord3 = trword3;}
-   void  SetTriggerWord4(Int_t trword4)    {fTrWord4 = trword4;}
    void  SetDspId(Int_t dspid)             {fDspId = dspid;}
-   void  SetEventWord(Int_t evtword)       {fEvtWord = evtword;}
+   void  SetBlkL1ATrigger(Int_t trword1)   {fBlkL1ATrigger = trword1;}
+   void  SetMiniEventId(Int_t trword2)     {fMiniEventId = trword2;}
+   void  SetL1ATrigger(Int_t trword3)      {fL1ATrigger = trword3;}
+   void  SetL1RTrigger(Int_t trword4)      {fL1RTrigger = trword4;}
+   void  SetPaddingWord(UInt_t padword)    {fPaddingWord = padword;}
+   void  SetErrorWord(Int_t errw)          {fErrorWord = errw;}
+
    void  SetHeader(Int_t *header);
 
+   Int_t  GetHeaderLength()       const {return fgkHeaderLength;}
+   UInt_t GetDefaultPaddingWord() const {return fgkDefaultPaddingWord;}
 
-   Int_t GetHeaderLength()  const {return fgkHeaderLength;}
+   Int_t GetDataKey()       const {return fDataKey;}
    Int_t GetTotalLength()   const {return fTotalLength;}
    Int_t GetRawDataLength() const {return fRawDataLength;}
-   Int_t GetTriggerWord1()  const {return fTrWord1;}  
-   Int_t GetTriggerWord2()  const {return fTrWord2;}  
-   Int_t GetTriggerWord3()  const {return fTrWord3;}  
-   Int_t GetTriggerWord4()  const {return fTrWord4;}  
    Int_t GetDspId()         const {return fDspId;}
-   Int_t GetEventWord()     const {return fEvtWord;}  
+   Int_t GetBlkL1Trigger()  const {return fBlkL1ATrigger;}  
+   Int_t GetMiniEventId()   const {return fMiniEventId;}  
+   Int_t GetL1ATrigger()    const {return fL1ATrigger;}  
+   Int_t GetL1RTrigger()    const {return fL1RTrigger;}  
+   Int_t GetPaddingWord()   const {return fPaddingWord;}  
+   Int_t GetErrorWord()     const {return fErrorWord;}  
 
  private:
 
+   Int_t     fDataKey;        // Data key word for FRT header
    Int_t     fTotalLength;    // total length of block structure
    Int_t     fRawDataLength;  // length of raw data
-   Int_t     fTrWord1;        // 1st trigger word
-   Int_t     fTrWord2;        // 1st trigger word
-   Int_t     fTrWord3;        // 1st trigger word
-   Int_t     fTrWord4;        // 1st trigger word
    Int_t     fDspId;          // Dsp id
-   Int_t     fEvtWord;        // Event word (nb words odd:1, even:0)
+   Int_t     fBlkL1ATrigger;  // 1st trigger word
+   Int_t     fMiniEventId;    // 1st trigger word
+   Int_t     fL1ATrigger;     // 1st trigger word
+   Int_t     fL1RTrigger;     // 1st trigger word
+   UInt_t    fPaddingWord;    // padding word (nb words odd:1, even:0)
+   Int_t     fErrorWord;      // Error word (nb words odd:1, even:0)
 
-   static const Int_t fgkHeaderLength;   // header length in word
+   static const Int_t  fgkHeaderLength;       // header length in word
+   static const UInt_t fgkDefaultPaddingWord; // Default padding word
 
-   ClassDef(AliPMDDspHeader,0)  // PMD dsp Header
+   ClassDef(AliPMDDspHeader,1)  // PMD dsp Header
 };
 #endif
index 52df423..de1a92a 100644 (file)
@@ -24,12 +24,12 @@ ClassImp(AliPMDPatchBusHeader)
 const Int_t  AliPMDPatchBusHeader::fgkHeaderLength = 4;
 
 //------------------------------------------------------------
-AliPMDPatchBusHeader::AliPMDPatchBusHeader()
-  :  TObject(),
-     fTotalLength(0),
-     fRawDataLength(0),
-     fPatchBusId(0),
-     fTrWord(0)
+AliPMDPatchBusHeader::AliPMDPatchBusHeader() :
+  TObject(),
+  fDataKey(0),
+  fTotalLength(0),
+  fRawDataLength(0),
+  fPatchBusId(0)
 {
   //
   // ctor
@@ -48,10 +48,10 @@ AliPMDPatchBusHeader::~AliPMDPatchBusHeader()
 //___________________________________________
 AliPMDPatchBusHeader::AliPMDPatchBusHeader(const AliPMDPatchBusHeader & pbush):
   TObject(),
+  fDataKey(pbush.fDataKey),
   fTotalLength(pbush.fTotalLength),
   fRawDataLength(pbush.fRawDataLength),
-  fPatchBusId(pbush.fPatchBusId),
-  fTrWord(pbush.fTrWord)
+  fPatchBusId(pbush.fPatchBusId)
 {
   //
   // copy ctor
@@ -67,18 +67,18 @@ AliPMDPatchBusHeader::operator=(const AliPMDPatchBusHeader &pbush)
   //
   if (this != &pbush)
     {
+      fDataKey       = pbush.fDataKey;
       fTotalLength   = pbush.fTotalLength;
       fRawDataLength = pbush.fRawDataLength;
       fPatchBusId    = pbush.fPatchBusId;
-      fTrWord        = pbush.fTrWord;
     }
   return *this;
 }
 void AliPMDPatchBusHeader::SetHeader(Int_t *header)
 {
-  fTotalLength   = header[0];
-  fRawDataLength = header[1];
-  fPatchBusId    = header[2];
-  fTrWord        = header[3];
+  fDataKey       = header[0];
+  fTotalLength   = header[1];
+  fRawDataLength = header[2];
+  fPatchBusId    = header[3];
 }
-
+      
index 9d4873f..38eff6f 100644 (file)
@@ -17,31 +17,32 @@ public:
    virtual ~AliPMDPatchBusHeader();
 
    // PatchBus header
-
+   void  SetDataKey(Int_t dkey)            {fDataKey = dkey;}
    void  SetTotalLength(Int_t totlength)   {fTotalLength = totlength;}
    void  SetRawDataLength(Int_t rawlength) {fRawDataLength = rawlength;}
    void  SetPatchBusId(Int_t pbusid)       {fPatchBusId = pbusid;}
-   void  SetTriggerWord(Int_t trword)      {fTrWord = trword;}
 
    void  SetHeader(Int_t *header);
 
 
    Int_t GetHeaderLength()  const {return fgkHeaderLength;}
+   Int_t GetDataKey()       const {return fDataKey;}  
    Int_t GetTotalLength()   const {return fTotalLength;}
    Int_t GetRawDataLength() const {return fRawDataLength;}
    Int_t GetPatchBusId()    const {return fPatchBusId;}
-   Int_t GetTriggerWord()   const {return fTrWord;}  
+
 
 
  private:
 
+   Int_t     fDataKey;        // data key
    Int_t     fTotalLength;    // total length of block structure
    Int_t     fRawDataLength;  // length of raw data
    Int_t     fPatchBusId;     // Patch bus id
-   Int_t     fTrWord;         // 1st trigger word
+
 
    static const Int_t fgkHeaderLength;   // header length in word
 
-   ClassDef(AliPMDPatchBusHeader,0)  // PMD PatchBus Header
+   ClassDef(AliPMDPatchBusHeader,1)  // PMD PatchBus Header
 };
 #endif
index 2f2e180..cf5ab6b 100644 (file)
@@ -192,47 +192,53 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
   AliPMDDspHeader      dspHeader;
   AliPMDPatchBusHeader pbusHeader;
 
+  const Int_t kblHLen   = blockHeader.GetHeaderLength();
+  const Int_t kdspHLen  = dspHeader.GetHeaderLength();
+  const Int_t kpbusHLen = pbusHeader.GetHeaderLength();
+  
+
   Int_t idet, ismn;
   Int_t irow = -1;
   Int_t icol = -1;
 
-  Int_t block[8];
-  Int_t pbus[4];
+  Int_t blHeaderWord[8];
+  Int_t dspHeaderWord[10];
+  Int_t pbusHeaderWord[4];
 
   Int_t ilowLimit = 0;
   Int_t iuppLimit = 0;
   for (Int_t iblock = 0; iblock < 2; iblock++)
     {
       ilowLimit = iuppLimit;
-      iuppLimit = ilowLimit + 8;
+      iuppLimit = ilowLimit + kblHLen;
 
       for (Int_t i = ilowLimit; i < iuppLimit; i++)
        {
-         block[i-ilowLimit] = (Int_t) buffer[i];
+         blHeaderWord[i-ilowLimit] = (Int_t) buffer[i];
        }
-      blockHeader.SetHeader(block);
+      blockHeader.SetHeader(blHeaderWord);
       for (Int_t idsp = 0; idsp < 5; idsp++)
        {
          ilowLimit = iuppLimit;
-         iuppLimit = ilowLimit + 8;
+         iuppLimit = ilowLimit + kdspHLen;
 
          for (Int_t i = ilowLimit; i < iuppLimit; i++)
            {
-             block[i-ilowLimit] = (Int_t) buffer[i];
+             dspHeaderWord[i-ilowLimit] = (Int_t) buffer[i];
            }
-         dspHeader.SetHeader(block);
+         dspHeader.SetHeader(dspHeaderWord);
 
          for (Int_t ibus = 0; ibus < 5; ibus++)
            {
 
              ilowLimit = iuppLimit;
-             iuppLimit = ilowLimit + 4;
+             iuppLimit = ilowLimit + kpbusHLen;
 
              for (Int_t i = ilowLimit; i < iuppLimit; i++)
                {
-                 pbus[i-ilowLimit] = (Int_t) buffer[i];
+                 pbusHeaderWord[i-ilowLimit] = (Int_t) buffer[i];
                }
-             pbusHeader.SetHeader(pbus);
+             pbusHeader.SetHeader(pbusHeaderWord);
              Int_t rawdatalength = pbusHeader.GetRawDataLength();
              Int_t pbusid = pbusHeader.GetPatchBusId();
 
@@ -274,11 +280,12 @@ void AliPMDRawStream::DdlData(TObjArray *pmdddlcont)
                  
                  pmdddlcont->Add(pmdddldata);
                  
-               }
+               } // data word loop
+           } // patch bus loop
 
-           }
-       } // end of DSP
+         if (dspHeader.GetPaddingWord() == 1) iuppLimit++;
 
+       } // end of DSP
 
     } // end of BLOCK