Public Member Functions | Public Attributes | List of all members
dune::WIBHeader Struct Reference

#include <FelixFormat.hh>

Public Member Functions

uint64_t timestamp () const
 
uint16_t wib_counter () const
 
void set_timestamp (const uint64_t new_timestamp)
 
void set_wib_counter (const uint16_t new_wib_counter)
 
void print () const
 
void printHex () const
 
void printBits () const
 

Public Attributes

word_t sof: 8
 
word_t version: 5
 
word_t fiber_no: 3
 
word_t crate_no: 5
 
word_t slot_no: 3
 
word_t reserved_1: 8
 
word_t mm: 1
 
word_t oos: 1
 
word_t reserved_2: 14
 
word_t wib_errors: 16
 
word_t timestamp_1
 
word_t timestamp_2: 16
 
word_t wib_counter_1: 15
 
word_t z: 1
 

Detailed Description

Definition at line 24 of file FelixFormat.hh.

Member Function Documentation

void dune::WIBHeader::print ( ) const
inline

Definition at line 54 of file FelixFormat.hh.

54  {
55  std::cout << "SOF:" << unsigned(sof) << " version:" << unsigned(version)
56  << " fiber:" << unsigned(fiber_no)
57  << " slot:" << unsigned(slot_no)
58  << " crate:" << unsigned(crate_no) << " mm:" << unsigned(mm)
59  << " oos:" << unsigned(oos)
60  << " wib_errors:" << unsigned(wib_errors)
61  << " timestamp: " << timestamp() << '\n';
62  }
uint64_t timestamp() const
Definition: FelixFormat.hh:31
void dune::WIBHeader::printBits ( ) const
inline

Definition at line 71 of file FelixFormat.hh.

71  {
72  std::cout << "SOF:" << std::bitset<8>(sof)
73  << " version:" << std::bitset<5>(version)
74  << " fiber:" << std::bitset<3>(fiber_no)
75  << " slot:" << std::bitset<5>(slot_no)
76  << " crate:" << std::bitset<3>(crate_no) << " mm:" << bool(mm)
77  << " oos:" << bool(oos)
78  << " wib_errors:" << std::bitset<16>(wib_errors)
79  << " timestamp: " << timestamp() << '\n'
80  << " Z: " << z << '\n';
81  }
uint64_t timestamp() const
Definition: FelixFormat.hh:31
int bool
Definition: qglobal.h:345
void dune::WIBHeader::printHex ( ) const
inline

Definition at line 63 of file FelixFormat.hh.

63  {
64  std::cout << std::hex << "SOF:" << sof << " version:" << version
65  << " fiber:" << fiber_no << " slot:" << slot_no
66  << " crate:" << crate_no << " mm:" << mm << " oos:" << oos
67  << " wib_errors:" << wib_errors << " timestamp: " << timestamp()
68  << std::dec << '\n';
69  }
QTextStream & hex(QTextStream &s)
uint64_t timestamp() const
Definition: FelixFormat.hh:31
QTextStream & dec(QTextStream &s)
void dune::WIBHeader::set_timestamp ( const uint64_t  new_timestamp)
inline

Definition at line 40 of file FelixFormat.hh.

40  {
41  timestamp_1 = new_timestamp;
42  timestamp_2 = new_timestamp >> 32;
43  if (!z) {
44  wib_counter_1 = new_timestamp >> 48;
45  }
46  }
word_t wib_counter_1
Definition: FelixFormat.hh:29
word_t timestamp_1
Definition: FelixFormat.hh:28
word_t timestamp_2
Definition: FelixFormat.hh:29
void dune::WIBHeader::set_wib_counter ( const uint16_t  new_wib_counter)
inline

Definition at line 47 of file FelixFormat.hh.

47  {
48  if(z) {
49  wib_counter_1 = new_wib_counter;
50  }
51  }
word_t wib_counter_1
Definition: FelixFormat.hh:29
uint64_t dune::WIBHeader::timestamp ( ) const
inline

Definition at line 31 of file FelixFormat.hh.

31  {
32  uint64_t timestamp = timestamp_1 | ((uint64_t)timestamp_2 << 32);
33  if (!z) {
34  timestamp |= (uint64_t)wib_counter_1 << 48;
35  }
36  return timestamp;
37  }
word_t wib_counter_1
Definition: FelixFormat.hh:29
uint64_t timestamp() const
Definition: FelixFormat.hh:31
word_t timestamp_1
Definition: FelixFormat.hh:28
word_t timestamp_2
Definition: FelixFormat.hh:29
uint16_t dune::WIBHeader::wib_counter ( ) const
inline

Definition at line 38 of file FelixFormat.hh.

38 { return z ? wib_counter_1 : 0; }
word_t wib_counter_1
Definition: FelixFormat.hh:29

Member Data Documentation

word_t dune::WIBHeader::crate_no

Definition at line 25 of file FelixFormat.hh.

word_t dune::WIBHeader::fiber_no

Definition at line 25 of file FelixFormat.hh.

word_t dune::WIBHeader::mm

Definition at line 27 of file FelixFormat.hh.

word_t dune::WIBHeader::oos

Definition at line 27 of file FelixFormat.hh.

word_t dune::WIBHeader::reserved_1

Definition at line 25 of file FelixFormat.hh.

word_t dune::WIBHeader::reserved_2

Definition at line 27 of file FelixFormat.hh.

word_t dune::WIBHeader::slot_no

Definition at line 25 of file FelixFormat.hh.

word_t dune::WIBHeader::sof

Definition at line 25 of file FelixFormat.hh.

word_t dune::WIBHeader::timestamp_1

Definition at line 28 of file FelixFormat.hh.

word_t dune::WIBHeader::timestamp_2

Definition at line 29 of file FelixFormat.hh.

word_t dune::WIBHeader::version

Definition at line 25 of file FelixFormat.hh.

word_t dune::WIBHeader::wib_counter_1

Definition at line 29 of file FelixFormat.hh.

word_t dune::WIBHeader::wib_errors

Definition at line 27 of file FelixFormat.hh.

word_t dune::WIBHeader::z

Definition at line 29 of file FelixFormat.hh.


The documentation for this struct was generated from the following file: