ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_DCS_ConditionsSvc Class Reference

Service for accessing DCS conditions information. More...

#include <TRT_DCS_ConditionsSvc.h>

Inheritance diagram for TRT_DCS_ConditionsSvc:

Public Member Functions

 TRT_DCS_ConditionsSvc (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor //.
virtual ~TRT_DCS_ConditionsSvc ()
 Destructor //.
virtual StatusCode initialize ()
 Initialize //.
virtual StatusCode finalize ()
 Finalize //.
InDet::TRT_DCS_StatusFlag getFlag (const Identifier)
 Returns the DCS conditions StatusFlag for a given identifier.
StatusCode getValue (const Identifier, const InDet::TRT_DCS_DataType, InDet::TRT_DCS_ValueType &)
 Returns the value for a given identifier and data type.
StatusCode getValue (const std::string &fname, const std::string &chanName, InDet::TRT_DCS_ValueType &value)
 Returns the value for a given folder/channel name.
StatusCode getValue (const std::string &fname, const int chanNum, InDet::TRT_DCS_ValueType &value)
 Returns the value for a given folder and COOL channel number.
const CondAttrListCollectiongetCollection (const std::string &collName)
 get pointer
void monitorBarrel ()
 Monitor barrel HV //.
void monitorEndcapA ()
 Monitor EndcapA HV //.
void monitorEndcapC ()
 Monitor EndcapC HV //.

Functions inherited from ITRT_ConditionsSvc

bool m_VeryVerbose {}
std::string m_Barrel_HV_COOLFolderName
std::string m_EndcapA_HV_COOLFolderName
std::string m_EndcapC_HV_COOLFolderName
float m_HVWarnValLo {}
float m_HVWarnValHi {}
ServiceHandle< StoreGateSvcm_evtStore
ServiceHandle< StoreGateSvcm_detStore
ServiceHandle< ITRT_HWMappingSvcm_mapSvc
SG::ReadHandleKey< xAOD::EventInfom_EventInfoKey {this,"EventInfoKey","EventInfo","RHK for EventInfo"}
ServiceHandle< ICondSvc > m_condSvc
SG::ReadCondHandleKey< CondAttrListCollectionm_barrelReadKey {this,"BarrelKeyName","in","HV Barrel in-key"}
SG::ReadCondHandleKey< CondAttrListCollectionm_EAReadKey {this,"EAKeyName","in","HV EA in-key"}
SG::ReadCondHandleKey< CondAttrListCollectionm_ECReadKey {this,"ECKeyName","in","HV EC in-key"}
std::vector< const CondAttrListCollection * > m_Barrel_HV_COOLCont ATLAS_THREAD_SAFE
std::vector< const CondAttrListCollection * > m_EndcapA_HV_COOLCont ATLAS_THREAD_SAFE
std::vector< const CondAttrListCollection * > m_EndcapC_HV_COOLCont ATLAS_THREAD_SAFE
std::mutex m_cacheMutex
std::vector< EventContext::ContextEvt_t > m_evtBA ATLAS_THREAD_SAFE
std::vector< EventContext::ContextEvt_t > m_evtEA ATLAS_THREAD_SAFE
std::vector< EventContext::ContextEvt_t > m_evtEC ATLAS_THREAD_SAFE
int m_IOVmaxLength {}
bool m_doIOVchecking {}
bool m_FallBackOnCOOLChanNames {}
const TRT_IDm_TRT_ID_Helper
int m_numFlagRED
 Counters.
int m_numFlagNOINFO
int m_currentTimestamp
bool m_doMonitoring
TH1D * m_h_Barrel_nRED
TH1D * m_h_EndcapA_nRED
TH1D * m_h_EndcapC_nRED
TH1D * m_h_Barrel_nNOINFO
TH1D * m_h_EndcapA_nNOINFO
TH1D * m_h_EndcapC_nNOINFO
TH1D * m_h_Barrel_HVvalAvg
TH1D * m_h_EndcapA_HVvalAvg
TH1D * m_h_EndcapC_HVvalAvg
int m_nBAEvts
int m_nEAEvts
int m_nECEvts
InDet::TRT_CondFlag condSummaryStatus (const Identifier &)
 Evaluation for TRT_ConditionsSummarySvc.

Detailed Description

Service for accessing DCS conditions information.

Definition at line 33 of file TRT_DCS_ConditionsSvc.h.

Constructor & Destructor Documentation

◆ TRT_DCS_ConditionsSvc()

TRT_DCS_ConditionsSvc::TRT_DCS_ConditionsSvc ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor //.

Definition at line 26 of file TRT_DCS_ConditionsSvc.cxx.

27 :
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}
#define ATH_MSG_WARNING(x)
ServiceHandle< ICondSvc > m_condSvc
SG::ReadCondHandleKey< CondAttrListCollection > m_barrelReadKey
ServiceHandle< ITRT_HWMappingSvc > m_mapSvc
ServiceHandle< StoreGateSvc > m_evtStore
SG::ReadCondHandleKey< CondAttrListCollection > m_ECReadKey
ServiceHandle< StoreGateSvc > m_detStore
SG::ReadCondHandleKey< CondAttrListCollection > m_EAReadKey

