ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::nsw::NSWCommonDecoder Class Reference

#include <NSWCommonDecoder.h>

Collaboration diagram for Muon::nsw::NSWCommonDecoder:

Public Member Functions

 NSWCommonDecoder (const eformat::read::ROBFragment &rob)
virtual ~NSWCommonDecoder ()
const std::vector< Muon::nsw::NSWElink * > & get_elinks () const
const std::vector< Muon::nsw::VMMChannel * > & get_channels () const
bool has_error ()

Private Attributes

bool m_has_error
std::vector< Muon::nsw::NSWElink * > m_elinks
std::vector< Muon::nsw::VMMChannel * > m_channels

Detailed Description

Definition at line 19 of file NSWCommonDecoder.h.

Constructor & Destructor Documentation

◆ NSWCommonDecoder()

Muon::nsw::NSWCommonDecoder::NSWCommonDecoder ( const eformat::read::ROBFragment & rob)
explicit

Definition at line 12 of file NSWCommonDecoder.cxx.

13 : m_has_error (false)
14{
15 static const uint32_t s_min_packet_size = 3; // felix header + null ROC header
16
17 robFrag.check ();
18
19 uint32_t nw = robFrag.rod_ndata ();
20 const uint32_t *bs = robFrag.rod_data (); // point directly to the first data element
21 const uint32_t *current_data_pointer = const_cast <uint32_t *> (bs);
22
23 uint32_t wcount(0); // data-element (32-bit word) counter
24
25 ERS_DEBUG (1, "NDATA FROM ROB HEADER: " << nw);
26
27 uint32_t remaining = nw;
28
29 while (remaining >= s_min_packet_size)
30 {
31 try
32 {
33 Muon::nsw::NSWElink *elink = new Muon::nsw::NSWElink (current_data_pointer, remaining);
34 m_elinks.push_back (elink);
35
36 // Append pointers to elink channels to a local channel vector
37
38 const std::vector <Muon::nsw::VMMChannel *> vchan = elink->get_channels ();
39 for (auto i = vchan.begin (); i != vchan.end (); ++i)
40 m_channels.push_back (*i);
41
42 wcount += elink->nwords ();
43 current_data_pointer += elink->nwords ();
44
45 ERS_DEBUG (1, "NDATA: " << nw << " WORD COUNTER: " << wcount);
46 ERS_DEBUG (1, "NPACKETS: " << m_elinks.size ());
47
48 remaining = nw - wcount;
49 }
50
51 catch (Muon::nsw::MuonNSWCommonDecoder::NSWElinkFelixHeaderException &e)
52 {
53 m_has_error = true;
54 ERS_DEBUG (1, e.what());
55 break;
56 }
57
58 catch (Muon::nsw::MuonNSWCommonDecoder::NSWElinkROCHeaderException &e)
59 {
60 m_has_error = true;
61 ERS_DEBUG (1, e.what());
62
63 // Try to move to next link
64
65 wcount += s_min_packet_size;
66 current_data_pointer += s_min_packet_size;
67 remaining = nw - wcount;
68 continue;
69 }
70 }
71}
std::vector< Muon::nsw::NSWElink * > m_elinks
std::vector< Muon::nsw::VMMChannel * > m_channels
setEventNumber uint32_t

◆ ~NSWCommonDecoder()

Muon::nsw::NSWCommonDecoder::~NSWCommonDecoder ( )
virtual

Definition at line 73 of file NSWCommonDecoder.cxx.

74{
75 for (auto i = m_elinks.begin (); i != m_elinks.end (); ++i)
76 delete *i;
77}

Member Function Documentation

◆ get_channels()

const std::vector< Muon::nsw::VMMChannel * > & Muon::nsw::NSWCommonDecoder::get_channels ( ) const
inline

Definition at line 26 of file NSWCommonDecoder.h.

26{return m_channels;};

◆ get_elinks()

const std::vector< Muon::nsw::NSWElink * > & Muon::nsw::NSWCommonDecoder::get_elinks ( ) const
inline

Definition at line 25 of file NSWCommonDecoder.h.

25{return m_elinks;};

◆ has_error()

bool Muon::nsw::NSWCommonDecoder::has_error ( )
inline

Definition at line 28 of file NSWCommonDecoder.h.

28{return m_has_error;};

Member Data Documentation

◆ m_channels

std::vector<Muon::nsw::VMMChannel *> Muon::nsw::NSWCommonDecoder::m_channels
private

Definition at line 34 of file NSWCommonDecoder.h.

◆ m_elinks

std::vector<Muon::nsw::NSWElink *> Muon::nsw::NSWCommonDecoder::m_elinks
private

Definition at line 33 of file NSWCommonDecoder.h.

◆ m_has_error

bool Muon::nsw::NSWCommonDecoder::m_has_error
private

Definition at line 31 of file NSWCommonDecoder.h.


The documentation for this class was generated from the following files: