7 std::vector<unsigned char> Vo_CHAR;
10 Registry::iterator
p =
16 size_t sd = Vo_CHAR.end() - Vo_CHAR.begin();
43 DetIds_.push_back(
p->detid);
48 vped.push_back((static_cast<uint16_t>(ped) & 0x3FF));
54 <<
"[SiStripPedestals::getPed] looking for SiStripPedestals for a strip out of range: strip " <<
strip;
60 static const uint16_t BITS_PER_STRIP = 10;
61 const size_t VoSize = (size_t)((Vi.size() * BITS_PER_STRIP) / 8 + .999);
63 for (
size_t i = 0;
i < Vo.size(); ++
i)
66 for (
unsigned int stripIndex = 0; stripIndex < Vi.size(); ++stripIndex) {
67 unsigned char*
data = &Vo[Vo.size() - 1];
68 uint32_t lowBit = stripIndex * BITS_PER_STRIP;
69 uint8_t firstByteBit = (lowBit & 0x6);
70 uint8_t firstByteNBits = 8 - firstByteBit;
71 uint8_t firstByteMask = 0xffu << firstByteBit;
72 uint8_t secondByteNbits = (BITS_PER_STRIP - firstByteNBits);
73 uint8_t secondByteMask = ~(0xffu << secondByteNbits);
75 *(
data - lowBit / 8) = (*(
data - lowBit / 8) & ~(firstByteMask)) | ((Vi[stripIndex] & 0xffu) << firstByteBit);
76 *(
data - lowBit / 8 - 1) =
77 (*(
data - lowBit / 8 - 1) & ~(secondByteMask)) | ((Vi[stripIndex] >> firstByteNBits) & secondByteMask);
103 static const uint16_t BITS_PER_STRIP = 10;
105 uint32_t lowBit =
strip * BITS_PER_STRIP;
106 uint8_t firstByteBit = (lowBit & 6);
107 uint8_t firstByteNBits = 8 - firstByteBit;
108 uint8_t firstByteMask = 0xffu << firstByteBit;
109 uint8_t secondByteMask = ~(0xffu << (BITS_PER_STRIP - firstByteNBits));
110 uint16_t
value = ((uint16_t(*(
data - lowBit / 8)) & firstByteMask) >> firstByteBit) |
111 ((uint16_t(*(
data - lowBit / 8 - 1)) & secondByteMask) << firstByteNBits);
136 uint8_t maskThis = (0xFF <<
skip);
137 uint8_t maskThat = ((4 <<
skip) - 1);
138 uint16_t
ret = (((*ptr) & maskThis) >>
skip);
140 return ret | (((*ptr) & maskThat) << (8 -
skip));
144 size_t mysize = ((
range.second -
range.first) << 3) / 10;
145 size_t size = peds.size();
147 throw cms::Exception(
"CorruptedData") <<
"[SiStripPedestals::allPeds] Requested pedestals for " << peds.size()
148 <<
" strips, I have it only for " << mysize <<
" strips\n";
149 size_t size4 =
size & (~0x3), carry =
size & 0x3;
150 const uint8_t* ptr = reinterpret_cast<const uint8_t*>(&*
range.second) - 1;
151 std::vector<int>::iterator
out = peds.begin(), end4 = peds.begin() + size4;
165 for (
size_t rem = 0; rem < carry; ++rem) {
172 std::vector<uint32_t> detid;
175 for (
size_t id = 0;
id < detid.size(); ++
id) {
177 for (
int it = 0; it < (
range.second -
range.first) * 8 / 10; ++it) {
181 ss <<
"Summary of pedestals:" << std::endl;
186 std::vector<uint32_t> detid;
189 ss <<
"Number of detids = " << detid.size() << std::endl;
191 for (
size_t id = 0;
id < detid.size(); ++
id) {
195 ss <<
"detid" << std::setw(15) <<
"strip" << std::setw(10) <<
"pedestal" << std::endl;
198 for (
int it = 0; it < (
range.second -
range.first) * 8 / 10; ++it) {
200 if (detId != oldDetId) {