Go to the documentation of this file.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_HF;
00092 MonitorElement *RBX_loss_VS_LB;
00093 MonitorElement *ProblemsInLastNLB_HBHEHF_alarm;
00094 MonitorElement *NumberOfNeverPresentDigis, *NumberOfNeverPresentDigisHB, *NumberOfNeverPresentDigisHE, *NumberOfNeverPresentDigisHO, *NumberOfNeverPresentDigisHF;
00095 MonitorElement *NumberOfRecentMissingDigis, *NumberOfRecentMissingDigisHB, *NumberOfRecentMissingDigisHE, *NumberOfRecentMissingDigisHO, *NumberOfRecentMissingDigisHF;
00096 MonitorElement *NumberOfRecentMissingRecHits, *NumberOfRecentMissingRecHitsHB, *NumberOfRecentMissingRecHitsHE, *NumberOfRecentMissingRecHitsHO, *NumberOfRecentMissingRecHitsHF;
00097 MonitorElement *NumberOfNeverPresentRecHits, *NumberOfNeverPresentRecHitsHB, *NumberOfNeverPresentRecHitsHE, *NumberOfNeverPresentRecHitsHO, *NumberOfNeverPresentRecHitsHF;
00098
00099 MonitorElement *Nevents;
00100 int beamMode_;
00101 bool doReset_;
00102
00103 MonitorElement *HBDeadVsEvent, *HEDeadVsEvent, *HODeadVsEvent, *HFDeadVsEvent;
00104 bool present_digi[85][72][4];
00105 bool present_rechit[85][72][4];
00106 unsigned int recentoccupancy_digi[85][72][4];
00107 unsigned int recentoccupancy_rechit[85][72][4];
00108 unsigned int occupancy_RBX[156];
00109
00110 int deadevt_;
00111 int is_RBX_loss_;
00112 int rbxlost[156];
00113 int alarmer_counter_;
00114 bool hbhedcsON, hfdcsON;
00115 unsigned int NumBadHB, NumBadHE, NumBadHO, NumBadHF, NumBadHFLUMI, NumBadHO0, NumBadHO12;
00116 edm::InputTag digiLabel_;
00117 edm::InputTag hbheRechitLabel_, hoRechitLabel_, hfRechitLabel_;
00118
00119 bool endLumiProcessed_;
00120
00121 bool excludeHORing2_;
00122 bool excludeHO1P02_;
00123 int NumBadHO1P02;
00124 };
00125
00126 #endif