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,3,3,2,2,2,3,2,2,2,3,2,2,2,0,3,3,3,3,2,2,2,3,2,2,2,3,2,2,2,
0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,0,3,3,3,3,2,2,2,3,2,2,2,3,2,2,2,
0,3,3,3,3,2,2,2,3,2,2,2,3,2,2,2,0,3,3,3,3,2,2,2,3,2,2,2,3,2,2,2},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,
0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,
0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,
0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3,0,0,0,0,0,3,3,3,0,3,3,3,0,3,3,3}};
UChar_t HMdcBArray::setBitLUp[8]={1,2,4,8,16,32,64,128};
UChar_t HMdcBArray::unsetBitLUp[8]={254,253,251,247,239,223,191,127};
UChar_t HMdcBArray::nextBit[8]={254,252,248,240,224,192,128,0};
UChar_t HMdcBArray::prevBit[8]={0,1,3,7,15,31,63,127};
UChar_t HMdcBArray::nBitLookUp[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,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,7,7,7};
UChar_t HMdcBArray::nLayOrientation[64]={
0,1,1,2,1,2,2,3,1,2,2,3,1,2,2,3,1,2,2,3,2,3,3,4,2,3,3,4,2,3,3,4,
1,2,2,3,2,3,3,4,2,3,3,4,2,3,3,4,2,3,3,4,3,4,4,5,3,4,4,5,3,4,4,5};
UChar_t HMdcBArray::is40degCross[64]={
0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,1,0,1,1,1,0,1,1,1,0,1,1,1,
0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
Int_t HMdcTBArray::next(const UChar_t *pF, const UChar_t *pL, Int_t prPos) {
const UChar_t *pB=pF;
UChar_t next=*pB;
if(prPos >=0 ) {
pB+=prPos>>2;
if(pB>pL) return -1;
next=*pB & nextTBit[prPos&3];
}
for(; pB<=pL; next=*(++pB)) {
if( next ) return ((pB-pF)<<2)+pTBitLookUp[0][next];
}
return -1;
}
UChar_t HMdcTBArray::next2Bits(const UChar_t *pF, const UChar_t *pL, Int_t& pos) {
const UChar_t *pB=pF;
UChar_t next=*pB;
if(pos >=0 ) {
pB+=pos>>2;
if(pB>pL) return 0;
next=*pB & nextTBit[pos&3];
}
for(; pB<=pL; next=*(++pB)) if( next ) {
pos = ((pB-pF)<<2)+pTBitLookUp[0][next];
return (next >> (pos&3)*2) & 0x3;;
}
return 0;
}
Int_t HMdcTBArray::previous(const UChar_t *pF,const UChar_t *pL,Int_t prPos) {
if(prPos<0) return -1;
const UChar_t *pB=pL;
UChar_t next=*pB;
if((prPos>>2)+pF <= pL) {
pB=pF+(prPos>>2);
next=*pB & prevTBit[prPos&3];
}
for(; pB>=pF; next=*(--pB)) {
if(next) return ((pB-pF)<<2)+pTBitLookUp[nTBitLookUp[next]-1][next];
}
return -1;
}
ClassImp(HMdcTBArray)
ClassImp(HMdcBArray)
Last change: Sat May 22 13:03:39 2010
Last generated: 2010-05-22 13:03
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.