]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing bug in Darc header length (Christian)
authormartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Jun 2006 14:04:30 +0000 (14:04 +0000)
committermartinez <martinez@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 12 Jun 2006 14:04:30 +0000 (14:04 +0000)
MUON/AliMUONDarcHeader.cxx
MUON/AliMUONDarcHeader.h
MUON/AliMUONPayloadTrigger.cxx
MUON/AliMUONRawWriter.cxx

index 85ce887bd2208bbb9d66a67b1911e142f9d6493c..eea6cc2a17d0ec118962e6c1298b37d79e8456e6 100644 (file)
@@ -31,8 +31,9 @@
 ClassImp(AliMUONDarcHeader)
 /// \endcond
 
- const Int_t AliMUONDarcHeader::fgkHeaderLength = 8;
- const Int_t AliMUONDarcHeader::fgkDarcScalerLength   = 6;
+ const Int_t AliMUONDarcHeader::fgkDarcHeaderLength   =  1;
+ const Int_t AliMUONDarcHeader::fgkGlobalHeaderLength =  5;
+ const Int_t AliMUONDarcHeader::fgkDarcScalerLength   =  6;
  const Int_t AliMUONDarcHeader::fgkGlobalScalerLength = 10;
 
  const UInt_t AliMUONDarcHeader::fgkEndOfDarc   = 0xDEADFACE;
index 7a0ceb10dcac035644d1e837226e11aa3b628c88..8403e0c04bd49ac91aa6e9a09c2c7233d2e8ba7a 100644 (file)
@@ -41,7 +41,8 @@ public:
    void    SetGlobalInput(Int_t in, Int_t n) {fGlobalInput[n] = in;}
    void    SetGlobalOutput(Int_t out) {fGlobalOutput = out;}
 
-   Int_t   GetHeaderLength() const {return fgkHeaderLength;}
+   Int_t   GetDarcHeaderLength()   const {return fgkDarcHeaderLength;}
+   Int_t   GetGlobalHeaderLength() const {return fgkGlobalHeaderLength;}
 
    UInt_t* GetHeader() {return &fWord;}
    Int_t*  GetGlobalInput()    {return &fGlobalInput[0];}
@@ -93,7 +94,8 @@ public:
    Int_t     fGlobalInput[4];    ///< global input
    Int_t     fGlobalOutput;      ///< global ouput
 
-   static const Int_t fgkHeaderLength; ///< header length
+   static const Int_t fgkDarcHeaderLength;   ///< darc header length
+   static const Int_t fgkGlobalHeaderLength; ///< global header length
 
 
  // global card scalers   
index bc4c1efe8fd9863a4b63d61000b4e2b5bdcfe895..e40ec1e5711839822d849cb6edd6087ee8c52621 100644 (file)
@@ -89,20 +89,23 @@ AliMUONPayloadTrigger::~AliMUONPayloadTrigger()
 //______________________________________________________
 Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
 {
-  // reading tracker DDL
-  // store buspatch info into Array
-  // store only non-empty structures (buspatch info with datalength !=0)
+  // decode trigger DDL
+  // store only non-empty structures (TrigY ==0)
 
  // reading DDL for trigger
 
   AliMUONDarcHeader* darcHeader = fDDLTrigger->GetDarcHeader();
 
-  Int_t kDarcHeaderSize = darcHeader->GetHeaderLength(); 
-  Int_t kRegHeaderSize  = fRegHeader->GetHeaderLength() ;
-  Bool_t scalerEvent    = kFALSE;
+  static Int_t kGlobalHeaderSize = darcHeader->GetGlobalHeaderLength(); 
+  static Int_t kDarcHeaderSize   = darcHeader->GetDarcHeaderLength(); 
+  static Int_t kRegHeaderSize    = fRegHeader->GetHeaderLength();
+
+  Bool_t scalerEvent = kFALSE;
   
   Int_t index = 0;
-  darcHeader->SetWord(buffer[index++]);
+
+  memcpy(darcHeader->GetHeader(), &buffer[index], (kDarcHeaderSize)*4); 
+  index += kDarcHeaderSize;
 
   if(darcHeader->GetEventType() == 2) {
     scalerEvent = kTRUE;
@@ -119,8 +122,8 @@ Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
     AliWarning(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], (kDarcHeaderSize-1)*4); 
-  index += kDarcHeaderSize- 1; // kind tricky cos scaler info in-between Darc header
+  memcpy(darcHeader->GetGlobalInput(), &buffer[index], (kGlobalHeaderSize)*4); 
+  index += kGlobalHeaderSize; 
 
   if(scalerEvent) {
     // 10 Global scaler words
@@ -129,7 +132,7 @@ Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
   }
 
   if (buffer[index++] != darcHeader->GetEndOfGlobal())
-    AliWarning(Form("Wrong end of Global word %d instead of %d\n",buffer[index-1], darcHeader->GetEndOfGlobal()));
+    AliWarning(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
index 819adc4406d852a80fec882c61636bdf623116cc..96870ca580c2a93364c0c6b0e18b94e899f108eb 100644 (file)
@@ -713,7 +713,9 @@ Int_t AliMUONRawWriter::WriteTriggerDDL()
 
     AliBitPacking::PackWord((UInt_t)globalFlag,word,8,11);
     fDarcHeader->SetWord(word);
-    buffer[index++] = word;
+
+    memcpy(&buffer[index], fDarcHeader->GetHeader(), (fDarcHeader->GetDarcHeaderLength())*4); 
+    index += fDarcHeader->GetDarcHeaderLength();
 
     if (iDDL == 0)
      fDarcHeader->SetGlobalOutput(gloTrigPat);// no global input for the moment....
@@ -729,8 +731,8 @@ Int_t AliMUONRawWriter::WriteTriggerDDL()
     buffer[index++] = fDarcHeader->GetEndOfDarc();
 
     // 4 words of global board input + Global board output
-    memcpy(&buffer[index], fDarcHeader->GetGlobalInput(), (fDarcHeader->GetHeaderLength()-1)*4); 
-    index += fDarcHeader->GetHeaderLength() - 1; // kind tricky cos scaler info in-between Darc header
+    memcpy(&buffer[index], fDarcHeader->GetGlobalInput(), (fDarcHeader->GetGlobalHeaderLength())*4); 
+    index += fDarcHeader->GetGlobalHeaderLength(); 
 
     if (fScalerEvent) {
       // 10 Global scaler words