Skip to content
Snippets Groups Projects
Commit 3a13bc25 authored by Stephen A. Wood's avatar Stephen A. Wood Committed by Stephen A. Wood
Browse files

Fix nplaneshit>6 bug. (fix Count1Bits routine)

parent f0d579c7
No related branches found
No related tags found
No related merge requests found
......@@ -836,13 +836,11 @@ void THcDriftChamber::CorrectHitTimes()
}
}
UInt_t THcDriftChamber::Count1Bits(UInt_t x)
// From "Hacker's Delight"
// From http://graphics.stanford.edu/~seander/bithacks.html
{
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = x + (x >> 8);
x = x + (x >> 16);
return x & 0x0000003F;
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
return (((x + (x >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
}
//_____________________________________________________________________________
......@@ -1003,7 +1001,7 @@ void THcDriftChamber::LeftRight()
// Calculate final coordinate based on plusminusbest
// Update the hit positions in the space points
for(Int_t ihit; ihit<nhits; ihit++) {
for(Int_t ihit=0; ihit<nhits; ihit++) {
sp->GetHit(ihit)->SetLeftRight(plusminusbest[ihit]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment