|
|
Go to the documentation of this file. 1 #ifndef DataFormats_L1TrackTrigger_TTBV_h
2 #define DataFormats_L1TrackTrigger_TTBV_h
20 static constexpr
int S = 64;
34 const char*
c = reinterpret_cast<const char*>(&
d);
35 for (
int iByte = 0; iByte < (
int)
sizeof(
d); iByte++) {
36 const std::bitset<std::numeric_limits<unsigned char>::digits> byte(*(
c + iByte));
37 for (
int bit = 0; bit < std::numeric_limits<unsigned char>::digits; bit++)
61 std::bitset<S>
bs()
const {
return bs_; }
72 bool all()
const {
return bs_.all(); }
73 bool any()
const {
return bs_.any(); }
146 bs_ = std::bitset<S>(
bs_.to_ullong() + 1);
202 }
else if (size < size_ && size > 0) {
220 int val(
bool Signed)
const {
return (Signed && this->
msb()) ? (
int)bs_.to_ullong() -
iMax() :
bs_.to_ullong(); }
231 for (
int i = begin;
i <
end;
i++)
247 for (
int e =
size_ - 1;
e > -1;
e--)
255 constexpr std::array<unsigned long long int, S>
powersOfTwo()
const {
256 std::array<unsigned long long int, S> lut = {};
257 for (
int i = 0;
i <
S;
i++)
263 unsigned long long int iMax()
const {
264 static const std::array<unsigned long long int, S> lut =
powersOfTwo();
double val(double base) const
std::bitset< S > bs() const
TTBV(int value, int size, bool Signed=false)
bool operator!=(const TTBV &rhs) const
TTBV(double value, double base, int size, bool Signed=false)
TTBV operator<<(int pos) const
constexpr std::array< unsigned long long int, S > powersOfTwo() const
TTBV(const std::bitset< S > &bs, bool Signed=false)
std::bitset< S >::reference operator[](int pos)
bool operator[](int pos) const
TTBV & operator^=(const TTBV &rhs)
TTBV(const std::string &str, bool Signed=false)
int val(int start, int end=0, bool Signed=false) const
TTBV(unsigned long long int value, int size)
unsigned long long int iMax() const
int pmEncode(bool b=true) const
int plEncode(bool b=true) const
TTBV & operator<<=(int pos)
std::string str(int start, int end=0) const
TTBV & operator+=(const TTBV &rhs)
TTBV & operator&=(const TTBV &rhs)
bool operator==(const TTBV &rhs) const
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
TTBV operator+(const TTBV &rhs) const
TTBV & operator|=(const TTBV &rhs)
int val(bool Signed) const
std::bitset< S >::reference msb()
Power< A, B >::type pow(const A &a, const B &b)
TTBV & operator>>=(int pos)
int count(int begin, int end, bool b=true) const
TTBV operator>>(int pos) const