CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h

Go to the documentation of this file.
00001 #ifndef DQM_HCALMONITORTASKS_HCALHOTCELLMONITOR_H
00002 #define DQM_HCALMONITORTASKS_HCALHOTCELLMONITOR_H
00003 
00004 #include "DQM/HcalMonitorTasks/interface/HcalBaseDQMonitor.h"
00005 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
00006 // collection info
00007 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00008 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00009 
00010 #include <cmath>
00011 
00012 
00020 struct hotNeighborParams{
00021   int DeltaIphi;
00022   int DeltaIeta;
00023   int DeltaDepth;
00024   double minCellEnergy; // cells below this threshold can never be considered "hot" by this algorithm
00025   double minNeighborEnergy; //neighbors must have some amount of energy to be counted
00026   double maxEnergy; //  a cell above this energy will always be considered hot
00027   double HotEnergyFrac; // a cell will be considered hot if neighbor energy/ cell energy is less than this value
00028 };
00029 
00030 class HcalHotCellMonitor: public HcalBaseDQMonitor {
00031 
00032  public:
00033   HcalHotCellMonitor(const edm::ParameterSet& ps);
00034 
00035   ~HcalHotCellMonitor();
00036 
00037   void setup();
00038   void beginRun(const edm::Run& run, const edm::EventSetup& c);
00039   void endRun(const edm::Run& run, const edm::EventSetup& c);
00040   
00041   void done();
00042   void cleanup(void);
00043   void reset();
00044   void endJob();
00045 
00046   // analyze function
00047   void analyze(edm::Event const&e, edm::EventSetup const&s);
00048 
00049   // Begin LumiBlock
00050   void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00051                             const edm::EventSetup& c) ;
00052 
00053   // End LumiBlock
00054   void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00055                           const edm::EventSetup& c);
00056 
00057   void processEvent(const HBHERecHitCollection& hbHits,
00058                     const HORecHitCollection& hoHits,
00059                     const HFRecHitCollection& hfHits
00060                     );
00061 
00062   void processEvent_rechitenergy( const HBHERecHitCollection& hbheHits,
00063                                   const HORecHitCollection& hoHits,
00064                                   const HFRecHitCollection& hfHits);
00065 
00066   template <class R, class C> void processHit_rechitNeighbors(R& rechititer,
00067                                                               C& collection,
00068                                                               hotNeighborParams& params);
00069 
00070   void periodicReset();
00071 
00072 
00073  private:
00074   void fillNevents_neighbor();
00075   void fillNevents_energy();
00076   void fillNevents_persistentenergy();
00077   
00078   void fillNevents_problemCells();
00079   void zeroCounters();
00080 
00081   int minEvents_; // minimum # of events in a lumi block before persistent test will be checked
00082   // Booleans to control which of the three hot cell checking routines are used
00083   bool test_neighbor_;
00084   bool test_energy_;
00085   bool test_et_;
00086   bool test_persistent_;
00087   bool setupDone_;
00088   
00089   double energyThreshold_, HBenergyThreshold_, HEenergyThreshold_, HOenergyThreshold_, HFenergyThreshold_;
00090   double ETThreshold_, HBETThreshold_, HEETThreshold_, HOETThreshold_, HFETThreshold_;
00091   double persistentThreshold_, HBpersistentThreshold_, HEpersistentThreshold_, HOpersistentThreshold_, HFpersistentThreshold_;
00092   double persistentETThreshold_, HBpersistentETThreshold_, HEpersistentETThreshold_, HOpersistentETThreshold_, HFpersistentETThreshold_;
00093 
00094   double HFfarfwdScale_;
00095 
00096   double minErrorFlag_; // minimum error rate needed to dump out bad bin info 
00097   
00098   double nsigma_;
00099   double HBnsigma_, HEnsigma_, HOnsigma_, HFnsigma_;
00100   EtaPhiHists   AboveNeighborsHotCellsByDepth;
00101   EtaPhiHists   AboveEnergyThresholdCellsByDepth;
00102   EtaPhiHists   AboveETThresholdCellsByDepth;
00103   EtaPhiHists   AbovePersistentThresholdCellsByDepth; 
00104   EtaPhiHists   AbovePersistentETThresholdCellsByDepth;
00105 
00106   double SiPMscale_;
00107   int aboveneighbors[85][72][4];
00108   int aboveenergy[85][72][4]; // when rechit is above threshold energy
00109   int aboveet[85][72][4]; // when rechit is above threshold et
00110   int abovepersistent[85][72][4]; // when rechit is consistently above some threshold
00111   int abovepersistentET[85][72][4];
00112   int rechit_occupancy_sum[85][72][4];
00113 
00114   bool excludeHORing2_;
00115 
00116 
00117   // Diagnostic plots
00118   MonitorElement* d_HBenergyVsNeighbor;
00119   MonitorElement* d_HEenergyVsNeighbor;
00120   MonitorElement* d_HOenergyVsNeighbor;
00121   MonitorElement* d_HFenergyVsNeighbor;
00122 
00123   int hbVsNeighbor[500];
00124   int heVsNeighbor[500];
00125   int hoVsNeighbor[500];
00126   int hfVsNeighbor[500];
00127 
00128   hotNeighborParams HBHENeighborParams_, HONeighborParams_, HFNeighborParams_;
00129 
00130   edm::InputTag hbheRechitLabel_, hoRechitLabel_, hfRechitLabel_;
00131 };
00132 
00133 #endif