CMS 3D CMS Logo

HcalTrigPrimMonitor.h

Go to the documentation of this file.
00001 #ifndef DQM_HCALMONITORTASKS_HCALTRIGPRIMMONITOR_H
00002 #define DQM_HCALMONITORTASKS_HCALTRIGPRIMMONITOR_H
00003 
00004 #include "DQM/HcalMonitorTasks/interface/HcalBaseMonitor.h"
00005 #include "DQMServices/Core/interface/DQMStore.h"
00006 #include "DQMServices/Core/interface/MonitorElement.h"
00007 
00008 
00015  static const float TrigMonAdc2fc[128]={-0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5,
00016                                         8.5,  9.5, 10.5, 11.5, 12.5, 13.5, 15., 17.,
00017                                         19., 21., 23., 25., 27., 29.5,
00018                                         32.5, 35.5, 38.5, 42., 46., 50., 54.5, 59.5,
00019                                         64.5, 59.5, 64.5, 69.5, 74.5,
00020                                         79.5, 84.5, 89.5, 94.5, 99.5, 104.5, 109.5,
00021                                         114.5, 119.5, 124.5, 129.5, 137.,
00022                                         147., 157., 167., 177., 187., 197., 209.5, 224.5,
00023                                         239.5, 254.5, 272., 292.,
00024                                         312., 334.5, 359.5, 384.5, 359.5, 384.5, 409.5,
00025                                         434.5, 459.5, 484.5, 509.5,
00026                                         534.5, 559.5, 584.5, 609.5, 634.5, 659.5, 684.5, 709.5,
00027                                         747., 797., 847.,
00028                                         897.,  947., 997., 1047., 1109.5, 1184.5, 1259.5,
00029                                         1334.5, 1422., 1522., 1622.,
00030                                         1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5,
00031                                         2234.5, 2359.5, 2484.5,
00032                                         2609.5, 2734.5, 2859.5, 2984.5, 3109.5,
00033                                         3234.5, 3359.5, 3484.5, 3609.5, 3797.,
00034                                         4047., 4297., 4547., 4797., 5047., 5297.,
00035                                         5609.5, 5984.5, 6359.5, 6734.5,
00036                                         7172., 7672., 8172., 8734.5, 9359.5, 9984.5};
00037 
00038 
00039 class HcalTrigPrimMonitor: public HcalBaseMonitor {
00040  public:
00041   HcalTrigPrimMonitor(); 
00042   ~HcalTrigPrimMonitor(); 
00043   
00044   void setup(const edm::ParameterSet& ps, DQMStore* dbe);
00045   void processEvent(const HBHERecHitCollection& hbHits, 
00046                     const HORecHitCollection& hoHits, 
00047                     const HFRecHitCollection& hfHits,
00048                     const HBHEDigiCollection& hbhedigi,
00049                     const HODigiCollection& hodigi,
00050                     const HFDigiCollection& hfdigi,                 
00051                     const HcalTrigPrimDigiCollection& tpDigis,
00052                     const HcalElectronicsMap& emap);
00053   void fill_Nevents();
00054   void clearME();
00055   void reset();
00056 
00057 
00058 private:  
00059 
00060   int ievt_;
00061 
00062   double occThresh_;
00063   double TPThresh_;
00064   int TPdigi_;
00065   int ADCdigi_;
00066 
00067   int tp_checkNevents_; // only fill some histograms every N events -- not yet in use
00068   bool tp_makeDiagnostics_; // make diagnostic plots
00069 
00070   MonitorElement* meEVT_;
00071   MonitorElement* tpCount_;
00072   MonitorElement* tpCountThr_;
00073   MonitorElement* tpSize_;
00074 
00075   float val_tpSize_[20];
00076   float val_tpCount_[5000];
00077   float val_tpCountThr_[1000];
00078 
00079   std::vector<MonitorElement*> tpSpectrum_;
00080   MonitorElement* tpSpectrumAll_;
00081   MonitorElement* tpETSumAll_;
00082   MonitorElement* tpSOI_ET_;
00083 
00084   // MonitorElement setBinContent expects a float value (for TH1F, no TH1I available)
00085   float val_tpSpectrum_[10][200];
00086   float val_tpSpectrumAll_[200];
00087   float val_tpETSumAll_[200];
00088   float val_tpSOI_ET_[100];
00089 
00090   MonitorElement* TPTiming_; 
00091   MonitorElement* TPTimingTop_; 
00092   MonitorElement* TPTimingBot_; 
00093   MonitorElement*     TPOcc_;
00094   MonitorElement* TP_ADC_;
00095   MonitorElement* MAX_ADC_;
00096   MonitorElement* TS_MAX_;
00097   MonitorElement* TPvsDigi_;
00098   
00099   float val_TPTiming_[10];
00100   float val_TPTimingTop_[10];
00101   float val_TPTimingBot_[10];
00102   float val_TPOcc_[87][72];
00103   float val_TP_ADC_[200];
00104   float val_MAX_ADC_[20];
00105   float val_TS_MAX_[10];
00106   float val_TPvsDigi_[128][200];
00107   
00108 
00109   MonitorElement* me_HBHE_ZS_SlidingSum;
00110   MonitorElement* me_HF_ZS_SlidingSum;
00111   MonitorElement* me_HO_ZS_SlidingSum;
00112 
00113   float val_HBHE_ZS_SlidingSum[128];
00114   float val_HF_ZS_SlidingSum[128];
00115   float val_HO_ZS_SlidingSum[128];
00116   
00117   MonitorElement* OCC_ETA;
00118   MonitorElement* OCC_PHI;
00119   MonitorElement* OCC_MAP_GEO;
00120   MonitorElement*     OCC_MAP_ETAPHI;
00121   MonitorElement*     OCC_MAP_ETAPHI_THR;
00122   MonitorElement* OCC_ELEC_VME;
00123   MonitorElement* OCC_ELEC_DCC;
00124   MonitorElement* EN_ETA;
00125   MonitorElement* EN_PHI;
00126   MonitorElement*     EN_MAP_ETAPHI;
00127   MonitorElement* EN_ELEC_VME;
00128   MonitorElement* EN_ELEC_DCC;
00129 
00130   float val_OCC_ETA[87];
00131   float val_OCC_PHI[72];
00132   float val_OCC_MAP_ETAPHI[87][72];
00133   float val_OCC_MAP_ETAPHI_THR[87][72];
00134   float val_OCC_ELEC_VME[40][18];
00135   float val_OCC_ELEC_DCC[15][36];
00136   // These need to be float/doubles
00137   float val_EN_ETA[87];
00138   float val_EN_PHI[72];
00139   float val_EN_MAP_ETAPHI[87][72];
00140   float val_EN_ELEC_VME[40][18];
00141   float val_EN_ELEC_DCC[15][36];
00142 
00143 
00144   // not so nice , but very useful for correlation plots...
00145   void   ClearEvent()
00146     {
00147       memset(adc_data,  0,(sizeof(float)*100*72*5*10));
00148       memset(tp_data,   0,(sizeof(float)*100*72*5*10));
00149       memset(Is_adc_Data,0,(sizeof(char)*100*72*5));      
00150       memset(Is_tp_Data, 0,(sizeof(char)*100*72*5));      
00151     }
00152 
00153   float *get_adc(int eta,int phi,int depth=1)
00154     {
00155       return &adc_data[eta+50][phi][depth][0];
00156     }
00157 
00158   void   set_adc(int eta,int phi,int depth,float *val)
00159     { 
00160       if(eta<-42 || eta>42 || eta==0) return;
00161       if(phi<1 || phi>72)             return;
00162       if(depth<1 || depth>4)          return;
00163       for(int i=0;i<10;i++) adc_data[eta+50][phi][depth][i]=val[i];
00164       Is_adc_Data[eta+50][phi][depth]=1;
00165     }
00166 
00167   float *get_tp(int eta,int phi,int depth=1)
00168     {
00169       return &tp_data[eta+50][phi][depth][0];
00170     }
00171 
00172   void   set_tp(int eta,int phi,int depth,float *val)
00173     { 
00174       if(eta<-42 || eta>42 || eta==0) return;
00175       if(phi<1 || phi>72)             return;
00176       if(depth<1 || depth>4)          return;
00177       for(int i=0;i<10;i++) tp_data[eta+50][phi][depth][i]=val[i];
00178       Is_tp_Data[eta+50][phi][depth]=1;
00179     }   
00180   
00181   char   IsSet_adc(int eta,int phi,int depth)
00182     { 
00183       return Is_adc_Data[eta+50][phi][depth];
00184     }
00185 
00186   char   IsSet_tp(int eta,int phi,int depth)
00187     { 
00188       return Is_tp_Data[eta+50][phi][depth];
00189     }
00190             
00191   float adc_data   [100][73][5][10];
00192   float tp_data    [100][73][5][10];
00193   char  Is_adc_Data[100][73][5];
00194   char  Is_tp_Data [100][73][5];
00195   float maxsum;  //for running sum-of-two sliding window calculations
00196 };
00197 
00198 #endif

Generated on Tue Jun 9 17:33:00 2009 for CMSSW by  doxygen 1.5.4