24 for (
unsigned int i = 0;
i < bits.size();
i++)
25 bits_[
i] = static_cast<unsigned char>(cpt[
i]);
32 for (
int i = 0;
i < (int)
sizeof(
bits_);
i++) {
47 for (
int i = 0;
i < 52;
i++) {
58 unsigned char byte = 0;
60 for (
int j = 0;
j < 80;
j++) {
61 unsigned char tmp = toupper(data[
j]) - 48;
67 if ((j + 1) % 2 == 0) {
69 bits_[
i * 40 + (j + 1) / 2 - 1] = byte;
84 for (
int i = 0;
i < 52;
i++) {
90 unsigned char byte = 0;
91 for (
int j = 0;
j < 80;
j++) {
92 unsigned char tmp = toupper(data[
j]) - 48;
96 if ((j + 1) % 2 == 0) {
98 bits_[
i * 40 + (j + 1) / 2 - 1] = byte;
111 in.read((
char*)
bits_, 2080);
123 for (
unsigned int i = 0;
i < 2080;
i++) {
136 for (
unsigned int col = 0;
col < 52;
col++) {
141 for (
int row = 0; row < 80; row++) {
142 out << std::hex << std::uppercase <<
trim(col, row) <<
std::dec;
149 unsigned int tmp =
bits_[col * 40 + row / 2];
158 unsigned int mask = 0xf0;
163 unsigned int tmp =
bits_[col * 40 + row / 2];
164 bits_[col * 40 + row / 2] = (tmp & mask) | trim;
168 s <<
"Dumping ROC masks" << std::endl;
170 for (
int i = 0;
i < 52;
i++) {
171 s <<
"Col" <<
i <<
": ";
172 for (
int j = 0;
j < 40;
j++) {
173 unsigned char bitmask = 15 * 16;
174 for (
int k = 0;
k < 2;
k++) {
175 unsigned int tmp = mask.
bits_[i * 40 +
j] & bitmask;
190 std::string mthn =
"[PixelROCTrimBits::writeXML()]\t\t\t\t";
195 *out <<
" <DATA>" << std::endl;
196 *out <<
" <ROC_NAME>" <<
rocid_.
rocname() <<
"</ROC_NAME>" << std::endl;
197 *out <<
" <TRIM_BITS>" << encoded <<
"</TRIM_BITS>" << std::endl;
198 *out <<
" </DATA>" << std::endl;
199 *out <<
" " << std::endl;
int read(PixelROCName rocid, std::string in)
void setROCTrimBits(PixelROCName rocid, std::string bits)
#define base64_decode(in, inlen, out, outlen)
void writeBinary(std::ofstream &out) const
static void trim(std::string &s)
int readBinary(PixelROCName rocid, std::ifstream &in)
unsigned int trim(unsigned int col, unsigned int row) const
std::string rocname() const
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
std::string base64_encode(unsigned char const *, unsigned int len)
void writeXML(std::ofstream *out) const
void setTrim(unsigned int col, unsigned int row, unsigned int trim)
char data[epos_bytes_allocation]
unsigned char bits_[2080]
void writeASCII(std::ofstream &out) const