From e946305455fc7d733d123a61a2953d761a04466d Mon Sep 17 00:00:00 2001 From: hristov Date: Mon, 24 Mar 2014 16:30:45 +0100 Subject: [PATCH] ALIROOT-5420 Changes for CDH v3 --- EMCAL/AliEMCALTriggerRawDigitMaker.cxx | 1 - HMPID/AliHMPIDDigit.cxx | 1 - MUON/AliMUONRawStreamTracker.cxx | 1 - MUON/AliMUONRawStreamTrackerHP.cxx | 4 ++-- MUON/AliMUONRawStreamTrigger.cxx | 20 ++++++++++++++++++-- MUON/AliMUONRawStreamTriggerHP.cxx | 12 ++++++++++-- MUON/AliMUONRawWriter.cxx | 4 ++-- MUON/AliMUONTriggerQADataMakerRec.cxx | 10 ++++++++-- TPC/Util/AliTPCAltroEmulator.cxx | 14 ++++++++++---- ZDC/AliZDCRawStream.cxx | 13 ++++++------- 10 files changed, 56 insertions(+), 24 deletions(-) diff --git a/EMCAL/AliEMCALTriggerRawDigitMaker.cxx b/EMCAL/AliEMCALTriggerRawDigitMaker.cxx index 6f5ba738661..2804a3f3c36 100644 --- a/EMCAL/AliEMCALTriggerRawDigitMaker.cxx +++ b/EMCAL/AliEMCALTriggerRawDigitMaker.cxx @@ -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" diff --git a/HMPID/AliHMPIDDigit.cxx b/HMPID/AliHMPIDDigit.cxx index 712a21798f4..c922cfe6066 100644 --- a/HMPID/AliHMPIDDigit.cxx +++ b/HMPID/AliHMPIDDigit.cxx @@ -17,7 +17,6 @@ #include //WriteRaw() #include //Draw() #include //Draw() -#include //WriteRaw() #include "AliHMPIDParam.h" #include //WriteRaw() #include "Riostream.h" //WriteRaw() diff --git a/MUON/AliMUONRawStreamTracker.cxx b/MUON/AliMUONRawStreamTracker.cxx index 81b78dfdaca..f1c3154d9c4 100644 --- a/MUON/AliMUONRawStreamTracker.cxx +++ b/MUON/AliMUONRawStreamTracker.cxx @@ -35,7 +35,6 @@ #include "AliMUONLogger.h" #include "AliRawReader.h" -#include "AliRawDataHeader.h" #include "AliDAQ.h" #include "AliLog.h" #include "AliMUONPayloadTracker.h" diff --git a/MUON/AliMUONRawStreamTrackerHP.cxx b/MUON/AliMUONRawStreamTrackerHP.cxx index 73fa28b13a5..fc6e5278a7f 100644 --- a/MUON/AliMUONRawStreamTrackerHP.cxx +++ b/MUON/AliMUONRawStreamTrackerHP.cxx @@ -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: diff --git a/MUON/AliMUONRawStreamTrigger.cxx b/MUON/AliMUONRawStreamTrigger.cxx index 171156e1e96..473719a43fc 100644 --- a/MUON/AliMUONRawStreamTrigger.cxx +++ b/MUON/AliMUONRawStreamTrigger.cxx @@ -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]; diff --git a/MUON/AliMUONRawStreamTriggerHP.cxx b/MUON/AliMUONRawStreamTriggerHP.cxx index aa9b12a2f46..f8219be320f 100644 --- a/MUON/AliMUONRawStreamTriggerHP.cxx +++ b/MUON/AliMUONRawStreamTriggerHP.cxx @@ -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; diff --git a/MUON/AliMUONRawWriter.cxx b/MUON/AliMUONRawWriter.cxx index d783d441343..7f378cdc570 100644 --- a/MUON/AliMUONRawWriter.cxx +++ b/MUON/AliMUONRawWriter.cxx @@ -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(); diff --git a/MUON/AliMUONTriggerQADataMakerRec.cxx b/MUON/AliMUONTriggerQADataMakerRec.cxx index ae4bd54b6b2..79e7d7b4d2f 100644 --- a/MUON/AliMUONTriggerQADataMakerRec.cxx +++ b/MUON/AliMUONTriggerQADataMakerRec.cxx @@ -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()))); diff --git a/TPC/Util/AliTPCAltroEmulator.cxx b/TPC/Util/AliTPCAltroEmulator.cxx index 35e3ce1fd2a..e31ceb42580 100644 --- a/TPC/Util/AliTPCAltroEmulator.cxx +++ b/TPC/Util/AliTPCAltroEmulator.cxx @@ -40,7 +40,8 @@ #include #include #include - +#include +#include /** @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(const_cast(fReader->GetDataHeader()))[i]; - + if (cdh) + cdhDDL[i]=reinterpret_cast(const_cast(cdh))[i]; + if (cdhV3) + cdhDDL[i]=reinterpret_cast(const_cast(cdhV3))[i]; + } // PAYLOAD while (fDecoder->NextChannel()) { Int_t hwaddr=fDecoder->GetHWAddress(); diff --git a/ZDC/AliZDCRawStream.cxx b/ZDC/AliZDCRawStream.cxx index 19e396c22f3..ba0c1666504 100644 --- a/ZDC/AliZDCRawStream.cxx +++ b/ZDC/AliZDCRawStream.cxx @@ -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); } */ - } } -- 2.43.5