ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_ByteStream_ConditionsSvc.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef SIMULATIONBASE
5
11
13
16
17#include "Identifier/Identifier.h"
18
23 ISvcLocator* pSvcLocator ) :
24 base_class( name, pSvcLocator ),
25 m_evtStore("StoreGateSvc",name),
38
39{
40}
41
46
51{
52 if(msgLvl(MSG::DEBUG)) msg() << "TRT_ByteStream_ConditionsSvc: Initialize." << endmsg;
53
54
55 /*
56 * Ask to be informed at the beginning of each new event so that we
57 * can reset.
58 */
59 SmartIF<IIncidentSvc> incsvc{service("IncidentSvc")};
60 const int priority = 100;
61 if( incsvc.isValid() )
62 {
63 incsvc->addListener( this, "BeginEvent", priority);
64 }
65
66 // Retrieve the EventStore
67 if ( StatusCode::SUCCESS!=m_evtStore.retrieve() ) {
68 ATH_MSG_FATAL("Couldn't retrieve " << m_evtStore);
69 return StatusCode::FAILURE;
70 }
71
78
85
86 return StatusCode::SUCCESS;
87}
88
92InDet::TRT_CondFlag
94{
95 return InDet::TRT_COND_GOOD;
96}
97
101StatusCode
103{
104 this->resetSets();
105 this->resetCounts();
106
107 msg(MSG::INFO) << " " << endmsg;
108 msg(MSG::INFO) << "---------------------------------" << endmsg;
109 msg(MSG::INFO) << " TRT BS Error Summary" << endmsg;
110 msg(MSG::INFO) << " " << endmsg;
111 msg(MSG::INFO) << " Number of L1ID Mismatch errors : " << m_tot_num_l1id_errors << endmsg;
112 msg(MSG::INFO) << " Number of BCID Mismatch errors : " << m_tot_num_bcid_errors << endmsg;
113 msg(MSG::INFO) << " Number of Missing FE errors : " << m_tot_num_missing_errors << endmsg;
114 msg(MSG::INFO) << " Number of FE with error bit : " << m_tot_num_error_errors << endmsg;
115 msg(MSG::INFO) << " Number of FE with SID bit : " << m_tot_num_sid_errors << endmsg;
116 msg(MSG::INFO) << " Number of ROB with non-zero status : " << m_tot_num_robStatus_errors << endmsg;
117 msg(MSG::INFO) << "---------------------------------" << endmsg;
118 msg(MSG::INFO) << " " << endmsg;
119
120
121 return StatusCode::SUCCESS;
122}
123
124/*
125 * Clear Sets and Counters at each new event
126 */
127void
129{
130 this->resetSets();
131 this->resetCounts();
132}
133
134void
136{
137 /*
138 * Clear the sets and release the memory they hold
139 */
140
141 std::set<uint32_t>().swap (m_l1id_errors);
142 std::set<uint32_t>().swap (m_bcid_errors);
143 std::set<uint32_t>().swap (m_missing_errors);
144 std::set<uint32_t>().swap (m_error_errors);
145 std::set<uint32_t>().swap (m_sid_errors);
146
147 std::set<std::pair<uint32_t,uint32_t> >().swap (m_l1id_pair_errors);
148 std::set<std::pair<uint32_t,uint32_t> >().swap (m_bcid_pair_errors);
149
150 std::set<std::pair<uint32_t,uint32_t> >().swap (m_rob_status_errors);
151}
152
156
157void
167
168int
189
190
191const std::set<std::pair<uint32_t,uint32_t> > &
193{
194
195 const std::set<std::pair<uint32_t,uint32_t> > & ref =
197
198 return ref;
199 }
200
201const std::set<std::pair<uint32_t,uint32_t> > &
203{
204
205 const std::set<std::pair<uint32_t,uint32_t> > & ref =
207
208 return ref;
209 }
210
211
212const std::set<std::pair<uint32_t,uint32_t> > &
214{
215
216 const std::set<std::pair<uint32_t,uint32_t> > & ref =
218
219 return ref;
220 }
221
222
223const std::set<uint32_t> &
225{
226
227 const std::set<uint32_t> & ref = m_missing_errors;
228
229 return ref;
230 }
231
232
233const std::set<uint32_t> &
235{
236
237 const std::set<uint32_t> & ref = m_error_errors;
238
239 return ref;
240 }
241
242
243const std::set<uint32_t> &
245{
246
247 const std::set<uint32_t> & ref = m_sid_errors;
248
249 return ref;
250 }
251
252
253
254// void
255// TRT_ByteStream_ConditionsSvc::add_l1id_error( uint32_t DTMROC_idx )
256// {
257// m_l1id_errors.insert( DTMROC_idx );
258// m_num_l1id_errors++;
259// }
260
261// void
262// TRT_ByteStream_ConditionsSvc::add_bcid_error( uint32_t DTMROC_idx )
263// {
264// m_bcid_errors.insert( DTMROC_idx );
265// m_num_bcid_errors++;
266// }
267
268void
270{
271 m_missing_errors.insert( DTMROC_idx );
274}
275
276void
278{
279 m_error_errors.insert( DTMROC_idx );
282}
283
284void
286{
287 m_sid_errors.insert( DTMROC_idx );
290}
291
292/*
293 * Versions with head info
294 */
295void
297 uint32_t l1id )
298{
299 std::pair<uint32_t, uint32_t> l1id_error( DTMROC_idx, l1id );
300
301 m_l1id_pair_errors.insert( l1id_error );
304}
305
306void
308 uint32_t bcid )
309{
310 std::pair<uint32_t, uint32_t> bcid_error( DTMROC_idx, bcid );
311
312 m_bcid_pair_errors.insert( bcid_error );
315}
316
317void
319 uint32_t robStatus )
320{
321 // ATH_MSG_INFO( "ROB status =" << std::hex << robStatus );
322
323 std::pair<uint32_t, uint32_t> rob_error( robSourceId, robStatus );
324
325 m_rob_status_errors.insert( rob_error );
328}
329
330
331std::set<std::pair<uint32_t,uint32_t> > *
333{
334 switch(ErrType)
335 {
337 return &m_rob_status_errors;
338 default:
339 return nullptr;
340 }
341
342 return nullptr;
343}
344
345std::set<std::pair<uint32_t,uint32_t> > *
347{
348 switch(ErrType)
349 {
351 return &m_bcid_pair_errors;
353 return &m_l1id_pair_errors;
354 default:
355 return nullptr;
356 }
357
358 return nullptr;
359}
360
361std::set<uint32_t> *
363{
364 switch(ErrType)
365 {
367 return &m_missing_errors;
369 return &m_error_errors;
371 return &m_sid_errors;
372 default:
373 return nullptr;
374 }
375
376 return nullptr;
377}
378
379
380#endif //ifndef SIMULATIONBASE
const boost::regex ref(r_ef)
#define endmsg
#define ATH_MSG_FATAL(x)
void swap(DataVector< T > &a, DataVector< T > &b)
See DataVector<T, BASE>::swap().
Service for accessing TRT ByteStream conditions information.
void add_rob_error(uint32_t robSourceId, uint32_t robStatus)
ServiceHandle< StoreGateSvc > m_evtStore
std::set< std::pair< uint32_t, uint32_t > > m_rob_status_errors
virtual ~TRT_ByteStream_ConditionsSvc()
Destructor //.
std::set< std::pair< uint32_t, uint32_t > > m_bcid_pair_errors
std::set< std::pair< uint32_t, uint32_t > > m_l1id_pair_errors
std::set< std::pair< uint32_t, uint32_t > > * getIdErrorSet(TRTByteStreamErrors::errorTypes ErrType)
const std::set< uint32_t > & getMissingErrorSet(void)
const std::set< uint32_t > & getErrorErrorSet(void)
int getNumberOfErrors(TRTByteStreamErrors::errorTypes ErrType)
void add_bcid_error(uint32_t DTMROC_idx)
virtual StatusCode initialize()
Initialize //.
void add_l1id_error(uint32_t DTMROC_idx)
const std::set< std::pair< uint32_t, uint32_t > > & getBcidErrorSet(void)
virtual StatusCode finalize()
Finalize //.
TRT_ByteStream_ConditionsSvc(const std::string &, ISvcLocator *)
Constructor //.
std::set< uint32_t > * getErrorSet(TRTByteStreamErrors::errorTypes ErrType)
const std::set< uint32_t > & getSidErrorSet(void)
const std::set< std::pair< uint32_t, uint32_t > > & getL1idErrorSet(void)
InDet::TRT_CondFlag condSummaryStatus(const Identifier &)
Evaluation for TRT_ConditionsSummarySvc.
void resetCounts(void)
The following methods are for HLT, to get the numbers of errors per RoI, so won't necessarily match u...
std::set< std::pair< uint32_t, uint32_t > > * getRodRobErrorSet(TRTByteStreamErrors::errorTypes ErrType)
const std::set< std::pair< uint32_t, uint32_t > > & getRobErrorSet(void)
MsgStream & msg
Definition testRead.cxx:32