// @(#)root/cont:$Id$
// Author: Philippe Canal 05/02/2001
//    Feb  5 2001: Creation
//    Feb  6 2001: Changed all int to unsigned int.

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TBits                                                                //
//                                                                      //
// Container of bits                                                    //
//                                                                      //
// This class provides a simple container of bits.                      //
// Each bit can be set and tested via the functions SetBitNumber and    //
// TestBitNumber.                                             .         //
// The default value of all bits is kFALSE.                             //
// The size of the container is automatically extended when a bit       //
// number is either set or tested.  To reduce the memory size of the    //
// container use the Compact function, this will discard the memory     //
// occupied by the upper bits that are 0.                               //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TBits.h"
#include "string.h"
#include "Riostream.h"

ClassImp(TBits)

//______________________________________________________________________________
TBits::TBits(UInt_t nbits) : fNbits(nbits)
{
   // TBits constructor.  All bits set to 0

   if (nbits <= 0) nbits = 8;
   fNbytes  = ((nbits-1)/8) + 1;
   fAllBits = new UChar_t[fNbytes];
   // this is redundant only with libNew
   memset(fAllBits,0,fNbytes);
}

//______________________________________________________________________________
TBits::TBits(const TBits &original) : TObject(original), fNbits(original.fNbits),
   fNbytes(original.fNbytes)
{
   // TBits copy constructor

   fAllBits = new UChar_t[fNbytes];
   memcpy(fAllBits,original.fAllBits,fNbytes);

}

//______________________________________________________________________________
TBits& TBits::operator=(const TBits& rhs)
{
   // TBits assignment operator

   if (this != &rhs) {
      TObject::operator=(rhs);
      fNbits   = rhs.fNbits;
      fNbytes  = rhs.fNbytes;
      delete [] fAllBits;
      if (fNbytes != 0) {
         fAllBits = new UChar_t[fNbytes];
         memcpy(fAllBits,rhs.fAllBits,fNbytes);
      } else {
         fAllBits = 0;
      }
   }
   return *this;
}

//______________________________________________________________________________
TBits::~TBits()
{
   // TBits destructor

   delete [] fAllBits;
}

//______________________________________________________________________________
void TBits::Clear(Option_t * /*option*/)
{
   // Clear the value.

   delete [] fAllBits;
   fAllBits = 0;
   fNbits   = 0;
   fNbytes  = 0;
}

//______________________________________________________________________________
void TBits::Compact()
{
   // Reduce the storage used by the object to a minimun

   if (!fNbits || !fAllBits) return;
   UInt_t needed;
   for(needed=fNbytes-1;
       needed > 0 && fAllBits[needed]==0; ) { needed--; };
   needed++;

   if (needed!=fNbytes) {
      UChar_t *old_location = fAllBits;
      fAllBits = new UChar_t[needed];

      memcpy(fAllBits,old_location,needed);
      delete [] old_location;

      fNbytes = needed;
      fNbits = 8*fNbytes;
   }
}

//______________________________________________________________________________
UInt_t TBits::CountBits(UInt_t startBit) const
{
   // Return number of bits set to 1 starting at bit startBit

   static const Int_t nbits[256] = {
             0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,
             1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
             1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
             2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
             1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
             2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
             2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
             3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
             1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
             2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
             2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
             3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
             2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
             3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
             3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
             4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8};

   UInt_t i,count = 0;
   if (startBit == 0) {
      for(i=0; i<fNbytes; i++) {
         count += nbits[fAllBits[i]];
      }
      return count;
   }
   if (startBit >= fNbits) return count;
   UInt_t startByte = startBit/8;
   UInt_t ibit = startBit%8;
   if (ibit) {
      for (i=ibit;i<8;i++) {
         if (fAllBits[startByte] & (1<<ibit)) count++;
      }
      startByte++;
   }
   for(i=startByte; i<fNbytes; i++) {
      count += nbits[fAllBits[i]];
   }
   return count;
}

//______________________________________________________________________________
void TBits::DoAndEqual(const TBits& rhs)
{
   // Execute (*this) &= rhs;
   // Extra bits in rhs are ignored
   // Missing bits in rhs are assumed to be zero.

   UInt_t min = (fNbytes<rhs.fNbytes) ? fNbytes : rhs.fNbytes;
   for(UInt_t i=0; i<min; ++i) {
      fAllBits[i] &= rhs.fAllBits[i];
   }
   if (fNbytes>min) {
      memset(&(fAllBits[min]),0,fNbytes-min);
   }
}

//______________________________________________________________________________
void TBits::DoOrEqual(const TBits& rhs)
{
   // Execute (*this) &= rhs;
   // Extra bits in rhs are ignored
   // Missing bits in rhs are assumed to be zero.

   UInt_t min = (fNbytes<rhs.fNbytes) ? fNbytes : rhs.fNbytes;
   for(UInt_t i=0; i<min; ++i) {
      fAllBits[i] |= rhs.fAllBits[i];
   }
}

//______________________________________________________________________________
void TBits::DoXorEqual(const TBits& rhs)
{
   // Execute (*this) ^= rhs;
   // Extra bits in rhs are ignored
   // Missing bits in rhs are assumed to be zero.

   UInt_t min = (fNbytes<rhs.fNbytes) ? fNbytes : rhs.fNbytes;
   for(UInt_t i=0; i<min; ++i) {
      fAllBits[i] ^= rhs.fAllBits[i];
   }
}

//______________________________________________________________________________
void TBits::DoFlip()
{
   // Execute ~(*this)

   for(UInt_t i=0; i<fNbytes; ++i) {
      fAllBits[i] = ~fAllBits[i];
   }
   // NOTE: out-of-bounds bit were also flipped!
}

//______________________________________________________________________________
void TBits::DoLeftShift(UInt_t shift)
{
   // Execute the left shift operation.

   if (shift==0) return;
   const UInt_t wordshift = shift / 8;
   const UInt_t offset = shift % 8;
   if (offset==0) {
      for(UInt_t n = fNbytes - 1; n >= wordshift; --n) {
         fAllBits[n] = fAllBits[ n - wordshift ];
      }
   } else {
      const UInt_t sub_offset = 8 - offset;
      for(UInt_t n = fNbytes - 1; n > wordshift; --n) {
         fAllBits[n] = (fAllBits[n - wordshift] << offset) |
                       (fAllBits[n - wordshift - 1] >> sub_offset);
      }
      fAllBits[wordshift] = fAllBits[0] << offset;
   }
   memset(fAllBits,0,wordshift);
}

//______________________________________________________________________________
void TBits::DoRightShift(UInt_t shift)
{
   // Execute the left shift operation.

   if (shift==0) return;
   const UInt_t wordshift = shift / 8;
   const UInt_t offset = shift % 8;
   const UInt_t limit = fNbytes - wordshift - 1;

   if (offset == 0)
      for (UInt_t n = 0; n <= limit; ++n)
         fAllBits[n] = fAllBits[n + wordshift];
   else
   {
      const UInt_t sub_offset = 8 - offset;
      for (UInt_t n = 0; n < limit; ++n)
         fAllBits[n] = (fAllBits[n + wordshift] >> offset) |
                       (fAllBits[n + wordshift + 1] << sub_offset);
      fAllBits[limit] = fAllBits[fNbytes-1] >> offset;
   }

   memset(&(fAllBits[limit + 1]),0, fNbytes - limit - 1);
}

//______________________________________________________________________________
UInt_t TBits::FirstNullBit(UInt_t startBit) const
{
   // Return position of first null bit (starting from position 0 and up)

   static const Int_t fbits[256] = {
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,
             0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,8};

   UInt_t i;
   if (startBit == 0) {
      for(i=0; i<fNbytes; i++) {
         if (fAllBits[i] != 255) return 8*i + fbits[fAllBits[i]];
      }
      return fNbits;
   }
   if (startBit >= fNbits) return fNbits;
   UInt_t startByte = startBit/8;
   UInt_t ibit = startBit%8;
   if (ibit) {
      for (i=ibit;i<8;i++) {
         if ((fAllBits[startByte] & (1<<i)) == 0) return 8*startByte+i;
      }
      startByte++;
   }
   for(i=startByte; i<fNbytes; i++) {
      if (fAllBits[i] != 255) return 8*i + fbits[fAllBits[i]];
   }
   return fNbits;
}

//______________________________________________________________________________
UInt_t TBits::LastNullBit(UInt_t startBit) const
{
   // Return position of first null bit (starting from position 0 and up)

   static const Int_t fbits[256] = {
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
             5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
             5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
             4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
             3,3,3,3,3,3,3,3,2,2,2,2,1,1,0,8};

   UInt_t i;
   if (startBit>=fNbits) startBit = fNbits-1;
   UInt_t startByte = startBit/8;
   UInt_t ibit = startBit%8;
   if (ibit<7) {
      for (i=ibit+1;i>0;i--) {
         if ((fAllBits[startByte] & (1<<(i-1))) == 0) return 8*startByte+i-1;
      }
      startByte--;
   }
   for(i=startByte+1; i>0; i--) {
      if (fAllBits[i-1] != 255) return 8*(i-1) + fbits[fAllBits[i-1]];
   }
   return fNbits;
}

//______________________________________________________________________________
UInt_t TBits::FirstSetBit(UInt_t startBit) const
{
   // Return position of first non null bit (starting from position 0 and up)

   static const Int_t fbits[256] = {
             8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,
             4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0};

   UInt_t i;
   if (startBit == 0) {
      for(i=0; i<fNbytes; i++) {
         if (fAllBits[i] != 0) return 8*i + fbits[fAllBits[i]];
      }
      return fNbits;
   }
   if (startBit >= fNbits) return fNbits;
   UInt_t startByte = startBit/8;
   UInt_t ibit = startBit%8;
   if (ibit) {
      for (i=ibit;i<8;i++) {
         if ((fAllBits[startByte] & (1<<i)) != 0) return 8*startByte+i;
      }
      startByte++;
   }
   for(i=startByte; i<fNbytes; i++) {
      if (fAllBits[i] != 0) return 8*i + fbits[fAllBits[i]];
   }
   return fNbits;
}

//______________________________________________________________________________
UInt_t TBits::LastSetBit(UInt_t startBit) const
{
   // Return position of first non null bit (starting from position 0 and up)

   static const Int_t fbits[256] = {
             8,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
             4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
             5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
             5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
             6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
             7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7};

   UInt_t i;
   if (startBit>=fNbits) startBit = fNbits-1;
   UInt_t startByte = startBit/8;
   UInt_t ibit = startBit%8;
   if (ibit<7) {
      for (i=ibit+1;i>0;i--) {
         if ((fAllBits[startByte] & (1<<(i-1))) != 0) return 8*startByte+i-1;
      }
      startByte--;
   }
   for(i=startByte+1; i>0; i--) {
      if (fAllBits[i-1] != 0) return 8*(i-1) + fbits[fAllBits[i-1]];
   }
   return fNbits;
}

//______________________________________________________________________________
void TBits::Output(std::ostream &os) const
{
   // Print the value to the std::ostream

   for(UInt_t i=0; i<fNbytes; ++i) {
      UChar_t val = fAllBits[fNbytes - 1 - i];
      for (UInt_t j=0; j<8; ++j) {
         os << (Bool_t)(val&0x80);
         val <<= 1;
      }
   }
}

//______________________________________________________________________________
void TBits::Paint(Option_t *)
{
   // Once implemented, it will draw the bit field as an histogram.
   // use the TVirtualPainter as the usual trick

}

//______________________________________________________________________________
void TBits::Print(Option_t *) const
{
   // Print the list of active bits

   Int_t count = 0;
   for(UInt_t i=0; i<fNbytes; ++i) {
      UChar_t val = fAllBits[i];
      for (UInt_t j=0; j<8; ++j) {
         if (val & 1) printf(" bit:%4d = 1\n",count);
         count++;
         val = val >> 1;
      }
   }
}

//______________________________________________________________________________
void TBits::ResetAllBits(Bool_t)
{
   // Reset all bits to 0 (false).

   if (fAllBits) memset(fAllBits,0,fNbytes);
}

//______________________________________________________________________________
void TBits::ReserveBytes(UInt_t nbytes)
{
   // Reverse each bytes.

   if (nbytes > fNbytes) {
      // do it in this order to remain exception-safe.
      UChar_t *newBits=new UChar_t[nbytes];
      delete[] fAllBits;
      fNbytes=nbytes;
      fAllBits=newBits;
   }
}

//______________________________________________________________________________
void TBits::Set(UInt_t nbits, const Char_t *array)
{
   // Set all the bytes.

   UInt_t nbytes=(nbits+7)>>3;

   ReserveBytes(nbytes);

   fNbits=nbits;
   memcpy(fAllBits, array, nbytes);
}

//______________________________________________________________________________
void TBits::Get(Char_t *array) const
{
   // Copy all the byes.

   memcpy(array, fAllBits, (fNbits+7)>>3);
}

 #ifdef R__BYTESWAP  /* means we are on little endian */

 /*
 If we are on a little endian machine, a bitvector represented using
 any integer type is identical to a bitvector represented using bytes.
 -- FP.
 */

void TBits::Set(UInt_t nbits, const Short_t *array)
{
   // Set all the bytes.

   Set(nbits, (const Char_t*)array);
}

void TBits::Set(UInt_t nbits, const Int_t *array)
{
   // Set all the bytes.

   Set(nbits, (const Char_t*)array);
}

void TBits::Set(UInt_t nbits, const Long64_t *array)
{
   // Set all the bytes.

   Set(nbits, (const Char_t*)array);
}

void TBits::Get(Short_t *array) const
{
   // Get all the bytes.

   Get((Char_t*)array);
}

void TBits::Get(Int_t *array) const
{
   // Get all the bytes.

   Get((Char_t*)array);
}

void TBits::Get(Long64_t *array) const
{
   // Get all the bytes.

   Get((Char_t*)array);
}

#else

 /*
 If we are on a big endian machine, some swapping around is required.
 */

void TBits::Set(UInt_t nbits, const Short_t *array)
{
   // make nbytes even so that the loop below is neat.
   UInt_t nbytes = ((nbits+15)>>3)&~1;

   ReserveBytes(nbytes);

   fNbits=nbits;

   const UChar_t *cArray = (const UChar_t*)array;
   for (UInt_t i=0; i<nbytes; i+=2) {
      fAllBits[i] = cArray[i+1];
      fAllBits[i+1] = cArray[i];
   }
}

void TBits::Set(UInt_t nbits, const Int_t *array)
{
   // make nbytes a multiple of 4 so that the loop below is neat.
   UInt_t nbytes = ((nbits+31)>>3)&~3;

   ReserveBytes(nbytes);

   fNbits=nbits;

   const UChar_t *cArray = (const UChar_t*)array;
   for (UInt_t i=0; i<nbytes; i+=4) {
      fAllBits[i] = cArray[i+3];
      fAllBits[i+1] = cArray[i+2];
      fAllBits[i+2] = cArray[i+1];
      fAllBits[i+3] = cArray[i];
   }
}

void TBits::Set(UInt_t nbits, const Long64_t *array)
{
   // make nbytes a multiple of 8 so that the loop below is neat.
   UInt_t nbytes = ((nbits+63)>>3)&~7;

   ReserveBytes(nbytes);

   fNbits=nbits;

   const UChar_t *cArray = (const UChar_t*)array;
   for (UInt_t i=0; i<nbytes; i+=8) {
      fAllBits[i] = cArray[i+7];
      fAllBits[i+1] = cArray[i+6];
      fAllBits[i+2] = cArray[i+5];
      fAllBits[i+3] = cArray[i+4];
      fAllBits[i+4] = cArray[i+3];
      fAllBits[i+5] = cArray[i+2];
      fAllBits[i+6] = cArray[i+1];
      fAllBits[i+7] = cArray[i];
   }
}

void TBits::Get(Short_t *array) const
{
   // Get all the bytes.

   UInt_t nBytes = (fNbits+7)>>3;
   UInt_t nSafeBytes = nBytes&~1;

   UChar_t *cArray=(UChar_t*)array;
   for (UInt_t i=0; i<nSafeBytes; i+=2) {
      cArray[i] = fAllBits[i+1];
      cArray[i+1] = fAllBits[i];
   }

   if (nBytes>nSafeBytes) {
      cArray[nSafeBytes+1] = fAllBits[nSafeBytes];
   }
}

void TBits::Get(Int_t *array) const
{
   // Get all the bytes.

   UInt_t nBytes = (fNbits+7)>>3;
   UInt_t nSafeBytes = nBytes&~3;

   UChar_t *cArray=(UChar_t*)array;
   UInt_t i;
   for (i=0; i<nSafeBytes; i+=4) {
      cArray[i] = fAllBits[i+3];
      cArray[i+1] = fAllBits[i+2];
      cArray[i+2] = fAllBits[i+1];
      cArray[i+3] = fAllBits[i];
   }

   for (i=0; i<nBytes-nSafeBytes; ++i) {
      cArray[nSafeBytes + (3 - i)] = fAllBits[nSafeBytes + i];
   }
}

void TBits::Get(Long64_t *array) const
{
   // Get all the bytes.

   UInt_t nBytes = (fNbits+7)>>3;
   UInt_t nSafeBytes = nBytes&~7;

   UChar_t *cArray=(UChar_t*)array;
   UInt_t i;
   for (i=0; i<nSafeBytes; i+=8) {
      cArray[i] = fAllBits[i+7];
      cArray[i+1] = fAllBits[i+6];
      cArray[i+2] = fAllBits[i+5];
      cArray[i+3] = fAllBits[i+4];
      cArray[i+4] = fAllBits[i+3];
      cArray[i+5] = fAllBits[i+2];
      cArray[i+6] = fAllBits[i+1];
      cArray[i+7] = fAllBits[i];
   }

   for (i=0; i<nBytes-nSafeBytes; ++i) {
      cArray[nSafeBytes + (7 - i)] = fAllBits[nSafeBytes + i];
   }
}

#endif

