8 #if ((defined WIN32) && (defined __CINT__))
10 typedef short int int16_t;
11 typedef unsigned int uint32_t;
12 typedef unsigned short int uint16_t;
13 typedef unsigned char uint8_t;
20 #include <Windows4Root.h>
58 template<
class ConfigType>
59 bool operator()(
const ConfigType &config)
const
61 return config.enable() == _isEnable;
74 template<
class ConfigType>
75 bool operator()(
const ConfigType &config)
const
77 return config.mask() == _isMasked;
85 const uint8_t _column;
88 const bool _check_roc;
91 findPixelXY(
const uint8_t pColumn,
const uint8_t pRow)
92 : _column(pColumn), _row(pRow), _roc(0), _check_roc(
false) {}
93 findPixelXY(
const uint8_t pColumn,
const uint8_t pRow,
const uint8_t pRoc)
94 : _column(pColumn), _row(pRow), _roc(pRoc), _check_roc(
true) {}
96 template<
class ConfigType>
97 bool operator()(
const ConfigType &config)
const
99 if(_check_roc)
return (config.row() == _row) && (config.column() == _column) && (config.roc() == _roc);
100 return (config.row() == _row) && (config.column() == _column);
110 const uint8_t _column;
114 findPixelBeyondXY(
const uint8_t pColumn,
const uint8_t pRow) : _column(pColumn), _row(pRow) {}
116 template<
class ConfigType>
117 bool operator()(
const ConfigType &config)
const
119 return (config.row() > _row) || (config.column() > _column);
127 const uint8_t _i2c_address;
130 findRoc(
const uint8_t pI2cAddress) : _i2c_address(pI2cAddress) {}
132 template<
class ConfigType>
133 bool operator()(
const ConfigType &config)
const
135 return (config.i2c_address == _i2c_address);
144 if(pxA.size() != pxB.size())
return false;
147 for(std::vector<pixelConfig>::const_iterator pixit = pxA.begin(); pixit != pxA.end(); pixit++){
148 if(std::count_if(pxB.begin(), pxB.end(),
findPixelXY(pixit->column(),pixit->row())) != 1) {
return false; }
156 template <
typename T>
157 std::string
listVector(std::vector<T> vec,
bool hex =
false) {
158 std::stringstream os;
159 if(hex) { os << std::hex; }
160 for(
typename std::vector<T>::iterator it = vec.begin(); it != vec.end(); ++it) {
161 if(hex) os << std::setw(4) << std::setfill(
'0');
162 os << static_cast<int>(*it) <<
" ";
164 if(hex) { os << std::dec; }
171 std::stringstream os;
174 if(flags == 0)
return "(0) ";
176 if((flags&FLAG_FORCE_SERIAL) != 0) { os <<
"FLAG_FORCE_SERIAL, "; flags -= FLAG_FORCE_SERIAL; }
177 if((flags&FLAG_CALS) != 0) { os <<
"FLAG_CALS, "; flags -= FLAG_CALS; }
178 if((flags&FLAG_XTALK) != 0) { os <<
"FLAG_XTALK, "; flags -= FLAG_XTALK; }
179 if((flags&FLAG_RISING_EDGE) != 0) { os <<
"FLAG_RISING_EDGE, "; flags -= FLAG_RISING_EDGE; }
180 if((flags&FLAG_FORCE_MASKED) != 0) { os <<
"FLAG_FORCE_MASKED (obsolete), "; flags -= FLAG_FORCE_MASKED; }
181 if((flags&FLAG_DISABLE_DACCAL) != 0) { os <<
"FLAG_DISABLE_DACCAL, "; flags -= FLAG_DISABLE_DACCAL; }
182 if((flags&FLAG_NOSORT) != 0) { os <<
"FLAG_NOSORT, "; flags -= FLAG_NOSORT; }
183 if((flags&FLAG_CHECK_ORDER) != 0) { os <<
"FLAG_CHECK_ORDER, "; flags -= FLAG_CHECK_ORDER; }
184 if((flags&FLAG_FORCE_UNMASKED) != 0) { os <<
"FLAG_FORCE_UNMASKED, "; flags -= FLAG_FORCE_UNMASKED; }
186 if(flags != 0) os <<
"Unknown flag: " << flags;
std::string listFlags(uint32_t flags)
bool comparePixelConfiguration(const std::vector< pixelConfig > pxA, const std::vector< pixelConfig > pxB)
std::string listVector(std::vector< T > vec, bool hex=false)