Commit bcad6c9d authored by Marcin Jerzy Nowak's avatar Marcin Jerzy Nowak Committed by Graeme Stewart
Browse files

histogram rebinning flag setting ported to ROOT6.4 (TrigDataAccessMonitoring-00-02-03)

	* src\MonROBDataProviderSvc.cxx:  histogram rebinning flag
	setting ported to ROOT6.4
	* TrigDataAccessMonitoring-00-02-03

2015-07-08 Stewart Martin-Haugh <smh@cern.ch>
	* Fix clang warning
	* TrigDataAccessMonitoring-00-02-02

2015-06-03 Francesca Pastore

	* Added SCHEDULED enum in ROBDataMonitor.h
	* TrigDataAccessMonitoring-00-02-01
parent 072ed812
......@@ -24,11 +24,12 @@ namespace robmonitor {
*/
enum ROBHistory {
UNCLASSIFIED = 0, // ROB was requested but never arrived at processor. History unknown.
RETRIEVED = 1, // ROB was retrieved from ROS by DataCollector
CACHED = 2, // ROB was found already in the internal cache of the ROBDataProviderSvc
IGNORED = 4, // ROB was on the "ignore" list and therefore not retrieved
DISABLED = 8, // ROB was disabled in OKS and therefore not retrieved
NUM_ROBHIST_CODES = 5 // number of different history codes
SCHEDULED = 1, // ROB was scheduled before retrieveing
RETRIEVED = 2, // ROB was retrieved from ROS by DataCollector
CACHED = 4, // ROB was found already in the internal cache of the ROBDataProviderSvc
IGNORED = 8, // ROB was on the "ignore" list and therefore not retrieved
DISABLED = 16, // ROB was disabled in OKS and therefore not retrieved
NUM_ROBHIST_CODES = 6 // number of different history codes
};
/**
......@@ -51,6 +52,7 @@ namespace robmonitor {
robmonitor::ROBHistory rob_history; // History of ROB retrieval
std::vector<uint32_t> rob_status_words; // all status words in the ROB header
// Accessor functions
/** @brief ROB is unclassified */
bool isUnclassified();
......@@ -62,6 +64,8 @@ namespace robmonitor {
bool isIgnored();
/** @brief ROB was disabled in OKS */
bool isDisabled();
/** @brief ROB was scheduled over network */
bool isScheduled();
/** @brief ROB has no status words set */
bool isStatusOk();
......@@ -112,6 +116,8 @@ namespace robmonitor {
unsigned ignoredROBs();
/** @brief number of disabled ROBs in structure */
unsigned disabledROBs();
/** @brief number of scheduled ROBs in structure */
unsigned scheduledROBs();
/** @brief number of ROBs with no status words set in structure */
unsigned statusOkROBs();
......@@ -139,6 +145,9 @@ namespace robmonitor {
os << "IGNORED";
} else if (rhs.rob_history == robmonitor::DISABLED) {
os << "DISABLED";
} else if (rhs.rob_history == robmonitor::SCHEDULED) {
os << "SCHEDULED";
} else {
os << "invalid code";
}
......@@ -176,6 +185,7 @@ namespace robmonitor {
os << "\n" << prefix << prefix2 << "Retrieved " << rhs.retrievedROBs() ;
os << "\n" << prefix << prefix2 << "Ignored " << rhs.ignoredROBs() ;
os << "\n" << prefix << prefix2 << "Disabled " << rhs.disabledROBs() ;
os << "\n" << prefix << prefix2 << "Scheduled " << rhs.scheduledROBs() ;
os << "\n" << prefix << prefix2 << "Status OK " << rhs.statusOkROBs() ;
for (std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it=rhs.requested_ROBs.begin();
it != rhs.requested_ROBs.end(); ++it) {
......
......@@ -126,7 +126,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 << endreq;
m_storeGateSvc.release().ignore();
return StatusCode::FAILURE;
}
......@@ -401,7 +401,11 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
m_histProp_requestedROBsPerCall.value().lowEdge(),
m_histProp_requestedROBsPerCall.value().highEdge());
if (m_hist_requestedROBsPerCall) {
m_hist_requestedROBsPerCall->SetBit(TH1::kCanRebin);
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
m_hist_requestedROBsPerCall->SetCanExtend(TH1::kAllAxes);
#else
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;
}
......@@ -414,7 +418,11 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
m_histProp_receivedROBsPerCall.value().lowEdge(),
m_histProp_receivedROBsPerCall.value().highEdge());
if (m_hist_receivedROBsPerCall) {
m_hist_receivedROBsPerCall->SetBit(TH1::kCanRebin);
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
m_hist_receivedROBsPerCall->SetCanExtend(TH1::kAllAxes);
#else
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;
}
......@@ -427,7 +435,11 @@ void MonROBDataProviderSvc::handle(const Incident& incident) {
m_histProp_timeROBretrieval.value().lowEdge(),
m_histProp_timeROBretrieval.value().highEdge());
if (m_hist_timeROBretrieval) {
m_hist_timeROBretrieval->SetBit(TH1::kCanRebin);
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0)
m_hist_timeROBretrieval->SetCanExtend(TH1::kAllAxes);
#else
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;
}
......
......@@ -45,6 +45,11 @@ bool ROBDataStruct::isDisabled() {
return ((rob_history == robmonitor::DISABLED) ? true : false);
}
bool ROBDataStruct::isScheduled() {
return ((rob_history == robmonitor::SCHEDULED) ? true : false);
}
bool ROBDataStruct::isStatusOk() {
if (rob_status_words.size() == 0) return true;
if ((rob_status_words.size() > 0) && (rob_status_words[0] == 0)) return true;
......@@ -133,6 +138,15 @@ unsigned ROBDataMonitorStruct::disabledROBs() {
return ret;
}
unsigned ROBDataMonitorStruct::scheduledROBs() {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
it != requested_ROBs.end(); it++ ) {
if ((*it).second.isScheduled()) ++ret;
}
return ret;
}
unsigned ROBDataMonitorStruct::statusOkROBs() {
ptrdiff_t ret=0;
for ( std::map<const uint32_t,robmonitor::ROBDataStruct>::iterator it = requested_ROBs.begin();
......
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