Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dune-raw-data
dune-raw-data
Overlays
CTBFragment.hh
Go to the documentation of this file.
1
#ifndef dune_artdaq_Overlays_CTBFragment_hh
2
#define dune_artdaq_Overlays_CTBFragment_hh
3
4
#include "artdaq-core/Data/Fragment.hh"
5
6
#include "
dune-raw-data/Overlays/CTB_content.h
"
7
8
#include <ostream>
9
#include <vector>
10
11
12
13
14
/*
15
-------------------------------------
16
Brief guide to CTB fragments
17
-------------------------------------
18
19
The CTB keeps sending information to the DAQ at all times.
20
Its fragments are just random collections of words
21
from the trigger board.
22
In this context "random" means that the wrapping is not particularly significant
23
and it is determined by pure convenience during runtime.
24
25
Hence the structure of fragments is quite simple.
26
It is just an array of trigger words.
27
The trigger words are defined in the content.h file, see include.
28
29
This overlay classes is just providing the proper readouts and
30
casts to the proper word type.
31
32
*/
33
34
namespace
dune
{
35
36
37
class
CTBFragment
{
38
public
:
39
40
// The constructor simply sets its const private member "artdaq_Fragment_"
41
// to refer to the artdaq::Fragment object
42
43
CTBFragment
( artdaq::Fragment
const
&
f
) ;
44
45
46
// const getter functions for the data in the header
47
unsigned
int
NWords
()
const
noexcept {
return
_n_words
; }
48
49
// array-like access to the words, index from 0 to NWords()-1
50
// this pointer should always be valid, if not there is a problem
51
// tipically i is too big
52
const
ptb::content::word::word_t
*
operator []
(
unsigned
int
i )
const
{
return
Word
(i) ; }
53
54
// casted words depending on their type for easy deconding
55
// An null pointer as a return means the requested cast is not correct
56
57
// access to the generic word structure.
58
// This simply allows access to word type, TS
59
// and the payload is not formatted
60
// this pointer should always be valid, if not there is a problem
61
const
ptb::content::word::word_t
*
Word
(
unsigned
int
i )
const
;
62
63
// These are words that report errors from the board
64
const
ptb::content::word::feedback_t
*
Feedback
(
unsigned
int
i )
const
;
65
66
// Channel status reports
67
const
ptb::content::word::ch_status_t
*
ChStatus
(
unsigned
int
i )
const
;
68
69
// simple mask to make explicit that this was a TS word
70
const
ptb::content::word::timestamp_t
*
Timestamp
(
unsigned
int
i )
const
;
71
72
// Trigger words
73
// There are a number of trigger words, the complete list being
74
// - High level trigger (HLT)
75
// - Low level trigger (LLT)
76
// yet the payload is organized in the same way and so the casting
77
// function is the same
78
const
ptb::content::word::trigger_t
*
Trigger
(
unsigned
int
i )
const
;
79
80
//static methods for casting
81
static
const
ptb::content::word::feedback_t
*
Feedback
(
const
ptb::content::word::word_t
&
w
) ;
82
static
const
ptb::content::word::ch_status_t
*
ChStatus
(
const
ptb::content::word::word_t
& w ) ;
83
static
const
ptb::content::word::timestamp_t
*
Timestamp
(
const
ptb::content::word::word_t
& w ) ;
84
static
const
ptb::content::word::trigger_t
*
Trigger
(
const
ptb::content::word::word_t
& w ) ;
85
86
static
constexpr
unsigned
int
WordSize
() {
return
sizeof
(
ptb::content::word::word_t
) ; }
87
88
friend
std::ostream &
operator <<
(std::ostream &,
CTBFragment
const
& ) ;
89
90
protected
:
91
92
//maybe let's put some utilities here
93
94
private
:
95
96
const
unsigned
int
_n_words
;
97
98
artdaq::Fragment
const
&
artdaq_Fragment_
;
99
100
};
101
102
103
}
// dune namespace
104
105
#endif
/* dune_artdaq_Overlays_CTBFragment_hh */
dune
Definition:
PdspHDFFileReader.hh:29
dune::CTBFragment::ChStatus
const ptb::content::word::ch_status_t * ChStatus(unsigned int i) const
Definition:
CTBFragment.cc:79
freeze_graph.const
const
Definition:
freeze_graph.py:179
keras_to_tensorflow.f
f
Definition:
keras_to_tensorflow.py:162
dune::CTBFragment::artdaq_Fragment_
artdaq::Fragment const & artdaq_Fragment_
Definition:
CTBFragment.hh:98
ptb::content::word::word_t
Definition:
CTB_content.h:82
dune::CTBFragment::Word
const ptb::content::word::word_t * Word(unsigned int i) const
Definition:
CTBFragment.cc:59
dune::CTBFragment::operator<<
friend std::ostream & operator<<(std::ostream &, CTBFragment const &)
Definition:
CTBFragment.cc:6
dune::CTBFragment::_n_words
const unsigned int _n_words
Definition:
CTBFragment.hh:96
ptb::content::word::timestamp_t
Definition:
CTB_content.h:176
dune::CTBFragment
Definition:
CTBFragment.hh:37
dune::CTBFragment::Trigger
const ptb::content::word::trigger_t * Trigger(unsigned int i) const
Definition:
CTBFragment.cc:101
dune::CTBFragment::CTBFragment
CTBFragment(artdaq::Fragment const &f)
Definition:
CTBFragment.cc:48
dune::CTBFragment::operator[]
const ptb::content::word::word_t * operator[](unsigned int i) const
Definition:
CTBFragment.hh:52
ptb::content::word::trigger_t
Definition:
CTB_content.h:195
dune::CTBFragment::Timestamp
const ptb::content::word::timestamp_t * Timestamp(unsigned int i) const
Definition:
CTBFragment.cc:90
ptb::content::word::feedback_t
Definition:
CTB_content.h:110
dune::CTBFragment::Feedback
const ptb::content::word::feedback_t * Feedback(unsigned int i) const
Definition:
CTBFragment.cc:68
projectgui.w
w
Definition:
projectgui.py:20
dune::CTBFragment::NWords
unsigned int NWords() const noexcept
Definition:
CTBFragment.hh:47
CTB_content.h
ptb::content::word::ch_status_t
Definition:
CTB_content.h:134
ptb::content::word::word_t
struct ptb::content::word::word_t word_t
dune::CTBFragment::WordSize
static constexpr unsigned int WordSize()
Definition:
CTBFragment.hh:86
Generated by
1.8.11