5 std::vector<unsigned char> Vo_CHAR;
8 if (p!=
indexes.end() && p->detid==DetId)
10 size_t sd = Vo_CHAR.end() - Vo_CHAR.begin();
12 detregistry.
detid=DetId;
23 if (p==
indexes.end()|| p->detid!=DetId)
34 DetIds.push_back(
p->detid);
39 return static_cast<float> (
decode(strip,range)/10.0);
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) = (*(data-lowBit/8-1) & ~(secondByteMask)) | ((Vi[stripIndex] >> firstByteNBits) & secondByteMask);
68 const unsigned char *
data = &*(range.second -1);
69 static const uint16_t BITS_PER_STRIP = 9;
71 uint32_t lowBit = strip * BITS_PER_STRIP;
72 uint8_t firstByteBit = (lowBit & 7);
73 uint8_t firstByteNBits = 8 - firstByteBit;
74 uint8_t firstByteMask = 0xffu << firstByteBit;
75 uint8_t secondByteMask = ~(0xffu << (BITS_PER_STRIP - firstByteNBits));
76 uint16_t
value = ((uint16_t(*(data-lowBit/8 )) & firstByteMask) >> firstByteBit) | ((uint16_t(*(data-lowBit/8-1)) & secondByteMask) << firstByteNBits);
uint16_t decode(const uint16_t &strip, const Range &range) const
float getNoise(const uint16_t &strip, const Range &range) const
const Range getRange(const uint32_t &detID) const
Registry::const_iterator RegistryIterator
static std::string const input
bool put(const uint32_t detID, InputVector &input)
std::pair< ContainerIterator, ContainerIterator > Range
void getDetIds(std::vector< uint32_t > &DetIds) const
std::vector< DetRegistry > indexes
const std::vector< short > InputVector
void setData(float noise_, std::vector< short > &vped)
std::vector< unsigned char > v_noises
void encode(InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)