00001 #ifndef DQM_HCALMONITORTASKS_HCALDEADCELLMONITOR_H
00002 #define DQM_HCALMONITORTASKS_HCALDEADCELLMONITOR_H
00003
00004 #include "DQM/HcalMonitorTasks/interface/HcalBaseMonitor.h"
00005
00006 #include "DQMServices/Core/interface/DQMStore.h"
00007 #include "DQMServices/Core/interface/MonitorElement.h"
00008 #include "CondFormats/HcalObjects/interface/HcalChannelStatus.h"
00009 #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h"
00010
00011 #include <cmath>
00012 #include <iostream>
00013 #include <fstream>
00014
00022 struct neighborParams{
00023 int DeltaIphi;
00024 int DeltaIeta;
00025 int DeltaDepth;
00026 double maxCellEnergy;
00027 double minNeighborEnergy;
00028 double minGoodNeighborFrac;
00029 double maxEnergyFrac;
00030 };
00031
00032 class HcalDeadCellMonitor: public HcalBaseMonitor {
00033
00034 public:
00035 HcalDeadCellMonitor();
00036
00037 ~HcalDeadCellMonitor();
00038
00039 void setup(const edm::ParameterSet& ps, DQMStore* dbe);
00040 void setupNeighborParams(const edm::ParameterSet& ps, neighborParams& N, char* type);
00041 void done(std::map<HcalDetId, unsigned int>& myqual);
00042 void clearME();
00043 void reset();
00044
00045 void createMaps(const HcalDbService& cond);
00046
00047 void processEvent(const HBHERecHitCollection& hbHits,
00048 const HORecHitCollection& hoHits,
00049 const HFRecHitCollection& hfHits,
00050
00051 const HBHEDigiCollection& hbhedigi,
00052 const HODigiCollection& hodigi,
00053 const HFDigiCollection& hfdigi,
00054
00055 const HcalDbService& cond
00056 );
00057
00058 void processEvent_digi(const HBHEDigiCollection& hbhedigi,
00059 const HODigiCollection& hodigi,
00060 const HFDigiCollection& hfdigi,
00061
00062 const HcalDbService& cond
00063 );
00064
00065 void processEvent_rechitenergy( const HBHERecHitCollection& hbheHits,
00066 const HORecHitCollection& hoHits,
00067 const HFRecHitCollection& hfHits);
00068
00069 void processEvent_rechitneighbors( const HBHERecHitCollection& hbheHits,
00070 const HORecHitCollection& hoHits,
00071 const HFRecHitCollection& hfHits);
00072 void fillDeadHistosAtEndRun();
00073 private:
00074
00075 void fillNevents_occupancy();
00076 void fillNevents_pedestal();
00077 void fillNevents_neighbor();
00078 void fillNevents_energy();
00079
00080 void fillNevents_problemCells();
00081
00082 bool doFCpeds_;
00083 bool deadmon_makeDiagnostics_;
00084
00085
00086 bool deadmon_test_occupancy_;
00087 bool deadmon_test_pedestal_;
00088 bool deadmon_test_neighbor_;
00089 bool deadmon_test_energy_;
00090 bool deadmon_test_rechit_occupancy_;
00091
00092 int deadmon_checkNevents_;
00093
00094 int deadmon_checkNevents_occupancy_;
00095 int deadmon_checkNevents_pedestal_;
00096 int deadmon_checkNevents_neighbor_;
00097 int deadmon_checkNevents_energy_;
00098 int deadmon_checkNevents_rechit_occupancy_;
00099
00100 double energyThreshold_;
00101 double HBenergyThreshold_;
00102 double HEenergyThreshold_;
00103 double HOenergyThreshold_;
00104 double HFenergyThreshold_;
00105 double ZDCenergyThreshold_;
00106
00107 MonitorElement* meEVT_;
00108 int ievt_;
00109
00110 double deadmon_minErrorFlag_;
00111
00112 MonitorElement* ProblemDeadCells;
00113 std::vector<MonitorElement*> ProblemDeadCellsByDepth;
00114
00115 std::vector<MonitorElement*>UnoccupiedDeadCellsByDepth;
00116 std::vector<MonitorElement*>UnoccupiedRecHitsByDepth;
00117 std::vector<MonitorElement*>BelowPedestalDeadCellsByDepth;
00118 double nsigma_;
00119 double HBnsigma_, HEnsigma_, HOnsigma_, HFnsigma_, ZDCnsigma_;
00120 std::vector<MonitorElement*>BelowNeighborsDeadCellsByDepth;
00121 std::vector<MonitorElement*>BelowEnergyThresholdCellsByDepth;
00122
00123
00124
00125 std::map<HcalDetId, float> pedestals_;
00126 std::map<HcalDetId, float> widths_;
00127 std::map<HcalDetId, float> pedestal_thresholds_;
00128 std::map<HcalDetId, double> rechitEnergies_;
00129
00130
00131 unsigned int occupancy[ETABINS][PHIBINS][4];
00132 unsigned int rechit_occupancy[ETABINS][PHIBINS][4];
00133 unsigned int abovepedestal[ETABINS][PHIBINS][4];
00134 unsigned int belowneighbors[ETABINS][PHIBINS][4];
00135 unsigned int aboveenergy[ETABINS][PHIBINS][4];
00136
00137
00138 MonitorElement* d_HBnormped;
00139 MonitorElement* d_HEnormped;
00140 MonitorElement* d_HOnormped;
00141 MonitorElement* d_HFnormped;
00142 MonitorElement* d_ZDCnormped;
00143
00144 MonitorElement* d_HBrechitenergy;
00145 MonitorElement* d_HErechitenergy;
00146 MonitorElement* d_HOrechitenergy;
00147 MonitorElement* d_HFrechitenergy;
00148 MonitorElement* d_ZDCrechitenergy;
00149
00150 MonitorElement* d_HBenergyVsNeighbor;
00151 MonitorElement* d_HEenergyVsNeighbor;
00152 MonitorElement* d_HOenergyVsNeighbor;
00153 MonitorElement* d_HFenergyVsNeighbor;
00154 MonitorElement* d_ZDCenergyVsNeighbor;
00155
00156 bool HBpresent_, HEpresent_, HOpresent_, HFpresent_;
00157
00158 neighborParams defaultNeighborParams_, HBNeighborParams_, HENeighborParams_, HONeighborParams_, HFNeighborParams_, ZDCNeighborParams_;
00159 };
00160
00161 #endif