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