12 detectors_ = detectors_ | (1<<theDetector);
14 detectors_ = detectors_ ^ (1<<theDetector);
23 return (detectors_>>theDetector) & 1;
28 if( ! isSingleDetector() )
return DET_NONE;
30 int pos = leastSignificantBitPosition( detectors_ );
45 if (n & 0x000000000000FFFFLL) { pos -= 16; }
else { n >>= 16; }
46 if (n & 0x00000000000000FFLL) { pos -= 8; }
else { n >>= 8; }
47 if (n & 0x000000000000000FLL) { pos -= 4; }
else { n >>= 4; }
48 if (n & 0x0000000000000003LL) { pos -= 2; }
else { n >>= 2; }
49 if (n & 0x0000000000000001LL) { pos -= 1; }
58 out<<
"CaloID: "<<
id.detectors();
Detectors detector() const
std::ostream & operator<<(std::ostream &, BeamSpot beam)
void setDetector(CaloID::Detectors theDetector, bool value)
tells the CaloID that it describes a given detector
int leastSignificantBitPosition(unsigned n) const