MilliSlice.hh
Go to the documentation of this file.
1 #ifndef dune_artdaq_Overlays_MilliSlice_hh
2 #define dune_artdaq_Overlays_MilliSlice_hh
3 
5 #include "artdaq-core/Data/Fragment.hh"
6 
7 namespace dune {
8  class MilliSlice;
9 }
10 
12 
13 public:
14 
15  struct Header {
16  typedef uint32_t data_t;
17 
18  typedef uint16_t pattern_t;
19  typedef uint16_t version_t;
20  typedef uint32_t millislice_size_t;
21  typedef uint32_t microslice_count_t;
22 
23  // this structure is deliberately incomplete - it should be
24  // improved to match what we want for the DUNE 35t detector
25 
26  data_t fixed_pattern : 16;
27  data_t version : 16;
28 
29  data_t millislice_size : 32; // total size, data & header
30 
31  data_t microslice_count : 32;
32  };
33 
34  // This constructor accepts a memory buffer that contains an existing
35  // MilliSlice and allows the the data inside it to be accessed
36  MilliSlice(uint8_t* address);
37 
38  // Returns the size of the MilliSlice
40 
41  // Returns the number of MicroSlices in this MilliSlice
43 
44  // Returns the requested MicroSlice if the requested slice was found,
45  // otherwise returns an empty pointer
46  std::unique_ptr<MicroSlice> microSlice(uint32_t index) const;
47 
48 protected:
49 
50  // returns a pointer to the header
51  Header const* header_() const;
52 
53  // returns a pointer to the requested MicroSlice
54  uint8_t* data_(int index) const;
55 
56  uint8_t* buffer_;
57 };
58 
59 #endif /* dune_artdaq_Overlays_MilliSlice_hh */
std::unique_ptr< MicroSlice > microSlice(uint32_t index) const
Definition: MilliSlice.cc:17
MilliSlice(uint8_t *address)
Definition: MilliSlice.cc:3
Header::microslice_count_t microSliceCount() const
Definition: MilliSlice.cc:12
Header const * header_() const
Definition: MilliSlice.cc:27
uint8_t * buffer_
Definition: MilliSlice.hh:56
uint8_t * data_(int index) const
Definition: MilliSlice.cc:32
Header::millislice_size_t size() const
Definition: MilliSlice.cc:7