- for (Int_t iCh = iSt*2; iCh <= iSt*2 + 1; ++iCh) {
-
- muonDigits = fMUONData->Digits(iCh);
-
- nDigits = muonDigits->GetEntriesFast();
-
- // loop over digit
- for (Int_t idig = 0; idig < nDigits; ++idig) {
-
- AliMUONDigit* digit = static_cast<AliMUONDigit*>(muonDigits->UncheckedAt(idig));
-
- charge = digit->ADC();
- if ( charge > kMAXADC )
- {
- // This is most probably an error in the digitizer (which should insure
- // the adc is below kMAXADC), so make it a (non-fatal) error indeed.
- AliError(Form("adc value %d above %x for ch %d . Setting to %x. Digit is:",iCh,
- charge,kMAXADC,kMAXADC));
- StdoutToAliError(digit->Print());
- charge = kMAXADC;
- }
-
- // inverse mapping
- fTimers[kGetBusPatch].Start(kFALSE);
- busPatchId = GetBusPatch(*digit);
- fTimers[kGetBusPatch].Stop();
- if (busPatchId<0) continue;
-
- if ( digit->ManuId() > 0x7FF || digit->ManuId() < 0 ||
- digit->ManuChannel() > 0x3F || digit->ManuChannel() < 0 )
- {
- StdoutToAliError(digit->Print(););
- AliFatal("ManuId,ManuChannel are invalid for the digit above.");
- }
-
- manuId = ( digit->ManuId() & 0x7FF ); // 11 bits
- channelId = ( digit->ManuChannel() & 0x3F ); // 6 bits
-
- //packing word
- word = 0;
- AliBitPacking::PackWord((UInt_t)manuId,word,18,28);
- AliBitPacking::PackWord((UInt_t)channelId,word,12,17);
- AliBitPacking::PackWord((UInt_t)charge,word,0,11);
-
- // parity word
- parity = word & 0x1;
- for (Int_t i = 1; i <= 30; ++i)
- parity ^= ((word >> i) & 0x1);
- AliBitPacking::PackWord((UInt_t)parity,word,31,31);
-
- AliMUONBusStruct* busStruct =
- static_cast<AliMUONBusStruct*>(busPatchMap.GetValue(busPatchId));
-
- if (!busStruct)
- {
- busStruct = new AliMUONBusStruct;
- busStruct->SetDataKey(busStruct->GetDefaultDataKey());
- busStruct->SetBusPatchId(busPatchId);
- busStruct->SetLength(0);
- busPatchMap.Add(busPatchId,busStruct);
- }
-
- // set sub Event
- busStruct->AddData(word);
-
- } // idig
- } // loop over chamber in station
-
- fTimers[kDigitLoop].Stop();