ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
MuCTPI_DataWord_Decoder Class Reference

Class helping to decode the MuCTPI data words. More...

#include <MuCTPI_DataWord_Decoder.h>

Collaboration diagram for MuCTPI_DataWord_Decoder:

Public Member Functions

 MuCTPI_DataWord_Decoder (uint32_t dataword=0)
 Constructor. More...
 
 ~MuCTPI_DataWord_Decoder ()=default
 Destructor. More...
 
uint16_t getSectorOverflow () const
 Flag showing whether there were more than 2 candidates in this candidate's sector. More...
 
uint16_t getRoiOverflow () const
 Flag showing whether there was more than 1 candidate in this candidate's RoI. More...
 
uint16_t getRoiNumber () const
 RoI number (sub-sector in which the candidate was detected) More...
 
uint16_t getOverlapBits () const
 2-bit overlap bits given to the candidate by the SL More...
 
MuCTPI_RDO::SectorLocation getSectorLocation () const
 The system that detected the muon candidate. More...
 
uint16_t getSectorAddress () const
 8-bit address of the sector that detected the candidate More...
 
uint16_t getSectorID (bool newScheme=0) const
 Number of the sector that detected the candidate. More...
 
uint16_t getHemisphere () const
 The hemisphere in which the candidate was detected. More...
 
uint16_t getPt () const
 3-bit pT threshold of the candidate More...
 
uint16_t getBCID () const
 3-bit BCID fragment saved with the candidate More...
 
uint16_t getCandidateIsHighestPt () const
 Flag showing whether the candidate had the highest pT in its sector. More...
 
uint16_t getSentRoi () const
 Flag showing whether the candidate was sent to the RoIB. More...
 
uint16_t getSign () const
 Get the candidate's sign (0=negative, 1=positive, 100=undefined) More...
 
uint16_t getVetoed () const
 Flag showing if the candidate was vetoed in the multiplicity sum. More...
 
void setWord (uint32_t word)
 Function setting the MuCTPI data word. More...
 
uint32_t getWord () const
 Function returning the MuCTPI data word. More...
 
void dumpData () const
 Function dumping the stored information to the message stream. More...
 
void dumpData (MsgStream &log) const
 Function dumping the stored information to the message stream. More...
 

Private Attributes

uint32_t m_dataWord
 The 32-bit data word to decode. More...
 

Detailed Description

Class helping to decode the MuCTPI data words.

