Public Member Functions | Protected Member Functions | List of all members
dune::Frame14FragmentUnordered Class Reference

#include <Frame14Fragment.hh>

Inheritance diagram for dune::Frame14FragmentUnordered:
dune::Frame14Fragment

Public Member Functions

uint8_t link_mask (const unsigned &frame_ID=0) const
 
uint8_t femb_valid (const unsigned &frame_ID=0) const
 
uint8_t fiber_no (const unsigned &frame_ID=0) const
 
uint8_t slot_no (const unsigned &frame_ID=0) const
 
uint8_t crate_no (const unsigned &frame_ID=0) const
 
uint8_t frame_version (const unsigned &frame_ID=0) const
 
uint32_t wib_data (const unsigned &frame_ID=0) const
 
uint64_t timestamp (const unsigned &frame_ID=0) const
 
uint32_t crc20 (const unsigned &frame_ID=0) const
 
uint32_t flex12 (const unsigned &frame_ID=0) const
 
uint32_t flex24 (const unsigned &frame_ID=0) const
 
size_t total_frames () const
 
adc_t get_ADC (const unsigned &frame_ID, const uint8_t block_ID, const uint8_t channel_ID) const
 
adc_t get_ADC (const unsigned &frame_ID, const uint8_t channel_ID) const
 
adc_v get_ADCs_by_channel (const uint8_t block_ID, const uint8_t channel_ID) const
 
adc_v get_ADCs_by_channel (const uint8_t channel_ID) const
 
std::map< uint8_t, adc_vget_all_ADCs () const
 
 Frame14FragmentUnordered (artdaq::Fragment const &fragment)
 
- Public Member Functions inherited from dune::Frame14Fragment
 Frame14Fragment (const artdaq::Fragment &fragment)
 
virtual ~Frame14Fragment ()
 

Protected Member Functions

frame14::frame14 const * frame_ (const unsigned &frame_num=0) const
 

Additional Inherited Members

- Public Types inherited from dune::Frame14Fragment
typedef uint16_t adc_t
 
typedef std::vector< uint16_t > adc_v
 
- Protected Attributes inherited from dune::Frame14Fragment
Metadata meta_
 
const void * artdaq_Fragment_
 
size_t sizeBytes_
 

Detailed Description

Definition at line 93 of file Frame14Fragment.hh.

Constructor & Destructor Documentation

dune::Frame14FragmentUnordered::Frame14FragmentUnordered ( artdaq::Fragment const &  fragment)
inline

Definition at line 177 of file Frame14Fragment.hh.

178  : Frame14Fragment(fragment) {}
Frame14Fragment(const artdaq::Fragment &fragment)

Member Function Documentation

uint8_t dune::Frame14FragmentUnordered::crate_no ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 108 of file Frame14Fragment.hh.

