8 FPGAWord::FPGAWord() {}
10 FPGAWord::FPGAWord(
int value,
int nbits,
bool positive,
int line,
const char*
file) {
14 void FPGAWord::set(
int value,
int nbits,
bool positive,
int line,
const char*
file) {
25 edm::LogPrint(
"Tracklet") <<
"FPGAWord got too many bits:" << nbits <<
" (" <<
file <<
":" <<
line <<
")";
29 edm::LogPrint(
"Tracklet") <<
"FPGAWord got too few bits:" << nbits <<
" (" <<
file <<
":" <<
line <<
")";
33 if (
value >= (1 << nbits)) {
34 if (
file !=
nullptr) {
41 if (
value > (1 << (nbits - 1))) {
46 if (
value < -(1 << (nbits - 1))) {
55 const int nbit = nbits_;
57 if (!(nbit > 0 && nbit < 22))
66 for (
int i = 0;
i < nbit;
i++) {
67 str = ((valtmp & 1) ?
"1" :
"0") +
str;
75 assert(
lsb + nbit <= (
unsigned int)nbits());
76 return (value_ >>
lsb) & ((1 << nbit) - 1);
79 bool FPGAWord::atExtreme()
const {
81 return (value_ == 0) || (value_ == (1 << nbits_) - 1);
83 return ((value_ == (-(1 << (nbits_ - 1)))) || (value_ == ((1 << (nbits_ - 1)) - 1)));
87 return (value_ ==
other.value_) && (nbits_ ==
other.nbits_) && (positive_ ==
other.positive_);
Log< level::Info, true > LogVerbatim
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
Log< level::Warning, true > LogPrint
Log< level::Error, true > LogProblem