◆ ~TRT_DCS_ConditionsSvc()

TRT_DCS_ConditionsSvc::~TRT_DCS_ConditionsSvc ( )
virtualdefault

Destructor //.

Member Function Documentation

◆ condSummaryStatus()

InDet::TRT_CondFlag TRT_DCS_ConditionsSvc::condSummaryStatus ( const Identifier & ident)

Evaluation for TRT_ConditionsSummarySvc.

StatusFlag for TRT_ConditionsSummarySvc (by Identifier) //.

Function inherited from ITRT_ConditionsSvc. Returns a InDet::TRT_CondFlag for the Identifier, as determined by the TRT_DCS_ConditionsSvc.

Definition at line 319 of file TRT_DCS_ConditionsSvc.cxx.

319 {
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}
Scalar phi() const
phi method
#define ATH_MSG_VERBOSE(x)
TRT_DCS_StatusFlag
status flags derived from DCS conditions data
TRT_CondFlag
status flag to be derived from the inheriting tool's conditions info
InDet::TRT_DCS_StatusFlag getFlag(const Identifier)
Returns the DCS conditions StatusFlag for a given identifier.
@ straw
Definition HitInfo.h:82

◆ finalize()

StatusCode TRT_DCS_ConditionsSvc::finalize ( )
virtual

Finalize //.

Definition at line 344 of file TRT_DCS_ConditionsSvc.cxx.

344 {
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}
#define ATH_MSG_INFO(x)
outFile
Comment Out Those You do not wish to run.
TFile * file

◆ getCollection()

const CondAttrListCollection * TRT_DCS_ConditionsSvc::getCollection ( const std::string & collName)

get pointer

Definition at line 373 of file TRT_DCS_ConditionsSvc.cxx.

373 {
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) {
384 SG::ReadCondHandle<CondAttrListCollection> rst(m_barrelReadKey,event_context);
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) {
397 SG::ReadCondHandle<CondAttrListCollection> rst(m_EAReadKey,event_context);
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) {
410 SG::ReadCondHandle<CondAttrListCollection> rst(m_ECReadKey,event_context);
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}
void monitorBarrel()
Monitor barrel HV //.
void monitorEndcapA()
Monitor EndcapA HV //.
void monitorEndcapC()
Monitor EndcapC HV //.

◆ getFlag()

InDet::TRT_DCS_StatusFlag TRT_DCS_ConditionsSvc::getFlag ( const Identifier ident)

Returns the DCS conditions StatusFlag for a given identifier.

getFlag //

Definition at line 129 of file TRT_DCS_ConditionsSvc.cxx.

129 {
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" );
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" );
148}
static Double_t sc
float TRT_DCS_ValueType
data type stored in COOL DCS tables (usually float)
StatusCode getValue(const Identifier, const InDet::TRT_DCS_DataType, InDet::TRT_DCS_ValueType &)
Returns the value for a given identifier and data type.
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ getValue() [1/3]

StatusCode TRT_DCS_ConditionsSvc::getValue ( const Identifier ident,
const InDet::TRT_DCS_DataType dataType,
InDet::TRT_DCS_ValueType & theValue )

Returns the value for a given identifier and data type.

getValue //

Get the value for a given identifier and DCS conditions data type.

