1 #ifndef SiStripNoises_h
2 #define SiStripNoises_h
7 #include<boost/cstdint.hpp>
41 typedef std::pair<ContainerIterator, ContainerIterator>
Range;
52 void getDetIds(std::vector<uint32_t>& DetIds_)
const;
60 return 0.1f*float(
decode(strip,range));
65 void allNoises (std::vector<float> & noises,
const Range& range)
const;
80 static inline uint16_t
get9bits(
const uint8_t * &ptr, int8_t
skip);
96 uint8_t maskThis = (0xFF <<
skip);
97 uint8_t maskThat = ((2 <<
skip) - 1);
98 uint16_t
ret = ( ((*ptr) & maskThis) >> skip );
100 return ret | ( ((*ptr) & maskThat) << (8 - skip) );
104 const unsigned char *
data = &*(range.second -1);
105 static const uint16_t BITS_PER_STRIP = 9;
107 uint32_t lowBit = strip * BITS_PER_STRIP;
108 uint8_t firstByteBit = (lowBit & 7);
109 uint8_t firstByteNBits = 8 - firstByteBit;
110 uint8_t firstByteMask = 0xffu << firstByteBit;
111 uint8_t secondByteMask = ~(0xffu << (BITS_PER_STRIP - firstByteNBits));
112 uint16_t
value = ((uint16_t(*(data-lowBit/8 )) & firstByteMask) >> firstByteBit) | ((uint16_t(*(data-lowBit/8-1)) & secondByteMask) << firstByteNBits);
std::vector< ratioData > operator/(SiStripNoises d)
ContainerIterator getDataVectorEnd() const
static uint16_t get9bits(const uint8_t *&ptr, int8_t skip)
std::vector< float > values
std::vector< uint16_t > InputVector
std::vector< DetRegistry > Registry
static void encode(const InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
static float getNoiseFast(const uint16_t &strip, const Range &range)
std::vector< unsigned char >::const_iterator ContainerIterator
static uint16_t decode(uint16_t strip, const Range &range)
Registry::const_iterator RegistryIterator
std::vector< unsigned char > Container
bool put(const uint32_t &detID, const InputVector &input)
static float getNoise(uint16_t strip, const Range &range)
RegistryIterator getRegistryVectorEnd() const
void getDetIds(std::vector< uint32_t > &DetIds_) const
RegistryIterator getRegistryVectorBegin() const
char data[epos_bytes_allocation]
void printDebug(std::stringstream &ss) const
void printSummary(std::stringstream &ss) const
std::pair< ContainerIterator, ContainerIterator > Range
const Range getRange(const uint32_t &detID) const
void allNoises(std::vector< float > &noises, const Range &range) const
ContainerIterator getDataVectorBegin() const
bool operator()(const DetRegistry &p, const uint32_t &i) const
void setData(float noise_, InputVector &vped)