1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 ////////////////////////////////////////////////////////////////////////////
18 // Decoding data from the TRD raw stream //
19 // and translation into ADC values //
21 // Author: J. Klein (jochen.klein@cern.ch) //
23 ////////////////////////////////////////////////////////////////////////////
28 #include "TClonesArray.h"
32 #include "AliRawReader.h"
33 #include "AliTRDdigitsManager.h"
34 #include "AliTRDdigitsParam.h"
35 #include "AliTRDtrapConfig.h"
36 #include "AliTRDarrayADC.h"
37 #include "AliTRDarrayDictionary.h"
38 #include "AliTRDSignalIndex.h"
39 #include "AliTRDtrackletWord.h"
40 #include "AliESDTrdTrack.h"
41 #include "AliTreeLoader.h"
43 #include "AliTRDrawStream.h"
46 #include "AliRunLoader.h"
48 ClassImp(AliTRDrawStream)
50 // some static information
51 const Int_t AliTRDrawStream::fgkMcmOrder[] = {12, 13, 14, 15,
55 const Int_t AliTRDrawStream::fgkRobOrder [] = {0, 1, 2, 3};
56 const Int_t AliTRDrawStream::fgkNlinks = 12;
57 const Int_t AliTRDrawStream::fgkNstacks = 5;
58 const UInt_t AliTRDrawStream::fgkDataEndmarker = 0x00000000;
59 const UInt_t AliTRDrawStream::fgkTrackletEndmarker = 0x10001000;
61 const char* AliTRDrawStream::fgErrorMessages[] = {
63 "Link monitor active",
64 "Pretrigger counter mismatch",
65 "not a TRD equipment (1024-1041)",
66 "Invalid Stack header",
67 "Invalid detector number",
68 "No digits could be retrieved from the digitsmanager",
70 "HC check bits wrong",
71 "Unexpected position in readout stream",
72 "Invalid testpattern mode",
73 "Testpattern mismatch",
74 "Number of timebins changed",
75 "ADC mask inconsistent",
76 "ADC check bits invalid",
78 "Missing expected ADC channels",
82 const Int_t AliTRDrawStream::fgErrorDebugLevel[] = {
103 AliTRDrawStream::ErrorBehav_t AliTRDrawStream::fgErrorBehav[] = {
104 AliTRDrawStream::kTolerate,
105 AliTRDrawStream::kDiscardHC,
106 AliTRDrawStream::kTolerate,
107 AliTRDrawStream::kAbort,
108 AliTRDrawStream::kAbort,
109 AliTRDrawStream::kAbort,
110 AliTRDrawStream::kAbort,
111 AliTRDrawStream::kDiscardHC,
112 AliTRDrawStream::kDiscardHC,
113 AliTRDrawStream::kTolerate,
114 AliTRDrawStream::kTolerate,
115 AliTRDrawStream::kTolerate,
116 AliTRDrawStream::kTolerate,
117 AliTRDrawStream::kTolerate,
118 AliTRDrawStream::kTolerate,
119 AliTRDrawStream::kTolerate,
120 AliTRDrawStream::kTolerate,
121 AliTRDrawStream::kTolerate
124 AliTRDrawStream::AliTRDrawStream(AliRawReader *rawReader) :
126 fStoreError(&AliTRDrawStream::StoreErrorTree),
127 fRawReader(rawReader),
143 fCurrSmuIndexHeaderSize(0),
144 fCurrSmuIndexHeaderVersion(0),
146 fCurrTrackletEnable(0),
148 fCurrStackIndexWord(0x0),
149 fCurrStackHeaderSize(0x0),
150 fCurrStackHeaderVersion(0x0),
152 fCurrCleanCheckout(0x0),
155 fCurrLinkMonitorFlags(0x0),
156 fCurrLinkDataTypeFlags(0x0),
157 fCurrLinkDebugFlags(0x0),
181 // default constructor
183 fCurrStackIndexWord = new UInt_t[fgkNstacks];
184 fCurrStackHeaderSize = new UInt_t[fgkNstacks];
185 fCurrStackHeaderVersion = new UInt_t[fgkNstacks];
186 fCurrLinkMask = new UInt_t[fgkNstacks];
187 fCurrCleanCheckout = new UInt_t[fgkNstacks];
188 fCurrBoardId = new UInt_t[fgkNstacks];
189 fCurrHwRev = new UInt_t[fgkNstacks];
190 fCurrLinkMonitorFlags = new UInt_t[fgkNstacks * fgkNlinks];
191 fCurrLinkDataTypeFlags = new UInt_t[fgkNstacks * fgkNlinks];
192 fCurrLinkDebugFlags = new UInt_t[fgkNstacks * fgkNlinks];
193 for (Int_t i = 0; i < 100; i++)
196 // preparing TClonesArray
197 fTrackletArray = new TClonesArray("AliTRDtrackletWord", 256);
199 // setting up the error tree
200 fErrors = new TTree("errorStats", "Error statistics");
201 fErrors->SetDirectory(0x0);
202 fErrors->Branch("error", &fLastError);
203 fErrors->SetCircular(1000);
204 for (Int_t i = 0; i < 100; i++) {
210 AliTRDrawStream::~AliTRDrawStream()
216 delete [] fCurrStackIndexWord;
217 delete [] fCurrStackHeaderSize;
218 delete [] fCurrStackHeaderVersion;
219 delete [] fCurrLinkMask;
220 delete [] fCurrCleanCheckout;
221 delete [] fCurrBoardId;
222 delete [] fCurrHwRev;
223 delete [] fCurrLinkMonitorFlags;
224 delete [] fCurrLinkDataTypeFlags;
225 delete [] fCurrLinkDebugFlags;
228 Bool_t AliTRDrawStream::ReadEvent(TTree *trackletTree)
230 // read the current event from the raw reader and fill it to the digits manager
233 AliError("No raw reader available");
238 ConnectTracklets(trackletTree);
243 // loop over all DDLs
244 // data starts with GTU payload, i.e. SMU index word
245 UChar_t *buffer = 0x0;
247 while (fRawReader->ReadNextData(buffer)) {
249 fCurrEquipmentId = fRawReader->GetEquipmentId();
250 AliDebug(2, Form("equipment: %i", fCurrEquipmentId));
252 if (fCurrEquipmentId < 1024 || fCurrEquipmentId > 1041) {
253 EquipmentError(kNonTrdEq, "Skipping");
257 // setting the pointer to data and current reading position
258 fPayloadCurr = fPayloadStart = (UInt_t*) (buffer);
259 fPayloadSize = fRawReader->GetDataSize() / sizeof(UInt_t);
260 fStats.fStatsSector[fCurrEquipmentId - 1024].fBytes = fRawReader->GetDataSize();
261 AliDebug(2, Form("Read buffer of size: %i", fRawReader->GetDataSize()));
263 // read SMU index header
264 if (ReadSmHeader() < 0) {
265 AliError(Form("Reading SMU header failed, skipping this DDL %i", fCurrEquipmentId));
269 // read stack index header
270 for (Int_t iStack = 0; iStack < 5; iStack++) {
271 if ((fCurrStackMask & (1 << iStack)) != 0)
272 ReadStackIndexHeader(iStack);
275 for (Int_t iStack = 0; iStack < 5; iStack++) {
277 if ((fCurrStackMask & (1 << fCurrSlot)) == 0)
280 AliDebug(2, Form("Stack %i, Link mask: 0x%02x", fCurrSlot, fCurrLinkMask[fCurrSlot]));
281 for (Int_t iLink = 0; iLink < 12; iLink++) {
283 fCurrHC = fCurrSm * 60 + fCurrSlot * 12 + iLink;
284 if ((fCurrLinkMask[fCurrSlot] & (1 << fCurrLink)) == 0)
288 // check for link monitor error flag
289 if (fCurrLinkMonitorFlags[fCurrSlot*fgkNlinks + fCurrLink] != 0)
290 LinkError(kLinkMonitor);
292 // read the data from one HC
295 // read all data endmarkers
304 Bool_t AliTRDrawStream::NextDDL()
306 // continue reading with the next equipment
311 fCurrEquipmentId = 0;
315 UChar_t *buffer = 0x0;
317 while (fRawReader->ReadNextData(buffer)) {
319 fCurrEquipmentId = fRawReader->GetEquipmentId();
320 AliDebug(2, Form("equipment: %i", fCurrEquipmentId));
322 if (fCurrEquipmentId < 1024 || fCurrEquipmentId > 1041) {
323 EquipmentError(kNonTrdEq, "Skipping");
327 // setting the pointer to data and current reading position
328 fPayloadCurr = fPayloadStart = (UInt_t*) (buffer);
329 fPayloadSize = fRawReader->GetDataSize() / sizeof(UInt_t);
330 AliDebug(2, Form("Read buffer of size: %i", fRawReader->GetDataSize()));
332 // read SMU index header
333 if (ReadSmHeader() < 0) {
334 AliError(Form("Reading SMU header failed, skipping this DDL %i", fCurrEquipmentId));
338 // read stack index header
339 for (Int_t iStack = 0; iStack < 5; iStack++) {
340 if ((fCurrStackMask & (1 << iStack)) != 0) {
341 ReadStackIndexHeader(iStack);
351 Int_t AliTRDrawStream::NextChamber(AliTRDdigitsManager *digMgr, UInt_t ** /* trackletContainer */, UShort_t ** /* errorContainer */)
353 // read the data for the next chamber
354 // in case you only want to read the data of a single chamber
355 // to read all data ReadEvent(...) is recommended
357 fDigitsManager = digMgr;
362 // tracklet output preparation
363 TTree *trklTree = 0x0;
364 AliRunLoader *rl = AliRunLoader::Instance();
365 AliLoader* trdLoader = rl ? rl->GetLoader("TRDLoader") : NULL;
366 AliDataLoader *trklLoader = trdLoader ? trdLoader->GetDataLoader("tracklets") : NULL;
368 AliTreeLoader *trklTreeLoader = (AliTreeLoader*) trklLoader->GetBaseLoader("tracklets-raw");
370 trklTree = trklTreeLoader->Tree();
372 trklTree = trklLoader->Tree();
375 if (fTrackletTree != trklTree)
376 ConnectTracklets(trklTree);
379 AliError("No raw reader available");
383 if (fCurrSlot < 0 || fCurrSlot >= 5) {
390 AliDebug(2, Form("Stack %i, Link %i, mask: 0x%02x", fCurrSlot, fCurrLink, fCurrLinkMask[fCurrSlot]));
391 fCurrHC = (fCurrEquipmentId - 1024) * 60 + fCurrSlot * 12 + fCurrLink;
393 if (fCurrLinkMonitorFlags[fCurrSlot*fgkNlinks + fCurrLink] != 0)
394 LinkError(kLinkMonitor);
396 // read the data from one HC
399 // read all data endmarkers
402 if (fCurrLink % 2 == 0) {
403 // if we just read the A-side HC then also check the B-side
406 if (fCurrLinkMask[fCurrSlot] & (1 << fCurrLink)) {
415 if (fCurrLink > 11) {
419 } while ((fCurrSlot < 5) &&
420 (((fCurrStackMask & (1 << fCurrSlot)) == 0) ||
421 ((fCurrLinkMask[fCurrSlot] & (1 << fCurrLink))) == 0));
423 // return chamber information from HC if it is valid
424 // otherwise return information from link position
425 if (fCurrSm < 0 || fCurrSm > 17 || fCurrStack < 0 || fCurrStack > 4 || fCurrLayer < 0 || fCurrLayer > 5)
426 return ((fCurrEquipmentId-1024) + fCurrSlot * 6 + fCurrLink/2);
428 return (fCurrSm * 30 + fCurrStack * 6 + fCurrLayer);
432 Int_t AliTRDrawStream::ReadSmHeader()
434 // read the SMU index header at the current reading position
435 // and store the information in the corresponding variables
437 if (fPayloadCurr - fPayloadStart >= fPayloadSize - 1) {
438 EquipmentError(kUnknown, "SM Header incomplete");
442 fCurrSmuIndexHeaderSize = ((*fPayloadCurr) >> 16) & 0xffff;
443 fCurrSmuIndexHeaderVersion = ((*fPayloadCurr) >> 12) & 0xf;
444 // fCurrSmuIndexHeaderTrgAvail = ((*fPayloadCurr) >> 9) & 0x1;
445 // fCurrSmuIndexHeaderEvType = ((*fPayloadCurr) >> 7) & 0x3;
446 fCurrTrackEnable = ((*fPayloadCurr) >> 6) & 0x1;
447 fCurrTrackletEnable = ((*fPayloadCurr) >> 5) & 0x1;
448 fCurrStackMask = ((*fPayloadCurr) ) & 0x1f;
450 AliDebug(5, Form("SMU header: size: %i, version: %i, track enable: %i, tracklet enable: %i, stack mask: %2x",
451 fCurrSmuIndexHeaderSize,
452 fCurrSmuIndexHeaderVersion,
457 // decode GTU track words
458 UInt_t trackWord[2] = { 0, 0 };
461 for (UInt_t iWord = 4; iWord < fCurrSmuIndexHeaderSize; iWord++) {
462 if (fPayloadCurr[iWord] == 0x10000000) {
468 ((fPayloadCurr[iWord] & 0xfffff0f0) == 0x13370000)) {
469 AliDebug(1,Form("stack %i: fast trigger word: 0x%08x", stack, fPayloadCurr[iWord]));
472 else if ((idx & 0x1)==0x1) {
473 trackWord[idx&0x1] = fPayloadCurr[iWord];
474 AliDebug(1,Form("track debug word: 0x%08x%08x", trackWord[1], trackWord[0]));
476 // new ((*fTracks)[fTracks->GetEntriesFast()]) AliESDTrdTrack(0, 0, trackWord[0], trackWord[1], fCurrEquipmentId-1024);
479 trackWord[idx&0x1] = fPayloadCurr[iWord];
485 fPayloadCurr += fCurrSmuIndexHeaderSize + 1;
487 return fCurrSmuIndexHeaderSize + 1;
490 Int_t AliTRDrawStream::ReadStackIndexHeader(Int_t stack)
492 // read the stack index header
493 // and store the information in the corresponding variables
495 fCurrStackIndexWord[stack] = *fPayloadCurr;
496 fCurrStackHeaderSize[stack] = (((*fPayloadCurr) >> 16) & 0xffff) + 1;
497 fCurrStackHeaderVersion[stack] = ((*fPayloadCurr) >> 12) & 0xf;
498 fCurrLinkMask[stack] = (*fPayloadCurr) & 0xfff;
500 if (fPayloadCurr - fPayloadStart >= fPayloadSize - (Int_t) fCurrStackHeaderSize[stack]) {
501 StackError(kStackHeaderInvalid, "Stack index header aborted");
505 switch (fCurrStackHeaderVersion[stack]) {
507 if (fCurrStackHeaderSize[stack] < 8) {
508 StackError(kStackHeaderInvalid, "Stack header smaller than expected!");
512 fCurrCleanCheckout[stack] = fPayloadCurr[1] & 0x1;
513 fCurrBoardId[stack] = (fPayloadCurr[1] >> 8) & 0xff;
514 fCurrHwRev[stack] = (fPayloadCurr[1] >> 16) & 0xffff;
516 for (Int_t iLayer = 0; iLayer < 6; iLayer++) {
518 fCurrLinkMonitorFlags [stack*fgkNlinks + iLayer*2] = fPayloadCurr[iLayer+2] & 0xf;
519 fCurrLinkDataTypeFlags [stack*fgkNlinks + iLayer*2] = (fPayloadCurr[iLayer+2] >> 4) & 0x3;
520 fCurrLinkDebugFlags [stack*fgkNlinks + iLayer*2] = (fPayloadCurr[iLayer+2] >> 12) & 0xf;
522 fCurrLinkMonitorFlags [stack*fgkNlinks + iLayer*2 + 1] = (fPayloadCurr[iLayer+2] >> 16) & 0xf;
523 fCurrLinkDataTypeFlags [stack*fgkNlinks + iLayer*2 + 1] = (fPayloadCurr[iLayer+2] >> 20) & 0x3;
524 fCurrLinkDebugFlags [stack*fgkNlinks + iLayer*2 + 1] = (fPayloadCurr[iLayer+2] >> 28) & 0xf;
529 StackError(kStackHeaderInvalid, "Invalid Stack Index Header version %x", fCurrStackHeaderVersion[stack]);
532 fPayloadCurr += fCurrStackHeaderSize[stack];
534 return fCurrStackHeaderSize[stack];
537 Int_t AliTRDrawStream::ReadLinkData()
539 // read the data in one link (one HC) until the data endmarker is reached
540 // returns the number of words read!
543 UInt_t* startPosLink = fPayloadCurr;
545 // printf("----- HC: %i -----\n", fCurrHC);
546 // for (Int_t i = 0; i < 3; i++) {
547 // printf("0x%08x 0x%08x 0x%08x 0x%08x\n",
548 // fPayloadCurr[i*4+0], fPayloadCurr[i*4+1], fPayloadCurr[i*4+2], fPayloadCurr[i*4+3]);
552 new ((*fMarkers)[fMarkers->GetEntriesFast()])
553 AliTRDrawStreamError(-kHCactive, fCurrSm, fCurrStack, fCurrLink);
555 if (fErrorFlags & kDiscardHC)
558 count += ReadTracklets();
559 if (fErrorFlags & kDiscardHC)
562 count += ReadHcHeader();
563 if (fErrorFlags & kDiscardHC)
566 Int_t det = fCurrSm * 30 + fCurrStack * 6 + fCurrLayer;
568 if (det > -1 && det < 540) {
570 if ((fAdcArray = fDigitsManager->GetDigits(det))) {
571 //fAdcArray->Expand();
572 if (fAdcArray->GetNtime() != fCurrNtimebins)
573 fAdcArray->Allocate(16, 144, fCurrNtimebins);
576 LinkError(kNoDigits);
580 fDigitsParam = fDigitsManager->GetDigitsParam();
583 fDigitsParam->SetPretriggerPhase(det, fCurrPtrgPhase);
584 fDigitsParam->SetNTimeBins(det, fCurrNtimebins);
585 fDigitsParam->SetADCbaseline(det, 10);
588 if (fDigitsManager->UsesDictionaries()) {
589 fDigitsManager->GetDictionary(det, 0)->Reset();
590 fDigitsManager->GetDictionary(det, 1)->Reset();
591 fDigitsManager->GetDictionary(det, 2)->Reset();
594 if ((fSignalIndex = fDigitsManager->GetIndexes(det))) {
595 fSignalIndex->SetSM(fCurrSm);
596 fSignalIndex->SetStack(fCurrStack);
597 fSignalIndex->SetLayer(fCurrLayer);
598 fSignalIndex->SetDetNumber(det);
599 if (!fSignalIndex->IsAllocated())
600 fSignalIndex->Allocate(16, 144, fCurrNtimebins);
603 // ----- check which kind of data -----
604 if (fCurrMajor & 0x40) {
605 if ((fCurrMajor & 0x7) == 0x7) {
606 AliDebug(1, "This is a config event");
607 UInt_t *startPos = fPayloadCurr;
608 while (fPayloadCurr - fPayloadStart < fPayloadSize &&
609 *fPayloadCurr != fgkDataEndmarker)
611 count += fPayloadCurr - startPos;
613 // feeding TRAP config
614 AliTRDtrapConfig *trapcfg = AliTRDtrapConfig::Instance();
615 trapcfg->ReadPackedConfig(fCurrHC, startPos, fPayloadCurr - startPos);
618 Int_t tpmode = fCurrMajor & 0x7;
619 AliDebug(1, Form("Checking testpattern (mode %i) data", tpmode));
623 else if (fCurrMajor & 0x20) {
624 AliDebug(1, "This is a zs event");
625 count += ReadZSData();
628 AliDebug(1, "This is a nozs event");
629 count += ReadNonZSData();
633 LinkError(kInvalidDetector, "%i", det);
634 while (fPayloadCurr - fPayloadStart < fPayloadSize &&
635 *fPayloadCurr != fgkDataEndmarker)
639 fStats.fStatsSector[fCurrSm].fStatsHC[fCurrHC%60].fBytes += (fPayloadCurr - startPosLink) * sizeof(UInt_t);
640 fStats.fStatsSector[fCurrSm].fStatsHC[fCurrHC%60].fBytesRead += count * sizeof(UInt_t);
641 fStats.fStatsSector[fCurrSm].fBytesRead += count * sizeof(UInt_t);
642 fStats.fBytesRead += count * sizeof(UInt_t);
647 Int_t AliTRDrawStream::ReadTracklets()
649 // read the tracklets from one HC
651 fTrackletArray->Clear();
653 UInt_t *start = fPayloadCurr;
654 while (*(fPayloadCurr) != fgkTrackletEndmarker &&
655 fPayloadCurr - fPayloadStart < fPayloadSize) {
657 new ((*fTrackletArray)[fTrackletArray->GetEntriesFast()]) AliTRDtrackletWord(*(fPayloadCurr), fCurrHC);
662 if (fTrackletArray->GetEntriesFast() > 0) {
663 AliDebug(1, Form("Found %i tracklets in %i %i %i (ev. %i)", fTrackletArray->GetEntriesFast(),
664 fCurrSm, fCurrSlot, fCurrLink, fRawReader->GetEventIndex()));
665 if (fCurrSm > -1 && fCurrSm < 18) {
666 fStats.fStatsSector[fCurrSm].fStatsHC[fCurrHC%60].fNTracklets += fTrackletArray->GetEntriesFast();
667 fStats.fStatsSector[fCurrSm].fNTracklets += fTrackletArray->GetEntriesFast();
670 fTrackletTree->Fill();
672 for (Int_t iTracklet = 0; iTracklet < fTrackletArray->GetEntriesFast(); iTracklet++) {
673 new ((*fTracklets)[fTracklets->GetEntriesFast()]) AliTRDtrackletWord(*((AliTRDtrackletWord*)(*fTrackletArray)[iTracklet]));
677 // loop over remaining tracklet endmarkers
678 while ((*(fPayloadCurr) == fgkTrackletEndmarker &&
679 fPayloadCurr - fPayloadStart < fPayloadSize))
682 return fPayloadCurr - start;
685 Int_t AliTRDrawStream::ReadHcHeader()
687 // read and parse the HC header of one HC
688 // and store the information in the corresponding variables
690 UInt_t *start = fPayloadCurr;
691 // check not to be at the data endmarker
692 if (*fPayloadCurr == fgkDataEndmarker)
695 fCurrSpecial = (*fPayloadCurr >> 31) & 0x1;
696 fCurrMajor = (*fPayloadCurr >> 24) & 0x7f;
697 fCurrMinor = (*fPayloadCurr >> 17) & 0x7f;
698 fCurrAddHcWords = (*fPayloadCurr >> 14) & 0x7;
699 fCurrSm = (*fPayloadCurr >> 9) & 0x1f;
700 fCurrLayer = (*fPayloadCurr >> 6) & 0x7;
701 fCurrStack = (*fPayloadCurr >> 3) & 0x7;
702 fCurrSide = (*fPayloadCurr >> 2) & 0x1;
703 fCurrCheck = (*fPayloadCurr) & 0x3;
705 if (fCurrSm != (((Int_t) fCurrEquipmentId) - 1024) ||
706 fCurrStack != fCurrSlot ||
707 fCurrLayer != fCurrLink / 2 ||
708 fCurrSide != fCurrLink % 2) {
709 LinkError(kHCmismatch,
710 "HC: %i, %i, %i, %i\n 0x%08x 0x%08x 0x%08x 0x%08x",
711 fCurrSm, fCurrStack, fCurrLayer, fCurrSide,
712 fPayloadCurr[0], fPayloadCurr[1], fPayloadCurr[2], fPayloadCurr[3]);;
714 if (fCurrCheck != 0x1) {
715 LinkError(kHCcheckFailed);
718 if (fCurrAddHcWords > 0) {
719 fCurrNtimebins = (fPayloadCurr[1] >> 26) & 0x3f;
720 fCurrBC = (fPayloadCurr[1] >> 10) & 0xffff;
721 fCurrPtrgCnt = (fPayloadCurr[1] >> 6) & 0xf;
722 fCurrPtrgPhase = (fPayloadCurr[1] >> 2) & 0xf;
725 fPayloadCurr += 1 + fCurrAddHcWords;
727 return (fPayloadCurr - start);
730 Int_t AliTRDrawStream::ReadTPData(Int_t mode)
732 // testing of testpattern 1 to 3 (hardcoded), 0 missing
733 // evcnt checking missing
735 Int_t cpufromchannel[] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3};
740 Int_t channelcount = 0;
742 UInt_t expadcval = 0;
744 Int_t lastmcmpos = -1;
745 Int_t lastrobpos = -1;
747 UInt_t* start = fPayloadCurr;
749 while (*(fPayloadCurr) != fgkDataEndmarker &&
750 fPayloadCurr - fPayloadStart < fPayloadSize - 1) {
752 // ----- Checking MCM Header -----
753 AliDebug(2, Form("MCM header: 0x%08x", *fPayloadCurr));
756 // ----- checking for proper readout order - ROB -----
757 if (GetROBReadoutPos(ROB(*fPayloadCurr) / 2) >= lastrobpos) {
758 lastrobpos = GetROBReadoutPos(ROB(*fPayloadCurr) / 2);
763 fCurrRobPos = ROB(*fPayloadCurr);
765 // ----- checking for proper readout order - MCM -----
766 if (GetMCMReadoutPos(MCM(*fPayloadCurr)) >= (lastmcmpos + 1) % 16) {
767 lastmcmpos = GetMCMReadoutPos(MCM(*fPayloadCurr));
772 fCurrMcmPos = MCM(*fPayloadCurr);
777 evcnt = 0x3f & *fPayloadCurr >> 26;
780 while (channelcount < 21) {
782 if (cpu != cpufromchannel[channelcount]) {
783 cpu = cpufromchannel[channelcount];
784 expadcval = (1 << 9) | (fCurrRobPos << 6) | (fCurrMcmPos << 2) | cpu;
789 if (channelcount % 2 == 0)
796 expword |= expadcval << 2;
797 expadcval = ( (expadcval << 1) | ( ( (expadcval >> 9) ^ (expadcval >> 6) ) & 1) ) & 0x3FF;
798 expword |= expadcval << 12;
799 expadcval = ( (expadcval << 1) | ( ( (expadcval >> 9) ^ (expadcval >> 6) ) & 1) ) & 0x3FF;
800 expword |= expadcval << 22;
801 expadcval = ( (expadcval << 1) | ( ( (expadcval >> 9) ^ (expadcval >> 6) ) & 1) ) & 0x3FF;
803 else if (mode == 2) {
805 expword = ((0x3f & evcnt) << 26) | ((fCurrSm + 1) << 21) | ((fCurrLayer + 1) << 18) |
806 ((fCurrStack + 1) << 15) |
807 (fCurrRobPos << 12) | (fCurrMcmPos << 8) | (cpu << 6) | (wordcount + 1);
809 else if (mode == 3) {
811 expword = ((0xfff & evcnt) << 20) | (fCurrSm << 15) | (fCurrLink/2 << 12) | (fCurrStack << 9) |
812 (fCurrRobPos << 6) | (fCurrMcmPos << 2) | (cpu << 0);
816 LinkError(kTPmodeInvalid, "Just reading");
819 diff = *fPayloadCurr ^ expword;
821 MCMError(kTPmismatch,
822 "Seen 0x%08x, expected 0x%08x, diff: 0x%08x (0x%02x)",
823 *fPayloadCurr, expword, diff, 0xff & (diff | diff >> 8 | diff >> 16 | diff >> 24));;
831 // continue with next MCM
833 return fPayloadCurr - start;
837 Int_t AliTRDrawStream::ReadZSData()
839 // read the zs data from one link from the current reading position
841 UInt_t *start = fPayloadCurr;
844 Int_t mcmcountExp = fCurrStack == 2 ? 48 : 64;
845 Int_t channelcount = 0;
846 Int_t channelcountExp = 0;
847 Int_t channelcountMax = 0;
849 Int_t currentTimebin = 0;
852 Int_t lastmcmpos = -1;
853 Int_t lastrobpos = -1;
855 if (fCurrNtimebins != fNtimebins) {
857 LinkError(kNtimebinsChanged,
858 "No. of timebins changed from %i to %i", fNtimebins, fCurrNtimebins);
859 fNtimebins = fCurrNtimebins;
862 timebins = fNtimebins;
864 while (*(fPayloadCurr) != fgkDataEndmarker &&
865 fPayloadCurr - fPayloadStart < fPayloadSize) {
867 // ----- Checking MCM Header -----
868 AliDebug(2, Form("MCM header: 0x%08x", *fPayloadCurr));
869 UInt_t *startPosMCM = fPayloadCurr;
871 // ----- checking for proper readout order - ROB -----
872 if (GetROBReadoutPos(ROB(*fPayloadCurr) / 2) >= lastrobpos) {
873 lastrobpos = GetROBReadoutPos(ROB(*fPayloadCurr) / 2);
878 fCurrRobPos = ROB(*fPayloadCurr);
880 // ----- checking for proper readout order - MCM -----
881 if (GetMCMReadoutPos(MCM(*fPayloadCurr)) > lastmcmpos) {
882 lastmcmpos = GetMCMReadoutPos(lastmcmpos);
887 fCurrMcmPos = MCM(*fPayloadCurr);
889 if (EvNo(*fPayloadCurr) != evno) {
891 evno = EvNo(*fPayloadCurr);
893 MCMError(kPtrgCntMismatch, "%i <-> %i", evno, EvNo(*fPayloadCurr));
896 Int_t adccoloff = AdcColOffset(*fPayloadCurr);
897 Int_t padcoloff = PadColOffset(*fPayloadCurr);
898 Int_t row = Row(*fPayloadCurr);
901 // ----- Reading ADC channels -----
902 AliDebug(2, Form("ADC mask: 0x%08x", *fPayloadCurr));
904 // ----- analysing the ADC mask -----
906 channelcountExp = GetNActiveChannelsFromMask(*fPayloadCurr);
907 channelcountMax = GetNActiveChannels(*fPayloadCurr);
908 Int_t channelmask = GetActiveChannels(*fPayloadCurr);
909 Int_t channelno = -1;
912 if (channelcountExp != channelcountMax) {
913 if (channelcountExp > channelcountMax) {
914 Int_t temp = channelcountExp;
915 channelcountExp = channelcountMax;
916 channelcountMax = temp;
918 while (channelcountExp < channelcountMax && channelcountExp < 21 &&
919 fPayloadCurr - fPayloadStart < fPayloadSize - 10 * channelcountExp - 1) {
920 MCMError(kAdcMaskInconsistent,
921 "Possible MCM-H: 0x%08x, possible ADC-mask: 0x%08x",
922 *(fPayloadCurr + 10 * channelcountExp),
923 *(fPayloadCurr + 10 * channelcountExp + 1) );
924 if (!CouldBeMCMhdr( *(fPayloadCurr + 10 * channelcountExp)) && !CouldBeADCmask( *(fPayloadCurr + 10 * channelcountExp + 1)))
930 MCMError(kAdcMaskInconsistent,
931 "Inconsistency in no. of active channels: Counter: %i, Mask: %i, chosen: %i!",
932 GetNActiveChannels(fPayloadCurr[-1]), GetNActiveChannelsFromMask(fPayloadCurr[-1]), channelcountExp);
934 AliDebug(2, Form("expecting %i active channels, timebins: %i", channelcountExp, fCurrNtimebins));
936 // ----- reading marked ADC channels -----
937 while (channelcount < channelcountExp && *(fPayloadCurr) != fgkDataEndmarker) {
940 while (channelno < 20 && (channelmask & 1 << channelno) == 0)
943 if (fCurrNtimebins > 30) {
944 currentTimebin = ((*fPayloadCurr >> 2) & 0x3f);
945 timebins = ((*fPayloadCurr >> 8) & 0xf) * 3;
952 AliDebug(2, Form("Now looking %i words", timebins / 3));
953 Int_t adccol = adccoloff - channelno;
954 Int_t padcol = padcoloff - channelno;
955 // if (adccol < 3 || adccol > 165)
956 // AliInfo(Form("writing channel %i of det %3i %i:%2i to adcrow/-col: %i/%i padcol: %i",
957 // channelno, fCurrHC/2, fCurrRobPos, fCurrMcmPos, row, adccol, padcol));
959 while (adcwc < timebins / 3 &&
960 *(fPayloadCurr) != fgkDataEndmarker &&
961 fPayloadCurr - fPayloadStart < fPayloadSize) {
962 int check = 0x3 & *fPayloadCurr;
963 if (channelno % 2 != 0) { // odd channel
964 if (check != 0x2 && channelno < 21) {
965 MCMError(kAdcCheckInvalid,
966 "%i for %2i. ADC word in odd channel %i",
967 check, adcwc+1, channelno);
970 else { // even channel
971 if (check != 0x3 && channelno < 21) {
972 MCMError(kAdcCheckInvalid,
973 "%i for %2i. ADC word in even channel %i",
974 check, adcwc+1, channelno);
978 // filling the actual timebin data
979 int tb2 = 0x3ff & *fPayloadCurr >> 22;
980 int tb1 = 0x3ff & *fPayloadCurr >> 12;
981 int tb0 = 0x3ff & *fPayloadCurr >> 2;
982 if (adcwc != 0 || fCurrNtimebins <= 30)
983 fAdcArray->SetDataByAdcCol(row, adccol, currentTimebin++, tb0);
986 fAdcArray->SetDataByAdcCol(row, adccol, currentTimebin++, tb1);
987 fAdcArray->SetDataByAdcCol(row, adccol, currentTimebin++, tb2);
993 if (adcwc != timebins / 3)
994 MCMError(kAdcDataAbort);
997 if (padcol > 0 && padcol < 144) {
998 fSignalIndex->AddIndexRC(row, padcol);
1004 fStats.fStatsSector[fCurrSm].fStatsHC[fCurrHC%60].fNChannels += channelcount;
1005 fStats.fStatsSector[fCurrSm].fNChannels += channelcount;
1006 if (channelcount != channelcountExp)
1007 MCMError(kAdcChannelsMiss);
1010 fStats.fStatsSector[fCurrSm].fStatsHC[fCurrHC%60].fNMCMs++;
1011 fStats.fStatsSector[fCurrSm].fNMCMs++;
1013 if (IsDumping() && DumpingMCM(fCurrHC/2, fCurrRobPos, fCurrMcmPos)) {
1014 DumpRaw(Form("Event %i: Det %3i ROB %i MCM %2i", fRawReader->GetEventIndex(), fCurrHC/2, fCurrRobPos, fCurrMcmPos),
1015 startPosMCM, fPayloadCurr - startPosMCM);
1018 // continue with next MCM
1021 // check for missing MCMs (if header suppression is inactive)
1022 if (((fCurrMajor & 0x1) == 0) && (mcmcount != mcmcountExp)) {
1023 LinkError(kMissMcmHeaders,
1024 "No. of MCM headers %i not as expected: %i",
1025 mcmcount, mcmcountExp);
1028 return (fPayloadCurr - start);
1031 Int_t AliTRDrawStream::ReadNonZSData()
1033 // read the non-zs data from one link from the current reading position
1035 UInt_t *start = fPayloadCurr;
1038 Int_t mcmcountExp = fCurrStack == 2 ? 48 : 64;
1039 Int_t channelcount = 0;
1040 Int_t channelcountExp = 0;
1042 Int_t currentTimebin = 0;
1045 Int_t lastmcmpos = -1;
1046 Int_t lastrobpos = -1;
1048 if (fCurrNtimebins != fNtimebins) {
1050 LinkError(kNtimebinsChanged,
1051 "No. of timebins changed from %i to %i", fNtimebins, fCurrNtimebins);
1052 fNtimebins = fCurrNtimebins;
1055 timebins = fNtimebins;
1057 while (*(fPayloadCurr) != fgkDataEndmarker &&
1058 fPayloadCurr - fPayloadStart < fPayloadSize - 2) {
1060 // ----- Checking MCM Header -----
1061 AliDebug(2, Form("MCM header: 0x%08x", *fPayloadCurr));
1063 // ----- checking for proper readout order - ROB -----
1064 if (GetROBReadoutPos(ROB(*fPayloadCurr) / 2) >= lastrobpos) {
1065 lastrobpos = GetROBReadoutPos(ROB(*fPayloadCurr) / 2);
1068 ROBError(kPosUnexp);
1070 fCurrRobPos = ROB(*fPayloadCurr);
1072 // ----- checking for proper readout order - MCM -----
1073 if (GetMCMReadoutPos(MCM(*fPayloadCurr)) >= (lastmcmpos + 1) % 16) {
1074 lastmcmpos = GetMCMReadoutPos(*fPayloadCurr);
1077 MCMError(kPosUnexp);
1079 fCurrMcmPos = MCM(*fPayloadCurr);
1081 if (EvNo(*fPayloadCurr) != evno) {
1083 evno = EvNo(*fPayloadCurr);
1085 MCMError(kPtrgCntMismatch, "%i <-> %i", evno, EvNo(*fPayloadCurr));
1090 channelcountExp = 21;
1093 Int_t adccoloff = AdcColOffset(*fPayloadCurr);
1094 Int_t padcoloff = PadColOffset(*fPayloadCurr);
1095 Int_t row = Row(*fPayloadCurr);
1099 // ----- reading marked ADC channels -----
1100 while (channelcount < channelcountExp &&
1101 *(fPayloadCurr) != fgkDataEndmarker) {
1108 AliDebug(2, Form("Now looking %i words", timebins / 3));
1109 Int_t adccol = adccoloff - channelno;
1110 Int_t padcol = padcoloff - channelno;
1111 while (adcwc < timebins / 3 &&
1112 *(fPayloadCurr) != fgkDataEndmarker &&
1113 fPayloadCurr - fPayloadStart < fPayloadSize) {
1114 int check = 0x3 & *fPayloadCurr;
1115 if (channelno % 2 != 0) { // odd channel
1116 if (check != 0x2 && channelno < 21) {
1117 MCMError(kAdcCheckInvalid,
1118 "%i for %2i. ADC word in odd channel %i",
1119 check, adcwc+1, channelno);
1122 else { // even channel
1123 if (check != 0x3 && channelno < 21) {
1124 MCMError(kAdcCheckInvalid,
1125 "%i for %2i. ADC word in even channel %i",
1126 check, adcwc+1, channelno);
1130 // filling the actual timebin data
1131 int tb2 = 0x3ff & *fPayloadCurr >> 22;
1132 int tb1 = 0x3ff & *fPayloadCurr >> 12;
1133 int tb0 = 0x3ff & *fPayloadCurr >> 2;
1134 if (adcwc != 0 || fCurrNtimebins <= 30)
1135 fAdcArray->SetDataByAdcCol(row, adccol, currentTimebin++, tb0);
1138 fAdcArray->SetDataByAdcCol(row, adccol, currentTimebin++, tb1);
1139 fAdcArray->SetDataByAdcCol(row, adccol, currentTimebin++, tb2);
1145 if (adcwc != timebins / 3)
1146 MCMError(kAdcDataAbort);
1149 if (padcol > 0 && padcol < 144) {
1150 fSignalIndex->AddIndexRC(row, padcol);
1156 if (channelcount != channelcountExp)
1157 MCMError(kAdcChannelsMiss);
1159 // continue with next MCM
1162 // check for missing MCMs (if header suppression is inactive)
1163 if (mcmcount != mcmcountExp) {
1164 LinkError(kMissMcmHeaders,
1165 "%i not as expected: %i", mcmcount, mcmcountExp);
1168 return (fPayloadCurr - start);
1171 Int_t AliTRDrawStream::SeekNextLink()
1173 UInt_t *start = fPayloadCurr;
1175 // read until data endmarkers
1176 while (fPayloadCurr - fPayloadStart < fPayloadSize &&
1177 *fPayloadCurr != fgkDataEndmarker)
1180 // read all data endmarkers
1181 while (fPayloadCurr - fPayloadStart < fPayloadSize &&
1182 *fPayloadCurr == fgkDataEndmarker)
1185 return (fPayloadCurr - start);
1188 Bool_t AliTRDrawStream::ConnectTracklets(TTree *trklTree)
1190 fTrackletTree = trklTree;
1194 if (!fTrackletTree->GetBranch("hc"))
1195 fTrackletTree->Branch("hc", &fCurrHC, "hc/I");
1197 fTrackletTree->SetBranchAddress("hc", &fCurrHC);
1199 if (!fTrackletTree->GetBranch("trkl"))
1200 fTrackletTree->Branch("trkl", &fTrackletArray);
1202 fTrackletTree->SetBranchAddress("trkl", &fTrackletArray);
1208 void AliTRDrawStream::EquipmentError(ErrorCode_t err, const char *const msg, ...)
1210 // register error according to error code on equipment level
1211 // and return the corresponding error message
1213 fLastError.fSector = fCurrEquipmentId - 1024;
1214 fLastError.fStack = -1;
1215 fLastError.fLink = -1;
1216 fLastError.fRob = -1;
1217 fLastError.fMcm = -1;
1218 fLastError.fError = err;
1219 (this->*fStoreError)();
1222 if (fgErrorDebugLevel[err] > 10)
1223 AliDebug(fgErrorDebugLevel[err],
1224 Form("Event %6i: Eq. %2d - %s : %s",
1225 fRawReader->GetEventIndex(), fCurrEquipmentId, fgErrorMessages[err],
1226 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1228 AliError(Form("Event %6i: Eq. %2d - %s : %s",
1229 fRawReader->GetEventIndex(), fCurrEquipmentId, fgErrorMessages[err],
1230 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1231 fErrorFlags |= fgErrorBehav[err];
1235 void AliTRDrawStream::StackError(ErrorCode_t err, const char *const msg, ...)
1237 // register error according to error code on stack level
1238 // and return the corresponding error message
1240 fLastError.fSector = fCurrEquipmentId - 1024;
1241 fLastError.fStack = fCurrSlot;
1242 fLastError.fLink = -1;
1243 fLastError.fRob = -1;
1244 fLastError.fMcm = -1;
1245 fLastError.fError = err;
1246 (this->*fStoreError)();
1249 if (fgErrorDebugLevel[err] > 0)
1250 AliDebug(fgErrorDebugLevel[err],
1251 Form("Event %6i: Eq. %2d S %i - %s : %s",
1252 fRawReader->GetEventIndex(), fCurrEquipmentId, fCurrSlot, fgErrorMessages[err],
1253 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1255 AliError(Form("Event %6i: Eq. %2d S %i - %s : %s",
1256 fRawReader->GetEventIndex(), fCurrEquipmentId, fCurrSlot, fgErrorMessages[err],
1257 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1258 fErrorFlags |= fgErrorBehav[err];
1262 void AliTRDrawStream::LinkError(ErrorCode_t err, const char *const msg, ...)
1264 // register error according to error code on link level
1265 // and return the corresponding error message
1267 fLastError.fSector = fCurrEquipmentId - 1024;
1268 fLastError.fStack = fCurrSlot;
1269 fLastError.fLink = fCurrLink;
1270 fLastError.fRob = -1;
1271 fLastError.fMcm = -1;
1272 fLastError.fError = err;
1273 (this->*fStoreError)();
1276 if (fgErrorDebugLevel[err] > 0)
1277 AliDebug(fgErrorDebugLevel[err],
1278 Form("Event %6i: Eq. %2d S %i l %2i - %s : %s",
1279 fRawReader->GetEventIndex(), fCurrEquipmentId, fCurrSlot, fCurrLink, fgErrorMessages[err],
1280 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1282 AliError(Form("Event %6i: Eq. %2d S %i l %2i - %s : %s",
1283 fRawReader->GetEventIndex(), fCurrEquipmentId, fCurrSlot, fCurrLink, fgErrorMessages[err],
1284 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1285 fErrorFlags |= fgErrorBehav[err];
1289 void AliTRDrawStream::ROBError(ErrorCode_t err, const char *const msg, ...)
1291 // register error according to error code on ROB level
1292 // and return the corresponding error message
1294 fLastError.fSector = fCurrEquipmentId - 1024;
1295 fLastError.fStack = fCurrSlot;
1296 fLastError.fLink = fCurrLink;
1297 fLastError.fRob = fCurrRobPos;
1298 fLastError.fMcm = -1;
1299 fLastError.fError = err;
1300 (this->*fStoreError)();
1303 if (fgErrorDebugLevel[err] > 0)
1304 AliDebug(fgErrorDebugLevel[err],
1305 Form("Event %6i: Eq. %2d S %i l %2i ROB %i - %s : %s",
1306 fRawReader->GetEventIndex(), fCurrEquipmentId, fCurrSlot, fCurrLink, fCurrRobPos, fgErrorMessages[err],
1307 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1309 AliError(Form("Event %6i: Eq. %2d S %i l %2i ROB %i - %s : %s",
1310 fRawReader->GetEventIndex(), fCurrEquipmentId, fCurrSlot, fCurrLink, fCurrRobPos, fgErrorMessages[err],
1311 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1312 fErrorFlags |= fgErrorBehav[err];
1316 void AliTRDrawStream::MCMError(ErrorCode_t err, const char *const msg, ...)
1318 // register error according to error code on MCM level
1319 // and return the corresponding error message
1321 fLastError.fSector = fCurrEquipmentId - 1024;
1322 fLastError.fStack = fCurrSlot;
1323 fLastError.fLink = fCurrLink;
1324 fLastError.fRob = fCurrRobPos;
1325 fLastError.fMcm = fCurrMcmPos;
1326 fLastError.fError = err;
1327 (this->*fStoreError)();
1330 if (fgErrorDebugLevel[err] > 0)
1331 AliDebug(fgErrorDebugLevel[err],
1332 Form("Event %6i: Eq. %2d S %i l %2i ROB %i MCM %2i - %s : %s",
1333 fRawReader->GetEventIndex(), fCurrEquipmentId, fCurrSlot, fCurrLink, fCurrRobPos, fCurrMcmPos, fgErrorMessages[err],
1334 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1336 AliError(Form("Event %6i: Eq. %2d S %i l %2i ROB %i MCM %2i - %s : %s",
1337 fRawReader->GetEventIndex(), fCurrEquipmentId, fCurrSlot, fCurrLink, fCurrRobPos, fCurrMcmPos, fgErrorMessages[err],
1338 (va_start(ap, msg), vsprintf(fErrorBuffer, msg, ap), va_end(ap), fErrorBuffer) ));
1339 fErrorFlags |= fgErrorBehav[err];
1342 const char* AliTRDrawStream::GetErrorMessage(ErrorCode_t errCode)
1344 // return the error message for the given error code
1346 if (errCode > 0 && errCode < kLastErrorCode)
1347 return fgErrorMessages[errCode];
1352 void AliTRDrawStream::AliTRDrawStats::ClearStats()
1354 // clear statistics (includes clearing sector-wise statistics)
1357 for (Int_t iSector = 0; iSector < 18; iSector++) {
1358 fStatsSector[iSector].ClearStats();
1363 void AliTRDrawStream::AliTRDrawStats::AliTRDrawStatsSector::ClearStats()
1365 // clear statistics (includes clearing HC-wise statistics)
1373 for (Int_t iHC = 0; iHC < 60; iHC++) {
1374 fStatsHC[iHC].ClearStats();
1378 void AliTRDrawStream::AliTRDrawStats::AliTRDrawStatsSector::AliTRDrawStatsHC::ClearStats()
1389 void AliTRDrawStream::SetDumpMCM(Int_t det, Int_t rob, Int_t mcm, Bool_t dump)
1391 // mark MCM for dumping of raw data
1394 fDumpMCM[fNDumpMCMs++] = (det << 7) | (rob << 4) | mcm;
1398 for (iMCM = 0; iMCM < fNDumpMCMs; iMCM++) {
1399 if (fDumpMCM[iMCM] == ((det << 7) | (rob << 4) | mcm)) {
1404 for ( ; iMCM < fNDumpMCMs; iMCM++) {
1405 fDumpMCM[iMCM] = fDumpMCM[iMCM+1];
1410 Bool_t AliTRDrawStream::DumpingMCM(Int_t det, Int_t rob, Int_t mcm)
1412 // check if MCM data should be dumped
1414 for (Int_t iMCM = 0; iMCM < fNDumpMCMs; iMCM++) {
1415 if (fDumpMCM[iMCM] == ((det << 7) | (rob << 4) | mcm)) {
1422 void AliTRDrawStream::DumpRaw(TString title, UInt_t *start, Int_t length)
1428 for ( ; pos+3 < length; pos += 4) {
1429 title += Form("0x%08x 0x%08x 0x%08x 0x%08x\n",
1430 start[pos+0], start[pos+1], start[pos+2], start[pos+3]);
1432 for ( ; pos < length; pos++) {
1433 title += Form("0x%08x ", start[pos]);
1438 AliTRDrawStream::AliTRDrawStreamError::AliTRDrawStreamError(Int_t error, Int_t sector, Int_t stack, Int_t link, Int_t rob, Int_t mcm) :