7 std::vector<unsigned char> Vo_CHAR;
10 Registry::iterator
p =
16 size_t sd = Vo_CHAR.end() - Vo_CHAR.begin();
43 DetIds_.push_back(
p->detid);
48 vped.push_back((static_cast<uint16_t>(
ped) & 0x3FF));
54 <<
"[SiStripPedestals::getPed] looking for SiStripPedestals for a strip out of range: strip " <<
strip;
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)
67 unsigned char*
data = &Vo[Vo.size() - 1];
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);
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;
165 for (
size_t rem = 0; rem < carry; ++rem) {
172 std::vector<uint32_t>
detid;
175 for (
size_t id = 0;
id <
detid.size(); ++
id) {
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;
200 if (
detId != oldDetId) {
uint16_t get10bits(const uint8_t *&ptr, int8_t skip) const
const Range getRange(const uint32_t &detID) const
ret
prodAgent to be discontinued
uint16_t decode(const uint16_t &strip, const Range &range) const
void allPeds(std::vector< int > &pefs, const Range &range) const
std::pair< ContainerIterator, ContainerIterator > Range
void encode(InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
float getPed(const uint16_t &strip, const Range &range) const
static std::string const input
void getDetIds(std::vector< uint32_t > &DetIds_) const
std::vector< uint16_t > InputVector
__host__ __device__ std::uint32_t stripIndex(fedId_t fed, fedCh_t channel, stripId_t strip)
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints mean pedestal value divided for subdet, layer and mono/stereo.
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints all pedestals.
bool put(const uint32_t &detID, InputVector &input)
void setData(float ped, InputVector &vped)
char data[epos_bytes_allocation]
Registry::const_iterator RegistryIterator