]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Remove pre-compilation option
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Mar 2007 10:59:51 +0000 (10:59 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Mar 2007 10:59:51 +0000 (10:59 +0000)
- Add print method
- Glitch errors handling
- Parity errors per buspatch handling"
(Christian)

MUON/AliMUONBlockHeader.cxx
MUON/AliMUONBlockHeader.h
MUON/AliMUONBusStruct.cxx
MUON/AliMUONBusStruct.h
MUON/AliMUONDspHeader.cxx
MUON/AliMUONDspHeader.h
MUON/AliMUONPayloadTracker.cxx
MUON/AliMUONPayloadTracker.h
MUON/AliMUONPayloadTrigger.cxx

index d5adade42bf70dd3f1f7af5bdc4fce3d0ec33aa9..094a7fa0beeb5a49f315761eafd07873abab5497 100644 (file)
@@ -18,6 +18,8 @@
 #include "AliMUONBlockHeader.h"
 #include "AliMUONDspHeader.h"
 
+#include <Riostream.h>
+
 /// \class AliMUONBlockHeader
 /// Block structure for tracker raw data
 /// each DDL contains two blocks,
@@ -96,6 +98,7 @@ AliMUONBlockHeader::operator=(const AliMUONBlockHeader &event)
   ///
   if (this == &event) return *this;
 
+  fDataKey     = event.fDataKey;
   fTotalLength = event.fTotalLength;
   fLength      = event.fLength;
   fDspId       = event.fDspId;
@@ -134,3 +137,21 @@ void AliMUONBlockHeader::Clear(Option_t* )
   fDspHeaderArray->Clear("C");
  
 }
+
+//___________________________________________
+void AliMUONBlockHeader::Print(Option_t* /*opt*/) const
+{
+  /// print out
+
+  cout << "CRT info"        << endl;
+  cout << "DataKey: "       << fDataKey << endl;
+  cout << "TotalLength: "   << fTotalLength << endl;
+  cout << "Length: "        << fLength << endl;
+  cout << "DspId: "         << fDspId << endl;
+  cout << "L0Trigger: "     << fL0Trigger << endl;
+  cout << "MiniEventId: "   << fMiniEventId<< endl; 
+  cout << "EventId1: "      << fEventId1 << endl;
+  cout << "EventId2: "      << fEventId2 << endl;;
+
+}
index aa824a353e0d8acaa5daaec4a1dc1bdd5f8c7dd4..66db24f92c13a2eb38cd71765f055e42ab54828b 100644 (file)
@@ -87,6 +87,9 @@ public:
    // clear
    void Clear(Option_t* opt);
 
+   // print out
+   void Print(Option_t* /*opt*/) const;
+
  private:
 
    // block header
index ddeb74dab32d66507ad4405a5a19b9a5f57cf4ab..ebc1435a26dc100e0d6246a6da2d89c6c80fb7df 100644 (file)
  **************************************************************************/
 
 /* $Id$ */
+
 #include "AliMUONBusStruct.h"
 #include "AliLog.h"
-
+#include <Riostream.h>
+#include <string.h>
 
 /// \class AliMUONBusStruct
 /// Bus patch structure for tracker raw data
@@ -94,7 +95,6 @@ void AliMUONBusStruct::ResizeData(Int_t size)
   /// In case of resizing the vector
   /// the most simplest way to do it
   ///
-  AliInfo("reallocating");
   if (size == 0)
     fBufSize *= 2;
   else
@@ -166,7 +166,6 @@ void AliMUONBusStruct::Clear(Option_t *)
   /// clear
   /// delete the allocated memory 
   ///
-  AliInfo("here");
   delete[] fData;
 }
 //___________________________________________
@@ -228,3 +227,23 @@ UShort_t AliMUONBusStruct::GetCharge(Int_t n) const
   AliError("Index outside limits."); 
   return 0; 
 }
+
+//___________________________________________
+void AliMUONBusStruct::Print(Option_t* opt) const
+{
+  /// print out
+
+  cout << "Bus patch info" << endl;
+  cout << "DataKey: "      << fDataKey << endl;
+  cout << "fTotalLength: " << fTotalLength << endl;
+  cout << "fLength: "      << fLength << endl;
+  cout << "fBusPatchId: "  << fBusPatchId << endl;
+  cout << "fBufSize: "     << fBufSize << endl;
+
+  if (strstr(opt, "all")) {
+  for (Int_t i = 0; i <fLength; ++i)
+      cout << "Data["<< i << "] = " << fData[i] << endl;
+  }
+}
+
+
index fb879ce33cc39d13b53c739931418c399faab187..387be6e402684e6fbccc299ddc8cac4930c337ac 100644 (file)
@@ -100,6 +100,9 @@ public:
 
    void ResizeData(Int_t size = 0);
 
