7 std::vector<unsigned char> Vo_CHAR;
10 Registry::iterator
p =
12 if (p !=
indexes.end() && p->detid == DetId)
16 size_t sd = Vo_CHAR.end() - Vo_CHAR.begin();
18 detregistry.
detid = DetId;
32 if (p ==
indexes.end() || p->detid != DetId)
43 DetIds_.push_back(
p->detid);
48 vped.push_back((static_cast<uint16_t>(ped) & 0x3FF));
52 if (10 * strip >= (range.second - range.first) * 8) {
54 <<
"[SiStripPedestals::getPed] looking for SiStripPedestals for a strip out of range: strip " <<
strip;
56 return static_cast<float>(
decode(strip, range));
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);
102 const char*
data = &*(range.second - 1);
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;
155 *out =
static_cast<int>(
get10bits(ptr, 0));
157 *out =
static_cast<int>(
get10bits(ptr, 2));
159 *out =
static_cast<int>(
get10bits(ptr, 4));
161 *out =
static_cast<int>(
get10bits(ptr, 6));
165 for (
size_t rem = 0; rem < carry; ++rem) {
166 *out =
static_cast<int>(
get10bits(ptr, 2 * 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) {
205 ss << std::setw(15) << strip++ << std::setw(10) <<
getPed(it, range) << std::endl;
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints all pedestals.
tuple ret
prodAgent to be discontinued
uint16_t *__restrict__ id
std::pair< ContainerIterator, ContainerIterator > Range
void encode(InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
uint16_t decode(const uint16_t &strip, const Range &range) const
static std::string const input
const uint16_t range(const Frame &aFrame)
float getPed(const uint16_t &strip, const Range &range) const
std::vector< uint16_t > InputVector
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints mean pedestal value divided for subdet, layer and mono/stereo.
void allPeds(std::vector< int > &pefs, const Range &range) const
void getDetIds(std::vector< uint32_t > &DetIds_) const
bool put(const uint32_t &detID, InputVector &input)
void setData(float ped, InputVector &vped)
char data[epos_bytes_allocation]
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
uint16_t get10bits(const uint8_t *&ptr, int8_t skip) const
const Range getRange(const uint32_t &detID) const
Registry::const_iterator RegistryIterator
tuple size
Write out results.