ATLAS Offline Software
Loading...
Searching...
No Matches
MuCTPI_DataWord_Decoder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// Local/Trigger include(s):
9
10// Gaudi/Athena include(s):
11#include "GaudiKernel/Bootstrap.h"
12#include "GaudiKernel/ISvcLocator.h"
13#include "GaudiKernel/IMessageSvc.h"
14#include "GaudiKernel/MsgStream.h"
15#include "GaudiKernel/StatusCode.h"
22 : m_dataWord( dataword ) {
23
24}
25
33
41
46
47 uint16_t roi = 0;
48 switch( getSectorLocation() ) {
51 break;
54 break;
57 break;
58 default:
59 roi = 99;
60 break;
61 }
62
63 return roi;
64}
65
70
71 uint16_t ol = 0;
72 switch( getSectorLocation() ) {
75 break;
77 ol = 0;
78 break;
81 break;
82 default:
83 ol = 99;
84 break;
85 }
86
87 return ol;
88}
89
103
111
115uint16_t MuCTPI_DataWord_Decoder::getSectorID(bool newScheme) const {
116
119 }
120 else if( getSectorLocation() == MuCTPI_RDO::BARREL ) {
121 if(newScheme)
123 else{
125 if( getHemisphere() ) id += 32;
126 return id;
127 }
128 }
129 else if( getSectorLocation() == MuCTPI_RDO::FORWARD ) {
131 }
132 return 0;
133}
134
141
149
153
158
162
167
171
176
181
182 // This bit is not defined for barrel candidates:
184 return 100;
185 }
186
188 0x1 );
189}
190
195
197 & 0x1 );
198}
199
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}
215
221void MuCTPI_DataWord_Decoder::dumpData( MsgStream& log ) const {
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}
#define endmsg
const std::string & roiString()
uint16_t getSectorOverflow() const
Flag showing whether there were more than 2 candidates in this candidate's sector.
uint16_t getVetoed() const
Flag showing if the candidate was vetoed in the multiplicity sum.
uint16_t getSign() const
Get the candidate's sign (0=negative, 1=positive, 100=undefined)
void dumpData() const
Function dumping the stored information to the message stream.
uint16_t getRoiOverflow() const
Flag showing whether there was more than 1 candidate in this candidate's RoI.
MuCTPI_DataWord_Decoder(uint32_t dataword=0)
Constructor.
uint16_t getSectorID(bool newScheme=0) const
Number of the sector that detected the candidate.
MuCTPI_RDO::SectorLocation getSectorLocation() const
The system that detected the muon candidate.
uint16_t getHemisphere() const
The hemisphere in which the candidate was detected.
uint16_t getRoiNumber() const
RoI number (sub-sector in which the candidate was detected)
uint16_t getCandidateIsHighestPt() const
Flag showing whether the candidate had the highest pT in its sector.
uint16_t getOverlapBits() const
2-bit overlap bits given to the candidate by the SL
uint16_t getSectorAddress() const
8-bit address of the sector that detected the candidate
uint16_t getSentRoi() const
Flag showing whether the candidate was sent to the RoIB.
uint32_t m_dataWord
The 32-bit data word to decode.
uint16_t getBCID() const
3-bit BCID fragment saved with the candidate
uint16_t getPt() const
3-bit pT threshold of the candidate
SectorLocation
Enumeration defining the different sources for the muon candidates.
Definition MuCTPI_RDO.h:45
static constexpr uint32_t FORWARD_SECTORID_MASK
Mask for extracting the sector ID for forward candidates from the data word.
static constexpr uint32_t FORWARD_ADDRESS_MASK
Bit in the candidate's address turned on for forward candidates.
Definition MuCTPI_Bits.h:89
static constexpr uint32_t SECTOR_HEMISPHERE_MASK
Mask for the bit showing which hemisphere the candidate came from.(1: positive; 0: negative)
Definition MuCTPI_Bits.h:80
static constexpr uint32_t CAND_HIGHEST_PT_MASK
gone in v2 Mask for extracting the bit from the data word showing whether the candidate had the highe...
static constexpr uint32_t CAND_OVERFLOW_SHIFT
Definition MuCTPI_Bits.h:28
static constexpr uint32_t ENDCAP_OL_MASK
Mask for extracting the overlap bits for endcap candidates from the data words.
Definition MuCTPI_Bits.h:56
static constexpr uint32_t BARREL_SECTORID_MASK
Mask for extracting the sector ID for barrel candidates from the data word.
static constexpr uint32_t ENDCAP_ROI_MASK
Mask for extracting the RoI for endcap candidates from the data words.
Definition MuCTPI_Bits.h:41
static constexpr uint32_t BARREL_ROI_MASK
new in v2
Definition MuCTPI_Bits.h:39
static constexpr uint32_t CAND_SENT_ROI_MASK
gone in v2
static constexpr uint32_t ENDCAP_OL_SHIFT
Position of the overlap bits in endcap data words.
Definition MuCTPI_Bits.h:59
static constexpr uint32_t BARREL_OL_MASK
Mask for extracting the overlap bits for barrel candidates from the data words.
Definition MuCTPI_Bits.h:50
static constexpr uint32_t CAND_VETO_SHIFT
static constexpr uint32_t ROI_OVERFLOW_MASK
Mask for the bit showing if more than one muon candidates were in the sector RoI.
Definition MuCTPI_Bits.h:31
static constexpr uint32_t CAND_SECTOR_ADDRESS_SHIFT
Definition MuCTPI_Bits.h:83
static constexpr uint32_t CAND_PT_MASK
Definition MuCTPI_Bits.h:63
static constexpr uint32_t CAND_TGC_CHARGE_SIGN_SHIFT
static constexpr uint32_t CAND_BCID_MASK
gone in v2
Definition MuCTPI_Bits.h:71
static constexpr uint32_t ENDCAP_SECTORID_MASK
Mask for extracting the sector ID for endcap candidates from the data word.
static constexpr uint32_t BARREL_OL_SHIFT
Position of the overlap bits in barrel data words.
Definition MuCTPI_Bits.h:54
static constexpr uint32_t CAND_HIGHEST_PT_SHIFT
Position of the "highest p<sub>T</sub>" bit.
static constexpr uint32_t ENDCAP_ADDRESS_MASK
Bit in the candidate's address turned on for endcap candidates.
Definition MuCTPI_Bits.h:87
static constexpr uint32_t CAND_PT_SHIFT
Definition MuCTPI_Bits.h:66
static constexpr uint32_t CAND_BCID_SHIFT
Position of the BCID bits in the data words.
Definition MuCTPI_Bits.h:73
static constexpr uint32_t ROI_OVERFLOW_SHIFT
Definition MuCTPI_Bits.h:34
static constexpr uint32_t CAND_SENT_ROI_SHIFT
Position of the "candidate sent to RoIB" bit.
static constexpr uint32_t CAND_SECTOR_ADDRESS_MASK
Definition MuCTPI_Bits.h:78
static constexpr uint32_t FORWARD_ROI_MASK
Mask for extracting the RoI for forward candidates from the data words.
Definition MuCTPI_Bits.h:43
static constexpr uint32_t CAND_OVERFLOW_MASK
Mask for the bit showing if more than two muon candidates were in the trigger sector.
Definition MuCTPI_Bits.h:25
static constexpr uint32_t ROI_SHIFT
Definition MuCTPI_Bits.h:46