Date
2007-07-05 13:26:22
   The data words of the MuCTPI readout data contain a lot of information
   about the LVL1 muon candidates in a tightly encoded fashion. This class
   can be used to easily extract all stored information from these 32-bit
   words.

   For a detailed description of the data format of the MuCTPI, see
   the MIROD documentation (https://edms.cern.ch/file/248757/1/mirod.pdf).
Author
David Berge David.nosp@m..Ber.nosp@m.ge@ce.nosp@m.rn.c.nosp@m.h
Version
Revision
1.5

Definition at line 37 of file MuCTPI_DataWord_Decoder.h.

Constructor & Destructor Documentation

◆ MuCTPI_DataWord_Decoder()

MuCTPI_DataWord_Decoder::MuCTPI_DataWord_Decoder ( uint32_t  dataword = 0)

Constructor.

The constructor only has to give an initial value to MuCTPI_DataWord_Decoder::m_dataWord stored in the object.

Parameters
datawordThe 32-bit MuCTPI data word that you want to decode

Definition at line 21 of file MuCTPI_DataWord_Decoder.cxx.

22  : m_dataWord( dataword ) {
23 
24 }

◆ ~MuCTPI_DataWord_Decoder()

MuCTPI_DataWord_Decoder::~MuCTPI_DataWord_Decoder ( )
default

Destructor.

Member Function Documentation

◆ dumpData() [1/2]

void MuCTPI_DataWord_Decoder::dumpData ( ) const

Function dumping the stored information to the message stream.

This function is not responsible for actually printing the information, it just creates a message stream to print the information to with MuCTPI_DataWord_Decoder::dumpData(MsgStream&) const.

Definition at line 204 of file MuCTPI_DataWord_Decoder.cxx.

204  {
205 
206  SmartIF<IMessageSvc> msgSvc{Gaudi::svcLocator()->service("MessageSvc")};
207  if ( !msgSvc ) {
208  return;
209  }
210  MsgStream log( msgSvc, "MuCTPI_DataWord_Decoder" );
211  dumpData( log );
212 
213  return;
214 }

◆ dumpData() [2/2]

void MuCTPI_DataWord_Decoder::dumpData ( MsgStream &  log) const

Function dumping the stored information to the message stream.

Function printing the decodable information of the MuCTPI data word in an easy-to-read fashion.

Parameters
logA message stream to print the information to

Definition at line 221 of file MuCTPI_DataWord_Decoder.cxx.

221  {
222 
223  uint16_t sectorLocation = getSectorLocation();
224  std::string locString = "BARREL";
225  if( sectorLocation == MuCTPI_RDO::ENDCAP ) locString = "ENDCAP";
226  else if( sectorLocation == MuCTPI_RDO::FORWARD ) locString = "FORWARD";
227  uint16_t candHighestPt = getCandidateIsHighestPt();
228  std::string isHigh = "NO";
229  if( candHighestPt ) isHigh = "YES";
230  uint16_t candSentRoi = getSentRoi();
231  std::string sentRoi = "NO";
232  if( candSentRoi ) sentRoi = "YES";
233  uint16_t secOf = getSectorOverflow();
234  std::string ofString = "NO";
235  if( secOf ) ofString = "YES";
236  uint16_t roiOf = getRoiOverflow();
237  std::string roiString = "NO";
238  if( roiOf ) roiString = "YES";
239  uint16_t ol = getOverlapBits();
240  std::string olString = "NO";
241  if( ol ) olString = "YES";
242 
243  log << MSG::DEBUG << "Data word : 0x" << MSG::hex << m_dataWord << MSG::dec << endmsg;
244  log << MSG::DEBUG << "BCID : " << getBCID() << endmsg;
245  log << MSG::DEBUG << "Pt : " << getPt() << endmsg;
246  log << MSG::DEBUG << "Is highest Pt : " << isHigh << endmsg;
247  log << MSG::DEBUG << "RoI ID : " << getRoiNumber() << endmsg;
248  log << MSG::DEBUG << "Sent RoI : " << sentRoi << endmsg;
249  log << MSG::DEBUG << "Sector address : 0x" << MSG::hex << getSectorAddress() << MSG::dec << endmsg;
250  log << MSG::DEBUG << "Sector ID : " << getSectorID() << endmsg;
251  log << MSG::DEBUG << "Sector location : " << locString << endmsg;
252  log << MSG::DEBUG << "Sector overflow : " << ofString << endmsg;
253  log << MSG::DEBUG << "RoI overflow : " << roiString << endmsg;
254  log << MSG::DEBUG << "Overlap found : " << olString << endmsg;
255  log << MSG::DEBUG << "Hemisphere : " << getHemisphere() << endmsg;
256  log << MSG::DEBUG << "=================================================" << endmsg;
257 
258  return;
259 }

◆ getBCID()

uint16_t MuCTPI_DataWord_Decoder::getBCID ( ) const

3-bit BCID fragment saved with the candidate

Returns
3-bit BCID fragment saved with the candidate

Definition at line 154 of file MuCTPI_DataWord_Decoder.cxx.

154  {
155  return ((m_dataWord >> LVL1::MuCTPIBits::CAND_BCID_SHIFT) &
156  LVL1::MuCTPIBits::CAND_BCID_MASK);
157 }

◆ getCandidateIsHighestPt()

uint16_t MuCTPI_DataWord_Decoder::getCandidateIsHighestPt ( ) const

Flag showing whether the candidate had the highest pT in its sector.

Returns
flag showing whether the candidate had the highest pT in its sector

Definition at line 163 of file MuCTPI_DataWord_Decoder.cxx.

163  {
164  return ((m_dataWord >> LVL1::MuCTPIBits::CAND_HIGHEST_PT_SHIFT) &
165  LVL1::MuCTPIBits::CAND_HIGHEST_PT_MASK);
166 }

◆ getHemisphere()

uint16_t MuCTPI_DataWord_Decoder::getHemisphere ( ) const

The hemisphere in which the candidate was detected.

Returns
hemisphere in which the candidate was detected

Definition at line 138 of file MuCTPI_DataWord_Decoder.cxx.

138  {
139  return (getSectorAddress() & LVL1::MuCTPIBits::SECTOR_HEMISPHERE_MASK);
140 }

◆ getOverlapBits()

uint16_t MuCTPI_DataWord_Decoder::getOverlapBits ( ) const

2-bit overlap bits given to the candidate by the SL

Returns
2-bit overlap bits given to the candidate by the Sector Logic

Definition at line 69 of file MuCTPI_DataWord_Decoder.cxx.

69  {
70 
71  uint16_t ol = 0;
72  switch( getSectorLocation() ) {
73  case MuCTPI_RDO::ENDCAP:
74  ol = (m_dataWord >> LVL1::MuCTPIBits::ENDCAP_OL_SHIFT) & LVL1::MuCTPIBits::ENDCAP_OL_MASK;
75  break;
77  ol = 0;
78  break;
79  case MuCTPI_RDO::BARREL:
80  ol = (m_dataWord >> LVL1::MuCTPIBits::BARREL_OL_SHIFT) & LVL1::MuCTPIBits::BARREL_OL_MASK;
81  break;
82  default:
83  ol = 99;
84  break;
85  }
86 
87  return ol;
88 }

◆ getPt()

uint16_t MuCTPI_DataWord_Decoder::getPt ( ) const

3-bit pT threshold of the candidate

Returns
3-bit pT threshold of the candidate

Definition at line 145 of file MuCTPI_DataWord_Decoder.cxx.

145  {
146  return ((m_dataWord >> LVL1::MuCTPIBits::CAND_PT_SHIFT) &
147  LVL1::MuCTPIBits::CAND_PT_MASK);
148 }

◆ getRoiNumber()

uint16_t MuCTPI_DataWord_Decoder::getRoiNumber ( ) const

RoI number (sub-sector in which the candidate was detected)

Returns
RoI number

Definition at line 45 of file MuCTPI_DataWord_Decoder.cxx.

45  {
46 
47  uint16_t roi = 0;
48  switch( getSectorLocation() ) {
49  case MuCTPI_RDO::ENDCAP:
50  roi = (m_dataWord >> LVL1::MuCTPIBits::ROI_SHIFT) & LVL1::MuCTPIBits::ENDCAP_ROI_MASK;
51  break;
53  roi = (m_dataWord >> LVL1::MuCTPIBits::ROI_SHIFT) & LVL1::MuCTPIBits::FORWARD_ROI_MASK;
54  break;
55  case MuCTPI_RDO::BARREL:
56  roi = (m_dataWord >> LVL1::MuCTPIBits::ROI_SHIFT) & LVL1::MuCTPIBits::BARREL_ROI_MASK;
57  break;
58  default:
59  roi = 99;
60  break;
61  }
62 
63  return roi;
64 }

◆ getRoiOverflow()

uint16_t MuCTPI_DataWord_Decoder::getRoiOverflow ( ) const

Flag showing whether there was more than 1 candidate in this candidate's RoI.

Returns
flag showing whether there was more than 1 candidate in this candidate's RoI

Definition at line 37 of file MuCTPI_DataWord_Decoder.cxx.

37  {
38  return ((m_dataWord >> LVL1::MuCTPIBits::ROI_OVERFLOW_SHIFT) &
39  LVL1::MuCTPIBits::ROI_OVERFLOW_MASK);
40 }

◆ getSectorAddress()

uint16_t MuCTPI_DataWord_Decoder::getSectorAddress ( ) const

8-bit address of the sector that detected the candidate

Returns
8-bit address of the sector that detected the candidate

Definition at line 107 of file MuCTPI_DataWord_Decoder.cxx.

107  {
108  return ((m_dataWord >> LVL1::MuCTPIBits::CAND_SECTOR_ADDRESS_SHIFT) &
109  LVL1::MuCTPIBits::CAND_SECTOR_ADDRESS_MASK);
110 }

◆ getSectorID()

uint16_t MuCTPI_DataWord_Decoder::getSectorID ( bool  newScheme = 0) const

Number of the sector that detected the candidate.

Returns
number of the sector that detected the candidate

Definition at line 115 of file MuCTPI_DataWord_Decoder.cxx.

115  {
116 
118  return ((getSectorAddress() >> 1) & LVL1::MuCTPIBits::ENDCAP_SECTORID_MASK);
119  }
120  else if( getSectorLocation() == MuCTPI_RDO::BARREL ) {
121  if(newScheme)
122  return ((getSectorAddress() >> 1) & LVL1::MuCTPIBits::BARREL_SECTORID_MASK);
123  else{
124  uint16_t id = (getSectorAddress() >> 1) & LVL1::MuCTPIBits::BARREL_SECTORID_MASK;
125  if( getHemisphere() ) id += 32;
126  return id;
127  }
128  }
129  else if( getSectorLocation() == MuCTPI_RDO::FORWARD ) {
130  return ((getSectorAddress() >> 1) & LVL1::MuCTPIBits::FORWARD_SECTORID_MASK);
131  }
132  return 0;
133 }

◆ getSectorLocation()

MuCTPI_RDO::SectorLocation MuCTPI_DataWord_Decoder::getSectorLocation ( ) const

The system that detected the muon candidate.

Returns
name of the system that detected the muon candidate

Definition at line 93 of file MuCTPI_DataWord_Decoder.cxx.

93  {
94 
95  if( getSectorAddress() & LVL1::MuCTPIBits::ENDCAP_ADDRESS_MASK ) {
96  return MuCTPI_RDO::ENDCAP;
97  } else if( getSectorAddress() & LVL1::MuCTPIBits::FORWARD_ADDRESS_MASK ) {
98  return MuCTPI_RDO::FORWARD;
99  } else {
100  return MuCTPI_RDO::BARREL;
101  }
102 }

◆ getSectorOverflow()

uint16_t MuCTPI_DataWord_Decoder::getSectorOverflow ( ) const

Flag showing whether there were more than 2 candidates in this candidate's sector.

Returns
flag showing whether there were more than 2 candidates in this candidate's sector

Definition at line 29 of file MuCTPI_DataWord_Decoder.cxx.

29  {
30  return ((m_dataWord >> LVL1::MuCTPIBits::CAND_OVERFLOW_SHIFT) &
31  LVL1::MuCTPIBits::CAND_OVERFLOW_MASK);
32 }

