CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DQM/CastorMonitor/interface/CastorLEDMonitor.h

Go to the documentation of this file.
00001 #ifndef DQM_CASTORMONITOR_CASTORLEDMONITOR_H
00002 #define DQM_CASTORMONITOR_CASTORLEDMONITOR_H
00003 
00004 #include "DQM/CastorMonitor/interface/CastorBaseMonitor.h"
00005 #include "DataFormats/HcalDigi/interface/HcalUnpackerReport.h"
00006 #include "DQMServices/Core/interface/DQMStore.h"
00007 #include "DQMServices/Core/interface/MonitorElement.h"
00008 
00010 static const float LedMonAdc2fc[128]={-0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5,
00011                                      8.5,  9.5, 10.5, 11.5, 12.5, 13.5, 15., 17., 
00012                                      19., 21., 23., 25., 27., 29.5,
00013                                      32.5, 35.5, 38.5, 42., 46., 50., 54.5, 59.5, 
00014                                      64.5, 59.5, 64.5, 69.5, 74.5,
00015                                      79.5, 84.5, 89.5, 94.5, 99.5, 104.5, 109.5, 
00016                                      114.5, 119.5, 124.5, 129.5, 137.,
00017                                      147., 157., 167., 177., 187., 197., 209.5, 224.5, 
00018                                      239.5, 254.5, 272., 292.,
00019                                      312., 334.5, 359.5, 384.5, 359.5, 384.5, 409.5, 
00020                                      434.5, 459.5, 484.5, 509.5,
00021                                      534.5, 559.5, 584.5, 609.5, 634.5, 659.5, 684.5, 709.5, 
00022                                      747., 797., 847.,
00023                                      897.,  947., 997., 1047., 1109.5, 1184.5, 1259.5, 
00024                                      1334.5, 1422., 1522., 1622.,
00025                                      1734.5, 1859.5, 1984.5, 1859.5, 1984.5, 2109.5, 
00026                                      2234.5, 2359.5, 2484.5,
00027                                      2609.5, 2734.5, 2859.5, 2984.5, 3109.5, 
00028                                      3234.5, 3359.5, 3484.5, 3609.5, 3797.,
00029                                      4047., 4297., 4547., 4797., 5047., 5297., 
00030                                      5609.5, 5984.5, 6359.5, 6734.5,
00031                                      7172., 7672., 8172., 8734.5, 9359.5, 9984.5};
00032 
00033 
00034 
00035 
00036 class CastorLEDMonitor: public CastorBaseMonitor {
00037 
00038 public:
00039   CastorLEDMonitor(); 
00040   ~CastorLEDMonitor(); 
00041 
00042   void setup(const edm::ParameterSet& ps, DQMStore* dbe);
00043 
00044   void processEvent(const CastorDigiCollection& cast, const CastorDbService& cond);
00045 
00046   void reset();
00047 
00048   void done();
00049 
00050  private: //members vars...
00051 
00052   // and this is just a very dumb way of doing the adc->fc conversion in the
00053   // full range (and is the same for all channels and cap-ids)
00054 
00055 
00056   void perChanHists(const HcalCastorDetId DetID, float* vals, 
00057                     std::map<HcalCastorDetId, MonitorElement*> &tShape, 
00058                     std::map<HcalCastorDetId, MonitorElement*> &tTime, 
00059                     std::map<HcalCastorDetId, MonitorElement*> &tEnergy,
00060                     std::string baseFolder);
00061 
00062   void createFEDmap(unsigned int fed);
00063 
00064   std::map<HcalCastorDetId, MonitorElement*>::iterator meIter;
00065   std::map<unsigned int, MonitorElement*>::iterator fedIter;
00066 
00067   bool doPerChannel_;
00068   
00069   int sigS0_, sigS1_; //-- first and last signal bins
00070   float adcThresh_;
00071 
00072   int ievt_, jevt_;
00073   CastorCalibrations calibs_;
00074 
00075 
00076  private: //monitoring elements...
00077   MonitorElement* meEVT_;
00078 
00079   struct{
00080     std::map<HcalCastorDetId,MonitorElement*> shape;
00081     std::map<HcalCastorDetId,MonitorElement*> time;
00082     std::map<HcalCastorDetId,MonitorElement*> energy;
00083 
00084     MonitorElement* shapePED;
00085     MonitorElement* shapeALL;
00086     MonitorElement* timeALL;
00087     MonitorElement* energyALL;
00088 
00089     MonitorElement* rms_shape;
00090     MonitorElement* mean_shape;
00091 
00092     MonitorElement* rms_time;
00093     MonitorElement* mean_time;
00094 
00095     MonitorElement* rms_energy;
00096     MonitorElement* mean_energy;
00097 
00098   } castHists;
00099 
00100 
00101   MonitorElement* MEAN_MAP_TIME_L1;
00102   MonitorElement*  RMS_MAP_TIME_L1;
00103 
00104   MonitorElement* MEAN_MAP_TIME_L2;
00105   MonitorElement*  RMS_MAP_TIME_L2;
00106 
00107   MonitorElement* MEAN_MAP_TIME_L3;
00108   MonitorElement*  RMS_MAP_TIME_L3;
00109 
00110   MonitorElement* MEAN_MAP_TIME_L4;
00111   MonitorElement*  RMS_MAP_TIME_L4;
00112 
00113  
00114 
00115   std::map<unsigned int,MonitorElement*> MEAN_MAP_ENERGY_DCC;
00116   std::map<unsigned int,MonitorElement*> RMS_MAP_ENERGY_DCC;
00117   
00118   std::map<unsigned int,MonitorElement*> MEAN_MAP_SHAPE_DCC;
00119   std::map<unsigned int,MonitorElement*> RMS_MAP_SHAPE_DCC;
00120 
00121   std::map<unsigned int,MonitorElement*> MEAN_MAP_TIME_DCC;
00122   std::map<unsigned int,MonitorElement*> RMS_MAP_TIME_DCC;
00123 
00124 };
00125 
00126 #endif