ATLAS Offline Software
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 
13 
16 
17 #include "Identifier/Identifier.h"
18 
23  ISvcLocator* pSvcLocator ) :
24  base_class( name, pSvcLocator ),
25  m_evtStore("StoreGateSvc",name),
26  m_num_l1id_errors(0),
27  m_num_bcid_errors(0),
28  m_num_missing_errors(0),
29  m_num_error_errors(0),
30  m_num_sid_errors(0),
31  m_num_robStatus_errors(0),
32  m_tot_num_l1id_errors(0),
33  m_tot_num_bcid_errors(0),
34  m_tot_num_missing_errors(0),
35  m_tot_num_error_errors(0),
36  m_tot_num_sid_errors(0),
37  m_tot_num_robStatus_errors(0)
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 
94 {
95  return InDet::TRT_COND_GOOD;
96 }
97 
101 StatusCode
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  */
127 void
129 {
130  this->resetSets();
131  this->resetCounts();
132 }
133 
134 void
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 
157 void
159 {
166 }
167 
168 int
170 {
171  switch( ErrType )
172  {
174  return m_num_bcid_errors;
176  return m_num_l1id_errors;
178  return m_num_missing_errors;
180  return m_num_error_errors;
182  return m_num_sid_errors;
184  return m_num_robStatus_errors;
185  }
186 
187  return 0;
188 }
189 
190 
191 const 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 
201 const 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 
212 const 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 
223 const std::set<uint32_t> &
225 {
226 
227  const std::set<uint32_t> & ref = m_missing_errors;
228 
229  return ref;
230  }
231 
232 
233 const std::set<uint32_t> &
235 {
236 
237  const std::set<uint32_t> & ref = m_error_errors;
238 
239  return ref;
240  }
241 
242 
243 const 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 
268 void
270 {
271  m_missing_errors.insert( DTMROC_idx );
274 }
275 
276 void
278 {
279  m_error_errors.insert( DTMROC_idx );
282 }
283 
284 void
286 {
287  m_sid_errors.insert( DTMROC_idx );
290 }
291 
292 /*
293  * Versions with head info
294  */
295 void
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 
306 void
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 
317 void
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 
331 std::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 
345 std::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 
361 std::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
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TRT_ByteStream_ConditionsSvc::getMissingErrorSet
const std::set< uint32_t > & getMissingErrorSet(void)
Definition: TRT_ByteStream_ConditionsSvc.cxx:224
TRT_ByteStream_ConditionsSvc::add_sid_error
void add_sid_error(uint32_t DTMROC_idx)
Definition: TRT_ByteStream_ConditionsSvc.cxx:285
TRT_ByteStream_ConditionsSvc::m_tot_num_missing_errors
long long m_tot_num_missing_errors
Definition: TRT_ByteStream_ConditionsSvc.h:112
TRT_ByteStream_ConditionsSvc::~TRT_ByteStream_ConditionsSvc
virtual ~TRT_ByteStream_ConditionsSvc()
Destructor //.
TRTByteStreamErrors::L1IDError
@ L1IDError
Definition: ITRT_ByteStream_ConditionsSvc.h:20
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TRTByteStreamErrors::ERRORError
@ ERRORError
Definition: ITRT_ByteStream_ConditionsSvc.h:22
TRT_ByteStream_ConditionsSvc::m_tot_num_bcid_errors
long long m_tot_num_bcid_errors
Definition: TRT_ByteStream_ConditionsSvc.h:111
TRT_ByteStream_ConditionsSvc::m_num_missing_errors
int m_num_missing_errors
Definition: TRT_ByteStream_ConditionsSvc.h:105
TRT_ByteStream_ConditionsSvc::m_num_bcid_errors
int m_num_bcid_errors
Definition: TRT_ByteStream_ConditionsSvc.h:104
TRT_BSIdErrContainer.h
python.selector.AtlRunQuerySelectorLhcOlc.priority
priority
Definition: AtlRunQuerySelectorLhcOlc.py:611
TRT_ByteStream_ConditionsSvc::add_error_error
void add_error_error(uint32_t DTMROC_idx)
Definition: TRT_ByteStream_ConditionsSvc.cxx:277
TRT_ByteStream_ConditionsSvc::getL1idErrorSet
const std::set< std::pair< uint32_t, uint32_t > > & getL1idErrorSet(void)
Definition: TRT_ByteStream_ConditionsSvc.cxx:192
TRTByteStreamErrors::RobStatusError
@ RobStatusError
Definition: ITRT_ByteStream_ConditionsSvc.h:24
TRT_ByteStream_ConditionsSvc::getBcidErrorSet
const std::set< std::pair< uint32_t, uint32_t > > & getBcidErrorSet(void)
Definition: TRT_ByteStream_ConditionsSvc.cxx:202
TRT_ByteStream_ConditionsSvc::m_tot_num_robStatus_errors
long long m_tot_num_robStatus_errors
Definition: TRT_ByteStream_ConditionsSvc.h:115
TRT_ByteStream_ConditionsSvc::m_rob_status_errors
std::set< std::pair< uint32_t, uint32_t > > m_rob_status_errors
Definition: TRT_ByteStream_ConditionsSvc.h:101
TRT_ByteStream_ConditionsSvc::m_num_l1id_errors
int m_num_l1id_errors
Definition: TRT_ByteStream_ConditionsSvc.h:103
TRT_ByteStream_ConditionsSvc::m_tot_num_error_errors
long long m_tot_num_error_errors
Definition: TRT_ByteStream_ConditionsSvc.h:113
TRT_ByteStream_ConditionsSvc::finalize
virtual StatusCode finalize()
Finalize //.
Definition: TRT_ByteStream_ConditionsSvc.cxx:102
TRT_ByteStream_ConditionsSvc::getRobErrorSet
const std::set< std::pair< uint32_t, uint32_t > > & getRobErrorSet(void)
Definition: TRT_ByteStream_ConditionsSvc.cxx:213
TRT_ByteStream_ConditionsSvc::condSummaryStatus
InDet::TRT_CondFlag condSummaryStatus(const Identifier &)
Evaluation for TRT_ConditionsSummarySvc.
Definition: TRT_ByteStream_ConditionsSvc.cxx:93
TRT_ByteStream_ConditionsSvc::m_num_sid_errors
int m_num_sid_errors
Definition: TRT_ByteStream_ConditionsSvc.h:107
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRT_ByteStream_ConditionsSvc::resetSets
void resetSets(void)
Definition: TRT_ByteStream_ConditionsSvc.cxx:135
TRT_ByteStream_ConditionsSvc::m_num_robStatus_errors
int m_num_robStatus_errors
Definition: TRT_ByteStream_ConditionsSvc.h:108
TRT_ByteStream_ConditionsSvc::m_num_error_errors
int m_num_error_errors
Definition: TRT_ByteStream_ConditionsSvc.h:106
TRT_ByteStream_ConditionsSvc::m_bcid_errors
std::set< uint32_t > m_bcid_errors
Definition: TRT_ByteStream_ConditionsSvc.h:93
TRT_ByteStream_ConditionsSvc::m_missing_errors
std::set< uint32_t > m_missing_errors
Definition: TRT_ByteStream_ConditionsSvc.h:94
TRT_ByteStream_ConditionsSvc::add_rob_error
void add_rob_error(uint32_t robSourceId, uint32_t robStatus)
Definition: TRT_ByteStream_ConditionsSvc.cxx:318
TRT_ByteStream_ConditionsSvc::initialize
virtual StatusCode initialize()
Initialize //.
Definition: TRT_ByteStream_ConditionsSvc.cxx:50
TRT_ByteStream_ConditionsSvc::getSidErrorSet
const std::set< uint32_t > & getSidErrorSet(void)
Definition: TRT_ByteStream_ConditionsSvc.cxx:244
TRT_ByteStream_ConditionsSvc::add_missing_error
void add_missing_error(uint32_t DTMROC_idx)
Definition: TRT_ByteStream_ConditionsSvc.cxx:269
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
TRTByteStreamErrors::BCIDError
@ BCIDError
Definition: ITRT_ByteStream_ConditionsSvc.h:19
TRT_ByteStream_ConditionsSvc.h
Service for accessing TRT ByteStream conditions information.
TRT_ByteStream_ConditionsSvc::m_l1id_pair_errors
std::set< std::pair< uint32_t, uint32_t > > m_l1id_pair_errors
Definition: TRT_ByteStream_ConditionsSvc.h:98
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TRT_ByteStream_ConditionsSvc::getErrorErrorSet
const std::set< uint32_t > & getErrorErrorSet(void)
Definition: TRT_ByteStream_ConditionsSvc.cxx:234
TRT_ByteStream_ConditionsSvc::m_tot_num_sid_errors
long long m_tot_num_sid_errors
Definition: TRT_ByteStream_ConditionsSvc.h:114
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
TRT_ByteStream_ConditionsSvc::getNumberOfErrors
int getNumberOfErrors(TRTByteStreamErrors::errorTypes ErrType)
Definition: TRT_ByteStream_ConditionsSvc.cxx:169
TRT_ByteStream_ConditionsSvc::getIdErrorSet
std::set< std::pair< uint32_t, uint32_t > > * getIdErrorSet(TRTByteStreamErrors::errorTypes ErrType)
Definition: TRT_ByteStream_ConditionsSvc.cxx:346
TRTByteStreamErrors::MISSINGError
@ MISSINGError
Definition: ITRT_ByteStream_ConditionsSvc.h:21
TRT_ByteStream_ConditionsSvc::resetCounts
void resetCounts(void)
The following methods are for HLT, to get the numbers of errors per RoI, so won't necessarily match u...
Definition: TRT_ByteStream_ConditionsSvc.cxx:158
TRT_ByteStream_ConditionsSvc::getRodRobErrorSet
std::set< std::pair< uint32_t, uint32_t > > * getRodRobErrorSet(TRTByteStreamErrors::errorTypes ErrType)
Definition: TRT_ByteStream_ConditionsSvc.cxx:332
TRT_ByteStream_ConditionsSvc::m_sid_errors
std::set< uint32_t > m_sid_errors
Definition: TRT_ByteStream_ConditionsSvc.h:96
TRT_ByteStream_ConditionsSvc::TRT_ByteStream_ConditionsSvc
TRT_ByteStream_ConditionsSvc(const std::string &, ISvcLocator *)
Constructor //.
Definition: TRT_ByteStream_ConditionsSvc.cxx:22
ref
const boost::regex ref(r_ef)
DEBUG
#define DEBUG
Definition: page_access.h:11
TRT_ByteStream_ConditionsSvc::m_tot_num_l1id_errors
long long m_tot_num_l1id_errors
Definition: TRT_ByteStream_ConditionsSvc.h:110
TRT_ByteStream_ConditionsSvc::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
Definition: TRT_ByteStream_ConditionsSvc.h:90
TRTByteStreamErrors::errorTypes
errorTypes
Definition: ITRT_ByteStream_ConditionsSvc.h:18
TRT_BSErrContainer_p1.h
TRT_ByteStream_ConditionsSvc::getErrorSet
std::set< uint32_t > * getErrorSet(TRTByteStreamErrors::errorTypes ErrType)
Definition: TRT_ByteStream_ConditionsSvc.cxx:362
TRT_ByteStream_ConditionsSvc::add_l1id_error
void add_l1id_error(uint32_t DTMROC_idx)
InDet::TRT_CondFlag
TRT_CondFlag
status flag to be derived from the inheriting tool's conditions info
Definition: ITRT_ConditionsSvc.h:19
InDet::TRT_COND_GOOD
@ TRT_COND_GOOD
Definition: ITRT_ConditionsSvc.h:21
TRTByteStreamErrors::SIDError
@ SIDError
Definition: ITRT_ByteStream_ConditionsSvc.h:23
TRT_ByteStream_ConditionsSvc::handle
void handle(const Incident &)
Definition: TRT_ByteStream_ConditionsSvc.cxx:128
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TRT_ByteStream_ConditionsSvc::add_bcid_error
void add_bcid_error(uint32_t DTMROC_idx)
TRT_ByteStream_ConditionsSvc::m_l1id_errors
std::set< uint32_t > m_l1id_errors
Definition: TRT_ByteStream_ConditionsSvc.h:92
TRT_ByteStream_ConditionsSvc::m_bcid_pair_errors
std::set< std::pair< uint32_t, uint32_t > > m_bcid_pair_errors
Definition: TRT_ByteStream_ConditionsSvc.h:99
TRT_ByteStream_ConditionsSvc::m_error_errors
std::set< uint32_t > m_error_errors
Definition: TRT_ByteStream_ConditionsSvc.h:95
Identifier
Definition: IdentifierFieldParser.cxx:14