#include <RceFragment.hh>
Definition at line 19 of file RceFragment.hh.
dune::RceFragment::RceFragment |
( |
artdaq::Fragment const & |
fragment | ) |
|
Definition at line 17 of file RceFragment.cc.
18 _data_ptr((uint64_t
const*)(afrag.dataBeginBytes() + 12))
const uint64_t * _data_ptr
dune::RceFragment::RceFragment |
( |
const uint64_t * |
data_ptr | ) |
|
void dune::RceFragment::_init |
( |
| ) |
|
|
private |
Definition at line 23 of file RceFragment.cc.
25 HeaderFragmentUnpack
const header (
_data_ptr);
26 if ( header.isData() )
32 _tpc_fragment = std::make_unique<TpcFragmentUnpack>(*_data_fragment);
std::unique_ptr< DataFragmentUnpack > _data_fragment
const uint64_t * _data_ptr
std::unique_ptr< TpcFragmentUnpack > _tpc_fragment
dune::RceFragments dune::RceFragment::from_container_frags |
( |
const artdaq::Fragments & |
frags | ) |
|
|
static |
Definition at line 79 of file RceFragment.cc.
83 for (
auto const& frag: frags)
85 artdaq::ContainerFragment cfrag(frag);
86 for (
size_t ii = 0 ; ii < cfrag.block_count(); ++ii)
88 auto* data_ptr = (uint8_t*) (cfrag.dataBegin());
89 data_ptr += cfrag.fragmentIndex(ii);
91 size_t afrag_size = 16;
92 artdaq::Fragment afrag;
93 afrag.resizeBytes(afrag_size);
94 memcpy(afrag.headerAddress(), data_ptr, afrag_size);
96 int afrag_header_bytes = afrag.dataBeginBytes()
97 - afrag.headerBeginBytes();
99 data_ptr += afrag_header_bytes;
std::vector< dune::RceFragment > RceFragments
TpcStreamUnpack const * dune::RceFragment::get_stream |
( |
int |
i | ) |
const |
Definition at line 48 of file RceFragment.cc.
std::unique_ptr< TpcFragmentUnpack > _tpc_fragment
void dune::RceFragment::hexdump |
( |
std::ostream & |
out, |
|
|
int |
n_words = 10 |
|
) |
| const |
Definition at line 55 of file RceFragment.cc.
58 for (
int i = 0; i < n_words; ++i)
QTextStream & hex(QTextStream &s)
const uint64_t * _data_ptr
QTextStream & dec(QTextStream &s)
QTextStream & endl(QTextStream &s)
void dune::RceFragment::save |
( |
const std::string & |
filepath | ) |
const |
Definition at line 63 of file RceFragment.cc.
67 size_t bytes = (header >> 8) & 0xffffff;
68 bytes *=
sizeof(uint64_t);
70 std::ofstream b_stream(
filepath.c_str(),
71 std::fstream::out | std::fstream::binary);
73 char const*
data =
reinterpret_cast<decltype(data)
>(
_data_ptr);
74 b_stream.write(data, bytes);
const uint64_t * _data_ptr
byte bytes
Alias for common language habits.
int dune::RceFragment::size |
( |
| ) |
const |
|
inline |
std::unique_ptr<DataFragmentUnpack> dune::RceFragment::_data_fragment |
|
private |
const uint64_t* dune::RceFragment::_data_ptr |
|
private |
int dune::RceFragment::_n_streams = 0 |
|
private |
std::unique_ptr<TpcFragmentUnpack> dune::RceFragment::_tpc_fragment |
|
private |
The documentation for this class was generated from the following files: