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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // This class provides access to TRD digits in raw data. //
22 // It loops over all TRD digits in the raw data given by the AliRawReader. //
23 // The Next method goes to the next digit. If there are no digits left //
24 // it returns kFALSE. //
25 // Several getters provide information about the current digit. //
27 // Author: C. Lippmann (C.Lippmann@gsi.de) //
29 ///////////////////////////////////////////////////////////////////////////////
32 #include "AliRawReader.h"
33 #include "AliTRDdigitsManager.h"
34 #include "AliTRDdataArrayI.h"
36 #include "AliTRDRawStream.h"
37 #include "AliTRDgeometry.h"
38 #include "AliTRDCommonParam.h"
39 #include "AliTRDcalibDB.h"
41 ClassImp(AliTRDRawStream)
43 //_____________________________________________________________________________
44 AliTRDRawStream::AliTRDRawStream()
100 ,fDigitsManager(NULL)
107 // Default constructor
110 for (Int_t i = 0; i < 540; i++) {
116 //_____________________________________________________________________________
117 AliTRDRawStream::AliTRDRawStream(AliRawReader *rawReader
118 , AliTRDdigitsManager *man
119 , AliTRDdataArrayI *dig)
157 ,fRawReader(rawReader)
183 // Create an object to read TRD raw digits
186 fGeo = new AliTRDgeometry();
188 fRawReader->Select("TRD");
190 for (Int_t i = 0; i < 540; i++) {
196 //_____________________________________________________________________________
197 AliTRDRawStream::AliTRDRawStream(AliRawReader *rawReader)
235 ,fRawReader(rawReader)
253 ,fDigitsManager(NULL)
261 // Create an object to read TRD raw digits
264 fRawReader->Select("TRD");
266 for (Int_t i = 0; i < 540; i++) {
272 //_____________________________________________________________________________
273 AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream)
329 ,fDigitsManager(NULL)
340 AliFatal("Copy constructor not implemented");
344 //_____________________________________________________________________________
345 AliTRDRawStream& AliTRDRawStream::operator = (const AliTRDRawStream&
349 // Assigment operator
352 Fatal("operator =", "assignment operator not implemented");
357 //_____________________________________________________________________________
358 AliTRDRawStream::~AliTRDRawStream()
366 //_____________________________________________________________________________
367 Bool_t AliTRDRawStream::SetRawVersion(Int_t rv)
370 // Set the raw data version
373 if ( rv >= 0 && rv <= 2 ) {
382 //_____________________________________________________________________________
383 Bool_t AliTRDRawStream::Next()
386 // This is Bogdans code for reading raw data (offline use only).
387 // It is used for fRawVersion == 0. This funcyion read the next raw digit.
388 // Returns kFALSE if there is no digit left
391 fPrevDetector = fDetector;
393 fPrevColumn = fColumn;
396 AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
397 if (!calibration) return kFALSE;
399 Int_t timeBins = calibration->GetNumberOfTimeBins();
401 while (fCount >= 0) {
403 while (fCount == 0) { // next detector
406 if (!fRawReader->ReadNextChar(data)) {
410 AliError(Form("wrong flag: %x", data));
415 // read the detector number
416 if (!fRawReader->ReadNextChar(data)) {
417 AliError("Could not read detector number");
422 if (!fRawReader->ReadNextChar(data)) {
423 AliError("Could not read detector number");
427 fDetector += (UInt_t(data) << 8);
429 // read the number of byts
430 if (!fRawReader->ReadNextChar(data)) {
431 AliError("Could not read number of bytes");
436 if (!fRawReader->ReadNextChar(data)) {
437 AliError("Could not read number of bytes");
441 fCount += (UInt_t(data) << 8);
442 if (!fRawReader->ReadNextChar(data)) {
443 AliError("Could not read number of bytes");
447 fCount += (UInt_t(data) << 16);
449 // read the number of active pads
450 if (!fRawReader->ReadNextChar(data)) {
451 AliError("Could not read number of active pads");
456 if (!fRawReader->ReadNextChar(data)) {
457 AliError("Could not read number of active pads");
461 fNPads += (UInt_t(data) << 8);
467 // read the pad row and column number
468 if ((fTime >= timeBins) && (fCount > 2)) {
469 if (!fRawReader->ReadNextChar(data)) {
470 AliError("Could not read row number");
476 if (!fRawReader->ReadNextChar(data)) {
477 AliError("Could not read column number");
486 // read the next data byte
487 if (!fRawReader->ReadNextChar(data)) {
488 AliError("Could not read data");
494 if (data == 0) { // zeros
495 if (!fRawReader->ReadNextChar(data)) {
496 AliError("Could not read time value");
505 fSignal = (UInt_t(data & 0x7F) << 8);
506 if (!fRawReader->ReadNextChar(data)) {
507 AliError("Could not read ADC value");
522 //____________________________________________________________________________
523 Bool_t AliTRDRawStream::ReadAll()
527 // Read all TRD raw data word (32 bits). This is for all fRawVersion > 0.
528 // Return kFALSE if something is not cool
533 AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
535 AliError("Could not get common parameters");
539 AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
541 AliError("Could not get calibration object");
545 UInt_t timeTotal = calibration->GetNumberOfTimeBins();
547 // The number of data words needed for this number of time bins (there
548 // are 3 time bins in one word)
549 UInt_t timeWords = ( timeTotal%3 == 0 ) ? timeTotal/3 : timeTotal/3 + 1;
551 AliDebug(2, Form("Number of Timebins read from CDB: %d", timeTotal));
554 UInt_t tBswitchCtr = 0;
560 fHCHctr1 = fHCHctr2 = 0;
561 fGTUctr1 = fGTUctr2 = -1;
563 AliInfo("Converting TRD raw data to digits ...");
565 while ( 1 ) { // loop over all supermodules
572 // 0) Find first GTU Link Mask and test if we can read data
576 if ( !fRawReader->ReadNextInt( fDataWord ) ) { // This is the standard exit point
577 // Compress also the digits from the last detector
578 if ( fChamberDone[iDET] == 2 ) {
579 //printf("Compressing data for det %d\n", iDET);
580 fDigits->Compress(1,0);
581 fTrack0->Compress(1,0);
582 fTrack1->Compress(1,0);
583 fTrack2->Compress(1,0);
585 AliInfo(Form("Finished processing TRD raw data: Found %d Half-Chambers", fHCHctr2));
588 fDigits = fDigitsManager->GetDigits(iDET+1);
589 fTrack0 = fDigitsManager->GetDictionary(iDET+1,0);
590 fTrack1 = fDigitsManager->GetDictionary(iDET+1,1);
591 fTrack2 = fDigitsManager->GetDictionary(iDET+1,2);
592 fDigits->Allocate(fRowMax,fColMax,timeTotal);
593 fTrack0->Allocate(fRowMax,fColMax,timeTotal);
594 fTrack1->Allocate(fRowMax,fColMax,timeTotal);
595 fTrack2->Allocate(fRowMax,fColMax,timeTotal);
596 fDigits->SetDataUnchecked(0, 0, 0, 50);
597 fTrack0->SetDataUnchecked(0, 0, 0, 0);
598 fTrack1->SetDataUnchecked(0, 0, 0, 0);
599 fTrack2->SetDataUnchecked(0, 0, 0, 0);
600 fDigits->Compress(1,0);
601 fTrack0->Compress(1,0);
602 fTrack1->Compress(1,0);
603 fTrack2->Compress(1,0);
610 // After reading the first word check for size of this data and get Eq. ID
611 if ( wordCtr == 1 ) {
612 datasize = fRawReader->GetDataSize()/4; // Size of this payload is in 32bit words
613 EqID = fRawReader->GetEquipmentId(); // Get Equipment ID
617 if ( (fDataWord & 0xfffff000) == 0xe0000000 ) {
618 fStatus = 1; // GTU link mask found
623 AliError(Form("Equipment %d: First data word is not GTU Link Mask!", EqID));
628 while ( wordCtr < datasize );
631 // loop over all half chambers in one supermodule
633 while ( wordCtr < datasize ) {
636 // 1) Find end_of_tracklet_marker
638 while ( wordCtr < datasize ) {
640 if ( !fRawReader->ReadNextInt( fDataWord ) ) {
641 AliError("Could not read data");
647 if ( (fDataWord & 0xfffff000) == 0xe0000000 ) {
652 // endoftrackletmarker?
653 if ( fDataWord == endoftrackletmarker ) {
654 AliDebug(3, "end-of-tracklet-marker found");
660 AliDebug(3, "Tracklet found");
666 if ( fStatus == 0 ) break;
669 // 2) Look for non-end_of_tracklet_marker
672 while ( wordCtr < datasize ) {
674 if ( !fRawReader->ReadNextInt( fDataWord ) ) {
675 AliError("Could not read data");
679 //printf("Word %d: 0x%08x\n", wordCtr, fDataWord);
681 if ( fDataWord != endoftrackletmarker ) {
688 if ( fStatus == 0 ) break;
691 // 3) This Word must be Half Chamber Header
694 if ( (fDataWord & 0x00000003) == 1 ) { // HC header
696 // If both half chambers of chamber corresponding to previous header
697 // were already processed, we can compress these digits
698 iDET = fGeo->GetDetector(fLAYER, fSTACK, fSM); // !!this is still the previous HC!!!
699 if ( fChamberDone[iDET] == 2 ) {
700 //printf("Compressing data for det %d\n", iDET);
701 fDigits->Compress(1,0);
702 fTrack0->Compress(1,0);
703 fTrack1->Compress(1,0);
704 fTrack2->Compress(1,0);
707 // Read from new HC header the chamber position (fLAYER, fSTACK, fSM)
708 DecodeHCheader(timeTotal); // This is the new header!
709 wordCtr += fHCHWords;
710 iDET = fGeo->GetDetector(fLAYER, fSTACK, fSM);
711 fRowMax = commonParam->GetRowMax(fLAYER,fSTACK,fSM);
712 fColMax = commonParam->GetColMax(fROC);
714 // The container for the digits of this detector
715 fDigits = fDigitsManager->GetDigits(iDET);
716 fTrack0 = fDigitsManager->GetDictionary(iDET,0);
717 fTrack1 = fDigitsManager->GetDictionary(iDET,1);
718 fTrack2 = fDigitsManager->GetDictionary(iDET,2);
720 // Allocate memory if it was not already done
721 if (fDigits->GetNtime() == 0) {
722 //printf("Allocating digits memory for det %d\n", iDET);
723 fDigits->Allocate(fRowMax,fColMax,timeTotal);
724 fTrack0->Allocate(fRowMax,fColMax,timeTotal);
725 fTrack1->Allocate(fRowMax,fColMax,timeTotal);
726 fTrack2->Allocate(fRowMax,fColMax,timeTotal);
731 fChamberDone[iDET]++;
739 while ( wordCtr < datasize ) {
741 if ( !fRawReader->ReadNextInt( fDataWord ) ) {
742 AliError("Could not read data");
746 //printf("Word %d: 0x%08x\n", wordCtr, fDataWord);
748 if( (fDataWord & 0x0000000f) == 0xC ) { // MCM Header
750 if ( fMCM < 0 || fMCM > 15 || fROB < 0 || fROB > 7 ) {
751 AliError("Wrong fMCM or fROB. Skip this data");
754 tBswitch = 3; // For first adc channel we expect: (fDataWord & 3) = 3
756 fADC = fTB = 0; // Reset Counter
757 fStatus = 1; // Now 1 means MCM header is found
761 // End of half-chamber data, finished:
762 if ( fDataWord == endofeventmarker ) {
767 if ( fStatus == 1 ) { // MCM header is set, ADC data is valid.
770 // Found some data. Decode it now:
772 if ( (fDataWord & 0x00000003) != 0x2 && (fDataWord & 0x00000003) != 0x3) {
773 AliError(Form("Data %08x : Data Word ends neither with 11 nor 10", (Int_t)fDataWord));
777 if ( (fDataWord & 0x00000003) != tBswitch ) { // Next ADC channel found
778 //if ( fTB+1 != timeBins ) AliError(Form("Time bins in data (%d) != DB (%d)", fTB+1, timeBins));
779 tBswitch = (tBswitch & 2) | !(tBswitch & 1); // 0x3 <--> 0x2
785 tBswitchCtr++; // Just read one word
787 // We have only timeTotal time bins
788 if ( tBswitchCtr > timeWords ) {
789 AliError(Form("Data is strange. Already found %d words for this ADC channel", (Int_t)tBswitchCtr));
793 // We have only 21 ADC channels.
794 if ( fADC > (Int_t)fGeo->ADCmax()-1 ) {
795 AliError(Form("Data %08x : Data is strange. fADC is already %d", (Int_t)fDataWord, (Int_t)fADC));
799 // There are 18 pads connected to each MCM ADC channels 2...19. The other channels cross to other
800 // MCMs and are good for online tracking in the MCM.
801 if ( fADC > 1 && fADC < (Int_t)fGeo->ADCmax()-1 ) {
804 fCOL = fGeo->GetPadCol(fROB, fMCM, fADC);
806 // We have only 144 Pad Columns
807 if ( fCOL > fColMax-1 || fCOL < 0 ) {
808 AliError(Form("SM%d L%dS%d: Wrong Pad column (%d) fROB=%d, fSIDE=%d, fMCM=%02d", fSM,
809 fLAYER, fSTACK, fCOL, fROB, fSIDE, fMCM ));
812 // Decode 32 bit data words with information from 3 time bins and copy the data
813 fSig[0] = (fDataWord & 0x00000ffc) >> 2;
814 fSig[1] = (fDataWord & 0x003ff000) >> 12;
815 fSig[2] = (fDataWord & 0xffc00000) >> 22;
817 // Print data to screen:
818 AliDebug(5, Form("SM%d L%dS%d: ROB%d MCM=%d ADC=%d (ROW=%d COL=%d): Data %04d %04d %04d\n",
819 fSM, fLAYER, fSTACK, fROB, fMCM, fADC, fROW, fCOL, fSig[0], fSig[1], fSig[2]));
822 if ( fCOL >= 0 && fCOL < fColMax && fROW >= 0 && fROW < fRowMax ) { // A real pad
823 for ( Int_t ctr = 0; ctr < 3; ctr++ ) {
824 if ( fTB+ctr < (Int_t)timeTotal ) {
826 fDigits->SetDataUnchecked(fROW, fCOL, fTB+ctr, fSig[ctr]);
827 fTrack0->SetDataUnchecked(fROW, fCOL, fTB+ctr, 0);
828 fTrack1->SetDataUnchecked(fROW, fCOL, fTB+ctr, 0);
829 fTrack2->SetDataUnchecked(fROW, fCOL, fTB+ctr, 0);
831 fDigits->SetData(fROW, fCOL, fTB+ctr, fSig[ctr]);
832 fTrack0->SetData(fROW, fCOL, fTB+ctr, 0);
833 fTrack1->SetData(fROW, fCOL, fTB+ctr, 0);
834 fTrack2->SetData(fROW, fCOL, fTB+ctr, 0);
852 AliDebug(2, Form("SM%d L%dS%d side %x: Processed %d MCMs.", fSM, fLAYER, fSTACK, fSIDE+10, fMCMHctr2));
854 } // End Half-Chamber loop
856 AliDebug(1, Form("SM%d (Eq %d): Processed %d HC (%d MCMs)", fSM, EqID, fHCHctr1, fMCMHctr1));
858 } // End Super Module loop
860 // Compress also the digits from the last detector
861 if ( fChamberDone[iDET] == 2 ) {
862 //printf("Compressing data for det %d\n", iDET);
863 fDigits->Compress(1,0);
864 fTrack0->Compress(1,0);
865 fTrack1->Compress(1,0);
866 fTrack2->Compress(1,0);
873 //============================================================================
874 // Decoding functions
875 //============================================================================
877 //____________________________________________________________________________
878 void AliTRDRawStream::DecodeHCheader(Int_t timeBins)
881 // Decode a half chamber header
884 if ( (fDataWord >> 31) != 1 ) {
886 if ( fRawVersion == 1 ) {
890 AliError(Form("Mismatch between fRawVersion (%d) and HC header signature", fRawVersion));
897 fRVmajor = (fDataWord >> 24) & 0x7f;
898 fRVminor = (fDataWord >> 17) & 0x7f;
899 if ( fRawVersion != fRVmajor ) {
900 AliError(Form("Mismatch between fRawVersion (%d) and fRVmajor from HC header(%d)"
901 ,fRawVersion,fRVmajor));
903 if (fRawVersion == 2 ) {
904 DecodeHCheaderV2(timeBins);
910 AliError(Form(" Unsupported raw version: %d", fRawVersion));
915 //____________________________________________________________________________
916 void AliTRDRawStream::DecodeHCheaderV1()
920 // Decode the HC header (fRawVersion == 1, SM I Commissioning 06)
923 if ( (fDataWord & 0x3) == 1 ) {
925 fDCS = (fDataWord >> 20);
926 fSM = (fDataWord >> 15) & 0x1f;
927 fLAYER = (fDataWord >> 12) & 0x7;
928 fSTACK = (fDataWord >> 9) & 0x7;
929 fSIDE = (fDataWord >> 8) & 0x1;
931 fROC = fGeo->GetDetectorSec(fLAYER, fSTACK);
933 //AliDebug(3, Form("0x%08x: HC header: dcs=%d; sm=%d; roc=%d; side=%x", fDataWord, fDCS, fSM, fROC, fSIDE+10));
942 AliError(Form("0x%08x: Strange HC header: dcs=%d; sm=%d; layer=%d; stack=%d.",
943 fDataWord, fDCS, fSM, fLAYER, fSTACK));
955 AliError(Form("0x%08x: No HC header when it was expected.", fDataWord));
962 //____________________________________________________________________________
963 void AliTRDRawStream::DecodeHCheaderV2(Int_t timeBins)
966 // Decode the HC header (fRawVersion == 2, Full raw production)
970 if ( (fDataWord & 0x3) == 1 ) {
972 fHCHWords = (fDataWord >> 14) & 0x7;
973 fSM = (fDataWord >> 9) & 0x1f;
974 fLAYER = (fDataWord >> 6) & 0x7;
975 fSTACK = (fDataWord >> 3) & 0x7;
976 fSIDE = (fDataWord >> 2) & 0x1;
978 fROC = fGeo->GetDetectorSec(fLAYER, fSTACK);
980 AliDebug(3, Form("0x%08x: HC header: sm=%d; roc=%d; side=%x", fDataWord, fSM, fROC, fSIDE+10));
990 AliError(Form("0x%08x: Strange HC header: dcs=%d; sm=%d; layer=%d; stack=%d.",
991 fDataWord, fDCS, fSM, fLAYER, fSTACK));
1000 AliError(Form("0x%08x: No HC header when it was expected.", fDataWord));
1004 if ( fHCHWords >= 1 ) {
1005 // read one more word
1006 if ( !fRawReader->ReadNextInt( fDataWord ) ) {
1007 AliError("Could not read data");
1010 if ( (fDataWord & 0x3) == 1 ) {
1012 fBCctr = (fDataWord >> 16);
1013 fPTctr = (fDataWord >> 12) & 0xf;
1014 fPTphase = (fDataWord >> 8) & 0xf;
1015 fTBins = ((fDataWord >> 2) & 0x3f) + 1;
1017 AliDebug(3, Form("0x%08x: HC header 2: BCctr=%d PTctr=%d PTph=%d TB=%d"
1018 , fDataWord, fBCctr, fPTctr, fPTphase, fTBins));
1020 if( fTBins != timeBins ) {
1021 AliError(Form("Mismatch between Number of Time Bins from CDB (%d) and from HC header (%d)"
1022 , timeBins, fTBins));
1030 if ( fHCHWords >= 2 ) {
1031 // read one more word
1032 if ( !fRawReader->ReadNextInt( fDataWord ) ) {
1033 AliError("Could not read data");
1036 if ( (fDataWord & 0x3) == 1 ) {
1038 Not finished. Next to come:
1051 //____________________________________________________________________________
1052 void AliTRDRawStream::DecodeMCMheader()
1058 if ( fRawVersion >= 1 && fRawVersion <= 2 ) {
1059 DecodeMCMheaderV1();
1063 AliError(Form(" Unsupported raw version: %d", fRawVersion));
1068 //____________________________________________________________________________
1069 void AliTRDRawStream::DecodeMCMheaderV1()
1073 // Decode the MCM header
1076 fMCM = (fDataWord & 0xff000000) >> 24;
1077 fEv = (fDataWord & 0x00fffff0) >> 4;
1082 fROW = fGeo->GetPadRow(fROB, fMCM);
1084 AliDebug(4, Form("0x%08x: SM%d L%dS%d. MCM Header: fROB=%d fMCM=%02d fEv=%02d"
1085 , fDataWord, fSM, fLAYER, fSTACK, fROB, fMCM, fEv));
1087 if ( fROB % 2 == 0 && fSIDE == 1 ) {
1088 AliError(Form("SM%d L%dS%d: Mismatch between fROB (%d) and fSIDE (%d): fMCM=%02d"
1089 , fSM, fLAYER, fSTACK, fROB, fSIDE, fMCM ));
1091 if ( fROB % 2 != 0 && fSIDE == 0 ) {
1092 AliError(Form("SM%d L%dS%d: Mismatch between fROB (%d) and fSIDE (%d): fMCM=%02d"
1093 , fSM, fLAYER, fSTACK, fROB, fSIDE, fMCM ));
1095 if ( (fSTACK == 2 && fROW > 11) || (fSTACK != 2 && fROW > 15) || fROW < 0 ) {
1096 AliError(Form("SM%d L%dS%d: Wrong Padrow (%d) fROB=%d, fSIDE=%d, fMCM=%02d"
1097 , fSM, fLAYER, fSTACK, fROW, fROB, fSIDE, fMCM ));
1105 //____________________________________________________________________________
1106 void AliTRDRawStream::DecodeTracklet()
1112 if ( fRawVersion >= 1 && fRawVersion <= 2 ) {
1117 AliError(Form(" Unsupported raw version: %d", fRawVersion));
1122 //____________________________________________________________________________
1123 void AliTRDRawStream::DecodeTrackletV1()
1127 // Decode the Tracklet
1129 // this function is not tested yet on real tracklets
1132 fTracklPID = (fDataWord >> 24) & 0xff;
1133 fTracklPadRow = (fDataWord >> 20) & 0xf; // 0:15
1134 fTracklDefL = (fDataWord >> 13) & 0x7f;
1135 fTracklPadPos = (fDataWord) & 0x1fff;
1137 fTracklPID /= (Float_t)((1<<8) - 1); // 0:1 (steps of 0.39%)
1138 fTracklDefL = (fTracklDefL - ((1<< 7)-1)/2.) * 140.e-4; // -0.889:0.889cm
1139 fTracklPadPos = (fTracklPadPos - ((1<<13)-1)/2.) * 160.e-4; // -65.528:65.528 cm
1141 AliDebug(4, Form("0x%08x: Tracklet found: SM%d L%dS%d side %x: PadRow=%d PadPos=%f DefL=%f PID=%f"
1142 , fDataWord, fSM, fLAYER, fSTACK, fSIDE+10
1143 , fTracklPadRow, fTracklPadPos, fTracklDefL, fTracklPID));
1145 if( (fSTACK == 2) && (fTracklPadRow >= (Int_t) fGeo->RowmaxC0()) ||
1146 (fSTACK != 2) && (fTracklPadRow >= (Int_t) fGeo->RowmaxC1()) ) {
1147 AliError(Form("Strange Row read from Tracklet Word: %d", fTracklPadRow));
1152 //____________________________________________________________________________
1153 void AliTRDRawStream::DecodeGTUlinkMask()
1159 if ( fRawVersion >= 1 && fRawVersion <= 2 ) {
1160 DecodeGTUlinkMaskV1();
1164 AliError(Form(" Unsupported raw version: %d", fRawVersion));
1169 //____________________________________________________________________________
1170 void AliTRDRawStream::DecodeGTUlinkMaskV1()
1174 // Decode the link masks sent by the GTU. These marke the active optical links
1175 // between GTU and Super Module. Up to now only fully active links are found
1176 // (0xfff = 12 active links).
1179 if ( fGTUctr1 == -1 ) fGTUctr2++;
1182 //printf("fGTUctr=%d",fGTUctr);
1183 //printf("fGTUctr1=%d, fGTUctr2=%d",fGTUctr1, fGTUctr2);
1185 if ( (fGTUctr1 >= 0) && (fGTUctr1 < 5) && (fGTUctr2 >= 0) && (fGTUctr2 < 18) ) {
1186 fGTUlinkMask[fGTUctr2][fGTUctr1] = (fDataWord & 0xfff);
1189 for ( Int_t ctr = 0; ctr < 12; ctr++ ) {
1190 if ( IsGTULinkActive(fGTUctr2, ctr/2, fGTUctr1, ctr%2) ) {
1191 AliDebug(3, Form("SM %2d Stack %d: GTU Link %2d is active!", fGTUctr2, fGTUctr1, ctr));