#ifndef ALITRDRAWSTREAM_H
#define ALITRDRAWSTREAM_H
-#include "TObject.h"
-#include "TClonesArray.h"
#include "TTree.h"
-
#include "AliLog.h"
+#include "TClonesArray.h"
+class TObject;
class TObjArray;
class TString;
class TBranch;
Bool_t NextDDL();
Int_t NextChamber(AliTRDdigitsManager *digMgr);
Int_t NextChamber(AliTRDdigitsManager *digMgr,
- UInt_t ** /* trackletContainer */, UShort_t ** /* errorContainer */) { AliError("Deprecated, use NextChamber(AliTRDdigitsManger*) instead!"); return NextChamber(digMgr); }
+ UInt_t ** /* trackletContainer */, UShort_t ** /* errorContainer */) { AliError("Deprecated, use NextChamber(AliTRDdigitsManger*) instead!"); return NextChamber(digMgr); }
Bool_t ConnectTracklets(TTree *trklTree);
enum ErrorCode_t {
kUnknown = 0,
kLinkMonitor,
- kPtrgCntMismatch,
+ kEvCntMismatch,
kNonTrdEq,
kStackHeaderInvalid,
kInvalidDetector,
kAdcDataAbort,
kAdcChannelsMiss,
kMissMcmHeaders,
+ kMissTpData,
+ kCRCmismatch,
kLastErrorCode
};
ClassDef(AliTRDrawStats, 1);
};
- AliTRDrawStats fStats; // event statistics, clearing must be done by the user
-
AliTRDrawStats* GetStats() { return &fStats; }
Int_t GetEventSize(Int_t sector) const { return fStats.fStatsSector[sector].fBytes; }
Int_t GetNTracklets(Int_t sector) const { return fStats.fStatsSector[sector].fNTracklets; }
Int_t GetNMCMs(Int_t sector) const { return fStats.fStatsSector[sector].fNMCMs; }
Int_t GetNChannels(Int_t sector) const { return fStats.fStatsSector[sector].fNChannels; }
+ ULong64_t GetTrkFlags(Int_t sector, Int_t stack) const { return fCurrTrkFlags[sector*fgkNstacks + stack]; }
+ UInt_t GetTriggerFlags(Int_t sector) const { return fCurrTrgFlags[sector]; }
+
// raw data dumping
void SetDumpMCM(Int_t det, Int_t rob, Int_t mcm, Bool_t dump = kTRUE);
Bool_t IsDumping() const { return (fNDumpMCMs > 0); }
Bool_t DumpingMCM(Int_t det, Int_t rob, Int_t mcm) const;
- TString DumpRaw(TString title, UInt_t *start, Int_t length, UInt_t endmarker = 0xffffffff);
+ TString DumpRaw(TString title, const UInt_t *start, Int_t length, UInt_t endmarker = 0xffffffff);
TString DumpMcmHeader(TString title, UInt_t word);
TString DumpAdcMask(TString title, UInt_t word);
+ static void SortTracklets(TClonesArray *trklArray, TList &sortedTracklets, Int_t *indices);
+
// temporary: allow to change expected readout order
static void SetMCMReadoutPos(Int_t mcm, Int_t pos) { if (mcm > -1 && mcm < 16) fgMcmOrder[mcm] = pos; }
static void SetROBReadoutPos(Int_t robpair, Int_t pos) { if (robpair > -1 && robpair < 4) fgMcmOrder[robpair] = pos; }
Int_t ReadZSData();
Int_t ReadNonZSData();
+ Int_t SeekNextStack();
Int_t SeekNextLink();
// MCM header decoding
Int_t CouldBeADCmask(UInt_t adcmask) const { return ((0xf & adcmask) == 0xc && (0x3 & adcmask >> 30) == 0x1); }
// error message generation
- void EquipmentError(ErrorCode_t err = kUnknown, const char *const msg = "", ...);
- void StackError (ErrorCode_t err = kUnknown, const char *const msg = "", ...);
- void LinkError (ErrorCode_t err = kUnknown, const char *const msg = "", ...);
- void ROBError (ErrorCode_t err = kUnknown, const char *const msg = "", ...);
- void MCMError (ErrorCode_t err = kUnknown, const char *const msg = "", ...);
+ void EquipmentError(ErrorCode_t err = kUnknown, const char *const msg = " ", ...);
+ void StackError (ErrorCode_t err = kUnknown, const char *const msg = " ", ...);
+ void LinkError (ErrorCode_t err = kUnknown, const char *const msg = " ", ...);
+ void ROBError (ErrorCode_t err = kUnknown, const char *const msg = " ", ...);
+ void MCMError (ErrorCode_t err = kUnknown, const char *const msg = " ", ...);
void StoreErrorTree() { fErrors->Fill(); }
void StoreErrorArray() { new ((*fMarkers)[fMarkers->GetEntriesFast()]) AliTRDrawStreamError(fLastError); }
void ForgetError() { return; }
UInt_t fErrorFlags; // error flags used to steer subsequent reading
char fErrorBuffer[100]; // buffer for error message
+ AliTRDrawStats fStats; // event statistics, clearing must be done by the user
+
UInt_t *fPayloadStart; // pointer to start of data payload
UInt_t *fPayloadCurr; // pointer to current reading position in the payload
Int_t fPayloadSize; // size of the payload (in UInt_t words)
static const Int_t fgkNtriggers; // number of triggers in data stream
static const UInt_t fgkDataEndmarker; // data endmarker
static const UInt_t fgkTrackletEndmarker; // tracklet endmarker
+ static const UInt_t fgkStackEndmarker[]; // stack endmarker (used from version 0xd on)
static Int_t fgMcmOrder []; // expected readout order of the MCMs
static Int_t fgRobOrder []; // expected readout order of the ROBs
UInt_t fCurrTrgHeaderAvail; // current trigger information availability
UInt_t fCurrTrgHeaderReadout; // current readout mode for the trigger headers
UInt_t fCurrTrkHeaderAvail; // current tracking information availability
+ UInt_t fCurrStackEndmarkerAvail; // current stack endmarker availability
UInt_t fCurrEvType; // current event type
UInt_t fCurrTriggerEnable; // current trigger enable
UInt_t fCurrTriggerFired; // current trigger fired
// Tracking header
UInt_t *fCurrTrkHeaderIndexWord; // current tracking header index word
UInt_t *fCurrTrkHeaderSize; // current tracking header index word
+ ULong64_t *fCurrTrkFlags; // current tracking done flags
// Trigger header
UInt_t *fCurrTrgHeaderIndexWord; // current tracking header index word
UInt_t *fCurrTrgHeaderSize; // current tracking header index word
+ UInt_t *fCurrTrgFlags; // current trigger flags of all sectors
// Stack header
UInt_t *fCurrStackIndexWord; // current stack index words
UInt_t *fCurrLinkDataTypeFlags; // current link data flags
UInt_t *fCurrLinkDebugFlags; // current link debug flags
+ // CRC checks from trailer
+ Char_t fCurrMatchFlagsSRAM;
+ Char_t fCurrMatchFlagsPostBP;
+ UInt_t fCurrChecksumStack[5];
+ UInt_t fCurrChecksumSIU;
+
// HC information
Int_t fCurrSpecial; // current value of the special flag
Int_t fCurrMajor; // current major version