/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/MdcTrkRecon/countBits.h File Reference

Go to the source code of this file.

Functions

int countbits (unsigned word)


Function Documentation

int countbits ( unsigned  word  )  [inline]

Definition at line 5 of file countBits.h.

References genRecEmupikp::i.

Referenced by MdcSegPatterns::MdcSegPatterns(), and MdcSegFinder::tryPatterns().

00005                                     {
00006    const int nbit[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 };
00007    int nset=0;
00008    for (unsigned i=0;i<2*sizeof(unsigned);i++) { // assume char = 8 bits, i.e. two
00009        nset+=nbit[word&0xf];                // iterations per 'char' size object
00010        word>>=4;
00011    }
00012    return nset;
00013 }


Generated on Tue Nov 29 23:16:56 2016 for BOSS_7.0.2 by  doxygen 1.4.7