◆ getSentRoi()

uint16_t MuCTPI_DataWord_Decoder::getSentRoi ( ) const

Flag showing whether the candidate was sent to the RoIB.

Returns
flag showing whether the candidate was sent to the RoIB

Definition at line 172 of file MuCTPI_DataWord_Decoder.cxx.

172  {
173  return ((m_dataWord >> LVL1::MuCTPIBits::CAND_SENT_ROI_SHIFT) &
174  LVL1::MuCTPIBits::CAND_SENT_ROI_MASK);
175 }

◆ getSign()

uint16_t MuCTPI_DataWord_Decoder::getSign ( ) const

Get the candidate's sign (0=negative, 1=positive, 100=undefined)

Returns
The candidate's sign (0=negative, 1=positive, 100=undefined)

Definition at line 180 of file MuCTPI_DataWord_Decoder.cxx.

180  {
181 
182  // This bit is not defined for barrel candidates:
184  return 100;
185  }
186 
187  return ( ( m_dataWord >> LVL1::MuCTPIBits::CAND_TGC_CHARGE_SIGN_SHIFT ) &
188  0x1 );
189 }

◆ getVetoed()

uint16_t MuCTPI_DataWord_Decoder::getVetoed ( ) const

Flag showing if the candidate was vetoed in the multiplicity sum.

Returns
Flag showing if the candidate was vetoed in the multiplicity sum

Definition at line 194 of file MuCTPI_DataWord_Decoder.cxx.

194  {
195 
196  return ( ( m_dataWord >> LVL1::MuCTPIBits::CAND_VETO_SHIFT )
197  & 0x1 );
198 }

◆ getWord()

