ATLAS Offline Software
Loading...
Searching...
No Matches
MuCTPI_RIO.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// Gaudi/Athena include(s):
7#include "GaudiKernel/Bootstrap.h"
8#include "GaudiKernel/ISvcLocator.h"
9#include "GaudiKernel/IMessageSvc.h"
10#include "GaudiKernel/MsgStream.h"
11
12// Local include(s):
14
26
27
34void MuCTPI_RIO::setSum( const uint16_t* sum ) {
35 for( int i = 0; i < N_SUM; ++i ) m_sum[ i ] = *( sum + i );
36 return;
37}
38
47uint16_t MuCTPI_RIO::getSum( const int index ) const {
48 if( index >= N_SUM ) return 0;
49 return m_sum[ index ];
50}
51
69void MuCTPI_RIO::setRoI( const uint16_t bcId, const uint16_t pTval, const uint16_t pTnum, const double eta, const double phi,
70 const uint16_t secID, const uint16_t sysId, const uint16_t hemisphere, const uint16_t roiNum,
71 const bool accepted, const bool first, const bool duplicatedRoI, const bool duplicatedSector) {
72
73 MyRoI roI( bcId, pTval,pTnum, eta, phi, secID, sysId, hemisphere, roiNum, accepted, first, duplicatedRoI, duplicatedSector);
74 m_roI.push_back( roI );
75
76 return;
77}
78
98bool MuCTPI_RIO::getRoI( const int index, uint16_t &bcId, uint16_t &pTval, uint16_t& pTnum, double &eta, double &phi,
99 uint16_t& secID, uint16_t& sysId, uint16_t& hemisphere, uint16_t& roiNum, bool &accepted,
100 bool &first, bool &duplicatedRoI, bool &duplicatedSector) const {
101
102 if( index >= getNRoI() ) return false;
103
104 const MyRoI &roi = m_roI.at( index );
105 bcId = roi.m_bcId;
106 pTval = roi.m_pTvalue;
107 pTnum = roi.m_pTnumber;
108 eta = roi.m_eta;
109 phi = roi.m_phi;
110 secID = roi.m_sectorID;
111 sysId = roi.m_sysId;
112 hemisphere = (roi.m_hemisphere ? 1 : 0);
113 roiNum = roi.m_roINumber;
114 accepted = roi.m_accepted;
115 first = roi.m_first;
116 duplicatedRoI = roi.m_duplicatedRoI;
117 duplicatedSector = roi.m_duplicatedSector;
118
119
120 return true;
121}
122
128
129 SmartIF<IMessageSvc> msgSvc{Gaudi::svcLocator()->service("MessageSvc")};
130 if ( !msgSvc ) {
131 return;
132 }
133 MsgStream log( msgSvc, "MuCTPI_RIO" );
134 dumpData( log );
135
136 return;
137}
138
144void MuCTPI_RIO::dumpData( MsgStream& log ) const {
145
146 log << MSG::DEBUG << "=================================================" << endmsg;
147 log << MSG::DEBUG << "MUCTPI ROD Header / Trailer data" << endmsg;
148 log << MSG::DEBUG << "Source ID : 0x" << MSG::hex << getHeaderSourceId() << MSG::dec << endmsg;
149 log << MSG::DEBUG << "Run number : " << getHeaderRunNumber() << endmsg;
150 log << MSG::DEBUG << "Ext. LVL1 ID : " << getHeaderLVL1ID() << endmsg;
151 log << MSG::DEBUG << "BCID : " << getHeaderBCID() << endmsg;
152 log << MSG::DEBUG << "Trigger type : " << getHeaderLVL1TriggerType() << endmsg;
153 log << MSG::DEBUG << "Det. event type : " << getHeaderDetectorEventType() << endmsg;
154 log << MSG::DEBUG << "No data words : " << getHeaderNumberDataWords() << endmsg;
155 log << MSG::DEBUG << "No status words : " << getHeaderNumberStatusWords() << endmsg;
156 for( uint32_t i = 0 ; i < getHeaderNumberStatusWords(); ++i ) {
157 log << MSG::DEBUG << "Status word " << i << " : 0x" << MSG::hex << getHeaderStatusWords()[i]
158 << MSG::dec << endmsg;
159 }
160 log << MSG::DEBUG << "=================================================" << endmsg;
161
162 std::vector<MyRoI>::const_iterator it = m_roI.begin();
163 for( ; it != m_roI.end(); ++it ) it->dumpData( log );
164
165 return;
166}
167
185MuCTPI_RIO::MyRoI::MyRoI( const uint16_t bcId, const uint16_t pTVal,const uint16_t pTnumber, const double eta, const double phi,const uint16_t secID, const uint16_t sysId , const uint16_t hemisphere, const uint16_t roiNum, const bool accepted, const bool first, const bool duplicatedRoI, const bool duplicatedSector)
186 : m_bcId( bcId ), m_pTvalue( pTVal ), m_pTnumber( pTnumber ), m_eta( eta ), m_phi( phi ),
187 m_sectorID( secID ), m_sysId( sysId ), m_hemisphere( hemisphere ? true : false ), m_roINumber( roiNum ), m_accepted( accepted ),
188 m_first( first ), m_duplicatedRoI( duplicatedRoI ), m_duplicatedSector( duplicatedSector ) {}
189
195
196 SmartIF<IMessageSvc> msgSvc{Gaudi::svcLocator()->service("MessageSvc")};
197 if ( !msgSvc ) {
198 return;
199 }
200 MsgStream log( msgSvc, "MuCTPI_RIO::RoI" );
201 dumpData( log );
202
203 return;
204}
205
211void MuCTPI_RIO::MyRoI::dumpData( MsgStream& log ) const {
212
213 log << MSG::DEBUG << "=================================================" << endmsg;
214 log << MSG::DEBUG << "MUCTPI RoI data" << endmsg;
215 log << MSG::DEBUG << "BCID : " << m_bcId << endmsg;
216 log << MSG::DEBUG << "Pt value : " << m_pTvalue << endmsg;
217 log << MSG::DEBUG << "Pt threshold number : " << m_pTnumber << endmsg;
218 log << MSG::DEBUG << "Eta : " << m_eta << endmsg;
219 log << MSG::DEBUG << "Phi : " << m_phi << endmsg;
220 log << MSG::DEBUG << "RoI number : " << m_roINumber << endmsg;
221 log << MSG::DEBUG << "Sector ID : " << m_sectorID << endmsg;
222 log << MSG::DEBUG << "System ID : " << m_sysId << endmsg;
223 log << MSG::DEBUG << "Hemisphere : " << m_hemisphere << endmsg;
224 log << MSG::DEBUG << "Flags " << endmsg;
225 log << MSG::DEBUG << "Accepted : " << m_accepted << endmsg;
226 log << MSG::DEBUG << "First : " << m_first << endmsg;
227 log << MSG::DEBUG << "Duplicated sector : " << m_duplicatedSector << endmsg;
228 log << MSG::DEBUG << "Duplicated RoI : " << m_duplicatedRoI << endmsg;
229 log << MSG::DEBUG << "=================================================" << endmsg;
230
231 return;
232}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define endmsg
uint16_t bcId(uint32_t data)
Custom private object to hold information about the stored reconstructed RoIs.
Definition MuCTPI_RIO.h:192
bool m_duplicatedSector
Flag showing whether there were more than 2 candidates in this candidate's sector.
Definition MuCTPI_RIO.h:234
uint16_t m_bcId
3-bit BCID as stored in the data word
Definition MuCTPI_RIO.h:208
uint16_t m_sectorID
8-bit sector address as stored in the data word
Definition MuCTPI_RIO.h:218
MyRoI(const uint16_t bcId, const uint16_t pTVal, const uint16_t pTNum, const double eta, const double phi, const uint16_t secID, const uint16_t sysId, const uint16_t hemisphere, const uint16_t roiNum, const bool accepted, const bool first, const bool duplicatedRoI, const bool duplicatedSector)
Constructor.
bool m_accepted
Flag showing whether the candidate was sent to the RoIB.
Definition MuCTPI_RIO.h:228
void dumpData() const
Function dumping the stored information to the message stream.
uint16_t m_roINumber
RoI number (sub-sector in which the candidate was detected) as stored in the data word.
Definition MuCTPI_RIO.h:225
uint16_t m_pTnumber
3-bit pT threshold number as stored in the data word
Definition MuCTPI_RIO.h:212
double m_eta
η position of the candidate
Definition MuCTPI_RIO.h:214
bool m_first
Flag showing whether the candidate had the highest pT in its sector.
Definition MuCTPI_RIO.h:230
uint16_t m_sysId
System in which the candidate was detected.
Definition MuCTPI_RIO.h:220
bool m_hemisphere
Hemisphere in which the candidate was detected (false: z < 0, true: z > 0)
Definition MuCTPI_RIO.h:222
uint16_t m_pTvalue
pT threshold value (in GeV) as reconstructed from the data word
Definition MuCTPI_RIO.h:210
bool m_duplicatedRoI
Flag showing whether there was more than 1 candidate in this candidate's RoI.
Definition MuCTPI_RIO.h:232
double m_phi
φ position of the candidate
Definition MuCTPI_RIO.h:216
uint32_t m_headerBCID
The full BCID as specified in the header.
Definition MuCTPI_RIO.h:138
uint32_t getHeaderRunNumber() const
Get the run number specified in the header.
Definition MuCTPI_RIO.h:78
uint32_t getHeaderNumberDataWords() const
Get the number of data words as it was specified in the trailer
Definition MuCTPI_RIO.h:88
uint32_t m_headerLVL1ID
LVL1 ID as specified in the header.
Definition MuCTPI_RIO.h:133
uint16_t getSum(const int index) const
Get the multiplicity sum for a given pT threshold.
uint16_t m_bcId
What kind of BCID is this???
Definition MuCTPI_RIO.h:166
uint32_t getHeaderLVL1ID() const
Get the LVL1 ID specified in the header.
Definition MuCTPI_RIO.h:80
uint32_t getHeaderLVL1TriggerType() const
Get the LVL1 trigger type specified in the header.
Definition MuCTPI_RIO.h:84
uint32_t getHeaderNumberStatusWords() const
Get the number of status words as it was specified in the trailer
Definition MuCTPI_RIO.h:90
int getNRoI() const
Get the number of muon RoIs.
Definition MuCTPI_RIO.h:69
bool getRoI(const int index, uint16_t &bcId, uint16_t &pTval, uint16_t &pTnum, double &eta, double &phi, uint16_t &secID, uint16_t &sysId, uint16_t &hemisphere, uint16_t &roiNum, bool &accepted, bool &first, bool &duplicatedRoI, bool &duplicatedSector) const
Get the properties of a given muon RoI.
std::vector< MyRoI > m_roI
Variable holding the custom RoIs.
Definition MuCTPI_RIO.h:240
uint32_t m_headerDetEventType
The event type as specified in the header.
Definition MuCTPI_RIO.h:148
void setSum(const uint16_t *sum)
Set the multiplicity sum.
void setRoI(const uint16_t bcId, const uint16_t pTval, const uint16_t pTnum, const double eta, const double phi, const uint16_t secID, const uint16_t sysId, const uint16_t hemisphere, const uint16_t roiNum, const bool accepted, const bool first, const bool duplicatedRoI, const bool duplicatedSector)
Add a muon RoI to the object
std::array< uint16_t, N_SUM > m_sum
Candidate multiplicity in MuCTPI_RIO::N_SUM number of pT thresholds.
Definition MuCTPI_RIO.h:170
uint32_t getHeaderDetectorEventType() const
Get the event type specified in the header.
Definition MuCTPI_RIO.h:86
MuCTPI_RIO()
Default constructor.
uint32_t getHeaderBCID() const
Get the full BCID specified in the header.
Definition MuCTPI_RIO.h:82
uint32_t m_headerNDataWords
The number of data words as specified in the trailer
Definition MuCTPI_RIO.h:153
uint32_t m_headerRunNumber
Run number as specified in the header.
Definition MuCTPI_RIO.h:128
uint32_t m_headerLVL1TriggerType
The LVL1 trigger type as specified in the header.
Definition MuCTPI_RIO.h:143
uint32_t m_headerNStatusWords
The number of status words as specified in the trailer
Definition MuCTPI_RIO.h:158
uint32_t getHeaderSourceId() const
Get the ROD ID specified in the header.
Definition MuCTPI_RIO.h:76
void dumpData() const
Function dumping the stored information to the message stream.
const std::vector< uint32_t > & getHeaderStatusWords() const
Get the status words from the payload.
Definition MuCTPI_RIO.h:92
uint32_t m_headerSourceId
Source ID as specified in the header.
Definition MuCTPI_RIO.h:123
Definition index.py:1