Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef CSCDQM_EventProcessor_H
00021 #define CSCDQM_EventProcessor_H
00022
00023 #include <set>
00024 #include <string>
00025 #include <math.h>
00026
00027 #include <TString.h>
00028
00029 #ifdef DQMGLOBAL
00030
00031 #include "FWCore/Framework/interface/Event.h"
00032 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
00033 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
00034 #include "EventFilter/CSCRawToDigi/interface/CSCDCCEventData.h"
00035
00036 #endif
00037
00038 #include "DQM/CSCMonitorModule/interface/CSCDQM_Logger.h"
00039 #include "DQM/CSCMonitorModule/interface/CSCDQM_Summary.h"
00040 #include "DQM/CSCMonitorModule/interface/CSCDQM_StripClusterFinder.h"
00041 #include "DQM/CSCMonitorModule/interface/CSCDQM_Configuration.h"
00042 #include "DQM/CSCMonitorModule/interface/CSCDQM_Configuration.h"
00043
00044 #include "EventFilter/CSCRawToDigi/interface/CSCDCCExaminer.h"
00045 #include "EventFilter/CSCRawToDigi/interface/CSCDDUEventData.h"
00046 #include "EventFilter/CSCRawToDigi/interface/CSCCFEBTimeSlice.h"
00047 #include "EventFilter/CSCRawToDigi/interface/CSCCFEBData.h"
00048
00049 #include "DataFormats/CSCDigi/interface/CSCDCCFormatStatusDigi.h"
00050 #include "DataFormats/CSCDigi/interface/CSCDCCFormatStatusDigiCollection.h"
00051
00052 namespace cscdqm {
00053
00057 struct HWStandbyType {
00058
00059
00060
00061 bool process;
00062
00063
00064 bool MeP;
00065
00066
00067 bool MeM;
00068
00069 HWStandbyType() {
00070 process = MeP = MeM = false;
00071 }
00072
00073 void applyMeP(bool ready) {
00074 MeP = MeP || !ready;
00075 }
00076
00077 void applyMeM(bool ready) {
00078 MeM = MeM || !ready;
00079 }
00080
00081 bool fullStandby() const {
00082 return (MeM && MeP);
00083 }
00084
00085 bool operator==(const HWStandbyType& t) const {
00086 return (t.MeP == MeP && t.MeM == MeM && t.process == process);
00087 }
00088
00089 bool operator!=(const HWStandbyType& t) const {
00090 return !(*this == t);
00091 }
00092
00093 const HWStandbyType& operator= (const HWStandbyType& t) {
00094 MeP = t.MeP;
00095 MeM = t.MeM;
00096 process = t.process;
00097 return *this;
00098 }
00099
00100 };
00101
00102 typedef std::map<CSCIdType, ExaminerStatusType> CSCExaminerMapType;
00103 typedef std::vector<DDUIdType> DDUExaminerVectorType;
00104
00105
00106
00111 class EventProcessor {
00112
00113
00114
00115
00116
00117 public:
00118
00119 EventProcessor(Configuration* const p_config);
00120
00124 ~EventProcessor() { }
00125
00126 void init();
00127
00128 void updateFractionHistos();
00129 void updateEfficiencyHistos();
00130 void standbyEfficiencyHistos(HWStandbyType& standby);
00131 void writeShifterHistograms();
00132
00133 unsigned int maskHWElements(std::vector<std::string>& tokens);
00134
00135 private:
00136
00137 bool processExaminer(const CSCDCCExaminer& binChecker);
00138 bool processExaminer(const CSCDCCExaminer& binChecker, const CSCDCCFormatStatusDigi& digi);
00139 void processDDU(const CSCDDUEventData& data, const CSCDCCExaminer& binChecker);
00140 void processCSC(const CSCEventData& data, const int dduID, const CSCDCCExaminer& binChecker);
00141
00142 void calcEMUFractionHisto(const HistoId& result, const HistoId& set, const HistoId& subset);
00143
00144 const bool getEMUHisto(const HistoId& histo, MonitorObject*& me);
00145 const bool getFEDHisto(const HistoId& histo, const HwId& fedID, MonitorObject*& me);
00146 const bool getDDUHisto(const HistoId& histo, const HwId& dduID, MonitorObject*& me);
00147 const bool getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, MonitorObject*& me);
00148 const bool getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, const HwId& adId, MonitorObject*& me);
00149 const bool getParHisto(const HistoId& histo, MonitorObject*& me);
00150 void preProcessEvent();
00151
00152 const bool getCSCFromMap(const unsigned int& crateId, const unsigned int& dmbId, unsigned int& cscType, unsigned int& cscPosition) const;
00153 void setEmuEventDisplayBit(MonitorObject*& mo, const unsigned int x, const unsigned int y, const unsigned int bit);
00154 void resetEmuEventDisplays();
00155
00157 Configuration* config;
00158
00160 Summary summary;
00161
00162 std::map<uint32_t, uint32_t> L1ANumbers;
00163 std::map<uint32_t, bool> fNotFirstEvent;
00164 uint32_t L1ANumber;
00165 uint32_t BXN;
00166 uint32_t cntDMBs;
00167 uint32_t cntCFEBs;
00168 uint32_t cntALCTs;
00169 uint32_t cntTMBs;
00170
00171
00172
00173 bool fCloseL1As;
00174 bool EmuEventDisplayWasReset;
00175
00176
00177
00178
00179
00180 #ifdef DQMLOCAL
00181
00182 public:
00183
00184 void processEvent(const char* data, const int32_t dataSize, const uint32_t errorStat, const int32_t nodeNumber);
00185
00186 #endif
00187
00188
00189
00190
00191
00192 #ifdef DQMGLOBAL
00193
00194 private:
00195
00196 bool bCSCEventCounted;
00197
00198 public:
00199
00200 void processEvent(const edm::Event& e, const edm::InputTag& inputTag);
00201
00202 #endif
00203
00204 };
00205
00206 }
00207
00208 #endif