+   void Print(Option_t* opt) const;
+
+
    ClassDef(AliMUONBusStruct,3)  // MUON DDL Tracker
 };
 #endif
index 303920fa5c04d56b65aaf4d843a7afc7fe43b8cc..6ad3b66a23f570be9498adb54c21abdb8c6e39a2 100644 (file)
@@ -17,6 +17,7 @@
  
 #include "AliMUONDspHeader.h"
 #include "AliMUONBusStruct.h"
+#include <Riostream.h>
 
 /// \class AliMUONDspHeader
 /// DSP structure for tracker raw data.
@@ -139,3 +140,22 @@ void AliMUONDspHeader::Clear(Option_t* )
   fBusPatchArray->Clear("C");
  
 }
+
+//___________________________________________
+void AliMUONDspHeader::Print(Option_t* /*opt*/) const
+{
+  /// print out
+
+  cout << "FRT info"        << endl;
+  cout << "DataKey: "       << fDataKey << endl;
+  cout << "TotalLength: "   << fTotalLength << endl;
+  cout << "Length : "       << fLength << endl;
+  cout << "DspId: "         << fDspId << endl;
+  cout << "BlkL1ATrigger: " << fBlkL1ATrigger << endl;
+  cout << "MiniEventId: "   << fMiniEventId << endl;
+  cout << "L1ATrigger: "    << fL1ATrigger << endl;
+  cout << "L1RTrigger: "    << fL1RTrigger << endl;
+  cout << "PaddingWord: "   << fPaddingWord << endl;
+  cout << "ErrorWord: "     << fErrorWord << endl;
+
+}
index 5063722c766c6441ae534aef6e4bea5c111a1e33..5148980bdbac462e2696b868cfd16ea777002275 100644 (file)
@@ -93,6 +93,9 @@ public:
    // clear
    void Clear(Option_t* opt);
 
+   // print out
+   void Print(Option_t* /*opt*/) const;
+
  private:
 
    // Dsp header
index 1868c6ed27e54052c8c3f48c1d8846d7559cf06a..0642c26df95db24e270e504f81b8235d4291a33d 100644 (file)
@@ -13,7 +13,6 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-
 ///
 /// \class AliMUONPayloadTracker
 /// Decodes rawdata from buffer and stores in TClonesArray.
 
 #include "AliMUONPayloadTracker.h"
 
-#include "AliRawReader.h"
-#include "AliRawDataHeader.h"
-
-#ifndef DATE_SYS
-#include "AliLog.h"
-#endif
-
 #include "AliMUONDspHeader.h"
 #include "AliMUONBlockHeader.h"
 #include "AliMUONBusStruct.h"
 #include "AliMUONDDLTracker.h"
 
+#include "AliLog.h"
+
 /// \cond CLASSIMP
 ClassImp(AliMUONPayloadTracker)
 /// \endcond
@@ -51,7 +45,9 @@ AliMUONPayloadTracker::AliMUONPayloadTracker()
     fDDLTracker(new AliMUONDDLTracker()),
     fBusStruct(new AliMUONBusStruct()),
     fBlockHeader(new AliMUONBlockHeader()),