Definition at line 153 of file TRT_DCS_ConditionsSvc.cxx.

155 {
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}
#define ATH_MSG_ERROR(x)

◆ getValue() [2/3]

StatusCode TRT_DCS_ConditionsSvc::getValue ( const std::string & fname,
const int chanNum,
InDet::TRT_DCS_ValueType & value )

Returns the value for a given folder and COOL channel number.

getValue by folder name and COOL channel number //

Get the value for a given folder and COOL channel number.

Definition at line 278 of file TRT_DCS_ConditionsSvc.cxx.

280 {
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}
const_iterator end() const
ChanAttrListMap::const_iterator const_iterator
const_iterator chanAttrListPair(ChanNum chanNum) const
Access to Chan/AttributeList pairs via channel number: returns map iterator.
coral::AttributeList AttributeList
const CondAttrListCollection * getCollection(const std::string &collName)
get pointer

◆ getValue() [3/3]

StatusCode TRT_DCS_ConditionsSvc::getValue ( const std::string & fname,
const std::string & chanName,
InDet::TRT_DCS_ValueType & value )

Returns the value for a given folder/channel name.

getValue by folder name and channel name //

Get the value for a given folder/channel name.

Definition at line 221 of file TRT_DCS_ConditionsSvc.cxx.

223 {
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}
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
ChanNameMap::const_iterator name_const_iterator

◆ initialize()

StatusCode TRT_DCS_ConditionsSvc::initialize ( )
virtual

Initialize //.

Definition at line 89 of file TRT_DCS_ConditionsSvc.cxx.

89 {
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}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
MsgStream & msg
Definition testRead.cxx:32

◆ monitorBarrel()

void TRT_DCS_ConditionsSvc::monitorBarrel ( )

Monitor barrel HV //.

Definition at line 426 of file TRT_DCS_ConditionsSvc.cxx.

426 {
427
428 StatusCode sc(StatusCode::SUCCESS);
429
430 // Get the current event timestamp
432 SG::ReadHandle<xAOD::EventInfo> evtInfo(m_EventInfoKey);
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
448 const CondAttrListCollection* clc = getCollection(m_Barrel_HV_COOLFolderName);
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 }

◆ monitorEndcapA()

void TRT_DCS_ConditionsSvc::monitorEndcapA ( )

Monitor EndcapA HV //.

Definition at line 486 of file TRT_DCS_ConditionsSvc.cxx.

486 {
487
488 StatusCode sc(StatusCode::SUCCESS);
489
490 // Get the current event timestamp
492 SG::ReadHandle<xAOD::EventInfo> evtInfo(m_EventInfoKey);
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
508 const CondAttrListCollection* clc = getCollection(m_EndcapA_HV_COOLFolderName);
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 );
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 }

◆ monitorEndcapC()

void TRT_DCS_ConditionsSvc::monitorEndcapC ( )

Monitor EndcapC HV //.

Definition at line 542 of file TRT_DCS_ConditionsSvc.cxx.

542 {
543
544 StatusCode sc(StatusCode::SUCCESS);
545
546 // Get the current event timestamp
548 SG::ReadHandle<xAOD::EventInfo> evtInfo(m_EventInfoKey);
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
564 const CondAttrListCollection* clc = getCollection(m_EndcapC_HV_COOLFolderName);
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 );
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 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/6]

std::vector<const CondAttrListCollection*> m_Barrel_HV_COOLCont TRT_DCS_ConditionsSvc::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 102 of file TRT_DCS_ConditionsSvc.h.

◆ ATLAS_THREAD_SAFE [2/6]

std::vector<const CondAttrListCollection*> m_EndcapA_HV_COOLCont TRT_DCS_ConditionsSvc::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 103 of file TRT_DCS_ConditionsSvc.h.

◆ ATLAS_THREAD_SAFE [3/6]

std::vector<const CondAttrListCollection*> m_EndcapC_HV_COOLCont TRT_DCS_ConditionsSvc::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 104 of file TRT_DCS_ConditionsSvc.h.

◆ ATLAS_THREAD_SAFE [4/6]

std::vector<EventContext::ContextEvt_t> m_evtBA TRT_DCS_ConditionsSvc::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 106 of file TRT_DCS_ConditionsSvc.h.

◆ ATLAS_THREAD_SAFE [5/6]

std::vector<EventContext::ContextEvt_t> m_evtEA TRT_DCS_ConditionsSvc::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 107 of file TRT_DCS_ConditionsSvc.h.

◆ ATLAS_THREAD_SAFE [6/6]

std::vector<EventContext::ContextEvt_t> m_evtEC TRT_DCS_ConditionsSvc::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 108 of file TRT_DCS_ConditionsSvc.h.

◆ m_Barrel_HV_COOLFolderName

std::string TRT_DCS_ConditionsSvc::m_Barrel_HV_COOLFolderName
private

Definition at line 88 of file TRT_DCS_ConditionsSvc.h.

◆ m_barrelReadKey

SG::ReadCondHandleKey<CondAttrListCollection> TRT_DCS_ConditionsSvc::m_barrelReadKey {this,"BarrelKeyName","in","HV Barrel in-key"}
private

Definition at line 99 of file TRT_DCS_ConditionsSvc.h.

99{this,"BarrelKeyName","in","HV Barrel in-key"};

◆ m_cacheMutex

std::mutex TRT_DCS_ConditionsSvc::m_cacheMutex
mutableprivate

Definition at line 105 of file TRT_DCS_ConditionsSvc.h.

◆ m_condSvc

ServiceHandle<ICondSvc> TRT_DCS_ConditionsSvc::m_condSvc
private

Definition at line 98 of file TRT_DCS_ConditionsSvc.h.

◆ m_currentTimestamp

int TRT_DCS_ConditionsSvc::m_currentTimestamp
private

Definition at line 126 of file TRT_DCS_ConditionsSvc.h.

◆ m_detStore

ServiceHandle<StoreGateSvc> TRT_DCS_ConditionsSvc::m_detStore
private

Definition at line 94 of file TRT_DCS_ConditionsSvc.h.

◆ m_doIOVchecking

bool TRT_DCS_ConditionsSvc::m_doIOVchecking {}
private

Definition at line 111 of file TRT_DCS_ConditionsSvc.h.

111{};

◆ m_doMonitoring

bool TRT_DCS_ConditionsSvc::m_doMonitoring
private

Definition at line 129 of file TRT_DCS_ConditionsSvc.h.

◆ m_EAReadKey

SG::ReadCondHandleKey<CondAttrListCollection> TRT_DCS_ConditionsSvc::m_EAReadKey {this,"EAKeyName","in","HV EA in-key"}
private

Definition at line 100 of file TRT_DCS_ConditionsSvc.h.

100{this,"EAKeyName","in","HV EA in-key"};

◆ m_ECReadKey

SG::ReadCondHandleKey<CondAttrListCollection> TRT_DCS_ConditionsSvc::m_ECReadKey {this,"ECKeyName","in","HV EC in-key"}
private

Definition at line 101 of file TRT_DCS_ConditionsSvc.h.

101{this,"ECKeyName","in","HV EC in-key"};

◆ m_EndcapA_HV_COOLFolderName

std::string TRT_DCS_ConditionsSvc::m_EndcapA_HV_COOLFolderName
private

Definition at line 89 of file TRT_DCS_ConditionsSvc.h.

◆ m_EndcapC_HV_COOLFolderName

std::string TRT_DCS_ConditionsSvc::m_EndcapC_HV_COOLFolderName
private

Definition at line 90 of file TRT_DCS_ConditionsSvc.h.

◆ m_EventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> TRT_DCS_ConditionsSvc::m_EventInfoKey {this,"EventInfoKey","EventInfo","RHK for EventInfo"}
private

Definition at line 96 of file TRT_DCS_ConditionsSvc.h.

96{this,"EventInfoKey","EventInfo","RHK for EventInfo"};

◆ m_evtStore

ServiceHandle<StoreGateSvc> TRT_DCS_ConditionsSvc::m_evtStore
private

Definition at line 93 of file TRT_DCS_ConditionsSvc.h.

◆ m_FallBackOnCOOLChanNames

bool TRT_DCS_ConditionsSvc::m_FallBackOnCOOLChanNames {}
private

Definition at line 112 of file TRT_DCS_ConditionsSvc.h.

112{};

◆ m_h_Barrel_HVvalAvg

TH1D* TRT_DCS_ConditionsSvc::m_h_Barrel_HVvalAvg
private

Definition at line 136 of file TRT_DCS_ConditionsSvc.h.

◆ m_h_Barrel_nNOINFO

TH1D* TRT_DCS_ConditionsSvc::m_h_Barrel_nNOINFO
private

Definition at line 133 of file TRT_DCS_ConditionsSvc.h.

◆ m_h_Barrel_nRED

TH1D* TRT_DCS_ConditionsSvc::m_h_Barrel_nRED
private

Definition at line 130 of file TRT_DCS_ConditionsSvc.h.

◆ m_h_EndcapA_HVvalAvg

TH1D* TRT_DCS_ConditionsSvc::m_h_EndcapA_HVvalAvg
private

Definition at line 137 of file TRT_DCS_ConditionsSvc.h.

◆ m_h_EndcapA_nNOINFO

TH1D* TRT_DCS_ConditionsSvc::m_h_EndcapA_nNOINFO
private

Definition at line 134 of file TRT_DCS_ConditionsSvc.h.

◆ m_h_EndcapA_nRED

TH1D* TRT_DCS_ConditionsSvc::m_h_EndcapA_nRED
private

Definition at line 131 of file TRT_DCS_ConditionsSvc.h.

◆ m_h_EndcapC_HVvalAvg

TH1D* TRT_DCS_ConditionsSvc::m_h_EndcapC_HVvalAvg
private

Definition at line 138 of file TRT_DCS_ConditionsSvc.h.

◆ m_h_EndcapC_nNOINFO

TH1D* TRT_DCS_ConditionsSvc::m_h_EndcapC_nNOINFO
private

Definition at line 135 of file TRT_DCS_ConditionsSvc.h.

◆ m_h_EndcapC_nRED

TH1D* TRT_DCS_ConditionsSvc::m_h_EndcapC_nRED
private

Definition at line 132 of file TRT_DCS_ConditionsSvc.h.

◆ m_HVWarnValHi

float TRT_DCS_ConditionsSvc::m_HVWarnValHi {}
private

Definition at line 92 of file TRT_DCS_ConditionsSvc.h.

92{};

◆ m_HVWarnValLo

float TRT_DCS_ConditionsSvc::m_HVWarnValLo {}
private

Definition at line 91 of file TRT_DCS_ConditionsSvc.h.

91{};

◆ m_IOVmaxLength

int TRT_DCS_ConditionsSvc::m_IOVmaxLength {}
private

Definition at line 110 of file TRT_DCS_ConditionsSvc.h.

110{};

◆ m_mapSvc

ServiceHandle<ITRT_HWMappingSvc> TRT_DCS_ConditionsSvc::m_mapSvc
private

Definition at line 95 of file TRT_DCS_ConditionsSvc.h.

◆ m_nBAEvts

int TRT_DCS_ConditionsSvc::m_nBAEvts
private

Definition at line 139 of file TRT_DCS_ConditionsSvc.h.

◆ m_nEAEvts

int TRT_DCS_ConditionsSvc::m_nEAEvts
private

Definition at line 140 of file TRT_DCS_ConditionsSvc.h.

◆ m_nECEvts

int TRT_DCS_ConditionsSvc::m_nECEvts
private

Definition at line 141 of file TRT_DCS_ConditionsSvc.h.

◆ m_numFlagNOINFO

int TRT_DCS_ConditionsSvc::m_numFlagNOINFO
private

Definition at line 121 of file TRT_DCS_ConditionsSvc.h.

◆ m_numFlagRED

int TRT_DCS_ConditionsSvc::m_numFlagRED
private

Counters.

Counts the number of times getFlag returns each flag

Definition at line 120 of file TRT_DCS_ConditionsSvc.h.

◆ m_TRT_ID_Helper

const TRT_ID* TRT_DCS_ConditionsSvc::m_TRT_ID_Helper
private

Definition at line 116 of file TRT_DCS_ConditionsSvc.h.

◆ m_VeryVerbose

bool TRT_DCS_ConditionsSvc::m_VeryVerbose {}
private

Definition at line 87 of file TRT_DCS_ConditionsSvc.h.

87{};

The documentation for this class was generated from the following files: