MonitorObject cache - list objects and routines to manage cache. More...
#include <CSCDQM_Cache.h>
Public Member Functions | |
Cache () | |
const bool | get (const HistoDef &histo, MonitorObject *&mo) |
Get Monitoring Object on Histogram Definition. | |
const bool | getCSC (const HistoId &id, const HwId &crateId, const HwId &dmbId, const HwId &addId, MonitorObject *&mo) |
Get CSC MO on Histogram Id and CSC Crate and DMB Ids. | |
const bool | getDDU (const HistoId &id, const HwId &dduId, MonitorObject *&mo) |
Get DDU MO on Histogram Id and DDU Id. | |
const bool | getEMU (const HistoId &id, MonitorObject *&mo) |
Get EMU MO on Histogram Id. | |
const bool | getFED (const HistoId &id, const HwId &fedId, MonitorObject *&mo) |
Get FED MO on Histogram Id and FED Id. | |
const bool | getPar (const HistoId &id, MonitorObject *&mo) |
Get Parameter MO on Histogram Id. | |
const bool | isBookedCSC (const HwId &crateId, const HwId &dmbId) const |
Check if CSC was booked on given identifiers. | |
const bool | isBookedDDU (const HwId &dduId) const |
Check if DDU was booked on given identifier. | |
const bool | isBookedFED (const HwId &fedId) const |
Check if FED was booked on given identifier. | |
const bool | nextBookedCSC (unsigned int &n, unsigned int &crateId, unsigned int &dmbId) const |
Iterator to get booked CSC identifiers on enumerator. | |
const bool | nextBookedDDU (unsigned int &n, unsigned int &dduId) const |
Iterator to get booked DDU identifier on enumerator. | |
const bool | nextBookedFED (unsigned int &n, unsigned int &fedId) const |
Iterator to get booked FED identifier on enumerator. | |
void | put (const HistoDef &histo, MonitorObject *mo) |
Put Monitoring Object into cache. | |
~Cache () | |
Private Attributes | |
CSCMapType | cscData |
CSCMapType::const_iterator | cscPointer |
MonitorObject * | data [h::namesSize] |
DDUMapType | dduData |
DDUMapType::const_iterator | dduPointer |
HwId | dduPointerValue |
FEDMapType | fedData |
FEDMapType::const_iterator | fedPointer |
HwId | fedPointerValue |
LookupMapType | lookupData |
MonitorObject cache - list objects and routines to manage cache.
Definition at line 112 of file CSCDQM_Cache.h.
cscdqm::Cache::Cache | ( | ) | [inline] |
Cache Constructor
Initialize EMU and PAR static array with zero's
Initialize FED cached pointers
Initialize DDU and CSC cached pointers
Definition at line 145 of file CSCDQM_Cache.h.
References cscData, cscPointer, data, dduData, dduPointer, dduPointerValue, fedData, fedPointer, fedPointerValue, i, and cscdqm::h::namesSize.
{ for (unsigned int i = 0; i < h::namesSize; i++) data[i] = 0; fedPointer = fedData.end(); fedPointerValue = 0; dduPointer = dduData.end(); dduPointerValue = 0; cscPointer = cscData.end(); }
cscdqm::Cache::~Cache | ( | ) | [inline] |
Destructor
Clear FED MO static arrays
Clear DDU MO static arrays
Definition at line 161 of file CSCDQM_Cache.h.
data refman pasoursint CMSSW_6_1_1 src DQM CSCMonitorModule plugins CSCDQM_Cache cc const bool cscdqm::Cache::get | ( | const HistoDef & | histo, |
MonitorObject *& | mo | ||
) |
Get Monitoring Object on Histogram Definition.
Native Cache methods
histo | Histogram definition |
mo | Monitoring Object to return |
Definition at line 30 of file CSCDQM_Cache.cc.
References getEMU().
Referenced by cscdqm::Dispatcher::getHisto().
{ return getEMU(histo.getId(), mo); } else if (typeid(histo) == FEDHistoDefT) { return getFED(histo.getId(), histo.getFEDId(), mo); } else if (typeid(histo) == DDUHistoDefT) { return getDDU(histo.getId(), histo.getDDUId(), mo); } else if (typeid(histo) == CSCHistoDefT) { return getCSC(histo.getId(), histo.getCrateId(), histo.getDMBId(), histo.getAddId(), mo); } else if (typeid(histo) == ParHistoDefT) { return getPar(histo.getId(), mo); } return false; }
const bool cscdqm::Cache::getCSC | ( | const HistoId & | id, |
const HwId & | crateId, | ||
const HwId & | dmbId, | ||
const HwId & | addId, | ||
MonitorObject *& | mo | ||
) |
Get CSC MO on Histogram Id and CSC Crate and DMB Ids.
id | Histogram identifier |
crateId | CSC Crate identifier |
dmbId | CSC DMB identifier |
mo | Monitoring Object to return |
If not cached (last CSC) - find CSC
Get Monitor object from multi_index List
Definition at line 130 of file CSCDQM_Cache.cc.
References cscData, and cscPointer.
Referenced by cscdqm::Dispatcher::Dispatcher().
{ cscPointer = cscData.find(boost::make_tuple(crateId, dmbId)); } if (cscPointer != cscData.end()) { CSCHistoMapType::const_iterator hit = cscPointer->mos.find(boost::make_tuple(id, addId)); if (hit != cscPointer->mos.end()) { mo = const_cast<MonitorObject*>(hit->mo); return true; } } return false; }
const bool cscdqm::Cache::getDDU | ( | const HistoId & | id, |
const HwId & | dduId, | ||
MonitorObject *& | mo | ||
) |
Get DDU MO on Histogram Id and DDU Id.
id | Histogram identifier |
dduId | DDU identifier |
mo | Monitoring Object to return |
If not cached (last DDU) - find DDU
Get MO from static array
Definition at line 101 of file CSCDQM_Cache.cc.
References dduData, dduPointer, and dduPointerValue.
Referenced by cscdqm::Dispatcher::Dispatcher().
{ dduPointer = dduData.find(dduId); if (dduPointer == dduData.end()) { dduPointerValue = 0; return false; } dduPointerValue = dduId; } if (dduPointer->second[id]) { mo = dduPointer->second[id]; return true; } return false; }
const bool cscdqm::Cache::getEMU | ( | const HistoId & | id, |
MonitorObject *& | mo | ||
) |
Get EMU MO on Histogram Id.
id | Histogram identifier |
mo | Monitoring Object to return |
Definition at line 57 of file CSCDQM_Cache.cc.
References data.
Referenced by cscdqm::Dispatcher::Dispatcher(), and get().
{ mo = data[id]; return true; } return false; }
const bool cscdqm::Cache::getFED | ( | const HistoId & | id, |
const HwId & | fedId, | ||
MonitorObject *& | mo | ||
) |
Get FED MO on Histogram Id and FED Id.
id | Histogram identifier |
fedId | FED identifier |
mo | Monitoring Object to return |
If not cached (last FED) - find FED
Get MO from static array
Definition at line 72 of file CSCDQM_Cache.cc.
References fedData, fedPointer, and fedPointerValue.
Referenced by cscdqm::Dispatcher::Dispatcher().
{ fedPointer = fedData.find(fedId); if (fedPointer == fedData.end()) { fedPointerValue = 0; return false; } fedPointerValue = fedId; } if (fedPointer->second[id]) { mo = fedPointer->second[id]; return true; } return false; }
const bool cscdqm::Cache::getPar | ( | const HistoId & | id, |
MonitorObject *& | mo | ||
) |
Get Parameter MO on Histogram Id.
id | Histogram identifier |
mo | Monitoring Object to return |
Definition at line 154 of file CSCDQM_Cache.cc.
References data.
Referenced by cscdqm::Dispatcher::Dispatcher().
{ mo = data[id]; return true; } return false; }
Check if CSC was booked on given identifiers.
crateId | CSC Crate Id |
dmbId | CSC DMB Id |
Definition at line 312 of file CSCDQM_Cache.cc.
Referenced by cscdqm::Dispatcher::Dispatcher().
{ return true; } return false; }
const bool cscdqm::Cache::isBookedDDU | ( | const HwId & | dduId | ) | const |
Check if DDU was booked on given identifier.
dduId | DDU Id |
Definition at line 335 of file CSCDQM_Cache.cc.
Referenced by cscdqm::Dispatcher::Dispatcher().
const bool cscdqm::Cache::isBookedFED | ( | const HwId & | fedId | ) | const |
Check if FED was booked on given identifier.
fedId | FED Id |
Definition at line 325 of file CSCDQM_Cache.cc.
Referenced by cscdqm::Dispatcher::Dispatcher().
const bool cscdqm::Cache::nextBookedCSC | ( | unsigned int & | n, |
unsigned int & | crateId, | ||
unsigned int & | dmbId | ||
) | const |
Iterator to get booked CSC identifiers on enumerator.
n | iterator (0 and up) |
crateId | CSC Crate Id returned |
dmbId | CSC DMB Id returned |
Definition at line 259 of file CSCDQM_Cache.cc.
Referenced by cscdqm::Dispatcher::Dispatcher().
const bool cscdqm::Cache::nextBookedDDU | ( | unsigned int & | n, |
unsigned int & | dduId | ||
) | const |
Iterator to get booked DDU identifier on enumerator.
n | iterator (0 and up) |
dduId | DDU Id returned |
Definition at line 295 of file CSCDQM_Cache.cc.
const bool cscdqm::Cache::nextBookedFED | ( | unsigned int & | n, |
unsigned int & | fedId | ||
) | const |
Iterator to get booked FED identifier on enumerator.
Utility methods
n | iterator (0 and up) |
fedId | FED Id returned |
Definition at line 277 of file CSCDQM_Cache.cc.
void cscdqm::Cache::put | ( | const HistoDef & | histo, |
MonitorObject * | mo | ||
) |
Put Monitoring Object into cache.
histo | Histogram Definition |
mo | Monitoring Object to put |
EMU MO
FED MO
DDU MO
CSC MO
Parameter MO
Add histo (if mo is not null!) into lookup list
Definition at line 168 of file CSCDQM_Cache.cc.
References data.
Referenced by cscdqm::Dispatcher::Dispatcher().
{ data[id] = mo; } else if (typeid(histo) == FEDHistoDefT) { HwId fedId = histo.getFEDId(); if (fedPointerValue != fedId) { fedPointer = fedData.find(fedId); } if (fedPointer == fedData.end()) { MonitorObject** mos = new MonitorObject*[h::namesSize]; for (unsigned int i = 0; i < h::namesSize; i++) mos[i] = 0; fedPointer = fedData.insert(fedData.end(), std::make_pair(fedId, mos)); } fedPointer->second[id] = mo; fedPointerValue = fedId; } else if (typeid(histo) == DDUHistoDefT) { HwId dduId = histo.getDDUId(); if (dduPointerValue != dduId) { dduPointer = dduData.find(dduId); } if (dduPointer == dduData.end()) { MonitorObject** mos = new MonitorObject*[h::namesSize]; for (unsigned int i = 0; i < h::namesSize; i++) mos[i] = 0; dduPointer = dduData.insert(dduData.end(), std::make_pair(dduId, mos)); } dduPointer->second[id] = mo; dduPointerValue = dduId; } else if (typeid(histo) == CSCHistoDefT) { HwId crateId = histo.getCrateId(); HwId dmbId = histo.getDMBId(); HwId addId = histo.getAddId(); CSCHistoKeyType histoKey(id, addId, mo); if (cscPointer == cscData.end() || cscPointer->crateId != crateId || cscPointer->dmbId != dmbId) { cscPointer = cscData.find(boost::make_tuple(crateId, dmbId)); } if (cscPointer == cscData.end()) { CSCKeyType cscKey(crateId, dmbId); cscPointer = cscData.insert(cscData.end(), cscKey); } CSCHistoMapType* mos = const_cast<CSCHistoMapType*>(&cscPointer->mos); mos->insert(histoKey); } else if (typeid(histo) == ParHistoDefT) { data[id] = mo; } if (mo) { lookupData.insert(lookupData.end(), LookupKeyType(histo, mo)); } }
CSCMapType cscdqm::Cache::cscData [private] |
Chamber MO List
Definition at line 135 of file CSCDQM_Cache.h.
Referenced by Cache(), getCSC(), and nextBookedCSC().
CSCMapType::const_iterator cscdqm::Cache::cscPointer [private] |
Pointer to the Last Chamber object used (cached)
Definition at line 137 of file CSCDQM_Cache.h.
MonitorObject* cscdqm::Cache::data[h::namesSize] [private] |
DDUMapType cscdqm::Cache::dduData [private] |
DDU MO List
Definition at line 128 of file CSCDQM_Cache.h.
Referenced by Cache(), getDDU(), nextBookedDDU(), and ~Cache().
DDUMapType::const_iterator cscdqm::Cache::dduPointer [private] |
Pointer to the Last DDU object used (cached)
Definition at line 130 of file CSCDQM_Cache.h.
HwId cscdqm::Cache::dduPointerValue [private] |
Last DDU id used (cached)
Definition at line 132 of file CSCDQM_Cache.h.
FEDMapType cscdqm::Cache::fedData [private] |
FED MO List
Definition at line 120 of file CSCDQM_Cache.h.
Referenced by Cache(), getFED(), nextBookedFED(), and ~Cache().
FEDMapType::const_iterator cscdqm::Cache::fedPointer [private] |
Pointer to the Last FED object used (cached)
Definition at line 122 of file CSCDQM_Cache.h.
HwId cscdqm::Cache::fedPointerValue [private] |
Last FED id used (cached)
Definition at line 124 of file CSCDQM_Cache.h.
LookupMapType cscdqm::Cache::lookupData [private] |
MO Lookup List
Definition at line 140 of file CSCDQM_Cache.h.