RceFragment.hh
Go to the documentation of this file.
1 #ifndef artdaq_dune_Overlays_RceFragment_hh
2 #define artdaq_dune_Overlays_RceFragment_hh
3 
4 #include <memory>
5 #include <string>
6 #include <ostream>
7 #include "dam/DataFragmentUnpack.hh"
8 #include "dam/TpcFragmentUnpack.hh"
9 #include "artdaq-core/Data/Fragment.hh"
10 
11 namespace dune
12 {
13  class RceFragment;
14  typedef std::vector<dune::RceFragment> RceFragments;
15 }
16 
17 class TpcStreamUnpack;
18 
20 {
21  public:
22 
23  RceFragment(artdaq::Fragment const & fragment );
24  RceFragment(const uint64_t* data_ptr);
25  int size() const { return _n_streams; }
26  TpcStreamUnpack const * get_stream(int i) const;
27  void hexdump(std::ostream& out, int n_words=10) const;
28  void save(const std::string& filepath) const;
29 
31 
32  private:
33  void _init();
34 
35  std::unique_ptr<DataFragmentUnpack> _data_fragment;
36  std::unique_ptr<TpcFragmentUnpack> _tpc_fragment;
37  int _n_streams = 0;
38  const uint64_t* _data_ptr;
39 };
40 #endif
std::unique_ptr< DataFragmentUnpack > _data_fragment
Definition: RceFragment.hh:35
TpcStreamUnpack const * get_stream(int i) const
Definition: RceFragment.cc:48
std::string string
Definition: nybbler.cc:12
int size() const
Definition: RceFragment.hh:25
const uint64_t * _data_ptr
Definition: RceFragment.hh:38
void hexdump(std::ostream &out, int n_words=10) const
Definition: RceFragment.cc:55
std::vector< dune::RceFragment > RceFragments
Definition: RceFragment.hh:13
std::unique_ptr< TpcFragmentUnpack > _tpc_fragment
Definition: RceFragment.hh:36
RceFragment(artdaq::Fragment const &fragment)
Definition: RceFragment.cc:17
static RceFragments from_container_frags(const artdaq::Fragments &frags)
Definition: RceFragment.cc:79
string filepath
Definition: train.py:371
void save(const std::string &filepath) const
Definition: RceFragment.cc:63
std::vector< Fragment > Fragments
Definition: HDF5Utils.h:57