10 std::vector<unsigned char> Vo_CHAR;
17 size_t sd = Vo_CHAR.end() - Vo_CHAR.begin();
34 __builtin_prefetch((&
v_noises.front()) +
p->ibegin);
35 __builtin_prefetch((&
v_noises.front()) +
p->ibegin + 96);
36 __builtin_prefetch((&
v_noises.front()) +
p->iend - 96);
45 __builtin_prefetch((&
v_noises.front()) +
p->ibegin);
46 __builtin_prefetch((&
v_noises.front()) +
p->ibegin + 96);
47 __builtin_prefetch((&
v_noises.front()) +
p->iend - 96);
55 DetIds_.reserve(
indexes.size());
57 DetIds_.push_back(
p->detid);
64 <<
"[SiStripNoises::getNoise] looking for SiStripNoises for a strip out of range: strip " <<
strip;
68 v.push_back((static_cast<int16_t>(
noise_ * 10.0 + 0.5) & 0x01FF));
72 static const uint16_t BITS_PER_STRIP = 9;
73 const size_t VoSize = (size_t)((Vi.size() * BITS_PER_STRIP) / 8 + .999);
75 for (
size_t i = 0;
i < VoSize; ++
i)
79 unsigned char*
data = &Vo[VoSize - 1];
81 uint8_t firstByteBit = (lowBit & 0x7);
82 uint8_t firstByteNBits = 8 - firstByteBit;
83 uint8_t firstByteMask = 0xffu << firstByteBit;
84 uint8_t secondByteNbits = (BITS_PER_STRIP - firstByteNBits);
85 uint8_t secondByteMask = ~(0xffu << secondByteNbits);
87 *(
data - lowBit / 8) = (*(
data - lowBit / 8) & ~(firstByteMask)) | ((Vi[
stripIndex] & 0xffu) << firstByteBit);
88 *(
data - lowBit / 8 - 1) =
89 (*(
data - lowBit / 8 - 1) & ~(secondByteMask)) | ((Vi[
stripIndex] >> firstByteNBits) & secondByteMask);
116 size_t mysize = ((
range.second -
range.first) << 3) / 9;
119 throw cms::Exception(
"CorruptedData") <<
"[SiStripNoises::allNoises] Requested noise for " <<
noises.size()
120 <<
" strips, I have it only for " << mysize <<
" strips\n";
121 size_t size8 =
size & (~0x7), carry =
size & 0x7;
122 const uint8_t* ptr = (&*
range.second) - 1;
123 std::vector<float>::iterator
out =
noises.begin(), end8 =
noises.begin() + size8;
127 *
out =
static_cast<float>(
get9bits(ptr, 0) / 10.0f);
129 *
out =
static_cast<float>(
get9bits(ptr, 1) / 10.0f);
131 *
out =
static_cast<float>(
get9bits(ptr, 2) / 10.0f);
133 *
out =
static_cast<float>(
get9bits(ptr, 3) / 10.0f);
135 *
out =
static_cast<float>(
get9bits(ptr, 4) / 10.0f);
137 *
out =
static_cast<float>(
get9bits(ptr, 5) / 10.0f);
139 *
out =
static_cast<float>(
get9bits(ptr, 6) / 10.0f);
141 *
out =
static_cast<float>(
get9bits(ptr, 7) / 10.0f);
145 for (
size_t rem = 0; rem < carry; ++rem) {
146 *
out =
static_cast<float>(
get9bits(ptr, rem) / 10.0f);
192 std::vector<float> vstripnoise;
194 ss <<
"detid" << std::setw(15) <<
"strip" << std::setw(10) <<
"noise" << std::endl;
198 for (; rit != erit; ++rit) {
199 Nstrips = (rit->iend - rit->ibegin) * 8 / 9;
200 vstripnoise.resize(Nstrips);
204 if (
detId != oldDetId) {
209 for (
size_t i = 0;
i < Nstrips; ++
i) {
212 ss << std::setw(15) <<
i << std::setw(10) << vstripnoise[
i] << std::endl;
220 std::stringstream tempss;
224 std::vector<float> vstripnoise;
226 for (; rit != erit; ++rit) {
227 Nstrips = (rit->iend - rit->ibegin) * 8 / 9;
228 vstripnoise.resize(Nstrips);
230 tempss <<
"\ndetid: " << rit->detid <<
" \t ";
238 for (
size_t i = 0;
i < Nstrips; ++
i) {
239 mean += vstripnoise[
i];
240 rms += vstripnoise[
i] * vstripnoise[
i];
241 if (vstripnoise[
i] <
min)
242 min = vstripnoise[
i];
243 if (vstripnoise[
i] >
max)
244 max = vstripnoise[
i];
251 tempss <<
"Nstrips " << Nstrips <<
" \t; mean " <<
mean <<
" \t; rms " <<
rms <<
" \t; min " <<
min <<
" \t; max " 254 ss << std::endl <<
"Summary:" << std::endl;
261 std::vector<ratioData>
result;
268 for (; iter != iterE; ++iter) {
271 aData.
detid = iter->detid;
273 Range d_range =
d.getRange(iter->detid);
279 if (d_range.first == d_range.second) {
289 iter =
d.getRegistryVectorBegin();
290 iterE =
d.getRegistryVectorEnd();
293 for (; iter != iterE; ++iter) {
297 Range d_range =
Range(
d.v_noises.begin() + iter->ibegin,
d.v_noises.begin() + iter->iend);
299 aData.
detid = iter->detid;
301 size_t strip = 0, stripE = (d_range.second - d_range.first) * 8 / 9;
Range getRangeByPos(unsigned short pos) const
RegistryIterator getRegistryVectorBegin() const
void allNoises(std::vector< float > &noises, const Range &range) 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)
ContainerIterator getDataVectorBegin() const
static void verify(uint16_t strip, const Range &range)
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
static void encode(const InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
static std::string const input
static float getNoise(uint16_t strip, const Range &range)
__host__ __device__ std::uint32_t stripIndex(fedId_t fed, fedCh_t channel, stripId_t strip)
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Registry::const_iterator RegistryIterator
bool put(const uint32_t &detID, const InputVector &input)
RegistryIterator getRegistryVectorEnd() const
const Range getRange(const uint32_t detID) const
char data[epos_bytes_allocation]
std::pair< ContainerIterator, ContainerIterator > Range
void getDetIds(std::vector< uint32_t > &DetIds_) const
void setData(float noise_, InputVector &vped)