#include "AliMUONBlockHeader.h"
#include "AliMUONDspHeader.h"
+#include <Riostream.h>
+
/// \class AliMUONBlockHeader
/// Block structure for tracker raw data
/// each DDL contains two blocks,
///
if (this == &event) return *this;
+ fDataKey = event.fDataKey;
fTotalLength = event.fTotalLength;
fLength = event.fLength;
fDspId = event.fDspId;
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;;
+
+}
// clear
void Clear(Option_t* opt);
+ // print out
+ void Print(Option_t* /*opt*/) const;
+
private:
// block header
**************************************************************************/
/* $Id$ */
-
+
#include "AliMUONBusStruct.h"
#include "AliLog.h"
-
+#include <Riostream.h>
+#include <string.h>
/// \class AliMUONBusStruct
/// Bus patch structure for tracker raw data
/// In case of resizing the vector
/// the most simplest way to do it
///
- AliInfo("reallocating");
if (size == 0)
fBufSize *= 2;
else
/// clear
/// delete the allocated memory
///
- AliInfo("here");
delete[] fData;
}
//___________________________________________
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 <fLength; ++i)
+ cout << "Data["<< i << "] = " << fData[i] << endl;
+ }
+}
+
+
void ResizeData(Int_t size = 0);
+ void Print(Option_t* opt) const;
+
+
ClassDef(AliMUONBusStruct,3) // MUON DDL Tracker
};
#endif
#include "AliMUONDspHeader.h"
#include "AliMUONBusStruct.h"
+#include <Riostream.h>
/// \class AliMUONDspHeader
/// DSP structure for tracker raw data.
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;
+
+}
// clear
void Clear(Option_t* opt);
+ // print out
+ void Print(Option_t* /*opt*/) const;
+
private:
// Dsp header
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
///
/// \class AliMUONPayloadTracker
/// Decodes rawdata from buffer and stores in TClonesArray.
#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
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
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);
fBusStruct->SetDspId(iDsp);
// check parity
- CheckDataParity();
+ if(!CheckDataParity())
+ AddParityErrBus(fBusStruct->GetBusPatchId());
// copy in TClonesArray
fDDLTracker->AddBusPatch(*fBusStruct, iBlock, iDsp);
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;
/// after each DDL
///
fDDLTracker->GetBlkHeaderArray()->Delete();
+ fGlitchErrors = 0;
+ fParityErrBus.Reset();
+
}
//______________________________________________________
// 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;
}
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);
+}
// Author Christian Finck
#include <TObject.h>
+#include <TArrayI.h>
class AliMUONDDLTracker;
class AliMUONBusStruct;
/// 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);
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
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
#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
}
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);
}
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
}
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
}
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;