ALIROOT-5420 Changes for CDH v3
authorhristov <Peter.Hristov@cern.ch>
Mon, 24 Mar 2014 15:30:45 +0000 (16:30 +0100)
committerhristov <Peter.Hristov@cern.ch>
Mon, 24 Mar 2014 15:42:28 +0000 (16:42 +0100)
EMCAL/AliEMCALTriggerRawDigitMaker.cxx
HMPID/AliHMPIDDigit.cxx
MUON/AliMUONRawStreamTracker.cxx
MUON/AliMUONRawStreamTrackerHP.cxx
MUON/AliMUONRawStreamTrigger.cxx
MUON/AliMUONRawStreamTriggerHP.cxx
MUON/AliMUONRawWriter.cxx
MUON/AliMUONTriggerQADataMakerRec.cxx
TPC/Util/AliTPCAltroEmulator.cxx
ZDC/AliZDCRawStream.cxx

index 6f5ba73..2804a3f 100644 (file)
@@ -39,7 +39,6 @@ Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
 #include "AliEMCALTriggerPatch.h"
 #include "AliLog.h"
 
-#include "AliRawDataHeader.h"
 #include "AliRawVEvent.h"
 #include "AliRawEventHeaderBase.h"
 #include "AliRawEvent.h"
index 712a217..c922cfe 100644 (file)
@@ -17,7 +17,6 @@
 #include <TClonesArray.h>     //WriteRaw() 
 #include <TBox.h>             //Draw() 
 #include <TPolyLine.h>        //Draw() 
-#include <AliRawDataHeader.h> //WriteRaw()
 #include "AliHMPIDParam.h"
 #include <AliDAQ.h>           //WriteRaw()
 #include "Riostream.h"        //WriteRaw()
index 81b78df..f1c3154 100644 (file)
@@ -35,7 +35,6 @@
 
 #include "AliMUONLogger.h"
 #include "AliRawReader.h"
-#include "AliRawDataHeader.h"
 #include "AliDAQ.h"
 #include "AliLog.h"
 #include "AliMUONPayloadTracker.h"
