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();
unsigned long long int iMax() const
int plEncode(bool b=true) const
TTBV(unsigned long long int value, int size)
TTBV operator+(const TTBV &rhs) const
Bit vector used by Track Trigger emulators. Mainly used to convert integers into arbitrary (within ma...
std::string str(int start, int end=0) const
TTBV & operator+=(const TTBV &rhs)
TTBV & operator &=(const TTBV &rhs)
TTBV & operator|=(const TTBV &rhs)
bool operator==(const TTBV &rhs) const
std::bitset< S >::reference msb()
int val(bool Signed) const
TTBV & operator>>=(int pos)
double val(double base) const
TTBV operator>>(int pos) const
std::bitset< S > bs() const
TTBV operator<<(int pos) const
TTBV(int value, int size, bool Signed=false)
TTBV(const std::bitset< S > &bs, bool Signed=false)
int count(int begin, int end, bool b=true) const
bool operator[](int pos) const
std::bitset< S >::reference operator[](int pos)
TTBV & operator^=(const TTBV &rhs)
bool operator!=(const TTBV &rhs) const
TTBV(double value, double base, int size, bool Signed=false)
constexpr std::array< unsigned long long int, S > powersOfTwo() const
TTBV(const std::string &str, bool Signed=false)
int val(int start, int end=0, bool Signed=false) const
int pmEncode(bool b=true) const
TTBV & operator<<=(int pos)
Power< A, B >::type pow(const A &a, const B &b)