ATLAS Offline Software
TRT_DCS_ConditionsSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #include "TRT_DCS_ConditionsSvc.h"
11 #include "StoreGate/StoreGateSvc.h"
13 
14 #include "InDetIdentifier/TRT_ID.h"
15 #include "StoreGate/ReadHandle.h"
17 
18 #include "TH1D.h"
19 #include "TFile.h"
20 
21 #include <sstream>
22 
27  ISvcLocator* pSvcLocator ) :
28  AthService( name, pSvcLocator ),
29  m_evtStore("StoreGateSvc",name),
30  m_detStore("DetectorStore",name),
31  m_mapSvc("TRT_HWMappingSvc",name),
32  m_condSvc("CondSvc",name),
33  m_barrelReadKey("/TRT/DCS/HV/BARREL"),
34  m_EAReadKey("/TRT/DCS/HV/ENDCAPA"),
35  m_ECReadKey("/TRT/DCS/HV/ENDCAPC"),
36  m_TRT_ID_Helper(nullptr),
37  m_numFlagRED(0),
38  m_numFlagNOINFO(0),
39  m_currentTimestamp(0),
40  m_doMonitoring(false),
41  m_h_Barrel_nRED(nullptr),
42  m_h_EndcapA_nRED(nullptr),
43  m_h_EndcapC_nRED(nullptr),
44  m_h_Barrel_nNOINFO(nullptr),
45  m_h_EndcapA_nNOINFO(nullptr),
46  m_h_EndcapC_nNOINFO(nullptr),
47  m_h_Barrel_HVvalAvg(nullptr),
48  m_h_EndcapA_HVvalAvg(nullptr),
49  m_h_EndcapC_HVvalAvg(nullptr),
50  m_nBAEvts(0),
51  m_nEAEvts(0),
52  m_nECEvts(0)
53 {
54  // Get properties from job options
55  declareProperty( "Barrel_HV_COOLFolderName", m_Barrel_HV_COOLFolderName = "/TRT/DCS/HV/BARREL" );
56  declareProperty( "EndcapA_HV_COOLFolderName", m_EndcapA_HV_COOLFolderName = "/TRT/DCS/HV/ENDCAPA" );
57  declareProperty( "EndcapC_HV_COOLFolderName", m_EndcapC_HV_COOLFolderName = "/TRT/DCS/HV/ENDCAPC" );
58  declareProperty( "VeryVerbose", m_VeryVerbose = false );
59  declareProperty( "HV_WarningValueLow", m_HVWarnValHi = 2000. );
60  declareProperty( "HV_WarningValueHigh", m_HVWarnValLo = 1000. );
61  declareProperty( "HWMapSvc", m_mapSvc );
62  declareProperty( "DoIOVChecking", m_doIOVchecking = false );
63  declareProperty( "IOVmaxLength", m_IOVmaxLength = 86400 /* 24 hours */ );
64  declareProperty( "FallBackOnCOOLChanNames", m_FallBackOnCOOLChanNames = false );
65  declareProperty( "EventStore", m_evtStore );
66  declareProperty( "DetectorStore", m_detStore );
67  declareProperty( "DoMonitoring", m_doMonitoring );
68  if ( m_doIOVchecking ) {
69  ATH_MSG_WARNING( "DoIOVChecking is deprecated and does nothing. Please remove from your job options configuration." );
70  m_doIOVchecking = false;
71  }
72  // initialize caches
73  m_evtBA.push_back(-1);
74  m_evtEA.push_back(-1);
75  m_evtEC.push_back(-1);
76  m_Barrel_HV_COOLCont.push_back(nullptr);
77  m_EndcapA_HV_COOLCont.push_back(nullptr);
78  m_EndcapC_HV_COOLCont.push_back(nullptr);
79 }
80 
85 
90  if (msgLvl(MSG::DEBUG)) msg() << "Initialize." << endmsg;
91  StatusCode sc(StatusCode::SUCCESS);
92 
93  // Retrieve the EventStore and DetectorStore
94  sc = m_evtStore.retrieve();
95  if ( sc.isFailure() ) {
96  ATH_MSG_ERROR( "Unable to retrieve " << m_evtStore );
97  }
98  sc = m_detStore.retrieve();
99  if ( sc.isFailure() ) {
100  msg(MSG::ERROR) << "Unable to retrieve " << m_detStore << endmsg;
101  }
102 
103  // initialize DataHandle keys
108 
109  // Get the TRT Identifier Helper.
110  sc = m_detStore->retrieve( m_TRT_ID_Helper, "TRT_ID" );
111  if ( sc.isFailure() ) {
112  ATH_MSG_ERROR( "Unable to retrieve pointer to TRT ID Helper." );
113  return sc;
114  }
115 
116  // Get the TRT_HWMappingSvc
117  sc = m_mapSvc.retrieve();
118  if ( sc.isFailure() ) {
119  ATH_MSG_ERROR( "Couldn't get " << m_mapSvc );
120  return sc;
121  }
122 
123  return sc;
124 }
125 
130  StatusCode sc(StatusCode::SUCCESS);
131 
132  // Temporary Solution: check voltage against upper and lower warning levels
133  InDet::TRT_DCS_ValueType theVoltage = -10.;
134  sc = getValue( ident, InDet::TRT_DCS_HV_VOLTAGE, theVoltage );
135  if ( sc.isFailure() ) {
136  if (m_VeryVerbose) ATH_MSG_VERBOSE( "Failed to get HV voltage value. Returning NOINFO" );
137  m_numFlagNOINFO++;
138  return InDet::TRT_DCS_NOINFO;
139  }
140  if ( theVoltage < m_HVWarnValLo || theVoltage > m_HVWarnValHi ) {
141  if (m_VeryVerbose) ATH_MSG_VERBOSE( "Voltage out of valid range. (" << theVoltage << ") Flagging RED." );
142  m_numFlagRED++;
143  return InDet::TRT_DCS_RED;
144  }
145 
146  if (m_VeryVerbose) ATH_MSG_VERBOSE( "Voltage = " << theVoltage << " Flagging GREEN" );
147  return InDet::TRT_DCS_GREEN;
148 }
149 
155  InDet::TRT_DCS_ValueType& theValue ) {
156  StatusCode sc(StatusCode::SUCCESS);
157 
158  // Decode the identifier
159  int barrel_ec = m_TRT_ID_Helper->barrel_ec( ident );
160  int phi_slice = m_TRT_ID_Helper->phi_module( ident );
161  int module_or_wheel = m_TRT_ID_Helper->layer_or_wheel( ident );
162  int straw_layer = m_TRT_ID_Helper->straw_layer( ident );
163  int straw = m_TRT_ID_Helper->straw( ident );
164 
165  // HV Voltage
167 
168  // Construct the DCS folder name
169  std::string folderName = "";
170  if ( abs(barrel_ec) == 1 ) folderName = m_Barrel_HV_COOLFolderName;
171  if ( barrel_ec == 2 ) folderName = m_EndcapA_HV_COOLFolderName;
172  if ( barrel_ec == -2 ) folderName = m_EndcapC_HV_COOLFolderName;
173  if ( folderName.empty() ) {
174  ATH_MSG_ERROR( "Invalid barrel/endcap identifier given." );
175  return StatusCode::FAILURE;
176  }
177 
178  // Get the Channel Number
179  int chanNum = -1;
180  chanNum = m_mapSvc->get_HV_CoolChanNum( ident );
181  if ( chanNum < 0 ) {
182  ATH_MSG_WARNING( "Failed to get COOL channel number from map tool: "
183  << barrel_ec << "," << phi_slice << "," << module_or_wheel << ","
184  << straw_layer << "," << straw );
185  }
186 
187  // Get the value for the determined folder name and channel number
188  sc = getValue( folderName, chanNum, theValue );
189  if ( sc.isFailure() ) {
190  // Try to get the value by channel name?
192  // Get the Channel Name
193  std::string chanName = "";
194  chanName = m_mapSvc->get_HV_CoolChanName( ident );
195  if ( chanName.empty() ) {
196  ATH_MSG_WARNING( "Failed to get COOL channel name from map tool: "
197  << barrel_ec << "," << phi_slice << "," << module_or_wheel << ","
198  << straw_layer << "," << straw );
199  return StatusCode::FAILURE;
200  }
201  // Get the value for the determined folder name and channel name
202  sc = getValue( folderName, chanName, theValue );
203  if ( sc.isFailure() ) {
204  ATH_MSG_WARNING( "Failed to fall back on COOL channel name." );
205  return sc;
206  }
207  } else return StatusCode::FAILURE;
208  }
209 
210  } else {
211  ATH_MSG_WARNING( "getValue called for unknown datatype" );
212  return StatusCode::FAILURE;
213  }
214 
215  return sc;
216 }
217 
222  const std::string & chanName,
223  InDet::TRT_DCS_ValueType& theValue ) {
224  StatusCode sc(StatusCode::SUCCESS);
225 
226  /*
227  // Specify foldername and chanName in COOL form
228  // e.g. foldername = "/TRT/DCS/HV/BARREL"
229  // chanName = "HVB_S24_M3_B3_OutputVoltage"
230  */
231 
232  // Get the folder from the CondStore.
233  const CondAttrListCollection* DCScondFolder = getCollection(foldername);
234  if ( !DCScondFolder ) {
235  sc = m_detStore->retrieve( DCScondFolder, foldername );
236  if ( sc.isFailure() ) {
237  ATH_MSG_WARNING( "Couldn't retrieve folder " << foldername
238  << " from DetectorStore. Has it been loaded into IOVDbSvc?" );
239  return StatusCode::FAILURE;
240  }
241  }
242  if ( !DCScondFolder ) return StatusCode::FAILURE;
243  // Get the channel number for this channel name.
244  int chanNum = -1;
246  if ( DCScondFolder->name_size() == 0 ) {
247  ATH_MSG_WARNING( "This CondAttrListCollection has no entries"
248  << " in its ChanNameMap. Won't be able to get channel numbers." );
249  }
250  for ( chanNameMapItr = DCScondFolder->name_begin();
251  chanNameMapItr != DCScondFolder->name_end(); ++chanNameMapItr ) {
252  if ( (*chanNameMapItr).second == chanName ) {
253  chanNum = (*chanNameMapItr).first;
254  break;
255  }
256  }
257 
258  // Get the requested channel/value pair
260  chanAttrListPair = DCScondFolder->chanAttrListPair( chanNum );
261  if ( chanAttrListPair == DCScondFolder->end() ) {
262  ATH_MSG_VERBOSE( "Channel " << chanName
263  << " not found in folder " << foldername
264  << " for this IOV." );
265  return StatusCode::FAILURE;
266  }
267  const CondAttrListCollection::AttributeList& attrList = (*chanAttrListPair).second;
268 
269  // Get the value
270  theValue = attrList["OUTPUTVOLTAGE_VALUE"].data<InDet::TRT_DCS_ValueType>();
271 
272  return sc;
273 }
274 
279  const int chanNum,
280  InDet::TRT_DCS_ValueType& theValue ) {
281 
282  /*
283  // Directly access the value by folder channel number
284  // e.g. foldername = "/TRT/DCS/HV/BARREL"
285  // chanNum = e.g. result from HV map query
286  */
287 
288  // Get the folder from the CondStore.
289  const CondAttrListCollection* DCScondFolder = getCollection(foldername);
290  if ( !DCScondFolder ) {
291  StatusCode sc = m_detStore->retrieve( DCScondFolder, foldername );
292  if ( sc.isFailure() ) {
293  ATH_MSG_WARNING( "Couldn't retrieve folder " << foldername
294  << " from DetectorStore. Has it been loaded into IOVDbSvc?" );
295  return sc;
296  }
297  }
298  if ( !DCScondFolder ) return StatusCode::FAILURE;
299  // Get the requested channel/value pair
301  chanAttrListPair = DCScondFolder->chanAttrListPair( chanNum );
302  if ( chanAttrListPair == DCScondFolder->end() ) {
303  ATH_MSG_VERBOSE( "Channel " << chanNum
304  << " not found in folder " << foldername
305  << " for this IOV." );
306  return StatusCode::FAILURE;
307  }
308  const CondAttrListCollection::AttributeList& attrList = (*chanAttrListPair).second;
309 
310  // Get the value
311  theValue = attrList["OUTPUTVOLTAGE_VALUE"].data<InDet::TRT_DCS_ValueType>();
312 
313  return StatusCode::SUCCESS;
314 }
315 
320 
323 
324  if ( theFlag == InDet::TRT_DCS_GREEN ) condFlag = InDet::TRT_COND_GOOD;
325  if ( theFlag == InDet::TRT_DCS_RED ) condFlag = InDet::TRT_COND_BAD;
326 
327  if ( m_VeryVerbose && theFlag != InDet::TRT_DCS_GREEN ) {
330  int lay = m_TRT_ID_Helper->layer_or_wheel( ident );
331  int strawLay = m_TRT_ID_Helper->straw_layer( ident );
332  int straw = m_TRT_ID_Helper->straw( ident );
333  std::string chanName = m_mapSvc->get_HV_CoolChanName( ident );
334  // InDet::TRT_DCS_StatusFlag enum defined in ITRT_DCS_ConditionsSvc.h
335  ATH_MSG_VERBOSE("Channel " << det << " " << phi << " " << lay << " " << strawLay << " " << straw << " on line " << chanName << " has flag " << theFlag);
336  }
337 
338  return condFlag;
339 }
340 
345  ATH_MSG_INFO( "Reported NOINFO " << m_numFlagNOINFO << " times." );
346  ATH_MSG_INFO( "Reported RED " << m_numFlagRED << " times." );
347  ATH_MSG_INFO( "If these are suspicious numbers, turn on VERBOSE output and set VeryVerbose=True to see more info." );
348  if ( m_doMonitoring ) {
349  m_h_Barrel_HVvalAvg->Scale(1./double(m_nBAEvts));
350  m_h_EndcapA_HVvalAvg->Scale(1./double(m_nEAEvts));
351  m_h_EndcapC_HVvalAvg->Scale(1./double(m_nECEvts));
352  TFile* outFile = new TFile("TRT_DCS_Monitoring.root","RECREATE");
353  bool file = outFile->cd();
354  if (file){
355  m_h_Barrel_nRED->Write();
356  m_h_Barrel_nNOINFO->Write();
357  m_h_Barrel_HVvalAvg->Write();
358  m_h_EndcapA_nRED->Write();
359  m_h_EndcapA_nNOINFO->Write();
360  m_h_EndcapA_HVvalAvg->Write();
361  m_h_EndcapC_nRED->Write();
362  m_h_EndcapC_nNOINFO->Write();
363  m_h_EndcapC_HVvalAvg->Write();
364  }
365  outFile->Close();
366  }
367  return StatusCode::SUCCESS;
368 }
369 
374  const EventContext& event_context=Gaudi::Hive::currentContext();
375  EventContext::ContextID_t slot=event_context.slot();
376  EventContext::ContextEvt_t event_id=event_context.evt();
377  std::lock_guard<std::mutex> lock(m_cacheMutex);
379  if(slot>=m_evtBA.size()) {
380  m_evtBA.resize(slot+1);
381  m_Barrel_HV_COOLCont.resize(slot+1);
382  }
383  if(m_evtBA[slot]!=event_id) {
385  m_evtBA[slot]=event_id;
386  m_Barrel_HV_COOLCont[slot]=(*rst);
387  monitorBarrel();
388  }
389  return m_Barrel_HV_COOLCont[slot];
390 
391  } else if(foldername == m_EndcapA_HV_COOLFolderName ) {
392  if(slot>=m_evtEA.size()) {
393  m_evtEA.resize(slot+1);
394  m_EndcapA_HV_COOLCont.resize(slot+1);
395  }
396  if(m_evtEA[slot]!=event_id) {
398  m_evtEA[slot]=event_id;
399  m_EndcapA_HV_COOLCont[slot]=(*rst);
400  monitorEndcapA();
401  }
402  return m_EndcapA_HV_COOLCont[slot];
403 
404  } else if (foldername == m_EndcapC_HV_COOLFolderName ) {
405  if(slot>=m_evtEC.size()) {
406  m_evtEC.resize(slot+1);
407  m_EndcapC_HV_COOLCont.resize(slot+1);
408  }
409  if(m_evtEC[slot]!=event_id) {
411  m_evtEC[slot]=event_id;
412  m_EndcapC_HV_COOLCont[slot]=(*rst);
413  monitorEndcapC();
414  }
415  return m_EndcapC_HV_COOLCont[slot];
416 
417  } else {
418  ATH_MSG_WARNING( " TRT DCS HV folder requested with bad folder name " );
419  }
420  return nullptr;
421 }
422 
423 
427 
428  StatusCode sc(StatusCode::SUCCESS);
429 
430  // Get the current event timestamp
431  m_currentTimestamp = 0;
433 
434  if (not evtInfo.isValid()) {
435  ATH_MSG_WARNING( "Couldn't get " << m_EventInfoKey.key()
436  << " from StoreGate." );
437  return;
438  }
439 
440  m_currentTimestamp = evtInfo->timeStamp();
441  if (m_VeryVerbose) ATH_MSG_VERBOSE( "Event timestamp: " << m_currentTimestamp );
442 
443  // Monitoring Histograms
444  if ( m_doMonitoring ) {
446  m_nBAEvts++;
447 
449  // Set up Monitoring Histograms if not done (first event)
450  if (!m_h_Barrel_HVvalAvg) {
451  m_h_Barrel_nRED = new TH1D("Barrel_nRED","Barrel - nRED",clc->name_size(),1,clc->name_size());
452  m_h_Barrel_nNOINFO = new TH1D("Barrel_nNOINFO","Barrel - nNOINFO",clc->name_size(),1,clc->name_size());
453  m_h_Barrel_HVvalAvg = new TH1D("Barrel_HVvalAvg","Barrel - HVvalAvg",clc->name_size(),1,clc->name_size());
454  for ( chanNameMapItr = clc->name_begin();
455  chanNameMapItr != clc->name_end(); ++chanNameMapItr ) {
456  std::string chanName( (*chanNameMapItr).second );
457  int chanNum( (*chanNameMapItr).first );
458  m_h_Barrel_nRED->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
459  m_h_Barrel_nNOINFO->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
460  m_h_Barrel_HVvalAvg->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
461  }
462  }
463 
464  // Fill Monitoring Histograms
465 
466  for ( chanNameMapItr = clc->name_begin();
467  chanNameMapItr != clc->name_end(); ++chanNameMapItr ) {
468  std::string chanName( (*chanNameMapItr).second );
469  int chanNum( (*chanNameMapItr).first );
471  InDet::TRT_DCS_ValueType theVoltage = -10.;
472  sc = getValue( m_Barrel_HV_COOLFolderName, chanNum, theVoltage );
473  if ( sc.isFailure() ) theFlag = InDet::TRT_DCS_NOINFO;
474  else if ( theVoltage < m_HVWarnValLo || theVoltage > m_HVWarnValHi ) theFlag = InDet::TRT_DCS_RED;
475  else theFlag = InDet::TRT_DCS_GREEN;
476  if ( theFlag == InDet::TRT_DCS_RED ) m_h_Barrel_nRED->Fill(chanNum);
477  if ( theFlag == InDet::TRT_DCS_NOINFO ) m_h_Barrel_nNOINFO->Fill(chanNum);
478  if (!sc.isFailure()) m_h_Barrel_HVvalAvg->Fill(chanNum,theVoltage);
479  }
480 
481  } // end of doMonitoring
482 
483  }
487 
488  StatusCode sc(StatusCode::SUCCESS);
489 
490  // Get the current event timestamp
491  m_currentTimestamp = 0;
493 
494  if (not evtInfo.isValid()) {
495  ATH_MSG_WARNING( "Couldn't get " << m_EventInfoKey.key()
496  << " from StoreGate." );
497  return;
498  }
499 
500  m_currentTimestamp = evtInfo->timeStamp();
501  if (m_VeryVerbose) ATH_MSG_VERBOSE( "Event timestamp: " << m_currentTimestamp );
502 
503  // Monitoring Histograms
504  if ( m_doMonitoring ) {
506  m_nEAEvts++;
507 
509  // Set up Monitoring Histograms if not done (first event)
510  if (!m_h_EndcapA_HVvalAvg) {
511  m_h_EndcapA_nRED = new TH1D("EndcapA_nRED","EA - nRED",clc->name_size(),1,clc->name_size());
512  m_h_EndcapA_nNOINFO = new TH1D("EndcapA_nNOINFO","EA - nNOINFO",clc->name_size(),1,clc->name_size());
513  m_h_EndcapA_HVvalAvg = new TH1D("EndcapA_HVvalAvg","EA - HVvalAvg",clc->name_size(),1,clc->name_size());
514  for ( chanNameMapItr = clc->name_begin();
515  chanNameMapItr != clc->name_end(); ++chanNameMapItr ) {
516  std::string chanName( (*chanNameMapItr).second );
517  int chanNum( (*chanNameMapItr).first );
518  m_h_EndcapA_nRED->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
519  m_h_EndcapA_nNOINFO->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
520  m_h_EndcapA_HVvalAvg->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
521  }
522  }
523 
524  for ( chanNameMapItr = clc->name_begin();
525  chanNameMapItr != clc->name_end(); ++chanNameMapItr ) {
526  std::string chanName( (*chanNameMapItr).second );
527  int chanNum( (*chanNameMapItr).first );
529  InDet::TRT_DCS_ValueType theVoltage = -10.;
531  if ( sc.isFailure() ) theFlag = InDet::TRT_DCS_NOINFO;
532  else if ( theVoltage < m_HVWarnValLo || theVoltage > m_HVWarnValHi ) theFlag = InDet::TRT_DCS_RED;
533  else theFlag = InDet::TRT_DCS_GREEN;
534  if ( theFlag == InDet::TRT_DCS_RED ) m_h_EndcapA_nRED->Fill(chanNum);
535  if ( theFlag == InDet::TRT_DCS_NOINFO ) m_h_EndcapA_nNOINFO->Fill(chanNum);
536  if (!sc.isFailure()) m_h_EndcapA_HVvalAvg->Fill(chanNum,theVoltage);
537  }
538  }
539  }
543 
544  StatusCode sc(StatusCode::SUCCESS);
545 
546  // Get the current event timestamp
547  m_currentTimestamp = 0;
549 
550  if (not evtInfo.isValid()) {
551  ATH_MSG_WARNING( "Couldn't get " << m_EventInfoKey.key()
552  << " from StoreGate." );
553  return;
554  }
555 
556  m_currentTimestamp = evtInfo->timeStamp();
557  if (m_VeryVerbose) ATH_MSG_VERBOSE( "Event timestamp: " << m_currentTimestamp );
558 
559  // Monitoring Histograms
560  if ( m_doMonitoring ) {
562  m_nECEvts++;
563 
565  // Set up Monitoring Histograms if not done (first event)
566  if (!m_h_EndcapC_HVvalAvg) {
567  m_h_EndcapC_nRED = new TH1D("EndcapC_nRED","EC - nRED",clc->name_size(),1,clc->name_size());
568  m_h_EndcapC_nNOINFO = new TH1D("EndcapC_nNOINFO","EC - nNOINFO",clc->name_size(),1,clc->name_size());
569  m_h_EndcapC_HVvalAvg = new TH1D("EndcapC_HVvalAvg","EC - HVvalAvg",clc->name_size(),1,clc->name_size());
570  for ( chanNameMapItr = clc->name_begin();
571  chanNameMapItr != clc->name_end(); ++chanNameMapItr ) {
572  std::string chanName( (*chanNameMapItr).second );
573  int chanNum( (*chanNameMapItr).first );
574  m_h_EndcapC_nRED->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
575  m_h_EndcapC_nNOINFO->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
576  m_h_EndcapC_HVvalAvg->GetXaxis()->SetBinLabel(chanNum,chanName.c_str());
577  }
578  }
579 
580  for ( chanNameMapItr = clc->name_begin();
581  chanNameMapItr != clc->name_end(); ++chanNameMapItr ) {
582  std::string chanName( (*chanNameMapItr).second );
583  int chanNum( (*chanNameMapItr).first );
585  InDet::TRT_DCS_ValueType theVoltage = -10.;
587  if ( sc.isFailure() ) theFlag = InDet::TRT_DCS_NOINFO;
588  else if ( theVoltage < m_HVWarnValLo || theVoltage > m_HVWarnValHi ) theFlag = InDet::TRT_DCS_RED;
589  else theFlag = InDet::TRT_DCS_GREEN;
590  if ( theFlag == InDet::TRT_DCS_RED ) m_h_EndcapC_nRED->Fill(chanNum);
591  if ( theFlag == InDet::TRT_DCS_NOINFO ) m_h_EndcapC_nNOINFO->Fill(chanNum);
592  if (!sc.isFailure()) m_h_EndcapC_HVvalAvg->Fill(chanNum,theVoltage);
593  }
594  }
595  }
TRT_DCS_ConditionsSvc::m_h_EndcapC_HVvalAvg
TH1D * m_h_EndcapC_HVvalAvg
Definition: TRT_DCS_ConditionsSvc.h:140
TRT_DCS_ConditionsSvc::monitorEndcapC
void monitorEndcapC()
Monitor EndcapC HV //.
Definition: TRT_DCS_ConditionsSvc.cxx:542
TRT_DCS_ConditionsSvc::m_barrelReadKey
SG::ReadCondHandleKey< CondAttrListCollection > m_barrelReadKey
Definition: TRT_DCS_ConditionsSvc.h:101
TRT_DCS_ConditionsSvc::m_h_EndcapA_HVvalAvg
TH1D * m_h_EndcapA_HVvalAvg
Definition: TRT_DCS_ConditionsSvc.h:139
TRT_DCS_ConditionsSvc::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: TRT_DCS_ConditionsSvc.h:96
CondAttrListCollection::end
const_iterator end() const
Definition: CondAttrListCollection.h:315
TRT_DCS_ConditionsSvc::m_h_EndcapA_nRED
TH1D * m_h_EndcapA_nRED
Definition: TRT_DCS_ConditionsSvc.h:133
InDet::TRT_DCS_GREEN
@ TRT_DCS_GREEN
Definition: ITRT_DCS_ConditionsSvc.h:23
TRT_DCS_ConditionsSvc::m_EndcapA_HV_COOLFolderName
std::string m_EndcapA_HV_COOLFolderName
Definition: TRT_DCS_ConditionsSvc.h:91
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
TRT_DCS_ConditionsSvc::m_Barrel_HV_COOLFolderName
std::string m_Barrel_HV_COOLFolderName
Definition: TRT_DCS_ConditionsSvc.h:90
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TRT_DCS_ConditionsSvc::m_h_Barrel_nNOINFO
TH1D * m_h_Barrel_nNOINFO
Definition: TRT_DCS_ConditionsSvc.h:135
TRT_DCS_ConditionsSvc::m_h_Barrel_nRED
TH1D * m_h_Barrel_nRED
Definition: TRT_DCS_ConditionsSvc.h:132
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TRT_DCS_ConditionsSvc::m_h_EndcapA_nNOINFO
TH1D * m_h_EndcapA_nNOINFO
Definition: TRT_DCS_ConditionsSvc.h:136
TRT_DCS_ConditionsSvc::m_mapSvc
ServiceHandle< ITRT_HWMappingSvc > m_mapSvc
Definition: TRT_DCS_ConditionsSvc.h:97
TRT_DCS_ConditionsSvc::monitorEndcapA
void monitorEndcapA()
Monitor EndcapA HV //.
Definition: TRT_DCS_ConditionsSvc.cxx:486
TRT_DCS_ConditionsSvc::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Definition: TRT_DCS_ConditionsSvc.h:98
InDet::TRT_DCS_ValueType
float TRT_DCS_ValueType
data type stored in COOL DCS tables (usually float)
Definition: ITRT_DCS_ConditionsSvc.h:32
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
python.checkUPD1.foldername
foldername
Definition: checkUPD1.py:77
TH1D
Definition: rootspy.cxx:342
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
TRT_DCS_ConditionsSvc.h
Service to provide a simple Athena interface to read DCS conditions data from COOL author Denver Whit...
AthCommonMsg< Service >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TRT_DCS_ConditionsSvc::m_currentTimestamp
int m_currentTimestamp
Definition: TRT_DCS_ConditionsSvc.h:128
TRT_DCS_ConditionsSvc::m_nEAEvts
int m_nEAEvts
Definition: TRT_DCS_ConditionsSvc.h:142
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
TRT_DCS_ConditionsSvc::finalize
virtual StatusCode finalize()
Finalize //.
Definition: TRT_DCS_ConditionsSvc.cxx:344
ReadCondHandle.h
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TRT_DCS_ConditionsSvc::m_h_EndcapC_nRED
TH1D * m_h_EndcapC_nRED
Definition: TRT_DCS_ConditionsSvc.h:134
InDet::TRT_COND_NOINFO
@ TRT_COND_NOINFO
Definition: ITRT_ConditionsSvc.h:20
CondAttrListCollection::name_const_iterator
ChanNameMap::const_iterator name_const_iterator
Definition: CondAttrListCollection.h:69
TRT_DCS_ConditionsSvc::m_nECEvts
int m_nECEvts
Definition: TRT_DCS_ConditionsSvc.h:143
TRT_DCS_ConditionsSvc::m_IOVmaxLength
int m_IOVmaxLength
Definition: TRT_DCS_ConditionsSvc.h:112
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:902
InDet::TRT_DCS_RED
@ TRT_DCS_RED
Definition: ITRT_DCS_ConditionsSvc.h:25
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
InDet::TRT_DCS_HV_VOLTAGE
@ TRT_DCS_HV_VOLTAGE
Definition: ITRT_DCS_ConditionsSvc.h:29
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
TRT_DCS_ConditionsSvc::m_FallBackOnCOOLChanNames
bool m_FallBackOnCOOLChanNames
Definition: TRT_DCS_ConditionsSvc.h:114
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
AthService
Definition: AthService.h:32
TRT_DCS_ConditionsSvc::m_nBAEvts
int m_nBAEvts
Definition: TRT_DCS_ConditionsSvc.h:141
WritePulseShapeToCool.det
det
Definition: WritePulseShapeToCool.py:204
TRT_DCS_ConditionsSvc::m_h_Barrel_HVvalAvg
TH1D * m_h_Barrel_HVvalAvg
Definition: TRT_DCS_ConditionsSvc.h:138
InDet::TRT_DCS_StatusFlag
TRT_DCS_StatusFlag
status flags derived from DCS conditions data
Definition: ITRT_DCS_ConditionsSvc.h:21
file
TFile * file
Definition: tile_monitor.h:29
TRT_DCS_ConditionsSvc::m_VeryVerbose
bool m_VeryVerbose
Definition: TRT_DCS_ConditionsSvc.h:89
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TRT_DCS_ConditionsSvc::m_numFlagNOINFO
int m_numFlagNOINFO
Definition: TRT_DCS_ConditionsSvc.h:123
TRT_DCS_ConditionsSvc::m_doMonitoring
bool m_doMonitoring
Definition: TRT_DCS_ConditionsSvc.h:131
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:866
TRT_DCS_ConditionsSvc::m_doIOVchecking
bool m_doIOVchecking
Definition: TRT_DCS_ConditionsSvc.h:113
TRT_ID::straw_layer
int straw_layer(const Identifier &id) const
Definition: TRT_ID.h:893
TRT_DCS_ConditionsSvc::m_EndcapC_HV_COOLFolderName
std::string m_EndcapC_HV_COOLFolderName
Definition: TRT_DCS_ConditionsSvc.h:92
TRT_ID::layer_or_wheel
int layer_or_wheel(const Identifier &id) const
Definition: TRT_ID.h:884
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TRT_DCS_ConditionsSvc::getCollection
const CondAttrListCollection * getCollection(const std::string &collName)
get pointer
Definition: TRT_DCS_ConditionsSvc.cxx:373
CondAttrListCollection::name_begin
name_const_iterator name_begin() const
Access to Chan/Name pairs via iterators.
Definition: CondAttrListCollection.h:364
DQPostProcessTest.outFile
outFile
Comment Out Those You do not wish to run.
Definition: DQPostProcessTest.py:37
TRT_DCS_ConditionsSvc::~TRT_DCS_ConditionsSvc
virtual ~TRT_DCS_ConditionsSvc()
Destructor //.
CondAttrListCollection::name_size
name_size_type name_size() const
number of Chan/Name pairs
Definition: CondAttrListCollection.h:377
CaloCellTimeCorrFiller.folderName
string folderName
Definition: CaloCellTimeCorrFiller.py:20
TRT_DCS_ConditionsSvc::m_TRT_ID_Helper
const TRT_ID * m_TRT_ID_Helper
Definition: TRT_DCS_ConditionsSvc.h:118
TRT_DCS_ConditionsSvc::condSummaryStatus
InDet::TRT_CondFlag condSummaryStatus(const Identifier &)
Evaluation for TRT_ConditionsSummarySvc.
Definition: TRT_DCS_ConditionsSvc.cxx:319
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TRT_DCS_ConditionsSvc::monitorBarrel
void monitorBarrel()
Monitor barrel HV //.
Definition: TRT_DCS_ConditionsSvc.cxx:426
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TRT::Hit::ident
@ ident
Definition: HitInfo.h:77
TRT_ID::phi_module
int phi_module(const Identifier &id) const
Definition: TRT_ID.h:875
TRT_DCS_ConditionsSvc::getValue
StatusCode getValue(const Identifier, const InDet::TRT_DCS_DataType, InDet::TRT_DCS_ValueType &)
Returns the value for a given identifier and data type.
Definition: TRT_DCS_ConditionsSvc.cxx:153
EventInfo.h
CondAttrListCollection::chanAttrListPair
const_iterator chanAttrListPair(ChanNum chanNum) const
Access to Chan/AttributeList pairs via channel number: returns map iterator.
Definition: CondAttrListCollection.h:301
TRT_DCS_ConditionsSvc::m_EAReadKey
SG::ReadCondHandleKey< CondAttrListCollection > m_EAReadKey
Definition: TRT_DCS_ConditionsSvc.h:102
InDet::TRT_COND_BAD
@ TRT_COND_BAD
Definition: ITRT_ConditionsSvc.h:25
TRT_DCS_ConditionsSvc::m_HVWarnValLo
float m_HVWarnValLo
Definition: TRT_DCS_ConditionsSvc.h:93
TRT_DCS_ConditionsSvc::m_ECReadKey
SG::ReadCondHandleKey< CondAttrListCollection > m_ECReadKey
Definition: TRT_DCS_ConditionsSvc.h:103
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
DEBUG
#define DEBUG
Definition: page_access.h:11
TRT_DCS_ConditionsSvc::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
Definition: TRT_DCS_ConditionsSvc.h:95
AthCommonMsg< Service >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TRT_DCS_ConditionsSvc::m_numFlagRED
int m_numFlagRED
Counters.
Definition: TRT_DCS_ConditionsSvc.h:122
TRT_DCS_ConditionsSvc::initialize
virtual StatusCode initialize()
Initialize //.
Definition: TRT_DCS_ConditionsSvc.cxx:89
TRT_DCS_ConditionsSvc::m_h_EndcapC_nNOINFO
TH1D * m_h_EndcapC_nNOINFO
Definition: TRT_DCS_ConditionsSvc.h:137
InDet::TRT_CondFlag
TRT_CondFlag
status flag to be derived from the inheriting tool's conditions info
Definition: ITRT_ConditionsSvc.h:19
TRT_DCS_ConditionsSvc::getFlag
InDet::TRT_DCS_StatusFlag getFlag(const Identifier)
Returns the DCS conditions StatusFlag for a given identifier.
Definition: TRT_DCS_ConditionsSvc.cxx:129
InDet::TRT_COND_GOOD
@ TRT_COND_GOOD
Definition: ITRT_ConditionsSvc.h:21
CondAttrListCollection::AttributeList
coral::AttributeList AttributeList
Definition: CondAttrListCollection.h:56
ReadHandle.h
Handle class for reading from StoreGate.
TRT_DCS_ConditionsSvc::m_cacheMutex
std::mutex m_cacheMutex
Definition: TRT_DCS_ConditionsSvc.h:107
StoreGateSvc.h
TRT_DCS_ConditionsSvc::TRT_DCS_ConditionsSvc
TRT_DCS_ConditionsSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor //.
Definition: TRT_DCS_ConditionsSvc.cxx:26
InDet::TRT_DCS_DataType
TRT_DCS_DataType
DCS data available in COOL offline database.
Definition: ITRT_DCS_ConditionsSvc.h:28
InDet::TRT_DCS_NOINFO
@ TRT_DCS_NOINFO
Definition: ITRT_DCS_ConditionsSvc.h:22
CondAttrListCollection::name_end
name_const_iterator name_end() const
Definition: CondAttrListCollection.h:370
TRT_DCS_ConditionsSvc::m_HVWarnValHi
float m_HVWarnValHi
Definition: TRT_DCS_ConditionsSvc.h:94