1 #ifndef EventFilter_Phase2TrackerRawToDigi_utils_H // { 2 #define EventFilter_Phase2TrackerRawToDigi_utils_H 20 static const uint16_t
NUMBER_OF_FEDS =
static_cast<uint16_t
>( FED_ID_MAX - FED_ID_MIN + 1 );
38 const std::ios_base::fmtflags originalFormatFlags = os.flags();
39 os << std::hex << std::setw(1) <<
value;
40 os.flags(originalFormatFlags);
45 const std::ios_base::fmtflags originalFormatFlags = os.flags();
46 os << std::hex << std::setfill(
'0') << std::setw(2);
47 os << uint16_t(value);
48 os.flags(originalFormatFlags);
51 inline void printHexWord(
const uint8_t* pointer,
const size_t lengthInBytes, std::ostream& os)
53 size_t i = lengthInBytes-1;
56 if (i != 0) os <<
" ";
60 inline void printHex(
const void* pointer,
const size_t lengthInBytes, std::ostream& os)
62 const uint8_t* bytePointer =
reinterpret_cast<const uint8_t*
>(pointer);
64 if (lengthInBytes <= 8) {
70 os <<
"word\tbyte\t \t\tbyte" << std::endl;;
71 const size_t words = lengthInBytes/8;
72 const size_t extraBytes = lengthInBytes - 8*words;
74 for (
size_t w = 0;
w < words;
w++) {
75 const size_t startByte =
w*8;
76 os <<
w <<
'\t' << startByte+8 <<
'\t';
78 os <<
"\t\t" << startByte << std::endl;
82 const size_t startByte = words*8;
83 os << words <<
'\t' << startByte+8 <<
'\t';
86 while (p-- > extraBytes) {
90 os <<
"\t\t" << startByte << std::endl;
119 os <<
"Processed raw";
122 os <<
"Zero suppressed";
125 os <<
"Zero suppressed lite";
134 os <<
"Unrecognized";
158 os <<
"Summary mode";
161 os <<
"Full debug mode";
164 os <<
"CBC error mode";
167 os <<
"Unrecognized mode";
206 data = (data &
mask) >> shift;
212 #endif // } end def utils
void printHexWord(const uint8_t *pointer, const size_t lengthInBytes, std::ostream &os)
static const int TRIGGER_SIZE
std::ostream & operator<<(std::ostream &os, const FEDDAQEventType &value)
static const uint8_t INVALID
static const uint16_t CMS_FED_ID_MAX
static const int MAX_CBC_PER_FE
void printHexValue(const uint8_t value, std::ostream &os)
unsigned long long uint64_t
void printNibbleValue(uint8_t value, std::ostream &os)
static const uint16_t FED_ID_MAX
char data[epos_bytes_allocation]
void printHex(const void *pointer, const size_t lengthInBytes, std::ostream &os)
uint64_t extract64(trackerHeader_m mask, trackerHeader_s shift, uint64_t data)
static unsigned int const shift
static const int STRIPS_PER_CBC
static const uint16_t FED_ID_MIN
static const int MAX_FE_PER_FED
static const int STRIPS_PADDING
uint64_t read64(int offset, const uint8_t *buffer)
static const uint16_t NUMBER_OF_FEDS