ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_DCS_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
13
17
18#include "TH1D.h"
19#include "TFile.h"
20
21#include <sstream>
22
27 ISvcLocator* pSvcLocator ) :
28 base_class( 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),
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
104 ATH_CHECK( m_EventInfoKey.initialize());
105 ATH_CHECK( m_barrelReadKey.initialize() );
106 ATH_CHECK( m_EAReadKey.initialize() );
107 ATH_CHECK( m_ECReadKey.initialize() );
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
129InDet::TRT_DCS_StatusFlag TRT_DCS_ConditionsSvc::getFlag( const Identifier ident ) {
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" );
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
154 InDet::TRT_DCS_DataType dataType,
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
166 if ( dataType == InDet::TRT_DCS_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
221StatusCode TRT_DCS_ConditionsSvc::getValue( const std::string & foldername,
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
278StatusCode TRT_DCS_ConditionsSvc::getValue( const std::string & foldername,
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
319InDet::TRT_CondFlag TRT_DCS_ConditionsSvc::condSummaryStatus( const Identifier& ident ) {
320
321 InDet::TRT_CondFlag condFlag(InDet::TRT_COND_NOINFO);
322 InDet::TRT_DCS_StatusFlag theFlag = getFlag( ident );
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 ) {
328 int det = m_TRT_ID_Helper->barrel_ec( ident );
329 int phi = m_TRT_ID_Helper->phi_module( ident );
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
373const CondAttrListCollection* TRT_DCS_ConditionsSvc::getCollection( const std::string & foldername) {
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);
378 if(foldername == m_Barrel_HV_COOLFolderName ) {
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);
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);
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);
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
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 );
470 InDet::TRT_DCS_StatusFlag theFlag;
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 }
484
487
488 StatusCode sc(StatusCode::SUCCESS);
489
490 // Get the current event timestamp
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)
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 );
528 InDet::TRT_DCS_StatusFlag theFlag;
529 InDet::TRT_DCS_ValueType theVoltage = -10.;
530 sc = getValue( m_EndcapA_HV_COOLFolderName, chanNum, theVoltage );
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 }
540
543
544 StatusCode sc(StatusCode::SUCCESS);
545
546 // Get the current event timestamp
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)
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 );
584 InDet::TRT_DCS_StatusFlag theFlag;
585 InDet::TRT_DCS_ValueType theVoltage = -10.;
586 sc = getValue( m_EndcapC_HV_COOLFolderName, chanNum, theVoltage );
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 }
Scalar phi() const
phi method
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
static Double_t sc
Handle class for reading from StoreGate.
Service to provide a simple Athena interface to read DCS conditions data from COOL author Denver Whit...
This is an Identifier helper class for the TRT subdetector.
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator end() const
name_const_iterator name_begin() const
Access to Chan/Name pairs via iterators.
name_size_type name_size() const
number of Chan/Name pairs
name_const_iterator name_end() const
ChanAttrListMap::const_iterator const_iterator
ChanNameMap::const_iterator name_const_iterator
const_iterator chanAttrListPair(ChanNum chanNum) const
Access to Chan/AttributeList pairs via channel number: returns map iterator.
coral::AttributeList AttributeList
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ServiceHandle< ICondSvc > m_condSvc
TRT_DCS_ConditionsSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor //.
SG::ReadCondHandleKey< CondAttrListCollection > m_barrelReadKey
ServiceHandle< ITRT_HWMappingSvc > m_mapSvc
ServiceHandle< StoreGateSvc > m_evtStore
virtual ~TRT_DCS_ConditionsSvc()
Destructor //.
InDet::TRT_DCS_StatusFlag getFlag(const Identifier)
Returns the DCS conditions StatusFlag for a given identifier.
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
SG::ReadCondHandleKey< CondAttrListCollection > m_ECReadKey
InDet::TRT_CondFlag condSummaryStatus(const Identifier &)
Evaluation for TRT_ConditionsSummarySvc.
ServiceHandle< StoreGateSvc > m_detStore
void monitorBarrel()
Monitor barrel HV //.
virtual StatusCode finalize()
Finalize //.
const CondAttrListCollection * getCollection(const std::string &collName)
get pointer
SG::ReadCondHandleKey< CondAttrListCollection > m_EAReadKey
void monitorEndcapA()
Monitor EndcapA HV //.
StatusCode getValue(const Identifier, const InDet::TRT_DCS_DataType, InDet::TRT_DCS_ValueType &)
Returns the value for a given identifier and data type.
virtual StatusCode initialize()
Initialize //.
void monitorEndcapC()
Monitor EndcapC HV //.
MsgStream & msg
Definition testRead.cxx:32
TFile * file