Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dune-raw-data
dune-raw-data
Overlays
CTBFragment.cc
Go to the documentation of this file.
1
#include "
dune-raw-data/Overlays/CTBFragment.hh
"
2
3
namespace
dune
{
4
5
6
std::ostream &
operator <<
(std::ostream & out,
CTBFragment
const
&
f
) {
7
8
out <<
"Fragment size: "
<< f.
artdaq_Fragment_
.dataSizeBytes() <<
" -> "
<< f.
_n_words
<<
" words"
<<
std::endl
;
9
10
for
(
unsigned
int
i = 0; i < f.
NWords
() ; ++i ) {
11
12
if
( f.
Trigger
(i) ) {
13
out <<
"Trigger word "
<<
std::hex
<< f.
Trigger
(i) ->
word_type
14
<<
", payload: "
<< f.
Trigger
(i) -> trigger_word
15
<<
", TS: "
<< f.
Trigger
(i) -> timestamp <<
std::dec
<<
std::endl
;
16
}
17
else
if
( f.
ChStatus
(i) ) {
18
out <<
"Check Status word "
<<
std::hex
19
<<
" PDS "
<< f.
ChStatus
(i) -> get_pds()
20
<<
", CRT: "
<< f.
ChStatus
(i) -> get_crt()
21
<<
", Beam: "
<< f.
ChStatus
(i) -> get_beam()
22
<<
", TS: "
<< f.
ChStatus
(i) -> timestamp
23
<<
std::dec
<<
std::endl
;
24
25
}
26
else
if
( f.
Feedback
(i) ) {
27
out <<
"Feedback word "
<<
std::hex
28
<<
", Padding: "
<< f.
Feedback
(i) -> padding
29
<<
", Source: "
<< f.
Feedback
(i) -> source
30
<<
", Code: "
<< f.
Feedback
(i) ->
code
31
<<
", TS: "
<< f.
Feedback
(i) -> timestamp <<
std::dec
<<
std::endl
;
32
33
}
34
else
{
35
out <<
"type: "
<<
std::hex
<< f.
Word
(i) ->
word_type
36
<<
", payload: "
<< f.
Word
(i) -> payload
37
<<
", TS: "
<< f.
Word
(i) -> timestamp <<
std::dec
<<
std::endl
;
38
}
39
40
}
41
42
43
return
out ;
44
}
45
46
47
48
CTBFragment::CTBFragment
( artdaq::Fragment
const
&
f
) :
49
50
_n_words( f.dataSizeBytes()/
CTBFragment
::WordSize() ),
51
artdaq_Fragment_( f )
52
{ ; }
53
54
55
//--------------------------------
56
// word getters
57
//--------------------------------
58
59
const
ptb::content::word::word_t
*
CTBFragment::Word
(
unsigned
int
i )
const
{
60
61
if
( i >=
NWords
() )
return
nullptr ;
62
63
return
reinterpret_cast<
const
ptb::content::word::word_t
*
>
(
artdaq_Fragment_
.dataBeginBytes() + i *
CTBFragment::WordSize
() ) ;
64
65
}
66
67
68
const
ptb::content::word::feedback_t
*
CTBFragment::Feedback
(
unsigned
int
i )
const
{
69
70
const
ptb::content::word::word_t
*
w
=
Word
( i ) ;
71
72
if
( ! w )
return
nullptr ;
73
74
return
CTBFragment::Feedback
( *w ) ;
75
76
}
77
78
79
const
ptb::content::word::ch_status_t
*
CTBFragment::ChStatus
(
unsigned
int
i )
const
{
80
81
const
ptb::content::word::word_t
*
w
=
Word
( i ) ;
82
83
if
( ! w )
return
nullptr ;
84
85
return
CTBFragment::ChStatus
( *w ) ;
86
87
}
88
89
90
const
ptb::content::word::timestamp_t
*
CTBFragment::Timestamp
(
unsigned
int
i )
const
{
91
92
const
ptb::content::word::word_t
*
w
=
Word
( i ) ;
93
94
if
( ! w )
return
nullptr ;
95
96
return
CTBFragment::Timestamp
( *w ) ;
97
98
}
99
100
101
const
ptb::content::word::trigger_t
*
CTBFragment::Trigger
(
unsigned
int
i )
const
{
102
103
const
ptb::content::word::word_t
*
w
=
Word
( i ) ;
104
105
if
( ! w )
return
nullptr ;
106
107
return
CTBFragment::Trigger
( *w ) ;
108
109
}
110
111
112
113
// casting methods
114
115
const
ptb::content::word::feedback_t
*
CTBFragment::Feedback
(
const
ptb::content::word::word_t
&
w
) {
116
117
if
( w.
word_type
!=
ptb::content::word::t_fback
)
return
nullptr ;
118
119
return
reinterpret_cast<
const
ptb::content::word::feedback_t
*
>
( &
w
) ;
120
121
}
122
123
const
ptb::content::word::ch_status_t
*
CTBFragment::ChStatus
(
const
ptb::content::word::word_t
&
w
) {
124
125
if
( w.
word_type
!=
ptb::content::word::t_ch
)
return
nullptr ;
126
127
return
reinterpret_cast<
const
ptb::content::word::ch_status_t
*
>
( &
w
) ;
128
129
}
130
131
const
ptb::content::word::timestamp_t
*
CTBFragment::Timestamp
(
const
ptb::content::word::word_t
&
w
) {
132
133
if
( w.
word_type
!=
ptb::content::word::t_ts
)
return
nullptr ;
134
135
return
reinterpret_cast<
const
ptb::content::word::timestamp_t
*
>
( &
w
) ;
136
137
}
138
139
const
ptb::content::word::trigger_t
*
CTBFragment::Trigger
(
const
ptb::content::word::word_t
&
w
) {
140
141
if
( w.
word_type
!=
ptb::content::word::t_lt
&& w.
word_type
!=
ptb::content::word::t_gt
)
return
nullptr ;
142
143
return
reinterpret_cast<
const
ptb::content::word::trigger_t
*
>
( &
w
) ;
144
145
}
146
147
}
// namespace dune
148
dune
Definition:
PdspHDFFileReader.hh:29
dune::CTBFragment::ChStatus
const ptb::content::word::ch_status_t * ChStatus(unsigned int i) const
Definition:
CTBFragment.cc:79
keras_to_tensorflow.f
f
Definition:
keras_to_tensorflow.py:162
dune::CTBFragment::artdaq_Fragment_
artdaq::Fragment const & artdaq_Fragment_
Definition:
CTBFragment.hh:98
dune::operator<<
std::ostream & operator<<(std::ostream &out, CTBFragment const &f)
Definition:
CTBFragment.cc:6
ptb::content::word::word_t::word_type
word_type_t word_type
Definition:
CTB_content.h:89
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::_n_words
const unsigned int _n_words
Definition:
CTBFragment.hh:96
hex
QTextStream & hex(QTextStream &s)
Definition:
qtextstream.cpp:2024
ptb::content::word::timestamp_t
Definition:
CTB_content.h:176
dune::CTBFragment
Definition:
CTBFragment.hh:37
ptb::content::word::t_gt
Definition:
CTB_content.h:59
ptb::content::word::t_ts
Definition:
CTB_content.h:59
code
CodeOutputInterface * code
Definition:
tclscanner.cpp:1114
ptb::content::word::t_lt
Definition:
CTB_content.h:59
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
dec
QTextStream & dec(QTextStream &s)
Definition:
qtextstream.cpp:2018
CTBFragment.hh
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
ptb::content::word::word_type
word_type
Definition:
CTB_content.h:59
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
ptb::content::word::t_fback
Definition:
CTB_content.h:59
dune::CTBFragment::NWords
unsigned int NWords() const noexcept
Definition:
CTBFragment.hh:47
ptb::content::word::ch_status_t
Definition:
CTB_content.h:134
ptb::content::word::t_ch
Definition:
CTB_content.h:59
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
dune::CTBFragment::WordSize
static constexpr unsigned int WordSize()
Definition:
CTBFragment.hh:86
Generated by
1.8.11