1 #ifndef SiStripNoises_h 2 #define SiStripNoises_h 9 #include<boost/cstdint.hpp> 50 typedef std::pair<ContainerIterator, ContainerIterator>
Range;
59 bool put(
const uint32_t& detID,
const InputVector &
input);
60 const Range
getRange(
const uint32_t detID)
const;
62 void getDetIds(std::vector<uint32_t>& DetIds_)
const;
73 static void verify(uint16_t
strip,
const Range& range);
74 static float getNoise(uint16_t strip,
const Range& range) {
82 void allNoises (std::vector<float> & noises,
const Range& range)
const;
91 static void encode(
const InputVector& Vi, std::vector<unsigned char>& Vo_CHAR);
93 static inline uint16_t
decode (uint16_t strip,
const Range& range);
97 static inline uint16_t
get9bits(
const uint8_t * &ptr, int8_t
skip);
115 uint8_t maskThis = (0xFF <<
skip);
116 uint8_t maskThat = ((2 <<
skip) - 1);
117 uint16_t ret = ( ((*ptr) & maskThis) >> skip );
119 return ret | ( ((*ptr) & maskThat) << (8 - skip) );
123 const unsigned char *
data = &*(range.second -1);
124 static const uint16_t BITS_PER_STRIP = 9;
126 uint32_t lowBit = strip * BITS_PER_STRIP;
127 uint8_t firstByteBit = (lowBit & 7);
129 uint16_t vin = uint16_t(*(data-lowBit/8)) | (uint16_t(*(data-lowBit/8-1))<<8);
130 vin = vin >> firstByteBit; vin &= 0x1FF;
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< ratioData > operator/(const SiStripNoises &d)
static void verify(uint16_t strip, const Range &range)
std::vector< DetRegistry > Registry
static void encode(const InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
static std::string const input
static float getNoiseFast(const uint16_t &strip, const Range &range)
static float getNoise(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)
RegistryIterator getRegistryVectorEnd() const
void getDetIds(std::vector< uint32_t > &DetIds_) const
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
RegistryIterator getRegistryVectorBegin() const
#define COND_SERIALIZABLE
char data[epos_bytes_allocation]
Range getRangeByPos(unsigned short pos) const
const Range getRange(const uint32_t detID) const
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
std::pair< ContainerIterator, ContainerIterator > Range
void allNoises(std::vector< float > &noises, const Range &range) const
ContainerIterator getDataVectorBegin() const
void setData(float noise_, InputVector &vped)