-//-------------------------------------------------------------------------------------
-
-void AliTOFDDLRawData::PackWord(UInt_t &BaseWord, UInt_t Word, Int_t StartBit, Int_t StopBit)
-{
- //This method packs a word into the Baseword buffer starting form the "StartBit"
- //and tacking StopBit-StartBit+1 bits
- UInt_t dummyWord,offSet;
- Int_t length;
- UInt_t sum;
- //The BaseWord is being filled with 1 from StartBit to StopBit
- length=StopBit-StartBit+1;
- sum=(UInt_t)TMath::Power(2,length)-1;
-
- if(Word > sum){
- Error("PackWord", "Word to be filled is not within desired length\n"
- "Word:%d Start bit:%d Stop Bit:%d",Word,StartBit,StopBit);
- return;
- }
- offSet=sum;
- offSet<<=StartBit;
- BaseWord=BaseWord|offSet;
-
- //The Word to be filled is shifted to the position StartBit
- //and the remaining Left and Right bits are filled with 1
- sum=(UInt_t)TMath::Power(2,StartBit)-1;
- dummyWord=0xFFFFFFFF<<length;
- dummyWord +=Word;
- dummyWord<<=StartBit;
- dummyWord+=sum;
- BaseWord=BaseWord&dummyWord;
-
- return;
-}
-
-//------------------------------------------------------------------------------------------------
-
-void AliTOFDDLRawData::UnpackWord(UInt_t PackedWord, Int_t StartBit, Int_t StopBit, UInt_t &Word)
-{
- //This method unpacks a words of StopBit-StartBit+1 bits starting from "StopBits"
- UInt_t offSet;
- Int_t length;
- length=StopBit-StartBit+1;
- offSet=(UInt_t)TMath::Power(2,length)-1;
- offSet<<=StartBit;
- Word=PackedWord&offSet;
- Word>>=StartBit;
- return;
-}
-