uint32_t MuCTPI_DataWord_Decoder::getWord ( ) const
inline

Function returning the MuCTPI data word.

Definition at line 77 of file MuCTPI_DataWord_Decoder.h.

77 { return m_dataWord; }

◆ setWord()

void MuCTPI_DataWord_Decoder::setWord ( uint32_t  word)
inline

Function setting the MuCTPI data word.

Definition at line 75 of file MuCTPI_DataWord_Decoder.h.

75 { m_dataWord = word; }

Member Data Documentation

◆ m_dataWord

uint32_t MuCTPI_DataWord_Decoder::m_dataWord
private

The 32-bit data word to decode.

Definition at line 86 of file MuCTPI_DataWord_Decoder.h.


The documentation for this class was generated from the following files:
MuCTPI_DataWord_Decoder::getOverlapBits
uint16_t getOverlapBits() const
2-bit overlap bits given to the candidate by the SL
Definition: MuCTPI_DataWord_Decoder.cxx:69
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
MuCTPI_DataWord_Decoder::getRoiNumber
uint16_t getRoiNumber() const
RoI number (sub-sector in which the candidate was detected)
Definition: MuCTPI_DataWord_Decoder.cxx:45
MuCTPI_DataWord_Decoder::getSectorOverflow
uint16_t getSectorOverflow() const
Flag showing whether there were more than 2 candidates in this candidate's sector.
Definition: MuCTPI_DataWord_Decoder.cxx:29
MuCTPI_DataWord_Decoder::getSectorAddress
uint16_t getSectorAddress() const
8-bit address of the sector that detected the candidate
Definition: MuCTPI_DataWord_Decoder.cxx:107
MuCTPI_RDO::BARREL
@ BARREL
Definition: MuCTPI_RDO.h:45
MuCTPI_RDO::FORWARD
@ FORWARD
Definition: MuCTPI_RDO.h:45
MuCTPI_DataWord_Decoder::getSectorLocation
MuCTPI_RDO::SectorLocation getSectorLocation() const
The system that detected the muon candidate.
Definition: MuCTPI_DataWord_Decoder.cxx:93
MuCTPI_DataWord_Decoder::getHemisphere
uint16_t getHemisphere() const
The hemisphere in which the candidate was detected.
Definition: MuCTPI_DataWord_Decoder.cxx:138
MuCTPI_DataWord_Decoder::getSectorID
uint16_t getSectorID(bool newScheme=0) const
Number of the sector that detected the candidate.
Definition: MuCTPI_DataWord_Decoder.cxx:115
MuCTPI_DataWord_Decoder::dumpData
void dumpData() const
Function dumping the stored information to the message stream.
Definition: MuCTPI_DataWord_Decoder.cxx:204
MuCTPI_RDO::ENDCAP
@ ENDCAP
Definition: MuCTPI_RDO.h:45
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
MuCTPI_DataWord_Decoder::getRoiOverflow
uint16_t getRoiOverflow() const
Flag showing whether there was more than 1 candidate in this candidate's RoI.
Definition: MuCTPI_DataWord_Decoder.cxx:37
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuCTPI_DataWord_Decoder::getBCID
uint16_t getBCID() const
3-bit BCID fragment saved with the candidate
Definition: MuCTPI_DataWord_Decoder.cxx:154
MuCTPI_DataWord_Decoder::getCandidateIsHighestPt
uint16_t getCandidateIsHighestPt() const
Flag showing whether the candidate had the highest pT in its sector.
Definition: MuCTPI_DataWord_Decoder.cxx:163
MuCTPI_DataWord_Decoder::getPt
uint16_t getPt() const
3-bit pT threshold of the candidate
Definition: MuCTPI_DataWord_Decoder.cxx:145
MuCTPI_DataWord_Decoder::m_dataWord
uint32_t m_dataWord
The 32-bit data word to decode.
Definition: MuCTPI_DataWord_Decoder.h:86
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
MuCTPI_DataWord_Decoder::getSentRoi
uint16_t getSentRoi() const
Flag showing whether the candidate was sent to the RoIB.
Definition: MuCTPI_DataWord_Decoder.cxx:172
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:876