index 73fa28b..fc6e527 100644 (file)
@@ -715,7 +715,7 @@ void AliMUONRawStreamTrackerHP::AliDecoderEventHandler::OnError(
                detail = Form(
                        "At byte %lu in DDL %d, event %d, iBlock %d, iDsp %d [DSP ID: %d (0x%X)],"
                        " iBus %d [bus patch ID: %d (0x%X)].",
-                       (unsigned long)location - (unsigned long)fBufferStart + sizeof(AliRawDataHeader),
+                       (unsigned long)location - (unsigned long)fBufferStart + sizeof(AliRawDataHeaderV3),
                        AliDAQ::DdlID("MUONTRK", fRawStream->GetDDL()),
                        fRawStream->GetReader()->GetEventIndex(),
                        int(fBlockCount)-1,
@@ -852,7 +852,7 @@ void AliMUONRawStreamTrackerHP::AliDecoderEventHandler::OnError(
                        message = Form(
                                "%s (At byte %lu)",
                                ErrorCodeToMessage(error),
-                               (unsigned long)location - (unsigned long)fBufferStart + sizeof(AliRawDataHeader)
+                               (unsigned long)location - (unsigned long)fBufferStart + sizeof(AliRawDataHeaderV3)
                        );
                        break;
                case kHighErrorDetail:
index 171156e..473719a 100644 (file)
@@ -232,7 +232,15 @@ Bool_t AliMUONRawStreamTrigger::GetNextDDL()
   
   Int_t totalDataWord  = GetReader()->GetDataSize(); // in bytes
   
-  Bool_t scalerEvent =  GetReader()->GetDataHeader()->GetL1TriggerMessage() & 0x1;
+  AliRawReader * reader = GetReader();
+  if (!reader) return kFALSE;
+
+  const AliRawDataHeader * cdh = reader->GetDataHeader();
+  const AliRawDataHeaderV3 * cdh3 = reader->GetDataHeaderV3();
+
+  if (!cdh && !cdh3) return kFALSE;
+
+  Bool_t scalerEvent = ((cdh ?  cdh->GetL1TriggerMessage() : cdh3->GetL1TriggerMessage()) & 0x1) == 0x1;
 
   AliDebug(3, Form("DDL Number %d totalDataWord %d\n", fCurrentDDLIndex,
                    totalDataWord));
@@ -377,7 +385,15 @@ Bool_t AliMUONRawStreamTrigger::NextDDL()
 
   Int_t totalDataWord = GetReader()->GetDataSize(); // in bytes
 
-  Bool_t scalerEvent =  GetReader()->GetDataHeader() && GetReader()->GetDataHeader()->GetL1TriggerMessage() & 0x1;
+  AliRawReader * reader = GetReader();
+  if (!reader) return kFALSE;
+
+  const AliRawDataHeader * cdh = reader->GetDataHeader();
+  const AliRawDataHeaderV3 * cdh3 = reader->GetDataHeaderV3();
+
+  if (!cdh && !cdh3) return kFALSE;
+
+  Bool_t scalerEvent = ((cdh ?  cdh->GetL1TriggerMessage() : cdh3->GetL1TriggerMessage()) & 0x1) == 0x1;
 
 
   UInt_t *buffer = new UInt_t[totalDataWord/4];
index aa9b12a..f8219be 100644 (file)
@@ -242,7 +242,15 @@ Bool_t AliMUONRawStreamTriggerHP::NextDDL()
                // use AliMUONRawStreamTriggerHP::GetDDL()
        
        // Check if this is a scalar event.
-       bool scalerEvent = (GetReader()->GetDataHeader()->GetL1TriggerMessage() & 0x1) == 0x1;
+       AliRawReader * reader = GetReader();
+       if (!reader) return kFALSE;
+
+       const AliRawDataHeader * cdh = reader->GetDataHeader();
+       const AliRawDataHeaderV3 * cdh3 = reader->GetDataHeaderV3();
+
+       if (!cdh && !cdh3) return kFALSE;
+
+       bool scalerEvent = ((cdh ?  cdh->GetL1TriggerMessage() : cdh3->GetL1TriggerMessage()) & 0x1) == 0x1;
        
        bool result = false;
        try
@@ -728,7 +736,7 @@ void AliMUONRawStreamTriggerHP::AliDecoderEventHandler::OnError(
                message = Form(
                        "%s (At byte %lu in DDL.)",
                        ErrorCodeToMessage(error),
-                       (unsigned long)location - (unsigned long)fBufferStart + sizeof(AliRawDataHeader)
+                       (unsigned long)location - (unsigned long)fBufferStart + sizeof(AliRawDataHeaderV3)
                );
                fRawStream->GetReader()->AddMajorErrorLog(error, message);
                break;
index d783d44..7f378cd 100644 (file)
@@ -431,7 +431,7 @@ AliMUONRawWriter::WriteTrackerDDL(AliMpExMap& busPatchMap, Int_t iDDL)
   // total length in bytes
   // DDL header
 
-  Int_t headerSize = sizeof(AliRawDataHeader)/4;
+  Int_t headerSize = sizeof(AliRawDataHeaderV3)/4;
   
   fHeader->fSize = (totalDDLLength + headerSize) * 4;
   
@@ -465,7 +465,7 @@ Int_t AliMUONRawWriter::WriteTriggerDDL(const AliMUONVTriggerStore& triggerStore
  // DDL event one per half chamber
 
  // DDL header size
-  Int_t headerSize = sizeof(AliRawDataHeader)/4;
+  Int_t headerSize = sizeof(AliRawDataHeaderV3)/4;
 
   // global trigger for trigger pattern
   AliMUONGlobalTrigger* gloTrg = triggerStore.Global();
index ae4bd54..79e7d7b 100644 (file)
@@ -603,13 +603,19 @@ void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
     Int_t countAllBoards = 0;
 
     Bool_t containTriggerData = kFALSE;
-  Bool_t hasReadoutErrors = kFALSE;
+    Bool_t hasReadoutErrors = kFALSE;
     AliMUONRawStreamTriggerHP rawStreamTrig(rawReader);
     while (rawStreamTrig.NextDDL()) 
       {
        containTriggerData = kTRUE;
 
-        Bool_t scalerEvent =  rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1;
+       const AliRawDataHeader * cdh = rawReader->GetDataHeader();
+       const AliRawDataHeaderV3 * cdh3 = rawReader->GetDataHeaderV3();
+       
+       if (!cdh && !cdh3) continue;
+
+       Bool_t scalerEvent = ((cdh ?  cdh->GetL1TriggerMessage() : cdh3->GetL1TriggerMessage()) & 0x1) == 0x1;
+
         if ( scalerEvent ) AliDebug(1,Form("Scaler event: evtSpecie recoParam %s  QA %s\n",
                                            AliRecoParam::GetEventSpecieName(AliRecoParam::Convert(GetRecoParam()->GetEventSpecie())),
                                            AliRecoParam::GetEventSpecieName(CurrentEventSpecie())));
index 35e3ce1..e31ceb4 100644 (file)
@@ -40,7 +40,8 @@
 #include <AliRawEquipmentHeader.h>
 #include <AliTPCRawStreamV3.h>
 #include <TCanvas.h>
-
+#include <AliRawDataHeader.h>
+#include <AliRawDataHeaderV3.h>
 
 /**    @brief Consturctor of Altro Class
  *
@@ -1317,10 +1318,15 @@ void AliTPCAltroEmulator::RunEmulationOnRAWdata(AliRawReader *reader, Int_t plot
       UInt_t  *trailerDDL =fTrailers+ddlID*9         ;
       
       // CDH 
-      for (Int_t i=0;i<8;++i)
+      const AliRawDataHeader * cdh = fReader->GetDataHeader();
+      const AliRawDataHeaderV3 * cdhV3 = fReader->GetDataHeaderV3();
+      for (Int_t i=0;i<8;++i) {
        // just to show how ugly it is...
-       cdhDDL[i]=reinterpret_cast<UInt_t*>(const_cast<AliRawDataHeader*>(fReader->GetDataHeader()))[i]; 
-      
+       if (cdh)
+         cdhDDL[i]=reinterpret_cast<UInt_t*>(const_cast<AliRawDataHeader*>(cdh))[i]; 
+       if (cdhV3)
+         cdhDDL[i]=reinterpret_cast<UInt_t*>(const_cast<AliRawDataHeaderV3*>(cdhV3))[i]; 
+      }
       // PAYLOAD
       while (fDecoder->NextChannel()) {
        Int_t hwaddr=fDecoder->GetHWAddress();
index 19e396c..ba0c166 100644 (file)
@@ -268,15 +268,16 @@ void AliZDCRawStream::ReadCDHHeader()
 {
   // Reading CDH 
   const AliRawDataHeader* header = fRawReader->GetDataHeader();
-  if(!header) {
+  const AliRawDataHeaderV3* headerV3 = fRawReader->GetDataHeaderV3();
+  if(!header && !headerV3) {
       AliError(" No CDH in raw data streaming");
       fRawReader->AddMajorErrorLog(kCDHError);
       return;
   }
-  else{
+
     //printf("\t AliZDCRawStream::ReadCDHHeader -> Data Size = %x\n",fRawReader->GetDataSize());
 
-    UChar_t message = header->GetAttributes();
+  UChar_t message = header ? header->GetAttributes() : headerV3->GetAttributes();
     //printf("\t AliZDCRawStream::ReadCDHHeader -> Attributes %x\n",message);
     
     if((message & 0xf0) == 0x0){ // PHYSICS RUN
@@ -315,9 +316,8 @@ void AliZDCRawStream::ReadCDHHeader()
        //AliInfo("\t ZDC readout card used: ZRC");
     }
 
-    if(header->GetL1TriggerMessage() & 0x1){ // Calibration bit set in CDH
-      fIsCalib = kTRUE;
-    }
+    fIsCalib = (header ? header->GetL1TriggerMessage() : headerV3->GetL1TriggerMessage()) & 0x1;
+
     //printf("\t AliZDCRawStream::ReadCDHHeader -> L1TriggerMessage %x\n",header->GetL1TriggerMessage());
     //printf("\t AliZDCRawStream::ReadCDHHeader -> Calibration bit = %d\n",fIsCalib);    
     
@@ -367,7 +367,6 @@ void AliZDCRawStream::ReadCDHHeader()
       fRawReader->AddMajorErrorLog(kDARCError);
     }
     */
-  }
   
 }