CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQM/CSCMonitorModule/src/CSCDQM_EventProcessor.cc

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  EventProcessor.cc
00005  *
00006  *    Description:  EventProcessor Object General methods
00007  *
00008  *        Version:  1.0
00009  *        Created:  10/03/2008 10:47:11 AM
00010  *       Revision:  none
00011  *       Compiler:  gcc
00012  *
00013  *         Author:  Valdas Rapsevicius (VR), Valdas.Rapsevicius@cern.ch
00014  *        Company:  CERN, CH
00015  *
00016  * =====================================================================================
00017  */
00018 
00019 #include "DQM/CSCMonitorModule/interface/CSCDQM_EventProcessor.h"
00020 
00021 namespace cscdqm {
00022 
00023 
00028   EventProcessor::EventProcessor(Configuration* const p_config) {
00029 
00030     config = p_config;
00031     // fFirstEvent = true;
00032     fCloseL1As = true;
00033 
00034   }
00035 
00039   void EventProcessor::init() {
00040 
00041   }
00042 
00049   const bool EventProcessor::getEMUHisto(const HistoId& histo, MonitorObject*& me) {
00050     if (config->fnGetCacheEMUHisto(histo, me)) return (me != NULL);
00051     EMUHistoDef histoD(histo);
00052     if (config->fnGetHisto(histoD, me)) return (me != NULL);
00053     return false;
00054   }
00055 
00063   const bool EventProcessor::getDDUHisto(const HistoId& histo, const HwId& dduID, MonitorObject*& me) {
00064     if (config->fnGetCacheDDUHisto(histo, dduID, me)) return (me != NULL);
00065     DDUHistoDef histoD(histo, dduID);
00066     if (config->fnGetHisto(histoD, me)) return (me != NULL);
00067     return false;
00068   }
00069 
00078   const bool EventProcessor::getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, MonitorObject*& me) {
00079     if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, 0, me)) return (me != NULL);
00080     CSCHistoDef histoD(histo, crateID, dmbSlot);
00081     if (config->fnGetHisto(histoD, me)) return (me != NULL);
00082     return false;
00083   }
00084 
00095   const bool EventProcessor::getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, const HwId& adId, MonitorObject*& me) {
00096     if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, adId, me)) return (me != NULL);
00097     CSCHistoDef histoD(histo, crateID, dmbSlot, adId);
00098     if (config->fnGetHisto(histoD, me)) return (me != NULL);
00099     return false;
00100   }
00101 
00108   const bool EventProcessor::getParHisto(const HistoId& histo, MonitorObject*& me) {
00109     if (config->fnGetCacheParHisto(histo, me)) return (me != NULL);
00110     ParHistoDef histoD(histo);
00111     if (config->fnGetHisto(histoD, me)) return (me != NULL);
00112     return false;
00113   }
00114 
00123   const bool EventProcessor::getCSCFromMap(const unsigned int& crateId, const unsigned int& dmbId, unsigned int& cscType, unsigned int& cscPosition) const {
00124     bool result = false;
00125 
00126     CSCDetId cid;
00127     if (config->fnGetCSCDetId(crateId, dmbId, cid)) {
00128       cscPosition  = cid.chamber();
00129       int iring    = cid.ring();
00130       int istation = cid.station();
00131       int iendcap  = cid.endcap();
00132       std::string tlabel = cscdqm::Utility::getCSCTypeLabel(iendcap, istation, iring);
00133       cscType = cscdqm::Utility::getCSCTypeBin(tlabel);
00134       result = true;
00135     }
00136     
00137     /*
00138     if (!result) {
00139       LOG_ERROR << "Event #" << config->getNEvents() << ": Invalid CSC=" << CSCHistoDef::getPath(crateId, dmbId);
00140     }
00141     */
00142 
00143     return result;
00144 
00145   }
00146 
00153   unsigned int EventProcessor::maskHWElements(std::vector<std::string>& tokens) {
00154     unsigned int masked = summary.setMaskedHWElements(tokens);
00155     LOG_INFO << masked << " HW Elements masked";
00156     return masked;
00157   }
00158 
00159 }