Commit 3b0b67d5 authored by Scott Snyder's avatar Scott Snyder Committed by Graeme Stewart
Browse files

'Const fixes.' (TrigDataAccessMonitoring-00-02-06)

	* Tagging TrigDataAccessMonitoring-00-02-06.
	* Const fixes.
	* Tagging TrigDataAccessMonitoring-00-02-05.
	* endreq -> endmsg.
parent 6b03783d
......@@ -55,19 +55,19 @@ namespace robmonitor {
// Accessor functions
/** @brief ROB is unclassified */
bool isUnclassified();
bool isUnclassified() const;
/** @brief ROB was found in cache */
bool isCached();
bool isCached() const;
/** @brief ROB was retrieved over network */
bool isRetrieved();
bool isRetrieved() const;
/** @brief ROB was ignored */
bool isIgnored();
bool isIgnored() const;
/** @brief ROB was disabled in OKS */
bool isDisabled();
bool isDisabled() const;
/** @brief ROB was scheduled over network */
bool isScheduled();
bool isScheduled() const;
/** @brief ROB has no status words set */
bool isStatusOk();
bool isStatusOk() const;
// Extraction operators
friend std::ostream& operator<<(std::ostream& os, const robmonitor::ROBDataStruct& rhs);
......@@ -105,24 +105,24 @@ namespace robmonitor {
// Accessor functions to ROB history summaries
/** @brief number of ROBs in structure */
unsigned allROBs();
unsigned allROBs() const;
/** @brief number of unclassified ROBs in structure */
unsigned unclassifiedROBs();
unsigned unclassifiedROBs() const;
/** @brief number of cached ROBs in structure */
unsigned cachedROBs();
unsigned cachedROBs() const;
/** @brief number of retrieved ROBs in structure */
unsigned retrievedROBs();
unsigned retrievedROBs() const;
/** @brief number of ignored ROBs in structure */
unsigned ignoredROBs();
unsigned ignoredROBs() const;
/** @brief number of disabled ROBs in structure */
unsigned disabledROBs();
unsigned disabledROBs() const;
/** @brief number of scheduled ROBs in structure */
unsigned scheduledROBs();
unsigned scheduledROBs() const;
/** @brief number of ROBs with no status words set in structure */
unsigned statusOkROBs();
unsigned statusOkROBs() const;
/** @brief elapsed time for ROB request in [ms] */
float elapsedTime();
float elapsedTime() const;
// Extraction operators
friend std::ostream& operator<<(std::ostream& os, robmonitor::ROBDataMonitorStruct& rhs);
......
......@@ -92,25 +92,25 @@ StatusCode MonROBDataProviderSvc::initialize()
m_msg = new MsgStream( msgSvc(), name() );
logStream() << MSG::INFO << " ---> MonROBDataProviderSvc = " << name() << " initialize "
<< " - package version " << PACKAGE_VERSION << endreq ;
<< " - package version " << PACKAGE_VERSION << endmsg ;
if ( sc.isFailure() ) {
logStream() << MSG::ERROR << " ROBDataProviderSvc::initialize() failed." << endreq;
logStream() << MSG::ERROR << " ROBDataProviderSvc::initialize() failed." << endmsg;
return sc;
}
logStream() << MSG::INFO << " ---> MonROBDataProviderSvc = " << name() << " special properties <---" << endreq;
logStream() << MSG::INFO << " ---> Fill monitoring histograms = " << m_doMonitoring << endreq;
logStream() << MSG::INFO << " Hist:RequestedROBsPerCall = " << m_histProp_requestedROBsPerCall << endreq;
logStream() << MSG::INFO << " Hist:ReceivedROBsPerCall = " << m_histProp_receivedROBsPerCall << endreq;
logStream() << MSG::INFO << " Hist:TimeROBretrieval = " << m_histProp_timeROBretrieval << endreq;
logStream() << MSG::INFO << " ---> Do detailed ROB monitoring = " << m_doDetailedROBMonitoring << endreq;
logStream() << MSG::INFO << " ---> SG name for ROB monitoring collect. = " << m_ROBDataMonitorCollection_SG_Name << endreq;
logStream() << MSG::INFO << " ---> MonROBDataProviderSvc = " << name() << " special properties <---" << endmsg;
logStream() << MSG::INFO << " ---> Fill monitoring histograms = " << m_doMonitoring << endmsg;
logStream() << MSG::INFO << " Hist:RequestedROBsPerCall = " << m_histProp_requestedROBsPerCall << endmsg;
logStream() << MSG::INFO << " Hist:ReceivedROBsPerCall = " << m_histProp_receivedROBsPerCall << endmsg;
logStream() << MSG::INFO << " Hist:TimeROBretrieval = " << m_histProp_timeROBretrieval << endmsg;
logStream() << MSG::INFO << " ---> Do detailed ROB monitoring = " << m_doDetailedROBMonitoring << endmsg;
logStream() << MSG::INFO << " ---> SG name for ROB monitoring collect. = " << m_ROBDataMonitorCollection_SG_Name << endmsg;
// register incident handler for begin run
ServiceHandle<IIncidentSvc> incidentSvc("IncidentSvc", name());
if ((incidentSvc.retrieve()).isFailure()) {
logStream() << MSG::ERROR << "Unable to locate IncidentSvc" << endreq;
logStream() << MSG::ERROR << "Unable to locate IncidentSvc" << endmsg;
incidentSvc.release().ignore();
return StatusCode::FAILURE;
}
......@@ -120,7 +120,7 @@ StatusCode MonROBDataProviderSvc::initialize()
// Setup the StoreGateSvc
if( (m_storeGateSvc.retrieve()).isFailure() ) {
logStream() << MSG::ERROR << "Error retrieving StoreGateSvc " << m_storeGateSvc << endreq;
logStream() << MSG::ERROR << "Error retrieving StoreGateSvc " << m_storeGateSvc << endmsg;
m_storeGateSvc.release().ignore();
return StatusCode::FAILURE;
}
......@@ -132,9 +132,9 @@ StatusCode MonROBDataProviderSvc::initialize()
StatusCode MonROBDataProviderSvc::finalize()
{
StatusCode sc = ROBDataProviderSvc::finalize();
logStream() << MSG::DEBUG << "finalize()" << endreq;
logStream() << MSG::DEBUG << "finalize()" << endmsg;
if ( !sc.isSuccess() ) {
logStream() << MSG::ERROR << " ROBDataProviderSvc::finalize() failed." << endreq;
logStream() << MSG::ERROR << " ROBDataProviderSvc::finalize() failed." << endmsg;
}
// delete message stream
......@@ -177,14 +177,14 @@ void MonROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, cons
if ( p_robMonCollection ) {
p_robMonCollection->reserve( 10 ) ;
if ( (m_storeGateSvc->record(p_robMonCollection, m_ROBDataMonitorCollection_SG_Name.value(), true)).isFailure() ) {
logStream() << MSG::WARNING << " Registering ROB Monitoring collection in StoreGate failed." << endreq;
logStream() << MSG::WARNING << " Registering ROB Monitoring collection in StoreGate failed." << endmsg;
delete p_robMonCollection;
p_robMonCollection = 0;
}
}
} else {
if ( m_storeGateSvc->retrieve(p_robMonCollection).isFailure() ) {
logStream() << MSG::WARNING << " Retrieval of ROB Monitoring collection from StoreGate failed." << endreq;
logStream() << MSG::WARNING << " Retrieval of ROB Monitoring collection from StoreGate failed." << endmsg;
p_robMonCollection = 0;
}
}
......@@ -236,7 +236,7 @@ void MonROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, cons
if(logLevel() <= MSG::DEBUG)
logStream() << MSG::DEBUG << " ---> Found ROB Id : 0x" << MSG::hex << (*map_it).second->source_id() << MSG::dec
<<" in cache "<< endreq;
<<" in cache "<< endmsg;
//* detailed monitoring
if ( p_robMonStruct ) {
// check if ROB was already accessed before and set ROB history accordingly
......@@ -315,7 +315,7 @@ void MonROBDataProviderSvc::addROBData(const std::vector<uint32_t>& robIds, cons
<< ". Number of ROB Id s found/not found = " << number_ROB_found
<< "/" << number_ROB_not_found
<< " for Lvl1 id = "<< m_currentLvl1ID
<< endreq;
<< endmsg;
//* histograms for number of requested/received ROBs
if ( m_hist_requestedROBsPerCall ) m_hist_requestedROBsPerCall->Fill(robIds.size());
......@@ -359,14 +359,14 @@ const RawEvent* MonROBDataProviderSvc::getEvent(){
void MonROBDataProviderSvc::handle(const Incident& incident) {
if (incident.type()!="BeginRun") return;
if(logLevel() <= MSG::DEBUG)
logStream() <<MSG::DEBUG << "In BeginRun incident." << endreq;
logStream() <<MSG::DEBUG << "In BeginRun incident." << endmsg;
// if detailed ROB monitoring is requested, check if the AlgContextSvc is running,
// if yes use it to obtain the calling algorithm name
if ( m_doDetailedROBMonitoring.value() ) {
if ( service("AlgContextSvc", m_algContextSvc, /*createIf=*/ false).isFailure() ) {
logStream() << MSG::ERROR << "Error retrieving AlgContextSvc."
<< "Calling algorithm name not available in detailed ROB monitoring" << endreq;
<< "Calling algorithm name not available in detailed ROB monitoring" << endmsg;
m_algContextSvc=0;
}
}
......@@ -377,7 +377,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
// find histogramming service
ServiceHandle<ITHistSvc> rootHistSvc("THistSvc", name());
if ((rootHistSvc.retrieve()).isFailure()) {
logStream() << MSG::ERROR << "Unable to locate THistSvc" << endreq;
logStream() << MSG::ERROR << "Unable to locate THistSvc" << endmsg;
rootHistSvc.release().ignore();
return;
}
......@@ -401,7 +401,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
m_hist_requestedROBsPerCall->SetBit(TH1::kCanRebin);
#endif
if( rootHistSvc->regHist(path + m_hist_requestedROBsPerCall->GetName(), m_hist_requestedROBsPerCall).isFailure() ) {
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_requestedROBsPerCall->GetName() << endreq;
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_requestedROBsPerCall->GetName() << endmsg;
}
}
......@@ -418,7 +418,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
m_hist_receivedROBsPerCall->SetBit(TH1::kCanRebin);
#endif
if( rootHistSvc->regHist(path + m_hist_receivedROBsPerCall->GetName(), m_hist_receivedROBsPerCall).isFailure() ) {
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_receivedROBsPerCall->GetName() << endreq;
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_receivedROBsPerCall->GetName() << endmsg;
}
}
......@@ -435,7 +435,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
m_hist_timeROBretrieval->SetBit(TH1::kCanRebin);
#endif
if( rootHistSvc->regHist(path + m_hist_timeROBretrieval->GetName(), m_hist_timeROBretrieval).isFailure() ) {
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_timeROBretrieval->GetName() << endreq;
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_timeROBretrieval->GetName() << endmsg;
}
}
......@@ -460,7 +460,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
n_tmp_bin++;
}
if( rootHistSvc->regHist(path + m_hist_genericStatusForROB->GetName(), m_hist_genericStatusForROB).isFailure() ) {
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_genericStatusForROB->GetName() << endreq;
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_genericStatusForROB->GetName() << endmsg;
}
}
......@@ -485,7 +485,7 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
n_tmp_bin++;
}
if( rootHistSvc->regHist(path + m_hist_specificStatusForROB->GetName(), m_hist_specificStatusForROB).isFailure() ) {
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_specificStatusForROB->GetName() << endreq;
logStream() << MSG::WARNING << "Can not register monitoring histogram: " << m_hist_specificStatusForROB->GetName() << endmsg;
}
}
......
......@@ -25,32 +25,32 @@ ROBDataStruct::ROBDataStruct(const uint32_t srcId)
rob_status_words()
{}
bool ROBDataStruct::isUnclassified() {
bool ROBDataStruct::isUnclassified() const {
return ((rob_history == robmonitor::UNCLASSIFIED) ? true : false);
}
bool ROBDataStruct::isCached() {
bool ROBDataStruct::isCached() const {
return ((rob_history == robmonitor::CACHED) ? true : false);
}
bool ROBDataStruct::isRetrieved() {
bool ROBDataStruct::isRetrieved() const {
return ((rob_history == robmonitor::RETRIEVED) ? true : false);
}
bool ROBDataStruct::isIgnored() {
bool ROBDataStruct::isIgnored() const {
return ((rob_history == robmonitor::IGNORED) ? true : false);
}
bool ROBDataStruct::isDisabled() {
bool ROBDataStruct::isDisabled() const {
return ((rob_history == robmonitor::DISABLED) ? true : false);
}
bool ROBDataStruct::isScheduled() {
bool ROBDataStruct::isScheduled() const {
return ((rob_history == robmonitor::SCHEDULED) ? true : false);
}
bool ROBDataStruct::isStatusOk() {
bool ROBDataStruct::isStatusOk() const {
if (rob_status_words.size() == 0) return true;
if ((rob_status_words.size() > 0) && (rob_status_words[0] == 0)) return true;
return false;
......@@ -89,74 +89,74 @@ ROBDataMonitorStruct::ROBDataMonitorStruct(const uint32_t l1_id,
}
}
unsigned ROBDataMonitorStruct::allROBs() {
unsigned ROBDataMonitorStruct::allROBs() const {
return requested_ROBs.size();
}
unsigned ROBDataMonitorStruct::unclassifiedROBs() {
unsigned ROBDataMonitorStruct::unclassifiedROBs() const {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::const_iterator it = requested_ROBs.begin();
it != requested_ROBs.end(); it++ ) {
if ((*it).second.isUnclassified()) ++ret;
}
return ret;
}
unsigned ROBDataMonitorStruct::cachedROBs() {
unsigned ROBDataMonitorStruct::cachedROBs() const {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::const_iterator it = requested_ROBs.begin();
it != requested_ROBs.end(); it++ ) {
if ((*it).second.isCached()) ++ret;
}
return ret;
}
unsigned ROBDataMonitorStruct::retrievedROBs() {
unsigned ROBDataMonitorStruct::retrievedROBs() const {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::const_iterator it = requested_ROBs.begin();
it != requested_ROBs.end(); it++ ) {
if ((*it).second.isRetrieved()) ++ret;
}
return ret;
}
unsigned ROBDataMonitorStruct::ignoredROBs() {
unsigned ROBDataMonitorStruct::ignoredROBs() const {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::const_iterator it = requested_ROBs.begin();
it != requested_ROBs.end(); it++ ) {
if ((*it).second.isIgnored()) ++ret;
}
return ret;
}
unsigned ROBDataMonitorStruct::disabledROBs() {
unsigned ROBDataMonitorStruct::disabledROBs() const {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::const_iterator it = requested_ROBs.begin();
it != requested_ROBs.end(); it++ ) {
if ((*it).second.isDisabled()) ++ret;
}
return ret;
}
unsigned ROBDataMonitorStruct::scheduledROBs() {
unsigned ROBDataMonitorStruct::scheduledROBs() const {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::const_iterator it = requested_ROBs.begin();
it != requested_ROBs.end(); it++ ) {
if ((*it).second.isScheduled()) ++ret;
}
return ret;
}
unsigned ROBDataMonitorStruct::statusOkROBs() {
unsigned ROBDataMonitorStruct::statusOkROBs() const {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::const_iterator it = requested_ROBs.begin();
it != requested_ROBs.end(); it++ ) {
if ((*it).second.isStatusOk()) ++ret;
}
return ret;
}
float ROBDataMonitorStruct::elapsedTime() {
float ROBDataMonitorStruct::elapsedTime() const {
int secs = 0 ;
if (end_time_of_ROB_request.tv_sec >= start_time_of_ROB_request.tv_sec)
secs = end_time_of_ROB_request.tv_sec - start_time_of_ROB_request.tv_sec;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment