]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added Darc error word for disable or not connected regional boards
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Apr 2008 14:38:52 +0000 (14:38 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Apr 2008 14:38:52 +0000 (14:38 +0000)
(Christian)

MUON/AliMUONDarcHeader.cxx
MUON/AliMUONDarcHeader.h
MUON/AliMUONPayloadTrigger.cxx
MUON/AliMUONRegHeader.cxx
MUON/AliMUONRegHeader.h

index f16a310a846147c980fad6e36174c2e270d24e4e..6d3c8c52801132fc8da7bd112fd193517211ea97 100644 (file)
@@ -41,6 +41,8 @@ ClassImp(AliMUONDarcHeader)
 
  const UInt_t AliMUONDarcHeader::fgkEndOfDarc   = 0xDEADFACE;
  const UInt_t AliMUONDarcHeader::fgkEndOfGlobal = 0xDEADBEEF;
+ const UInt_t AliMUONDarcHeader::fgkDarcVadorhType    = 4;
+ const UInt_t AliMUONDarcHeader::fgkDarcDefaultType   = 6;
 
 //___________________________________________
 AliMUONDarcHeader::AliMUONDarcHeader()
index c8d879f88174e99c7a07c43a96e23a58b1d5e50d..45751630f42e91048a0a8b757045823d937cc5e4 100644 (file)
@@ -119,6 +119,11 @@ public:
             /// Return end of global info word
    UInt_t GetEndOfGlobal()   const {return fgkEndOfGlobal;} 
 
+           /// Return default type for DARC def.
+   UInt_t GetDarcDefaultType()   const {return fgkDarcDefaultType;} 
+          /// Return default type for DARC def.
+   UInt_t GetDarcVadohrType()   const {return fgkDarcVadorhType;} 
+
    // set random numbers to fill variable
    void SetScalersNumbers();
 
@@ -168,6 +173,10 @@ public:
    static const UInt_t     fgkEndOfDarc;         ///< end of darc info word
    static const UInt_t     fgkEndOfGlobal;       ///< end of global info word
 
+   static const UInt_t     fgkDarcDefaultType;   ///< default type for DARC def.
+   static const UInt_t     fgkDarcVadorhType;    ///< default type for DARC vadorh
+
+
    TClonesArray* fRegHeaderArray; ///< container for regional header
 
    ClassDef(AliMUONDarcHeader,1)  // MUON DDL Trigger
index 89f125f4ad3b0962bd6c49d1b02f125c75174074..c3dab7a4aab9c156b5e76f2156ce5722bc26bdc4 100644 (file)
@@ -85,22 +85,25 @@ Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer, Bool_t scalerEvent)
 
   AliMUONDarcHeader* darcHeader = fDDLTrigger->GetDarcHeader();
 
-  static Int_t kGlobalHeaderSize = darcHeader->GetGlobalHeaderLength(); 
-  static Int_t kDarcHeaderSize   = darcHeader->GetDarcHeaderLength(); 
-  static Int_t kRegHeaderSize    = fRegHeader->GetHeaderLength();
-  
+  static Int_t kGlobalHeaderSize   = darcHeader->GetGlobalHeaderLength(); 
+  static Int_t kDarcHeaderSize     = darcHeader->GetDarcHeaderLength(); 
+  static Int_t kRegHeaderSize      = fRegHeader->GetHeaderLength();
+  static Int_t kRegEmptySize       = fRegHeader->GetHeaderLength()+1 + 16*(fLocalStruct->GetLength()+1);
+  static Int_t kRegEmptyScalerSize = fRegHeader->GetHeaderLength() + fRegHeader->GetScalerLength() + 1 +
+                                      16*(fLocalStruct->GetLength() + fLocalStruct->GetScalerLength() + 1);
+
   Int_t index = 0;
 
   memcpy(darcHeader->GetHeader(), &buffer[index], (kDarcHeaderSize)*4); 
   index += kDarcHeaderSize;
 
 
-  // darc type vardorh
-  if (darcHeader->GetDarcType() == 4)
+  // darc type vadorh
+  if (darcHeader->GetDarcType() == darcHeader->GetDarcVadohrType())
       fMaxReg = 1;
     
   // darc type def.
-  if (darcHeader->GetDarcType() == 6)
+  if (darcHeader->GetDarcType() == darcHeader->GetDarcDefaultType())
       fMaxReg = 8;
       
   if(darcHeader->GetEventType() == scalerEvent) 
@@ -142,6 +145,14 @@ Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer, Bool_t scalerEvent)
   // 8 regional boards
   for (Int_t iReg = 0; iReg < fMaxReg; iReg++) {           //loop over regeonal card
 
+    // skip empty regaional board (not connected or with error reading)
+    if (buffer[index] == fRegHeader->GetErrorWord()) {
+      if (scalerEvent)
+        index += kRegEmptyScalerSize;
+      else 
+        index += kRegEmptySize;
+      continue;
+    }
     memcpy(fRegHeader->GetHeader(), &buffer[index], kRegHeaderSize*4);
     index += kRegHeaderSize;
 
index ef3b4269166bfc7c7603d7f686f0629bf578f333..100d9cb8ab04e42ee699877614ddb94cc9b7e3fc 100644 (file)
@@ -36,6 +36,7 @@ ClassImp(AliMUONRegHeader)
  const Int_t  AliMUONRegHeader::fgkHeaderLength = 5;
  const Int_t  AliMUONRegHeader::fgkScalerLength = 10;
  const UInt_t AliMUONRegHeader::fgkEndOfReg     = 0xBEEFFACE;
+ const UInt_t AliMUONRegHeader::fgkErrorWord    = 0xCAFEDEAD;
 
 //___________________________________________
 AliMUONRegHeader::AliMUONRegHeader()
index bc1fca35cd4ff3a5ed822765799e7cce6e76f96f..d07711bad51cfe8af208a6f44458e4c269c2d7ea 100644 (file)
@@ -94,7 +94,8 @@ public:
    Int_t   GetHeaderLength() const {return fgkHeaderLength;}
    /// Return end of regional info word
    UInt_t  GetEndOfReg()     const {return fgkEndOfReg;}
-
+  /// Return error word
+   UInt_t  GetErrorWord()    const {return fgkErrorWord;}
 
    /// Return header
    UInt_t* GetHeader() {return &fDarcWord;}
@@ -146,9 +147,10 @@ public:
    static const Int_t  fgkScalerLength;  ///< length of regional scaler in word
    static const Int_t  fgkHeaderLength;  ///< header length in word
    static const UInt_t fgkEndOfReg;      ///< end of regional info word
-
+   static const UInt_t fgkErrorWord;     ///< error word when a regional board is missing
+   
    TClonesArray* fLocalArray;   ///< array of local structure
 
-   ClassDef(AliMUONRegHeader,3) //MUON regional header for trigger
+   ClassDef(AliMUONRegHeader,4) //MUON regional header for trigger
 };
 #endif