ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::NSWCandData_v1 Class Reference

Data class describing the L0 muon candidates from NSW-TP to TGC SL. More...

#include <NSWCandData_v1.h>

Inheritance diagram for xAOD::NSWCandData_v1:
Collaboration diagram for xAOD::NSWCandData_v1:

Public Member Functions

 NSWCandData_v1 ()=default
 ~NSWCandData_v1 ()=default
uint16_t bcid () const
 Getters.
uint8_t nSegments () const
 Retrieve the number of segments sent from NSW-TP to Sector Logic.
bool overflow () const
 Check if the segment candidate limit has been exceeded.
uint8_t fiberId () const
 Retrieve the fiber id.
uint8_t boardId () const
 Retrieve the board id.
const std::vector< uint32_t > & segmentWords () const
 Segments.
uint16_t segEtaIndex (size_t i) const
 Element-by-Element Index.
uint16_t segPhiIndex (size_t i) const
 Retrieve the phi index for a specific segment.
uint8_t segDeltaThetaIndex (size_t i) const
 Retrieve the delta theta index for a specific segment.
uint8_t segQuality (size_t i) const
 Retrieve the quality flag for a specific segment.
float segEta (size_t i) const
 Retrieve the decoded physical eta coordinate for a specific segment.
float segPhi (size_t i) const
 Retrieve the decoded physical phi coordinate for a specific segment.
void setBCID (uint16_t bcid)
 Setters.
void setNSegments (uint8_t nseg)
 Set the total number of segments sent from NSW-TP to Sector Logic.
void setOverflow (bool ovf)
 Set the segment total capacity overflow state flag.
void setFiberId (uint8_t fiber)
 Set the fiber id.
void setBoardId (uint8_t board)
 Set the board id.
void addSegment (uint16_t etaIndex, uint16_t phiIndex, uint8_t deltaThetaIndex, uint8_t quality)
 Pack and append a single segment.
void clearSegments ()
 Clear all recorded segment vectors.

Friends

std::ostream & operator<< (std::ostream &os, const NSWCandData_v1 &obj)
 Produce a formatted string representation of the candidates.

Detailed Description

Data class describing the L0 muon candidates from NSW-TP to TGC SL.

Definition at line 20 of file NSWCandData_v1.h.

Constructor & Destructor Documentation

◆ NSWCandData_v1()

xAOD::NSWCandData_v1::NSWCandData_v1 ( )
default

◆ ~NSWCandData_v1()

xAOD::NSWCandData_v1::~NSWCandData_v1 ( )
default

Member Function Documentation

◆ addSegment()

void xAOD::NSWCandData_v1::addSegment ( uint16_t etaIndex,
uint16_t phiIndex,
uint8_t deltaThetaIndex,
uint8_t quality )

Pack and append a single segment.

Push a new completed segment into the candidate's segment collections

Parameters
etaIndexCalculated eta index
phiIndexCalculated phi index
deltaThetaIndexCalculated theta index
qualityQuality flag value

Definition at line 72 of file NSWCandData_v1.cxx.

72 {
73 static const SG::AuxElement::Accessor<std::vector<uint32_t>> accWord{preFixStr + "segmentWord"};
74
75 // Pack the fields into a single 32-bit container word
76 uint32_t packedWord = 0;
79 packedWord |= (static_cast<uint32_t>(deltaThetaIndex) & L0Muon::NSWTPBits::RUN4_NSWTP_DTH_MASK) << L0Muon::NSWTPBits::RUN4_NSWTP_DTH_SHIFT;
81
82 accWord(*this).push_back(packedWord);
83 }
constexpr uint32_t RUN4_NSWTP_DTH_MASK
Definition NSWTPBits.h:30
constexpr uint32_t RUN4_NSWTP_DTH_SHIFT
Angular deviation of the locally defined segment from the infinite momentum track.
Definition NSWTPBits.h:29
constexpr uint32_t RUN4_NSWTP_PHI_SHIFT
Segment position in phi.
Definition NSWTPBits.h:21
constexpr uint32_t RUN4_NSWTP_ETA_SHIFT
Segment position in eta.
Definition NSWTPBits.h:13
constexpr uint32_t RUN4_NSWTP_QUAL_SHIFT
Valid flag and detector information.
Definition NSWTPBits.h:35
constexpr uint32_t RUN4_NSWTP_ETA_MASK
Definition NSWTPBits.h:14
constexpr uint32_t RUN4_NSWTP_QUAL_MASK
Definition NSWTPBits.h:36
constexpr uint32_t RUN4_NSWTP_PHI_MASK
Definition NSWTPBits.h:22
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition EtaPhiLUT.cxx:23
setEventNumber uint32_t

◆ bcid()

uint16_t xAOD::NSWCandData_v1::bcid ( ) const

Getters.

Retrieve the Bunch Crossing Identifier (BCID)

Returns
12-bit bunch crossing ID

◆ boardId()

uint8_t xAOD::NSWCandData_v1::boardId ( ) const

Retrieve the board id.

Returns
Board identifier address

◆ clearSegments()

void xAOD::NSWCandData_v1::clearSegments ( )

Clear all recorded segment vectors.

Definition at line 86 of file NSWCandData_v1.cxx.

86 {
87 static const SG::AuxElement::Accessor<std::vector<uint32_t>> accWord{preFixStr + "segmentWord"};
88 accWord(*this).clear();
89 }

◆ fiberId()

uint8_t xAOD::NSWCandData_v1::fiberId ( ) const

Retrieve the fiber id.

Returns
Fiber identifier code

◆ nSegments()

uint8_t xAOD::NSWCandData_v1::nSegments ( ) const

Retrieve the number of segments sent from NSW-TP to Sector Logic.

Returns
Number of segments

◆ overflow()

bool xAOD::NSWCandData_v1::overflow ( ) const

Check if the segment candidate limit has been exceeded.

Returns
True if there are more than 8 segments detected

Definition at line 29 of file NSWCandData_v1.cxx.

29 {
30 static const SG::AuxElement::Accessor<uint8_t> acc(preFixStr + "overflow");
31 return acc(*this);
32 }
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.

◆ segDeltaThetaIndex()

uint8_t xAOD::NSWCandData_v1::segDeltaThetaIndex ( size_t i) const

Retrieve the delta theta index for a specific segment.

Parameters
iIndex of the segment within the vector

Definition at line 54 of file NSWCandData_v1.cxx.

54 {
56 }
const std::vector< uint32_t > & segmentWords() const
Segments.
mapped_type at(key_type key) const
Look up an element in the map.

◆ segEta()

float xAOD::NSWCandData_v1::segEta ( size_t i) const

Retrieve the decoded physical eta coordinate for a specific segment.

Parameters
iIndex of the segment within the vector
Returns
Transformed float value representing the physical eta position

Definition at line 62 of file NSWCandData_v1.cxx.

62 {
65 }
uint16_t segEtaIndex(size_t i) const
Element-by-Element Index.
constexpr float ETA_MAX
Definition NSWTPBits.h:17
constexpr float ETA_MAX_RAW
Definition NSWTPBits.h:15
constexpr float ETA_MIN
Definition NSWTPBits.h:16

◆ segEtaIndex()

uint16_t xAOD::NSWCandData_v1::segEtaIndex ( size_t i) const

Element-by-Element Index.

Retrieve the eta index for a specific segment

Parameters
iIndex of the segment within the vector

Definition at line 46 of file NSWCandData_v1.cxx.

◆ segmentWords()

const std::vector< uint32_t > & xAOD::NSWCandData_v1::segmentWords ( ) const

Segments.

Get the complete collection of packed 32-bit segment words

Returns
Reference to the vector of packed segment data words

Definition at line 40 of file NSWCandData_v1.cxx.

