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 getDDUHisto(const HistoId& histo, const HwId& dduID, MonitorObject*& me);
00146 const bool getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, MonitorObject*& me);
00147 const bool getCSCHisto(const HistoId& histo, const HwId& crateID, const HwId& dmbSlot, const HwId& adId, MonitorObject*& me);
00148 const bool getParHisto(const HistoId& histo, MonitorObject*& me);
00149 void preProcessEvent();
00150
00151 const bool getCSCFromMap(const unsigned int& crateId, const unsigned int& dmbId, unsigned int& cscType, unsigned int& cscPosition) const;
00152 void setEmuEventDisplayBit(MonitorObject*& mo, const unsigned int x, const unsigned int y, const unsigned int bit);
00153 void resetEmuEventDisplays();
00154
00156 Configuration* config;
00157
00159 Summary summary;
00160
00161 std::map<uint32_t, uint32_t> L1ANumbers;
00162 std::map<uint32_t, bool> fNotFirstEvent;
00163 uint32_t L1ANumber;
00164 uint32_t BXN;
00165
00166 bool fCloseL1As;
00167 bool EmuEventDisplayWasReset;
00168
00169
00170
00171
00172
00173 #ifdef DQMLOCAL
00174
00175 public:
00176
00177 void processEvent(const char* data, const int32_t dataSize, const uint32_t errorStat, const int32_t nodeNumber);
00178
00179 #endif
00180
00181
00182
00183
00184
00185 #ifdef DQMGLOBAL
00186
00187 private:
00188
00189 bool bCSCEventCounted;
00190
00191 public:
00192
00193 void processEvent(const edm::Event& e, const edm::InputTag& inputTag);
00194
00195 #endif
00196
00197 };
00198
00199 }
00200
00201 #endif