ATLAS Offline Software
Loading...
Searching...
No Matches
L1Muon::RPCMuonPattern Class Reference

#include <RPCMuonPattern.h>

Collaboration diagram for L1Muon::RPCMuonPattern:

Public Member Functions

 RPCMuonPattern ()=default
 RPCMuonPattern (const uint16_t header, const uint32_t BIBM1, const uint32_t BM2BO, const uint32_t coordBIBM1, const uint32_t coordBM2BO, const uint32_t infos)
 RPCMuonPattern (const uint16_t header, const uint32_t packedBI, const uint32_t packedBM1, const uint32_t packedBM2, const uint32_t packedBO, const uint32_t coordBI, const uint32_t coordBM1, const uint32_t coordBM2, const uint32_t coordBO, const uint32_t pt, const uint32_t packedInfos)
 RPCMuonPattern (const RPCMuonPattern &other, const uint32_t newInfos)
uint16_t getHeader () const
uint16_t getTriggerSector () const
uint32_t getBIBM1 () const
uint32_t getBM2BO () const
uint32_t getCoordBIBM1 () const
uint32_t getCoordBM2BO () const
uint32_t getInfos () const
uint32_t getStripBI () const
uint32_t getStripBM1 () const
uint32_t getStripBM2 () const
uint32_t getStripBO () const
uint32_t getCoordBI () const
uint32_t getCoordBM1 () const
uint32_t getCoordBM2 () const
uint32_t getCoordBO () const
uint32_t getPt () const
uint32_t getEtaBin () const
uint32_t getCharge () const
uint32_t getEta () const
uint32_t getPhi () const
float getEtaFloat () const
float getPhiFloat () const
float getPtFloat () const
float getCoordSign () const
float getCoordBIFloat () const
float getCoordBM1Float () const
float getCoordBM2Float () const
float getCoordBOFloat () const
uint32_t getMaxThreshold () const
int getPriority () const
void print (MsgStream &msg) const

Private Attributes

uint16_t m_header {0}
uint32_t m_BIBM1 {0}
uint32_t m_BM2BO {0}
uint32_t m_coordBIBM1 {0}
uint32_t m_coordBM2BO {0}
uint32_t m_infos {0}

Static Private Attributes

static constexpr uint32_t m_lower16BitsMask = 0x0000FFFF
static constexpr uint32_t m_lower12BitsMask = 0x00000FFF
static constexpr uint32_t m_lower8BitsMask = 0x000000FF
static constexpr uint32_t m_lower1BitMask = 0x00000001
static constexpr uint32_t m_lower14BitsMask = 0x00003FFF
static constexpr uint32_t m_lower9BitsMask = 0x000001FF
static constexpr int m_highestStripShift = 16
static constexpr int m_highestCoordShift = 20
static constexpr int m_lowestCoordShift = 8
static constexpr int m_etaBinShift = 27
static constexpr int m_chargeShift = 26
static constexpr int m_etaShift = 12
static constexpr int m_phiShift = 3
static constexpr uint16_t m_nullBIEtaStrip = 0x0000
static constexpr uint16_t m_nullBM1EtaStrip = 0x4000
static constexpr uint16_t m_nullBM2EtaStrip = 0x8000
static constexpr uint16_t m_nullBOEtaStrip = 0xc000
static constexpr uint16_t m_nullBIPhiStrip = 0x0001
static constexpr uint16_t m_nullBM1PhiStrip = 0x4001
static constexpr uint16_t m_nullBM2PhiStrip = 0x8001
static constexpr uint16_t m_nullBOPhiStrip = 0xc001

Detailed Description

Definition at line 27 of file RPCMuonPattern.h.

Constructor & Destructor Documentation

◆ RPCMuonPattern() [1/4]

L1Muon::RPCMuonPattern::RPCMuonPattern ( )
default

◆ RPCMuonPattern() [2/4]

L1Muon::RPCMuonPattern::RPCMuonPattern ( const uint16_t header,
const uint32_t BIBM1,
const uint32_t BM2BO,
const uint32_t coordBIBM1,
const uint32_t coordBM2BO,
const uint32_t infos )
inline

Definition at line 31 of file RPCMuonPattern.h.

33 :
34 m_header(header), m_BIBM1(BIBM1), m_BM2BO(BM2BO),
35 m_coordBIBM1(coordBIBM1), m_coordBM2BO(coordBM2BO),
36 m_infos(infos) {} ;

◆ RPCMuonPattern() [3/4]

L1Muon::RPCMuonPattern::RPCMuonPattern ( const uint16_t header,
const uint32_t packedBI,
const uint32_t packedBM1,
const uint32_t packedBM2,
const uint32_t packedBO,
const uint32_t coordBI,
const uint32_t coordBM1,
const uint32_t coordBM2,
const uint32_t coordBO,
const uint32_t pt,
const uint32_t packedInfos )
inline

Definition at line 38 of file RPCMuonPattern.h.

43 :
44 m_header(header),
45 m_BIBM1( (packedBI & m_lower16BitsMask) << m_highestStripShift | (packedBM1 & m_lower16BitsMask) ), // combine BI and BM1 into a single 32-bit value, take the lower 16 bits for both BI and BM1
46 m_BM2BO( (packedBM2 & m_lower16BitsMask) << m_highestStripShift | (packedBO & m_lower16BitsMask) ), // combine BM2 and BO into a single 32-bit value, take the lower 16 bits for both BM2 and BO
47 m_coordBIBM1( (coordBI & m_lower12BitsMask) << m_highestCoordShift | (coordBM1 & m_lower12BitsMask) << m_lowestCoordShift | (pt & m_lower8BitsMask)), // combine coordinates into a single 32-bit value, take the lower 8 bits for each coordinate
48 m_coordBM2BO( (coordBM2 & m_lower12BitsMask) << m_highestCoordShift | (coordBO & m_lower12BitsMask) << m_lowestCoordShift ), // combine coordinates into a single 32-bit value, take the lower 8 bits for each coordinate
49 m_infos(packedInfos) {} ;
static constexpr uint32_t m_lower12BitsMask
static constexpr int m_lowestCoordShift
static constexpr int m_highestStripShift
static constexpr uint32_t m_lower8BitsMask
static constexpr uint32_t m_lower16BitsMask
static constexpr int m_highestCoordShift

◆ RPCMuonPattern() [4/4]

L1Muon::RPCMuonPattern::RPCMuonPattern ( const RPCMuonPattern & other,
const uint32_t newInfos )
inline

Definition at line 51 of file RPCMuonPattern.h.

51 :
52 m_header(other.m_header), m_BIBM1(other.m_BIBM1), m_BM2BO(other.m_BM2BO),
53 m_coordBIBM1(other.m_coordBIBM1), m_coordBM2BO(other.m_coordBM2BO),
54 m_infos(newInfos) {} ;

Member Function Documentation

◆ getBIBM1()

uint32_t L1Muon::RPCMuonPattern::getBIBM1 ( ) const
inline

Definition at line 58 of file RPCMuonPattern.h.

58{ return m_BIBM1; };

◆ getBM2BO()

uint32_t L1Muon::RPCMuonPattern::getBM2BO ( ) const
inline

Definition at line 59 of file RPCMuonPattern.h.

59{ return m_BM2BO; };

◆ getCharge()

uint32_t L1Muon::RPCMuonPattern::getCharge ( ) const
inline

Definition at line 73 of file RPCMuonPattern.h.

73{ return (m_infos >> m_chargeShift) & m_lower1BitMask; }; // get the charge from the packed infos
static constexpr int m_chargeShift
static constexpr uint32_t m_lower1BitMask

◆ getCoordBI()

uint32_t L1Muon::RPCMuonPattern::getCoordBI ( ) const
inline

Definition at line 67 of file RPCMuonPattern.h.

67{ return m_coordBIBM1 >> m_highestCoordShift; }; // get the BI coordinate from the packed coordinates

◆ getCoordBIBM1()

uint32_t L1Muon::RPCMuonPattern::getCoordBIBM1 ( ) const
inline

Definition at line 60 of file RPCMuonPattern.h.

60{ return m_coordBIBM1; };