40 {
41 static const SG::AuxElement::Accessor<std::vector<uint32_t>> acc{preFixStr + "segmentWord"};
42 return acc(*this);
43 }

◆ segPhi()

float xAOD::NSWCandData_v1::segPhi ( size_t i) const

Retrieve the decoded physical phi coordinate for a specific segment.

Parameters
iIndex of the segment within the vector
Returns
Transformed float value representing the physical phi position (in radians)

Definition at line 67 of file NSWCandData_v1.cxx.

67 {
69 }
uint16_t segPhiIndex(size_t i) const
Retrieve the phi index for a specific segment.
constexpr float PHI_MAX
Definition NSWTPBits.h:24
constexpr float PHI_MAX_RAW
Definition NSWTPBits.h:23

◆ segPhiIndex()

uint16_t xAOD::NSWCandData_v1::segPhiIndex ( size_t i) const

Retrieve the phi index for a specific segment.

Parameters
iIndex of the segment within the vector

Definition at line 50 of file NSWCandData_v1.cxx.

◆ segQuality()

uint8_t xAOD::NSWCandData_v1::segQuality ( size_t i) const

Retrieve the quality flag for a specific segment.

Parameters
iIndex of the segment within the vector

Definition at line 58 of file NSWCandData_v1.cxx.

◆ setBCID()

void xAOD::NSWCandData_v1::setBCID ( uint16_t bcid)

Setters.

Set the Bunch Crossing Identifier (BCID)

Parameters
bcid12-bit bunch crossing ID

◆ setBoardId()

void xAOD::NSWCandData_v1::setBoardId ( uint8_t board)

Set the board id.

Parameters
boardBoard id

◆ setFiberId()

void xAOD::NSWCandData_v1::setFiberId ( uint8_t fiber)

Set the fiber id.

Parameters
fiberFiber id code

◆ setNSegments()

void xAOD::NSWCandData_v1::setNSegments ( uint8_t nseg)

Set the total number of segments sent from NSW-TP to Sector Logic.

Parameters
nsegSegment count token

◆ setOverflow()

void xAOD::NSWCandData_v1::setOverflow ( bool ovf)

Set the segment total capacity overflow state flag.

Parameters
ovfOverflow flag state

Definition at line 34 of file NSWCandData_v1.cxx.

34 {
35 static const SG::AuxElement::Accessor<uint8_t> acc(preFixStr + "overflow");
36 acc(*this) = value;
37 }

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const NSWCandData_v1 & obj )
friend

Produce a formatted string representation of the candidates.

Returns
A string summary of the candidates

Definition at line 92 of file NSWCandData_v1.cxx.

92 {
93 os << "\n*BEGIN* xAOD::NSWCandData" << std::endl;
94 os << " BCID: " << obj.bcid() << std::endl;
95 os << " Board ID: " << static_cast<int>(obj.boardId()) << std::endl;
96 os << " Fiber ID: " << static_cast<int>(obj.fiberId()) << std::endl;
97 os << " Number of Segments: " << static_cast<int>(obj.nSegments()) << std::endl;
98 os << " Overflow Flag: " << (obj.overflow() ? "TRUE" : "FALSE") << std::endl;
99
100 const auto& words = obj.segmentWords();
101 os << " Stored Packed Segment Count: " << words.size() << std::endl;
102
103 for (size_t i = 0; i < words.size(); ++i) {
104 os << " -- Segment #" << i << std::endl;
105 os << " Eta Index: " << obj.segEtaIndex(i) << " (eta ~ " << obj.segEta(i) << ")" << std::endl;
106 os << " Phi Index: " << obj.segPhiIndex(i) << " (phi ~ " << obj.segPhi(i) << ")" << std::endl;
107 os << " Delta Theta Index: " << static_cast<int>(obj.segDeltaThetaIndex(i)) << std::endl;
108 os << " Quality Flag: " << static_cast<int>(obj.segQuality(i)) << std::endl;
109 }
110 os << "*END* xAOD::NSWCandData" << std::endl;
111 return os;
112 }

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