* provided "as is" without express or implied warranty. *
**************************************************************************/
+// $Id$
-///////////////////////////////////////////////////////////////////////////////
-///
+//-----------------------------------------------------------------------------
+/// \class AliMUONPayloadTrigger
/// Class Payload
///
/// Decodes rawdata from buffer and stores in TClonesArray.
///
/// First version implement for Trigger
///
-///////////////////////////////////////////////////////////////////////////////
+/// \author Christian Finck
+//-----------------------------------------------------------------------------
#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
AliMUONPayloadTrigger::AliMUONPayloadTrigger()
: TObject(),
fMaxLoc(16),
fDDLTrigger(new AliMUONDDLTrigger()),
fRegHeader(new AliMUONRegHeader()),
- fLocalStruct(new AliMUONLocalStruct())
+ fLocalStruct(new AliMUONLocalStruct()),
+ fDarcEoWErrors(0),
+ fGlobalEoWErrors(0),
+ fRegEoWErrors(0),
+ fLocalEoWErrors(0)
{
- //
- // create an object to read MUON raw digits
- // Default ctor for monitoring purposes
- //
+ ///
+ /// create an object to read MUON raw digits
+ /// Default ctor for monitoring purposes
+ ///
}
//___________________________________
AliMUONPayloadTrigger::~AliMUONPayloadTrigger()
{
- //
- // clean up
- //
+ ///
+ /// clean up
+ ///
delete fDDLTrigger;
delete fLocalStruct;
delete fRegHeader;
//______________________________________________________
Bool_t AliMUONPayloadTrigger::Decode(UInt_t *buffer)
{
- // decode trigger DDL
- // store only non-empty structures (TrigY ==0)
+ /// decode trigger DDL
+ /// store only notified cards
// reading DDL for trigger
index += darcHeader->GetDarcScalerLength();
}
- 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
+ if (buffer[index++] != darcHeader->GetEndOfDarc()) {
+ AliWarning(Form("Wrong end of Darc word %x instead of %x\n",
+ buffer[index-1], darcHeader->GetEndOfDarc()));
+ fDarcEoWErrors++;
+ }
// 4 words of global board input + Global board output
memcpy(darcHeader->GetGlobalInput(), &buffer[index], (kGlobalHeaderSize)*4);
index += kGlobalHeaderSize;
index += darcHeader->GetGlobalScalerLength();
}
- 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
-
+ if (buffer[index++] != darcHeader->GetEndOfGlobal()) {
+
+ AliWarning(Form("Wrong end of Global word %x instead of %x\n",
+ buffer[index-1], darcHeader->GetEndOfGlobal()));
+ fGlobalEoWErrors++;
+ }
// 8 regional boards
for (Int_t iReg = 0; iReg < fMaxReg; iReg++) { //loop over regeonal card
index += fRegHeader->GetScalerLength();
}
- 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
+ if (buffer[index++] != fRegHeader->GetEndOfReg()) {
+ AliWarning(Form("Wrong end of Reg word %x instead of %x\n",
+ buffer[index-1], fRegHeader->GetEndOfReg()));
+ fRegEoWErrors++;
+ }
// 16 local cards per regional board
for (Int_t iLoc = 0; iLoc < fMaxLoc; iLoc++) { //loop over local card
index += fLocalStruct->GetScalerLength();
}
- 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
-
+ if (buffer[index++] != fLocalStruct->GetEndOfLocal()) {
+
+ AliWarning(Form("Wrong end of local word %x instead of %x\n",
+ buffer[index-1], fLocalStruct->GetEndOfLocal()));
+ fLocalEoWErrors++;
+ }
+ // fill only if card notified
+ if (fLocalStruct->GetData(0) == fLocalStruct->GetDisableWord())
+ continue;
+
fDDLTrigger->AddLocStruct(*fLocalStruct, iReg);
} // local card loop
//______________________________________________________
void AliMUONPayloadTrigger::ResetDDL()
{
- // reseting TClonesArray
- // after each DDL
- //
+ /// reseting TClonesArray
+ /// after each DDL
+ ///
AliMUONDarcHeader* darcHeader = fDDLTrigger->GetDarcHeader();
darcHeader->GetRegHeaderArray()->Delete();
+ fDarcEoWErrors = 0;
+ fGlobalEoWErrors = 0;
+ fRegEoWErrors = 0;
+ fLocalEoWErrors = 0;
}
//______________________________________________________
void AliMUONPayloadTrigger::SetMaxReg(Int_t reg)
{
- // set regional card number
+ /// set regional card number
if (reg > 8) reg = 8;
fMaxReg = reg;
}
//______________________________________________________
void AliMUONPayloadTrigger::SetMaxLoc(Int_t loc)
{
- // set local card number
+ /// set local card number
if (loc > 16) loc = 16;
fMaxLoc = loc;
}