-    fDspHeader(new AliMUONDspHeader())
+    fDspHeader(new AliMUONDspHeader()),
+    fParityErrBus(),
+    fGlitchErrors(0)
 {
   ///
   /// create an object to decode MUON payload
@@ -126,15 +122,24 @@ Bool_t AliMUONPayloadTracker::Decode(UInt_t* buffer, Int_t totalDDLSize)
       memcpy(fDspHeader->GetHeader(),&buffer[index], kDspHeaderSize*4);
 
       totalDspSize = fDspHeader->GetTotalLength();
+
+      if (fDspHeader->GetErrorWord()) {
+       fDspHeader->Print("");
+       if (fDspHeader->GetErrorWord() == (0x000000B1 |  fBlockHeader->GetDspId())){
+         // an event with a glitch in the readout  has been detected
+         // it means that somewhere a 1 byte word has been randomly inserted
+         // all the readout sequence is shifted  untill the next event 
+
+         AliWarning(Form("Glitch in data detected, skipping event ")); 
+
+         fGlitchErrors++;
+         return kFALSE ; 
+       }       
+      }
+      
       indexDsp = index;
       index += kDspHeaderSize;
 
-//       if (fDspHeader->GetPaddingWord() != fDspHeader->GetDefaultPaddingWord()) {
-//     // copy the field of Padding word into ErrorWord field
-//     fDspHeader->SetErrorWord(fDspHeader->GetPaddingWord());
-//     index--;
-//       }
-
       // copy in TClonesArray
       fDDLTracker->AddDspHeader(*fDspHeader, iBlock);
 
@@ -167,7 +172,8 @@ Bool_t AliMUONPayloadTracker::Decode(UInt_t* buffer, Int_t totalDDLSize)
            fBusStruct->SetDspId(iDsp);
 
            // check parity
-           CheckDataParity();
+           if(!CheckDataParity())
+               AddParityErrBus(fBusStruct->GetBusPatchId());
 
            // copy in TClonesArray
            fDDLTracker->AddBusPatch(*fBusStruct, iBlock, iDsp);
@@ -188,12 +194,9 @@ Bool_t AliMUONPayloadTracker::Decode(UInt_t* buffer, Int_t totalDDLSize)
       if (fDspHeader->GetPaddingWord() == 1) {
        if (buffer[index++] != fDspHeader->GetDefaultPaddingWord())
 
-#ifndef DATE_SYS
-         AliWarning(Form("Error in padding word for iBlock %d, iDsp %d, iBus %d\n", 
+           AliError(Form("Error in padding word for iBlock %d, iDsp %d, iBus %d\n", 
                          iBlock, iDsp, iBusPatch));
-#else
-       printf("Error in padding word for iBlock %d, iDsp %d, iBus %d\n", iBlock, iDsp, iBusPatch);
-#endif
+
       }
 
       index = indexDsp + totalDspSize;
@@ -222,6 +225,9 @@ void AliMUONPayloadTracker::ResetDDL()
   /// after each DDL
   ///
   fDDLTracker->GetBlkHeaderArray()->Delete();
+  fGlitchErrors = 0;
+  fParityErrBus.Reset();
+
 }
 
 //______________________________________________________
@@ -254,13 +260,9 @@ Bool_t AliMUONPayloadTracker::CheckDataParity()
 
     // Check
     if (parity != fBusStruct->GetParity(idata)) {
-#ifndef DATE_SYS
+
       AliWarning(Form("Parity error in word %d for manuId %d and channel %d\n", 
                      idata, fBusStruct->GetManuId(idata), fBusStruct->GetChannelId(idata)));
-#else
-      printf("Parity error in word %d for manuId %d and channel %d\n", 
-            idata, fBusStruct->GetManuId(idata), fBusStruct->GetChannelId(idata));
-#endif
 
       return kFALSE;
                     
@@ -268,3 +270,11 @@ Bool_t AliMUONPayloadTracker::CheckDataParity()
   }
   return kTRUE;
 }
+
+//______________________________________________________
+void AliMUONPayloadTracker::AddParityErrBus(Int_t buspatch)
+{
+// adding bus with at least on parity error
+    fParityErrBus.Set(fParityErrBus.GetSize() + 1);
+    fParityErrBus.AddAt(buspatch, fParityErrBus.GetSize() - 1);
+}
index 3d7ab69be895d5a26a42ecba2f3feee477359ba7..bebfef7958916d91bc1d5379787b16bb6d0ddbdb 100644 (file)
@@ -12,6 +12,7 @@
 //  Author Christian Finck
 
 #include <TObject.h>
+#include <TArrayI.h>
 
 class AliMUONDDLTracker;
 class AliMUONBusStruct;
@@ -49,6 +50,13 @@ class AliMUONPayloadTracker: public TObject {
     /// Return pointer for buspatch structure
     AliMUONDDLTracker*      GetDDLTracker()   const {return fDDLTracker;}
 
+    /// Get number of parity errors
+    Int_t   GetParityErrors() const {return fParityErrBus.GetSize();} // for online
+    /// Get parity errors in buspatch
+    TArrayI GetParityErrBus() const {return fParityErrBus;} // for MOOD
+    /// Get number of glitch errors
+    Int_t   GetGlitchErrors() const {return fGlitchErrors;}
+
   private :
     /// Not implemented
     AliMUONPayloadTracker(const AliMUONPayloadTracker& stream);
@@ -56,6 +64,7 @@ class AliMUONPayloadTracker: public TObject {
     AliMUONPayloadTracker& operator = (const AliMUONPayloadTracker& stream);
 
     Bool_t CheckDataParity();
+    void   AddParityErrBus(Int_t buspatch);
 
     Int_t  fBusPatchId;   ///< entry of buspatch structure
     Int_t  fDspId;        ///< entry of Dsp header
@@ -71,7 +80,10 @@ class AliMUONPayloadTracker: public TObject {
     AliMUONBlockHeader*     fBlockHeader;     //!< pointer for block structure 
     AliMUONDspHeader*       fDspHeader;       //!< pointer for dsp structure 
 
-    ClassDef(AliMUONPayloadTracker, 1)    // base class for reading MUON raw digits
+    TArrayI fParityErrBus;                    //!< list of buspatch with at least one parity errors;
+    Int_t   fGlitchErrors;                    //!< number of glitch errors;
+
+    ClassDef(AliMUONPayloadTracker, 2)    // base class for reading MUON raw digits
 };
 
 #endif
index 2d57c95b4f18479c55605dfa341aed15f1305e70..5511f46e98485fd1f170ba3567e12be0188be976 100644 (file)
 
 #include "AliMUONPayloadTrigger.h"
 
-#include "AliRawReader.h"
-#include "AliRawDataHeader.h"
-
-#ifndef DATE_SYS
-#include "AliLog.h"
-#endif
-
 #include "AliMUONDarcHeader.h"
 #include "AliMUONRegHeader.h"
 #include "AliMUONLocalStruct.h"
 #include "AliMUONDDLTrigger.h"
 
+#include "AliLog.h"
+
 /// \cond CLASSIMP
 ClassImp(AliMUONPayloadTrigger)
 /// \endcond
@@ -101,11 +96,10 @@ Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
   }
 
   if (buffer[index++] != darcHeader->GetEndOfDarc())
-#ifndef DATE_SYS
-    AliWarning(Form("Wrong end of Darc word %x instead of %x\n",buffer[index-1], darcHeader->GetEndOfDarc()));
-#else 
-  printf("Wrong end of Darc word %x instead of %x\n",buffer[index-1], darcHeader->GetEndOfDarc());
-#endif
+
+      AliError(Form("Wrong end of Darc word %x instead of %x\n",
+                   buffer[index-1], darcHeader->GetEndOfDarc()));
+
 
   // 4 words of global board input + Global board output
   memcpy(darcHeader->GetGlobalInput(), &buffer[index], (kGlobalHeaderSize)*4); 
@@ -118,11 +112,10 @@ Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
   }
 
   if (buffer[index++] != darcHeader->GetEndOfGlobal())
-#ifndef DATE_SYS
-    AliWarning(Form("Wrong end of Global word %x instead of %x\n",buffer[index-1], darcHeader->GetEndOfGlobal()));
-#else 
-  printf("Wrong end of Global word %x instead of %x\n",buffer[index-1], darcHeader->GetEndOfGlobal());
-#endif
+
+  AliError(Form("Wrong end of Global word %x instead of %x\n",
+               buffer[index-1], darcHeader->GetEndOfGlobal()));
+
  
   // 8 regional boards
   for (Int_t iReg = 0; iReg < fMaxReg; iReg++) {           //loop over regeonal card
@@ -138,11 +131,10 @@ Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
     }
 
     if (buffer[index++] != fRegHeader->GetEndOfReg())
-#ifndef DATE_SYS
-      AliWarning(Form("Wrong end of Reg word %x instead of %x\n",buffer[index-1], fRegHeader->GetEndOfReg()));
-#else
-      printf("Wrong end of Reg word %x instead of %x\n",buffer[index-1], fRegHeader->GetEndOfReg());
-#endif
+
+      AliError(Form("Wrong end of Reg word %x instead of %x\n",
+                   buffer[index-1], fRegHeader->GetEndOfReg()));
+
 
     // 16 local cards per regional board
     for (Int_t iLoc = 0; iLoc < fMaxLoc; iLoc++) {         //loop over local card
@@ -160,11 +152,10 @@ Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
       }
 
       if (buffer[index++] != fLocalStruct->GetEndOfLocal())
-#ifndef DATE_SYS
-       AliWarning(Form("Wrong end of local word %x instead of %x\n",buffer[index-1], fLocalStruct->GetEndOfLocal()));
-#else
-      printf("Wrong end of local word %x instead of %x\n",buffer[index-1], fLocalStruct->GetEndOfLocal());
-#endif
+
+      AliError(Form("Wrong end of local word %x instead of %x\n",
+                   buffer[index-1], fLocalStruct->GetEndOfLocal()));
+
       // fill only if card notified
       if (fLocalStruct->GetData(0) == fLocalStruct->GetDisableWord())
          continue;