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

#include <NSWTriggerElink.h>

Inheritance diagram for Muon::nsw::NSWTriggerElink:
Collaboration diagram for Muon::nsw::NSWTriggerElink:

Public Member Functions

 NSWTriggerElink (const uint32_t *bs, uint32_t remaining)
virtual ~NSWTriggerElink ()=default
unsigned int nwords () const
unsigned int nwordsFlx () const
unsigned int status () const
bool suspect () const
uint32_t elinkWord () const
const std::shared_ptr< Muon::nsw::NSWResourceId > & elinkId () const

Protected Attributes

unsigned int m_wordCount {}
unsigned int m_wordCountFlx {}
unsigned int m_packet_status {}
bool m_packet_sus {}
uint32_t m_elinkWord {}
std::shared_ptr< Muon::nsw::NSWResourceIdm_elinkId

Detailed Description

Definition at line 47 of file NSWTriggerElink.h.

Constructor & Destructor Documentation

◆ NSWTriggerElink()

Muon::nsw::NSWTriggerElink::NSWTriggerElink ( const uint32_t * bs,
uint32_t remaining )

Definition at line 12 of file NSWTriggerElink.cxx.

12 {
13
14 // Felix header (2 words) - remember that main decoder interface is already checking that remaining>2 (so preventing a crash)
15 // redoing it here since this class is supposed to be independent
16
17 static const uint32_t min_packet_size = 2;
18 if ( remaining < min_packet_size ) {
19 Muon::nsw::NSWTriggerException e ( Muon::nsw::format("Bytestream shorter than minimum size: provided {}, expected {}", remaining, min_packet_size) , 1);
20 throw e;
21 }
22
23 std::span<const std::uint32_t> data{bs, 2};
26
27 if ( m_packet_status != 0 ) {
28 //later in commissioning, will decide if one can also accept statuses !=0 and can delegate to user checks (or maybe to the decoder upper level)
29 Muon::nsw::NSWTriggerException e ( Muon::nsw::format("Packet status in FELIX header {}", m_packet_status), 2);
30 throw e;
31 }
32
33 if ( remaining < m_wordCountFlx ) {
34 Muon::nsw::NSWTriggerException e ( Muon::nsw::format("Packet length in FELIX header ({}) is larger than available data ({})", m_wordCountFlx, remaining), 3);
35 throw e;
36 }
37
38 m_elinkWord = data[1];
39 m_elinkId.reset(new Muon::nsw::NSWResourceId (m_elinkWord));
40
42 //just trusting felix/swrod (TP packets have variables size in general; there's no expected size or prediction that can be done)
43
44 ERS_DEBUG(2, Muon::nsw::format("\n FELIX header: \n"
45 " status {}\n"
46 " size {}\n"
47 " id {}",
49
50}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Target bit_slice(const std::span< const Source > words, const std::size_t start, const std::size_t end)
Decode bits from data of words.
std::string format(const std::string &str, const T &arg)
setEventNumber uint32_t

◆ ~NSWTriggerElink()

virtual Muon::nsw::NSWTriggerElink::~NSWTriggerElink ( )
virtualdefault

Member Function Documentation

◆ elinkId()

const std::shared_ptr< Muon::nsw::NSWResourceId > & Muon::nsw::NSWTriggerElink::elinkId ( ) const
inline

Definition at line 63 of file NSWTriggerElink.h.

63{return m_elinkId;};

◆ elinkWord()

uint32_t Muon::nsw::NSWTriggerElink::elinkWord ( ) const
inline

Definition at line 62 of file NSWTriggerElink.h.

62{return m_elinkWord;};

◆ nwords()

unsigned int Muon::nsw::NSWTriggerElink::nwords ( ) const
inline

Definition at line 55 of file NSWTriggerElink.h.

55{return m_wordCount;}; //self counted or expected in case it will be possible

◆ nwordsFlx()

unsigned int Muon::nsw::NSWTriggerElink::nwordsFlx ( ) const
inline

Definition at line 56 of file NSWTriggerElink.h.

56{return m_wordCountFlx;}; //reading from packet felix header

◆ status()

unsigned int Muon::nsw::NSWTriggerElink::status ( ) const
inline

Definition at line 57 of file NSWTriggerElink.h.

57{return m_packet_status;}; //felix status

◆ suspect()

bool Muon::nsw::NSWTriggerElink::suspect ( ) const
inline

Definition at line 58 of file NSWTriggerElink.h.

58{return m_packet_sus;}; //elink decoded but with triggering suspects

Member Data Documentation

◆ m_elinkId

std::shared_ptr<Muon::nsw::NSWResourceId> Muon::nsw::NSWTriggerElink::m_elinkId
protected

Definition at line 73 of file NSWTriggerElink.h.

◆ m_elinkWord

uint32_t Muon::nsw::NSWTriggerElink::m_elinkWord {}
protected

Definition at line 72 of file NSWTriggerElink.h.

72{};

◆ m_packet_status

unsigned int Muon::nsw::NSWTriggerElink::m_packet_status {}
protected

Definition at line 68 of file NSWTriggerElink.h.

68{};

◆ m_packet_sus

bool Muon::nsw::NSWTriggerElink::m_packet_sus {}
protected

Definition at line 69 of file NSWTriggerElink.h.

69{};

◆ m_wordCount

unsigned int Muon::nsw::NSWTriggerElink::m_wordCount {}
protected

Definition at line 66 of file NSWTriggerElink.h.

66{};

◆ m_wordCountFlx

unsigned int Muon::nsw::NSWTriggerElink::m_wordCountFlx {}
protected

Definition at line 67 of file NSWTriggerElink.h.

67{};

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