◆ getCoordBIFloat()

float L1Muon::RPCMuonPattern::getCoordBIFloat ( ) const
inline

Definition at line 81 of file RPCMuonPattern.h.

81{ return getCoordSign() * static_cast<float>(getCoordBI()) * 16368.0f / 1023.0f; }; // convert the BI coordinate from 10 bits to float in the range [0, 16368]
float getCoordSign() const
uint32_t getCoordBI() const

◆ getCoordBM1()

uint32_t L1Muon::RPCMuonPattern::getCoordBM1 ( ) const
inline

Definition at line 68 of file RPCMuonPattern.h.

68{ return (m_coordBIBM1 >> m_lowestCoordShift) & m_lower12BitsMask; }; // get the BM1 coordinate from the packed coordinates

◆ getCoordBM1Float()

float L1Muon::RPCMuonPattern::getCoordBM1Float ( ) const
inline

Definition at line 82 of file RPCMuonPattern.h.

82{ return getCoordSign() * static_cast<float>(getCoordBM1()) * 16368.0f / 1023.0f; }; // convert the BM1 coordinate from 10 bits to float in the range [0, 16368]
uint32_t getCoordBM1() const

◆ getCoordBM2()

uint32_t L1Muon::RPCMuonPattern::getCoordBM2 ( ) const
inline

Definition at line 69 of file RPCMuonPattern.h.

69{ return m_coordBM2BO >> m_highestCoordShift; }; // get the BM2 coordinate from the packed coordinates

◆ getCoordBM2BO()

uint32_t L1Muon::RPCMuonPattern::getCoordBM2BO ( ) const
inline

Definition at line 61 of file RPCMuonPattern.h.

61{ return m_coordBM2BO; };

◆ getCoordBM2Float()

float L1Muon::RPCMuonPattern::getCoordBM2Float ( ) const
inline

Definition at line 83 of file RPCMuonPattern.h.

83{ return getCoordSign() * static_cast<float>(getCoordBM2()) * 16368.0f / 1023.0f; }; // convert the BM2 coordinate from 10 bits to float in the range [0, 16368]
uint32_t getCoordBM2() const

◆ getCoordBO()

uint32_t L1Muon::RPCMuonPattern::getCoordBO ( ) const
inline

Definition at line 70 of file RPCMuonPattern.h.

70{ return (m_coordBM2BO >> m_lowestCoordShift) & m_lower12BitsMask; }; // get the BO coordinate from the packed coordinates

◆ getCoordBOFloat()

float L1Muon::RPCMuonPattern::getCoordBOFloat ( ) const
inline

Definition at line 84 of file RPCMuonPattern.h.

84{ return getCoordSign() * static_cast<float>(getCoordBO()) * 16368.0f / 1023.0f; }; // convert the BO coordinate from 10 bits to float in the range [0, 16368]
uint32_t getCoordBO() const

◆ getCoordSign()

float L1Muon::RPCMuonPattern::getCoordSign ( ) const
inline

Definition at line 80 of file RPCMuonPattern.h.

80{ return (getEtaFloat() >= 0.0f) ? 1.0f : -1.0f; }; // get the sign of the coordinate based on the eta value
float getEtaFloat() const

◆ getEta()

uint32_t L1Muon::RPCMuonPattern::getEta ( ) const
inline

Definition at line 74 of file RPCMuonPattern.h.

74{ return (m_infos >> m_etaShift) & m_lower14BitsMask; }; // get the eta from the packed infos
static constexpr int m_etaShift
static constexpr uint32_t m_lower14BitsMask

◆ getEtaBin()

uint32_t L1Muon::RPCMuonPattern::getEtaBin ( ) const
inline

Definition at line 72 of file RPCMuonPattern.h.

72{ return m_infos >> m_etaBinShift; }; // get the eta bin region from the packed infos
static constexpr int m_etaBinShift

◆ getEtaFloat()

float L1Muon::RPCMuonPattern::getEtaFloat ( ) const
inline

Definition at line 77 of file RPCMuonPattern.h.

77{ return static_cast<float>(getEta()) * 5.4f / 16383.0f - 2.7f; }; // convert the eta from 14 bits to float in the range [-2.7, 2.7]
uint32_t getEta() const

