5 std::vector<unsigned char> Vo_CHAR;
10 size_t sd = Vo_CHAR.end() - Vo_CHAR.begin();
34 DetIds.push_back(
p->detid);
43 v.push_back((static_cast<int16_t>(
noise_ * 10.0 + 0.5) & 0x01FF));
47 static const uint16_t BITS_PER_STRIP = 9;
48 const size_t VoSize = (size_t)((Vi.size() * BITS_PER_STRIP) / 8 + .999);
50 for (
size_t i = 0;
i < Vo.size(); ++
i)
53 for (
unsigned int stripIndex = 0; stripIndex < Vi.size(); ++stripIndex) {
54 unsigned char*
data = &Vo[Vo.size() - 1];
55 uint32_t lowBit = stripIndex * BITS_PER_STRIP;
56 uint8_t firstByteBit = (lowBit & 0x7);
57 uint8_t firstByteNBits = 8 - firstByteBit;
58 uint8_t firstByteMask = 0xffu << firstByteBit;
59 uint8_t secondByteNbits = (BITS_PER_STRIP - firstByteNBits);
60 uint8_t secondByteMask = ~(0xffu << secondByteNbits);
62 *(
data - lowBit / 8) = (*(
data - lowBit / 8) & ~(firstByteMask)) | ((Vi[stripIndex] & 0xffu) << firstByteBit);
63 *(
data - lowBit / 8 - 1) =
64 (*(
data - lowBit / 8 - 1) & ~(secondByteMask)) | ((Vi[stripIndex] >> firstByteNBits) & secondByteMask);
69 const unsigned char*
data = &*(
range.second - 1);
70 static const uint16_t BITS_PER_STRIP = 9;
72 uint32_t lowBit =
strip * BITS_PER_STRIP;
73 uint8_t firstByteBit = (lowBit & 7);
74 uint8_t firstByteNBits = 8 - firstByteBit;
75 uint8_t firstByteMask = 0xffu << firstByteBit;
76 uint8_t secondByteMask = ~(0xffu << (BITS_PER_STRIP - firstByteNBits));
77 uint16_t
value = ((uint16_t(*(
data - lowBit / 8)) & firstByteMask) >> firstByteBit) |
78 ((uint16_t(*(
data - lowBit / 8 - 1)) & secondByteMask) << firstByteNBits);