108  {
109  return frame_(frame_ID)->crate_num;
110  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
uint32_t dune::Frame14FragmentUnordered::crc20 ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 121 of file Frame14Fragment.hh.

121  {
122  return frame_(frame_ID)->crc20;
123  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
uint8_t dune::Frame14FragmentUnordered::femb_valid ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 99 of file Frame14Fragment.hh.

99  {
100  return frame_(frame_ID)->femb_valid;
101  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
uint8_t dune::Frame14FragmentUnordered::fiber_no ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 102 of file Frame14Fragment.hh.

102  {
103  return frame_(frame_ID)->fiber_num;
104  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
uint32_t dune::Frame14FragmentUnordered::flex12 ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 124 of file Frame14Fragment.hh.

124  {
125  return frame_(frame_ID)->flex12;
126  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
uint32_t dune::Frame14FragmentUnordered::flex24 ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 127 of file Frame14Fragment.hh.

127  {
128  return frame_(frame_ID)->flex24;
129  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
frame14::frame14 const* dune::Frame14FragmentUnordered::frame_ ( const unsigned &  frame_num = 0) const
inlineprotected

Definition at line 182 of file Frame14Fragment.hh.

182  {
183  return static_cast<frame14::frame14 const*>(artdaq_Fragment_) + frame_num;
184  }
const void * artdaq_Fragment_
uint8_t dune::Frame14FragmentUnordered::frame_version ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 111 of file Frame14Fragment.hh.

111  {
112  return frame_(frame_ID)->frame_version;
113  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
adc_t dune::Frame14FragmentUnordered::get_ADC ( const unsigned &  frame_ID,
const uint8_t  block_ID,
const uint8_t  channel_ID 
) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 136 of file Frame14Fragment.hh.

137  {
138  if (block_ID == 0) {
139  return frame14::unpack14(frame_(frame_ID)->femb_a_seg,channel_ID);
140  } else if (block_ID == 1) {
141  return frame14::unpack14(frame_(frame_ID)->femb_b_seg,channel_ID);
142  } else {
143  return -1;
144  //FIXME throw an exception
145  }
146  }
uint16_t unpack14(const uint32_t *packed, size_t i)
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
adc_t dune::Frame14FragmentUnordered::get_ADC ( const unsigned &  frame_ID,
const uint8_t  channel_ID 
) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 147 of file Frame14Fragment.hh.

147  {
148  return get_ADC(frame_ID,channel_ID/128,channel_ID%128);
149  }
adc_t get_ADC(const unsigned &frame_ID, const uint8_t block_ID, const uint8_t channel_ID) const
adc_v dune::Frame14FragmentUnordered::get_ADCs_by_channel ( const uint8_t  block_ID,
const uint8_t  channel_ID 
) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 152 of file Frame14Fragment.hh.

153  {
155  for (size_t i = 0; i < total_frames(); i++) {
156  output[i] = get_ADC(i, block_ID, channel_ID);
157  }
158  return output;
159  }
adc_t get_ADC(const unsigned &frame_ID, const uint8_t block_ID, const uint8_t channel_ID) const
std::vector< uint16_t > adc_v
adc_v dune::Frame14FragmentUnordered::get_ADCs_by_channel ( const uint8_t  channel_ID) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 160 of file Frame14Fragment.hh.

160  {
162  for (size_t i = 0; i < total_frames(); i++) {
163  output[i] = get_ADC(i, channel_ID);
164  }
165  return output;
166  }
adc_t get_ADC(const unsigned &frame_ID, const uint8_t block_ID, const uint8_t channel_ID) const
std::vector< uint16_t > adc_v
std::map<uint8_t, adc_v> dune::Frame14FragmentUnordered::get_all_ADCs ( ) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 168 of file Frame14Fragment.hh.

168  {
169  std::map<uint8_t, adc_v> output;
170  for (int i = 0; i < 256; i++)
171  output.insert(std::pair<uint8_t, adc_v>(i, get_ADCs_by_channel(i)));
172  return output;
173  }
adc_v get_ADCs_by_channel(const uint8_t block_ID, const uint8_t channel_ID) const
uint8_t dune::Frame14FragmentUnordered::link_mask ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 96 of file Frame14Fragment.hh.

96  {
97  return frame_(frame_ID)->link_mask;
98  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
uint8_t dune::Frame14FragmentUnordered::slot_no ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 105 of file Frame14Fragment.hh.

105  {
106  return frame_(frame_ID)->slot_num;
107  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
uint64_t dune::Frame14FragmentUnordered::timestamp ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 118 of file Frame14Fragment.hh.

118  {
119  return frame_(frame_ID)->timestamp;
120  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const
size_t dune::Frame14FragmentUnordered::total_frames ( ) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 131 of file Frame14Fragment.hh.

131  {
132  return meta_.num_frames;
133  }
uint32_t dune::Frame14FragmentUnordered::wib_data ( const unsigned &  frame_ID = 0) const
inlinevirtual

Implements dune::Frame14Fragment.

Definition at line 115 of file Frame14Fragment.hh.

115  {
116  return frame_(frame_ID)->wib_data;
117  }
frame14::frame14 const * frame_(const unsigned &frame_num=0) const

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