From 1ed3c5c28975226f3b095e52855e59918da5285b Mon Sep 17 00:00:00 2001 From: ivana Date: Wed, 21 Mar 2007 10:59:51 +0000 Subject: [PATCH] - Remove pre-compilation option - Add print method - Glitch errors handling - Parity errors per buspatch handling" (Christian) --- MUON/AliMUONBlockHeader.cxx | 21 ++++++++++++ MUON/AliMUONBlockHeader.h | 3 ++ MUON/AliMUONBusStruct.cxx | 27 ++++++++++++--- MUON/AliMUONBusStruct.h | 3 ++ MUON/AliMUONDspHeader.cxx | 20 +++++++++++ MUON/AliMUONDspHeader.h | 3 ++ MUON/AliMUONPayloadTracker.cxx | 62 ++++++++++++++++++++-------------- MUON/AliMUONPayloadTracker.h | 14 +++++++- MUON/AliMUONPayloadTrigger.cxx | 45 ++++++++++-------------- 9 files changed, 140 insertions(+), 58 deletions(-) diff --git a/MUON/AliMUONBlockHeader.cxx b/MUON/AliMUONBlockHeader.cxx index d5adade42bf..094a7fa0bee 100644 --- a/MUON/AliMUONBlockHeader.cxx +++ b/MUON/AliMUONBlockHeader.cxx @@ -18,6 +18,8 @@ #include "AliMUONBlockHeader.h" #include "AliMUONDspHeader.h" +#include + /// \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;; + +} diff --git a/MUON/AliMUONBlockHeader.h b/MUON/AliMUONBlockHeader.h index aa824a353e0..66db24f92c1 100644 --- a/MUON/AliMUONBlockHeader.h +++ b/MUON/AliMUONBlockHeader.h @@ -87,6 +87,9 @@ public: // clear void Clear(Option_t* opt); + // print out + void Print(Option_t* /*opt*/) const; + private: // block header diff --git a/MUON/AliMUONBusStruct.cxx b/MUON/AliMUONBusStruct.cxx index ddeb74dab32..ebc1435a26d 100644 --- a/MUON/AliMUONBusStruct.cxx +++ b/MUON/AliMUONBusStruct.cxx @@ -14,10 +14,11 @@ **************************************************************************/ /* $Id$ */ - + #include "AliMUONBusStruct.h" #include "AliLog.h" - +#include +#include /// \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 /// \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; + +} diff --git a/MUON/AliMUONDspHeader.h b/MUON/AliMUONDspHeader.h index 5063722c766..5148980bdba 100644 --- a/MUON/AliMUONDspHeader.h +++ b/MUON/AliMUONDspHeader.h @@ -93,6 +93,9 @@ public: // clear void Clear(Option_t* opt); + // print out + void Print(Option_t* /*opt*/) const; + private: // Dsp header diff --git a/MUON/AliMUONPayloadTracker.cxx b/MUON/AliMUONPayloadTracker.cxx index 1868c6ed27e..0642c26df95 100644 --- a/MUON/AliMUONPayloadTracker.cxx +++ b/MUON/AliMUONPayloadTracker.cxx @@ -13,7 +13,6 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ - /// /// \class AliMUONPayloadTracker /// Decodes rawdata from buffer and stores in TClonesArray. @@ -23,18 +22,13 @@ #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); +} diff --git a/MUON/AliMUONPayloadTracker.h b/MUON/AliMUONPayloadTracker.h index 3d7ab69be89..bebfef79589 100644 --- a/MUON/AliMUONPayloadTracker.h +++ b/MUON/AliMUONPayloadTracker.h @@ -12,6 +12,7 @@ // Author Christian Finck #include +#include 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 diff --git a/MUON/AliMUONPayloadTrigger.cxx b/MUON/AliMUONPayloadTrigger.cxx index 2d57c95b4f1..5511f46e984 100644 --- a/MUON/AliMUONPayloadTrigger.cxx +++ b/MUON/AliMUONPayloadTrigger.cxx @@ -25,18 +25,13 @@ #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; -- 2.39.3