ATLAS Offline Software
Classes | Functions
PerfMon Namespace Reference

Classes

class  LinFitSglPass
 

Functions

StatusCode makeAuditor (const std::string &audName, IAuditorSvc *audSvc, MsgStream &msg)
 simple function to factorize boring things such as asking the AuditorSvc if an auditor is there (and scheduled) and make sure to create it if it is not yet alived. More...
 

Function Documentation

◆ makeAuditor()

StatusCode PerfMon::makeAuditor ( const std::string &  audName,
IAuditorSvc *  audSvc,
MsgStream &  msg 
)

simple function to factorize boring things such as asking the AuditorSvc if an auditor is there (and scheduled) and make sure to create it if it is not yet alived.

Definition at line 32 of file PerfMonUtils.cxx.

34 {
35  if ( 0 == audSvc ) {
36  msg << MSG::ERROR << "Null pointer to IAuditorSvc !!" << endmsg;
37  return StatusCode::FAILURE;
38  }
39 
40  if ( 0 != audSvc->getAuditor( audName ) ) {
41  msg << MSG::VERBOSE << "AuditorSvc already knows about ["
42  << audName << "]... good."
43  << endmsg;
44  return StatusCode::SUCCESS;
45  }
46 
47  const std::string propName = "Auditors";
48  SmartIF<IProperty> audSvcProp(audSvc);
49  if ( 0 == audSvcProp ) {
50  msg << MSG::ERROR
51  << "Could not dyn-cast IAuditorSvc to an IProperty !!" << endmsg;
52  return StatusCode::FAILURE;
53  }
54 
55  StringArrayProperty audNames;
56  audNames.assign( audSvcProp->getProperty(propName) );
57  std::vector<std::string> updatedNames( audNames.value() );
58  updatedNames.push_back( audName );
59  audNames.set( updatedNames );
60  audNames.setName( propName );
61  if ( !audSvcProp->setProperty( audNames ).isSuccess() ) {
62  msg << MSG::ERROR
63  << "Could not add [" << audName << "] to the list of auditors of"
64  << " [AuditorSvc] !!"
65  << endmsg
66  << audSvcProp->getProperty(propName)
67  << endmsg;
68  return StatusCode::FAILURE;
69  }
70 
71  // make sure the auditor has been created...
72  IAuditor* aud = audSvc->getAuditor( audName );
73  if ( 0 == aud ) {
74  msg << MSG::ERROR
75  << "Failed to make AuditorSvc instantiating ["
76  << audName << "] !!"
77  << endmsg;
78  return StatusCode::FAILURE;
79  }
80  // aud->release();
81 
82  return StatusCode::SUCCESS;
83 }
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
L1CaloPhase1Monitoring.propName
propName
Definition: L1CaloPhase1Monitoring.py:451
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7