New: UInt_t RanBit(UInt_t hRead) { // // UInt_t bit7 = (fgShreg & 0x00000040) != 0; UInt_t bit28 = (fgShreg & 0x08000000) != 0; UInt_t bit29 = (fgShreg & 0x10000000) != 0; UInt_t bit30 = (fgShreg & 0x20000000) != 0; UInt_t newbit = (bit30 ^ bit29 ^ bit28 ^ bit7) & 0x1; fgShreg = ( (hRead == 2 ? newbit : hRead) | (fgShreg << 1 )) & 0x3FFFFFFF; return newbit; } // Old: UInt_t RanBit(UInt_t hRead) { // // const UInt_t IB1 = 0x1; // Bit 1 mask 000000000000000000000001 const UInt_t IB3 = 0x4; // Bit 3 mask 000000000000000000000100 const UInt_t IB4 = 0x8; // Bit 4 mask 000000000000000000001000 const UInt_t IB24 = 0x800000; // Bit 24 mask 100000000000000000000000 const UInt_t MASK = IB1+IB3+IB4+IB24; // 100000000000000000001101 int hPred = (fgShreg & IB24) ? 1 : 0; if ((hRead == 2 ? hPred : hRead) == 1) fgShreg = ((fgShreg ^ MASK) << 1) | IB1; else fgShreg <<= 1; return hPred; } //