00001 #ifndef DQM_HCALMONITORTASKS_HCALDEADCELLMONITOR_H
00002 #define DQM_HCALMONITORTASKS_HCALDEADCELLMONITOR_H
00003
00004 #include "DQM/HcalMonitorTasks/interface/HcalBaseDQMonitor.h"
00005 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00006 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00007 #include "CalibCalorimetry/HcalAlgos/interface/HcalLogicalMapGenerator.h"
00008 #include "CondFormats/HcalObjects/interface/HcalLogicalMap.h"
00009 #include "DataFormats/Scalers/interface/DcsStatus.h"
00010 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerEvmReadoutRecord.h"
00011
00012
00013
00014 #include "CondFormats/HcalObjects/interface/HcalChannelStatus.h"
00015 #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h"
00016 #include "CondFormats/HcalObjects/interface/HcalCondObjectContainer.h"
00017 #include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h"
00018
00019 #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h"
00020 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
00021
00022 #include <cmath>
00023 #include <iostream>
00024 #include <fstream>
00025
00033 class HcalDeadCellMonitor: public HcalBaseDQMonitor {
00034
00035 public:
00036 HcalDeadCellMonitor(const edm::ParameterSet& ps);
00037
00038 ~HcalDeadCellMonitor();
00039
00040 void setup();
00041 void beginRun(const edm::Run& run, const edm::EventSetup& c);
00042 void analyze(edm::Event const&e, edm::EventSetup const&s);
00043 void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00044 const edm::EventSetup& c);
00045 void endRun(const edm::Run& run, const edm::EventSetup& c);
00046 void endJob();
00047 void cleanup();
00048 void reset();
00049
00050 void processEvent(const HBHERecHitCollection& hbHits,
00051 const HORecHitCollection& hoHits,
00052 const HFRecHitCollection& hfHits,
00053 const HBHEDigiCollection& hbhedigi,
00054 const HODigiCollection& hodigi,
00055 const HFDigiCollection& hfdigi
00056 );
00057
00058 private:
00059 void zeroCounters(bool resetpresent=false);
00060
00061 void processEvent_HBHEdigi(const HBHEDataFrame digi);
00062 template<class T> void process_Digi(T& digi);
00063 template<class T> void process_RecHit(T& rechit);
00064
00065 bool deadmon_makeDiagnostics_;
00066 int minDeadEventCount_;
00067
00068 HcalLogicalMap* logicalMap_;
00069
00070
00071 bool deadmon_test_digis_;
00072 bool deadmon_test_rechits_;
00073
00074 void fillNevents_problemCells();
00075 void fillNevents_recentdigis();
00076 void fillNevents_recentrechits();
00077
00078
00079 double energyThreshold_;
00080 double HBenergyThreshold_;
00081 double HEenergyThreshold_;
00082 double HOenergyThreshold_;
00083 double HFenergyThreshold_;
00084
00085 EtaPhiHists RecentMissingDigisByDepth;
00086 EtaPhiHists DigiPresentByDepth;
00087 EtaPhiHists RecentMissingRecHitsByDepth;
00088 EtaPhiHists RecHitPresentByDepth;
00089
00090
00091 MonitorElement *ProblemsVsLB, *ProblemsVsLB_HB, *ProblemsVsLB_HE, *ProblemsVsLB_HO, *ProblemsVsLB_HO2, *ProblemsVsLB_HF;
00092 MonitorElement *RBX_loss_VS_LB;
00093 MonitorElement *ProblemsInLastNLB_HBHEHF_alarm;
00094 MonitorElement *ProblemsInLastNLB_HO01_alarm;
00095 MonitorElement *NumberOfNeverPresentDigis, *NumberOfNeverPresentDigisHB, *NumberOfNeverPresentDigisHE, *NumberOfNeverPresentDigisHO, *NumberOfNeverPresentDigisHF;
00096 MonitorElement *NumberOfRecentMissingDigis, *NumberOfRecentMissingDigisHB, *NumberOfRecentMissingDigisHE, *NumberOfRecentMissingDigisHO, *NumberOfRecentMissingDigisHF;
00097 MonitorElement *NumberOfRecentMissingRecHits, *NumberOfRecentMissingRecHitsHB, *NumberOfRecentMissingRecHitsHE, *NumberOfRecentMissingRecHitsHO, *NumberOfRecentMissingRecHitsHF;
00098 MonitorElement *NumberOfNeverPresentRecHits, *NumberOfNeverPresentRecHitsHB, *NumberOfNeverPresentRecHitsHE, *NumberOfNeverPresentRecHitsHO, *NumberOfNeverPresentRecHitsHF;
00099
00100 MonitorElement *Nevents;
00101 int beamMode_;
00102 bool doReset_;
00103
00104 MonitorElement *HBDeadVsEvent, *HEDeadVsEvent, *HODeadVsEvent, *HFDeadVsEvent;
00105 bool present_digi[85][72][4];
00106 bool present_rechit[85][72][4];
00107 unsigned int recentoccupancy_digi[85][72][4];
00108 unsigned int recentoccupancy_rechit[85][72][4];
00109 unsigned int occupancy_RBX[156];
00110
00111 int deadevt_;
00112 int is_RBX_loss_;
00113 int rbxlost[156];
00114 int alarmer_counter_;
00115 int alarmer_counterHO01_;
00116 bool is_stable_beam;
00117 bool hbhedcsON, hfdcsON, hodcsON;
00118 unsigned int NumBadHB, NumBadHE, NumBadHO, NumBadHO01, NumBadHO2, NumBadHF, NumBadHFLUMI, NumBadHO0, NumBadHO12;
00119 edm::InputTag digiLabel_;
00120 edm::InputTag hbheRechitLabel_, hoRechitLabel_, hfRechitLabel_;
00121
00122 bool endLumiProcessed_;
00123
00124 bool excludeHORing2_;
00125 bool excludeHO1P02_;
00126 int NumBadHO1P02;
00127 };
00128
00129 #endif