◆ getHeader()

uint16_t L1Muon::RPCMuonPattern::getHeader ( ) const
inline

Definition at line 56 of file RPCMuonPattern.h.

56{ return m_header; };

◆ getInfos()

uint32_t L1Muon::RPCMuonPattern::getInfos ( ) const
inline

Definition at line 62 of file RPCMuonPattern.h.

62{ return m_infos; };

◆ getMaxThreshold()

uint32_t L1Muon::RPCMuonPattern::getMaxThreshold ( ) const
inline

Definition at line 85 of file RPCMuonPattern.h.

85 {
86 static const std::map<int, int> th_map = {{4, 0}, {5, 1}, {6, 2}, {7, 3}, {8, 4}, {9, 5}, {10, 6},
87 {12, 7}, {15, 8}, {18, 9}, {20, 10}, {25, 11}, {30, 12},
88 {40, 13}, {80, 14}, {100, 15}};
89 // upper_bound gives first element > x
90 auto it = th_map.upper_bound(std::round(getPtFloat()));
91 if (it == th_map.begin()) { return -1; }
92 --it;
93 return uint32_t(it->first); // returns threshold value
94 // return it->second; // or ID, if that's what you want
95 };
setEventNumber uint32_t

◆ getPhi()

uint32_t L1Muon::RPCMuonPattern::getPhi ( ) const
inline

Definition at line 75 of file RPCMuonPattern.h.

75{ return (m_infos >> m_phiShift) & m_lower9BitsMask; }; // get the phi from the packed infos
static constexpr uint32_t m_lower9BitsMask
static constexpr int m_phiShift

◆ getPhiFloat()

float L1Muon::RPCMuonPattern::getPhiFloat ( ) const
inline

Definition at line 78 of file RPCMuonPattern.h.

78{ return static_cast<float>(getPhi()) * (2.0f * static_cast<float>(M_PI)) / 511.0f; }; // convert the phi from 9 bits to float in the range [0, 2pi]
#define M_PI
uint32_t getPhi() const

◆ getPriority()

int L1Muon::RPCMuonPattern::getPriority ( ) const
inline

Definition at line 97 of file RPCMuonPattern.h.

97 {
98 // BI-BO
101 // BI-BM1-BM2
102 else if (((m_BM2BO & m_lower16BitsMask) == m_nullBOEtaStrip) ||
103 ((m_BM2BO & m_lower16BitsMask) == m_nullBOPhiStrip)) { return 2; }
104 // BM1-BM2-BO
105 else if (((m_BIBM1 >> m_highestStripShift) == m_nullBIEtaStrip) ||
106 ((m_BIBM1 >> m_highestStripShift) == m_nullBIPhiStrip)) { return 3; }
107 // BI-BM1-BO
108 else if (((m_BM2BO >> m_highestStripShift) == m_nullBM2EtaStrip) ||
109 ((m_BM2BO >> m_highestStripShift) == m_nullBM2PhiStrip)) { return 4; }
110 // BI-BM2-BO
111 else if (((m_BIBM1 & m_lower16BitsMask) == m_nullBM1EtaStrip) ||
112 ((m_BIBM1 & m_lower16BitsMask) == m_nullBM1PhiStrip)) { return 5; }
113 else { return 0; } // no valid pattern
114 };
static constexpr uint16_t m_nullBM2PhiStrip
static constexpr uint16_t m_nullBOPhiStrip
static constexpr uint16_t m_nullBM2EtaStrip
static constexpr uint16_t m_nullBIPhiStrip
static constexpr uint16_t m_nullBIEtaStrip
static constexpr uint16_t m_nullBOEtaStrip
static constexpr uint16_t m_nullBM1EtaStrip
static constexpr uint16_t m_nullBM1PhiStrip

◆ getPt()

uint32_t L1Muon::RPCMuonPattern::getPt ( ) const
inline

Definition at line 71 of file RPCMuonPattern.h.

71{ return m_coordBIBM1 & m_lower8BitsMask; }; // get the pt from the packed coordinates

