-void AliPMDDDLRawData::PackWord(UInt_t startbit, UInt_t stopbit,
- UInt_t dataword, UInt_t &packedword)
-{
- UInt_t bitLength = stopbit - startbit + 1;
- UInt_t bitContent = (UInt_t) (TMath::Power(2,bitLength) - 1);
- if(bitContent < dataword)
- {
- cout << " *** ERROR *** bitContent is less than the dataword" << endl;
- return;
- }
- UInt_t packedBits = 0;
- if (packedword != 0)
- packedBits = (UInt_t) (TMath::Log(packedword)/TMath::Log(2));
-
- UInt_t counter;
- if (packedBits <= stopbit)
- {
- counter = 31 - stopbit;
- }
- else
- {
- counter = 31 - packedBits;
- }
- UInt_t dummyword = 0xFFFFFFFF;
- dummyword >>= counter;
- UInt_t lword = dataword << startbit;
- UInt_t nword = lword | packedword;
- packedword = dummyword & nword;
-
-
-}
-//____________________________________________________________________________
-void AliPMDDDLRawData::UnpackWord(UInt_t startbit, UInt_t stopbit,
- UInt_t &dataword, UInt_t packedword)
-{
- UInt_t bitLength = stopbit - startbit + 1;
- UInt_t bitContent = (UInt_t) (TMath::Power(2,bitLength) - 1);
- bitContent <<= startbit;
- dataword = packedword & bitContent;
- dataword >>= startbit;
-
-}
-//____________________________________________________________________________
-