Bool_t TBits::operator==(const TBits &other) const
{
   // Compare object.

   if (fNbits == other.fNbits) {
      return !memcmp(fAllBits, other.fAllBits, (fNbits+7)>>3);
   } else if (fNbits <  other.fNbits) {
      return !memcmp(fAllBits, other.fAllBits, (fNbits+7)>>3) && other.FirstSetBit(fNbits) == other.fNbits;
   } else {
      return !memcmp(fAllBits, other.fAllBits, (other.fNbits+7)>>3) && FirstSetBit(other.fNbits) == fNbits;
   }
}

 TBits.cxx:1
 TBits.cxx:2
 TBits.cxx:3
 TBits.cxx:4
 TBits.cxx:5
 TBits.cxx:6
 TBits.cxx:7
 TBits.cxx:8
 TBits.cxx:9
 TBits.cxx:10
 TBits.cxx:11
 TBits.cxx:12
 TBits.cxx:13
 TBits.cxx:14
 TBits.cxx:15
 TBits.cxx:16
 TBits.cxx:17
 TBits.cxx:18
 TBits.cxx:19
 TBits.cxx:20
 TBits.cxx:21
 TBits.cxx:22
 TBits.cxx:23
 TBits.cxx:24
 TBits.cxx:25
 TBits.cxx:26
 TBits.cxx:27
 TBits.cxx:28
 TBits.cxx:29
 TBits.cxx:30
 TBits.cxx:31
 TBits.cxx:32
 TBits.cxx:33
 TBits.cxx:34
 TBits.cxx:35
 TBits.cxx:36
 TBits.cxx:37
 TBits.cxx:38
 TBits.cxx:39
 TBits.cxx:40
 TBits.cxx:41
 TBits.cxx:42
 TBits.cxx:43
 TBits.cxx:44
 TBits.cxx:45
 TBits.cxx:46
 TBits.cxx:47
 TBits.cxx:48
 TBits.cxx:49
 TBits.cxx:50
 TBits.cxx:51
 TBits.cxx:52
 TBits.cxx:53
 TBits.cxx:54
 TBits.cxx:55
 TBits.cxx:56
 TBits.cxx:57
 TBits.cxx:58
 TBits.cxx:59
 TBits.cxx:60
 TBits.cxx:61
 TBits.cxx:62
 TBits.cxx:63
 TBits.cxx:64
 TBits.cxx:65
 TBits.cxx:66
 TBits.cxx:67
 TBits.cxx:68
 TBits.cxx:69
 TBits.cxx:70
 TBits.cxx:71
 TBits.cxx:72
 TBits.cxx:73
 TBits.cxx:74
 TBits.cxx:75
 TBits.cxx:76
 TBits.cxx:77
 TBits.cxx:78
 TBits.cxx:79
 TBits.cxx:80
 TBits.cxx:81
 TBits.cxx:82
 TBits.cxx:83
 TBits.cxx:84
 TBits.cxx:85
 TBits.cxx:86
 TBits.cxx:87
 TBits.cxx:88
 TBits.cxx:89
 TBits.cxx:90
 TBits.cxx:91
 TBits.cxx:92
 TBits.cxx:93
 TBits.cxx:94
 TBits.cxx:95
 TBits.cxx:96
 TBits.cxx:97
 TBits.cxx:98
 TBits.cxx:99
 TBits.cxx:100
 TBits.cxx:101
 TBits.cxx:102
 TBits.cxx:103
 TBits.cxx:104
 TBits.cxx:105
 TBits.cxx:106
 TBits.cxx:107
 TBits.cxx:108
 TBits.cxx:109
 TBits.cxx:110
 TBits.cxx:111
 TBits.cxx:112
 TBits.cxx:113
 TBits.cxx:114
 TBits.cxx:115
 TBits.cxx:116
 TBits.cxx:117
 TBits.cxx:118
 TBits.cxx:119
 TBits.cxx:120
 TBits.cxx:121
 TBits.cxx:122
 TBits.cxx:123
 TBits.cxx:124
 TBits.cxx:125
 TBits.cxx:126
 TBits.cxx:127
 TBits.cxx:128
 TBits.cxx:129
 TBits.cxx:130
 TBits.cxx:131
 TBits.cxx:132
 TBits.cxx:133
 TBits.cxx:134
 TBits.cxx:135
 TBits.cxx:136
 TBits.cxx:137
 TBits.cxx:138
 TBits.cxx:139
 TBits.cxx:140
 TBits.cxx:141
 TBits.cxx:142
 TBits.cxx:143
 TBits.cxx:144
 TBits.cxx:145
 TBits.cxx:146
 TBits.cxx:147
 TBits.cxx:148
 TBits.cxx:149
 TBits.cxx:150
 TBits.cxx:151
 TBits.cxx:152
 TBits.cxx:153
 TBits.cxx:154
 TBits.cxx:155
 TBits.cxx:156
 TBits.cxx:157
 TBits.cxx:158
 TBits.cxx:159
 TBits.cxx:160
 TBits.cxx:161
 TBits.cxx:162
 TBits.cxx:163
 TBits.cxx:164
 TBits.cxx:165
 TBits.cxx:166
 TBits.cxx:167
 TBits.cxx:168
 TBits.cxx:169
 TBits.cxx:170
 TBits.cxx:171
 TBits.cxx:172
 TBits.cxx:173
 TBits.cxx:174
 TBits.cxx:175
 TBits.cxx:176
 TBits.cxx:177
 TBits.cxx:178
 TBits.cxx:179
 TBits.cxx:180
 TBits.cxx:181
 TBits.cxx:182
 TBits.cxx:183
 TBits.cxx:184
 TBits.cxx:185
 TBits.cxx:186
 TBits.cxx:187
 TBits.cxx:188
 TBits.cxx:189
 TBits.cxx:190
 TBits.cxx:191
 TBits.cxx:192
 TBits.cxx:193
 TBits.cxx:194
 TBits.cxx:195
 TBits.cxx:196
 TBits.cxx:197
 TBits.cxx:198
 TBits.cxx:199
 TBits.cxx:200
 TBits.cxx:201
 TBits.cxx:202
 TBits.cxx:203
 TBits.cxx:204
 TBits.cxx:205
 TBits.cxx:206
 TBits.cxx:207
 TBits.cxx:208
 TBits.cxx:209
 TBits.cxx:210
 TBits.cxx:211
 TBits.cxx:212
 TBits.cxx:213
 TBits.cxx:214
 TBits.cxx:215
 TBits.cxx:216
 TBits.cxx:217
 TBits.cxx:218
 TBits.cxx:219
 TBits.cxx:220
 TBits.cxx:221
 TBits.cxx:222
 TBits.cxx:223
 TBits.cxx:224
 TBits.cxx:225
 TBits.cxx:226
 TBits.cxx:227
 TBits.cxx:228
 TBits.cxx:229
 TBits.cxx:230
 TBits.cxx:231
 TBits.cxx:232
 TBits.cxx:233
 TBits.cxx:234
 TBits.cxx:235
 TBits.cxx:236
 TBits.cxx:237
 TBits.cxx:238
 TBits.cxx:239
 TBits.cxx:240
 TBits.cxx:241
 TBits.cxx:242
 TBits.cxx:243
 TBits.cxx:244
 TBits.cxx:245
 TBits.cxx:246
 TBits.cxx:247
 TBits.cxx:248
 TBits.cxx:249
 TBits.cxx:250
 TBits.cxx:251
 TBits.cxx:252
 TBits.cxx:253
 TBits.cxx:254
 TBits.cxx:255
 TBits.cxx:256
 TBits.cxx:257
 TBits.cxx:258
 TBits.cxx:259
 TBits.cxx:260
 TBits.cxx:261
 TBits.cxx:262
 TBits.cxx:263
 TBits.cxx:264
 TBits.cxx:265
 TBits.cxx:266
 TBits.cxx:267
 TBits.cxx:268
 TBits.cxx:269
 TBits.cxx:270
 TBits.cxx:271
 TBits.cxx:272
 TBits.cxx:273
 TBits.cxx:274
 TBits.cxx:275
 TBits.cxx:276
 TBits.cxx:277
 TBits.cxx:278
 TBits.cxx:279
 TBits.cxx:280
 TBits.cxx:281
 TBits.cxx:282
 TBits.cxx:283
 TBits.cxx:284
 TBits.cxx:285
 TBits.cxx:286
 TBits.cxx:287
 TBits.cxx:288
 TBits.cxx:289
 TBits.cxx:290
 TBits.cxx:291
 TBits.cxx:292
 TBits.cxx:293
 TBits.cxx:294
 TBits.cxx:295
 TBits.cxx:296
 TBits.cxx:297
 TBits.cxx:298
 TBits.cxx:299
 TBits.cxx:300
 TBits.cxx:301
 TBits.cxx:302
 TBits.cxx:303
 TBits.cxx:304
 TBits.cxx:305
 TBits.cxx:306
 TBits.cxx:307
 TBits.cxx:308
 TBits.cxx:309
 TBits.cxx:310
 TBits.cxx:311
 TBits.cxx:312
 TBits.cxx:313
 TBits.cxx:314
 TBits.cxx:315
 TBits.cxx:316
 TBits.cxx:317
 TBits.cxx:318
 TBits.cxx:319
 TBits.cxx:320
 TBits.cxx:321
 TBits.cxx:322
 TBits.cxx:323
 TBits.cxx:324
 TBits.cxx:325
 TBits.cxx:326
 TBits.cxx:327
 TBits.cxx:328
 TBits.cxx:329
 TBits.cxx:330
 TBits.cxx:331
 TBits.cxx:332
 TBits.cxx:333
 TBits.cxx:334
 TBits.cxx:335
 TBits.cxx:336
 TBits.cxx:337
 TBits.cxx:338
 TBits.cxx:339
 TBits.cxx:340
 TBits.cxx:341
 TBits.cxx:342
 TBits.cxx:343
 TBits.cxx:344
 TBits.cxx:345
 TBits.cxx:346
 TBits.cxx:347
 TBits.cxx:348
 TBits.cxx:349
 TBits.cxx:350
 TBits.cxx:351
 TBits.cxx:352
 TBits.cxx:353
 TBits.cxx:354
 TBits.cxx:355
 TBits.cxx:356
 TBits.cxx:357
 TBits.cxx:358
 TBits.cxx:359
 TBits.cxx:360
 TBits.cxx:361
 TBits.cxx:362
 TBits.cxx:363
 TBits.cxx:364
 TBits.cxx:365
 TBits.cxx:366
 TBits.cxx:367
 TBits.cxx:368
 TBits.cxx:369
 TBits.cxx:370
 TBits.cxx:371
 TBits.cxx:372
 TBits.cxx:373
 TBits.cxx:374
 TBits.cxx:375
 TBits.cxx:376
 TBits.cxx:377
 TBits.cxx:378
 TBits.cxx:379
 TBits.cxx:380
 TBits.cxx:381
 TBits.cxx:382
 TBits.cxx:383
 TBits.cxx:384
 TBits.cxx:385
 TBits.cxx:386
 TBits.cxx:387
 TBits.cxx:388
 TBits.cxx:389
 TBits.cxx:390
 TBits.cxx:391
 TBits.cxx:392
 TBits.cxx:393
 TBits.cxx:394
 TBits.cxx:395
 TBits.cxx:396
 TBits.cxx:397
 TBits.cxx:398
 TBits.cxx:399
 TBits.cxx:400
 TBits.cxx:401
 TBits.cxx:402
 TBits.cxx:403
 TBits.cxx:404
 TBits.cxx:405
 TBits.cxx:406
 TBits.cxx:407
 TBits.cxx:408
 TBits.cxx:409
 TBits.cxx:410
 TBits.cxx:411
 TBits.cxx:412
 TBits.cxx:413
 TBits.cxx:414
 TBits.cxx:415
 TBits.cxx:416
 TBits.cxx:417
 TBits.cxx:418
 TBits.cxx:419
 TBits.cxx:420
 TBits.cxx:421
 TBits.cxx:422
 TBits.cxx:423
 TBits.cxx:424
 TBits.cxx:425
 TBits.cxx:426
 TBits.cxx:427
 TBits.cxx:428
 TBits.cxx:429
 TBits.cxx:430
 TBits.cxx:431
 TBits.cxx:432
 TBits.cxx:433
 TBits.cxx:434
 TBits.cxx:435
 TBits.cxx:436
 TBits.cxx:437
 TBits.cxx:438
 TBits.cxx:439
 TBits.cxx:440
 TBits.cxx:441
 TBits.cxx:442
 TBits.cxx:443
 TBits.cxx:444
 TBits.cxx:445
 TBits.cxx:446
 TBits.cxx:447
 TBits.cxx:448
 TBits.cxx:449
 TBits.cxx:450
 TBits.cxx:451
 TBits.cxx:452
 TBits.cxx:453
 TBits.cxx:454
 TBits.cxx:455
 TBits.cxx:456
 TBits.cxx:457
 TBits.cxx:458
 TBits.cxx:459
 TBits.cxx:460
 TBits.cxx:461
 TBits.cxx:462
 TBits.cxx:463
 TBits.cxx:464
 TBits.cxx:465
 TBits.cxx:466
 TBits.cxx:467
 TBits.cxx:468
 TBits.cxx:469
 TBits.cxx:470
 TBits.cxx:471
 TBits.cxx:472
 TBits.cxx:473
 TBits.cxx:474
 TBits.cxx:475
 TBits.cxx:476
 TBits.cxx:477
 TBits.cxx:478
 TBits.cxx:479
 TBits.cxx:480
 TBits.cxx:481
 TBits.cxx:482
 TBits.cxx:483
 TBits.cxx:484
 TBits.cxx:485
 TBits.cxx:486
 TBits.cxx:487
 TBits.cxx:488
 TBits.cxx:489
 TBits.cxx:490
 TBits.cxx:491
 TBits.cxx:492
 TBits.cxx:493
 TBits.cxx:494
 TBits.cxx:495
 TBits.cxx:496
 TBits.cxx:497
 TBits.cxx:498
 TBits.cxx:499
 TBits.cxx:500
 TBits.cxx:501
 TBits.cxx:502
 TBits.cxx:503
 TBits.cxx:504
 TBits.cxx:505
 TBits.cxx:506
 TBits.cxx:507
 TBits.cxx:508
 TBits.cxx:509
 TBits.cxx:510
 TBits.cxx:511
 TBits.cxx:512
 TBits.cxx:513
 TBits.cxx:514
 TBits.cxx:515
 TBits.cxx:516
 TBits.cxx:517
 TBits.cxx:518
 TBits.cxx:519
 TBits.cxx:520
 TBits.cxx:521
 TBits.cxx:522
 TBits.cxx:523
 TBits.cxx:524
 TBits.cxx:525
 TBits.cxx:526
 TBits.cxx:527
 TBits.cxx:528
 TBits.cxx:529
 TBits.cxx:530
 TBits.cxx:531
 TBits.cxx:532
 TBits.cxx:533
 TBits.cxx:534
 TBits.cxx:535
 TBits.cxx:536
 TBits.cxx:537
 TBits.cxx:538
 TBits.cxx:539
 TBits.cxx:540
 TBits.cxx:541
 TBits.cxx:542
 TBits.cxx:543
 TBits.cxx:544
 TBits.cxx:545
 TBits.cxx:546
 TBits.cxx:547
 TBits.cxx:548
 TBits.cxx:549
 TBits.cxx:550
 TBits.cxx:551
 TBits.cxx:552
 TBits.cxx:553
 TBits.cxx:554
 TBits.cxx:555
 TBits.cxx:556
 TBits.cxx:557
 TBits.cxx:558
 TBits.cxx:559
 TBits.cxx:560
 TBits.cxx:561
 TBits.cxx:562
 TBits.cxx:563
 TBits.cxx:564
 TBits.cxx:565
 TBits.cxx:566
 TBits.cxx:567
 TBits.cxx:568
 TBits.cxx:569
 TBits.cxx:570
 TBits.cxx:571
 TBits.cxx:572
 TBits.cxx:573
 TBits.cxx:574
 TBits.cxx:575
 TBits.cxx:576
 TBits.cxx:577
 TBits.cxx:578
 TBits.cxx:579
 TBits.cxx:580
 TBits.cxx:581
 TBits.cxx:582
 TBits.cxx:583
 TBits.cxx:584
 TBits.cxx:585
 TBits.cxx:586
 TBits.cxx:587
 TBits.cxx:588
 TBits.cxx:589
 TBits.cxx:590
 TBits.cxx:591
 TBits.cxx:592
 TBits.cxx:593
 TBits.cxx:594
 TBits.cxx:595
 TBits.cxx:596
 TBits.cxx:597
 TBits.cxx:598
 TBits.cxx:599
 TBits.cxx:600
 TBits.cxx:601
 TBits.cxx:602
 TBits.cxx:603
 TBits.cxx:604
 TBits.cxx:605
 TBits.cxx:606
 TBits.cxx:607
 TBits.cxx:608
 TBits.cxx:609
 TBits.cxx:610
 TBits.cxx:611
 TBits.cxx:612
 TBits.cxx:613
 TBits.cxx:614
 TBits.cxx:615
 TBits.cxx:616
 TBits.cxx:617
 TBits.cxx:618
 TBits.cxx:619
 TBits.cxx:620
 TBits.cxx:621
 TBits.cxx:622
 TBits.cxx:623
 TBits.cxx:624
 TBits.cxx:625
 TBits.cxx:626
 TBits.cxx:627
 TBits.cxx:628
 TBits.cxx:629
 TBits.cxx:630
 TBits.cxx:631
 TBits.cxx:632
 TBits.cxx:633
 TBits.cxx:634
 TBits.cxx:635
 TBits.cxx:636
 TBits.cxx:637
 TBits.cxx:638
 TBits.cxx:639
 TBits.cxx:640
 TBits.cxx:641
 TBits.cxx:642
 TBits.cxx:643
 TBits.cxx:644
 TBits.cxx:645
 TBits.cxx:646
 TBits.cxx:647
 TBits.cxx:648
 TBits.cxx:649
 TBits.cxx:650
 TBits.cxx:651
 TBits.cxx:652
 TBits.cxx:653
 TBits.cxx:654
 TBits.cxx:655
 TBits.cxx:656
 TBits.cxx:657
 TBits.cxx:658
 TBits.cxx:659
 TBits.cxx:660
 TBits.cxx:661
 TBits.cxx:662
 TBits.cxx:663
 TBits.cxx:664
 TBits.cxx:665
 TBits.cxx:666
 TBits.cxx:667
 TBits.cxx:668
 TBits.cxx:669
 TBits.cxx:670
 TBits.cxx:671
 TBits.cxx:672
 TBits.cxx:673
 TBits.cxx:674
 TBits.cxx:675
 TBits.cxx:676
 TBits.cxx:677
 TBits.cxx:678
 TBits.cxx:679
 TBits.cxx:680
 TBits.cxx:681
 TBits.cxx:682
 TBits.cxx:683
 TBits.cxx:684
 TBits.cxx:685
 TBits.cxx:686
 TBits.cxx:687
 TBits.cxx:688
 TBits.cxx:689
 TBits.cxx:690
 TBits.cxx:691
 TBits.cxx:692
 TBits.cxx:693
 TBits.cxx:694
 TBits.cxx:695
 TBits.cxx:696
 TBits.cxx:697
 TBits.cxx:698
 TBits.cxx:699