◆ getPtFloat()

float L1Muon::RPCMuonPattern::getPtFloat ( ) const
inline

Definition at line 79 of file RPCMuonPattern.h.

79{ return static_cast<float>(getPt()) * 127.0f / 255.0f; }; // convert the pt from 8 bits to float in the range [0, 127]
uint32_t getPt() const

◆ getStripBI()

uint32_t L1Muon::RPCMuonPattern::getStripBI ( ) const
inline

Definition at line 63 of file RPCMuonPattern.h.

63{ return m_BIBM1 >> m_highestStripShift; }; // get the BI strip from the packed BI-BM1 information

◆ getStripBM1()

uint32_t L1Muon::RPCMuonPattern::getStripBM1 ( ) const
inline

Definition at line 64 of file RPCMuonPattern.h.

64{ return m_BIBM1 & m_lower16BitsMask; }; // get the BM1 strip from the packed BI-BM1 information

◆ getStripBM2()

uint32_t L1Muon::RPCMuonPattern::getStripBM2 ( ) const
inline

Definition at line 65 of file RPCMuonPattern.h.

65{ return m_BM2BO >> m_highestStripShift; }; // get the BM2 strip from the packed BM2-BO information

◆ getStripBO()

uint32_t L1Muon::RPCMuonPattern::getStripBO ( ) const
inline

Definition at line 66 of file RPCMuonPattern.h.

66{ return m_BM2BO & m_lower16BitsMask; }; // get the BO strip from the packed BM2-BO information

◆ getTriggerSector()

uint16_t L1Muon::RPCMuonPattern::getTriggerSector ( ) const
inline

Definition at line 57 of file RPCMuonPattern.h.

57{ return m_header; }; // same as getHeader()

◆ print()

void L1Muon::RPCMuonPattern::print ( MsgStream & msg) const
inline

Definition at line 116 of file RPCMuonPattern.h.

116 {
117 msg << "RPCMuonPattern: header: " << std::hex << m_header
118 << ", BIBM1: " << m_BIBM1
119 << ", BM2BO: " << m_BM2BO
120 << ", coordBIBM1: " << m_coordBIBM1
121 << ", coordBM2BO: " << m_coordBM2BO
122 << ", infos: " << m_infos << std::dec << endmsg;
123 msg << " BI strip: " << getStripBI()
124 << ", BM1 strip: " << getStripBM1()
125 << ", BM2 strip: " << getStripBM2()
126 << ", BO strip: " << getStripBO() << endmsg;
127 };
#define endmsg
uint32_t getStripBI() const
uint32_t getStripBM2() const
uint32_t getStripBM1() const
uint32_t getStripBO() const
MsgStream & msg
Definition testRead.cxx:32

Member Data Documentation

◆ m_BIBM1

uint32_t L1Muon::RPCMuonPattern::m_BIBM1 {0}
private

Definition at line 132 of file RPCMuonPattern.h.

132{0};

◆ m_BM2BO

uint32_t L1Muon::RPCMuonPattern::m_BM2BO {0}
private

Definition at line 133 of file RPCMuonPattern.h.

133{0};

◆ m_chargeShift

int L1Muon::RPCMuonPattern::m_chargeShift = 26
staticconstexprprivate

Definition at line 152 of file RPCMuonPattern.h.

◆ m_coordBIBM1

uint32_t L1Muon::RPCMuonPattern::m_coordBIBM1 {0}
private

Definition at line 134 of file RPCMuonPattern.h.

134{0};

◆ m_coordBM2BO

uint32_t L1Muon::RPCMuonPattern::m_coordBM2BO {0}
private

Definition at line 135 of file RPCMuonPattern.h.

135{0};

◆ m_etaBinShift

int L1Muon::RPCMuonPattern::m_etaBinShift = 27
staticconstexprprivate

Definition at line 151 of file RPCMuonPattern.h.

◆ m_etaShift

int L1Muon::RPCMuonPattern::m_etaShift = 12
staticconstexprprivate

Definition at line 153 of file RPCMuonPattern.h.

◆ m_header

uint16_t L1Muon::RPCMuonPattern::m_header {0}
private

Definition at line 131 of file RPCMuonPattern.h.

131{0};

◆ m_highestCoordShift

int L1Muon::RPCMuonPattern::m_highestCoordShift = 20
staticconstexprprivate

Definition at line 149 of file RPCMuonPattern.h.

◆ m_highestStripShift

int L1Muon::RPCMuonPattern::m_highestStripShift = 16
staticconstexprprivate

Definition at line 148 of file RPCMuonPattern.h.

◆ m_infos

uint32_t L1Muon::RPCMuonPattern::m_infos {0}
private

Definition at line 136 of file RPCMuonPattern.h.

136{0};

◆ m_lower12BitsMask

uint32_t L1Muon::RPCMuonPattern::m_lower12BitsMask = 0x00000FFF
staticconstexprprivate

Definition at line 141 of file RPCMuonPattern.h.

◆ m_lower14BitsMask

uint32_t L1Muon::RPCMuonPattern::m_lower14BitsMask = 0x00003FFF
staticconstexprprivate

Definition at line 144 of file RPCMuonPattern.h.

◆ m_lower16BitsMask

uint32_t L1Muon::RPCMuonPattern::m_lower16BitsMask = 0x0000FFFF
staticconstexprprivate

Definition at line 140 of file RPCMuonPattern.h.

◆ m_lower1BitMask

uint32_t L1Muon::RPCMuonPattern::m_lower1BitMask = 0x00000001
staticconstexprprivate

Definition at line 143 of file RPCMuonPattern.h.

◆ m_lower8BitsMask

uint32_t L1Muon::RPCMuonPattern::m_lower8BitsMask = 0x000000FF
staticconstexprprivate

Definition at line 142 of file RPCMuonPattern.h.

◆ m_lower9BitsMask

uint32_t L1Muon::RPCMuonPattern::m_lower9BitsMask = 0x000001FF
staticconstexprprivate

Definition at line 145 of file RPCMuonPattern.h.

◆ m_lowestCoordShift

int L1Muon::RPCMuonPattern::m_lowestCoordShift = 8
staticconstexprprivate

Definition at line 150 of file RPCMuonPattern.h.

◆ m_nullBIEtaStrip

uint16_t L1Muon::RPCMuonPattern::m_nullBIEtaStrip = 0x0000
staticconstexprprivate

Definition at line 158 of file RPCMuonPattern.h.

◆ m_nullBIPhiStrip

uint16_t L1Muon::RPCMuonPattern::m_nullBIPhiStrip = 0x0001
staticconstexprprivate

Definition at line 162 of file RPCMuonPattern.h.

◆ m_nullBM1EtaStrip

uint16_t L1Muon::RPCMuonPattern::m_nullBM1EtaStrip = 0x4000
staticconstexprprivate

Definition at line 159 of file RPCMuonPattern.h.

◆ m_nullBM1PhiStrip

uint16_t L1Muon::RPCMuonPattern::m_nullBM1PhiStrip = 0x4001
staticconstexprprivate

Definition at line 163 of file RPCMuonPattern.h.

◆ m_nullBM2EtaStrip

uint16_t L1Muon::RPCMuonPattern::m_nullBM2EtaStrip = 0x8000
staticconstexprprivate

Definition at line 160 of file RPCMuonPattern.h.

◆ m_nullBM2PhiStrip

uint16_t L1Muon::RPCMuonPattern::m_nullBM2PhiStrip = 0x8001
staticconstexprprivate

Definition at line 164 of file RPCMuonPattern.h.

◆ m_nullBOEtaStrip

uint16_t L1Muon::RPCMuonPattern::m_nullBOEtaStrip = 0xc000
staticconstexprprivate

Definition at line 161 of file RPCMuonPattern.h.

◆ m_nullBOPhiStrip

uint16_t L1Muon::RPCMuonPattern::m_nullBOPhiStrip = 0xc001
staticconstexprprivate

Definition at line 165 of file RPCMuonPattern.h.

◆ m_phiShift

int L1Muon::RPCMuonPattern::m_phiShift = 3
staticconstexprprivate

Definition at line 154 of file RPCMuonPattern.h.


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