ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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::warning (e);
55  break;
56  }
57 
59  {
60  m_has_error = true;
61  ers::warning (e);
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 }

◆ ~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:
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Muon::nsw::NSWCommonDecoder::m_channels
std::vector< Muon::nsw::VMMChannel * > m_channels
Definition: NSWCommonDecoder.h:34
Muon::nsw::NSWCommonDecoder::m_has_error
bool m_has_error
Definition: NSWCommonDecoder.h:28
Muon::nsw::NSWCommonDecoder::m_elinks
std::vector< Muon::nsw::NSWElink * > m_elinks
Definition: NSWCommonDecoder.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
Muon::nsw::NSWElinkROCHeaderException
NSWElinkROCHeaderException
Definition: NSWDecodeExceptions.h:22
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
python.web.remaining
remaining
Definition: web.py:132