CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQM/EcalBarrelMonitorTasks/interface/PedestalTask.h

Go to the documentation of this file.
00001 #ifndef PedestalTask_H
00002 #define PedestalTask_H
00003 
00004 #include "DQM/EcalCommon/interface/DQWorkerTask.h"
00005 
00006 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00007 
00008 namespace ecaldqm {
00009 
00010   class PedestalTask : public DQWorkerTask {
00011   public:
00012     PedestalTask(const edm::ParameterSet &, const edm::ParameterSet &);
00013     ~PedestalTask();
00014 
00015     void bookMEs();
00016 
00017     bool filterRunType(const std::vector<short>&);
00018 
00019     void analyze(const void*, Collections);
00020 
00021     void runOnDigis(const EcalDigiCollection&);
00022     void runOnPnDigis(const EcalPnDiodeDigiCollection&);
00023 
00024     enum Constants {
00025       nGain = 3,
00026       nPNGain = 2
00027     };
00028 
00029     enum MESets {
00030       kOccupancy, // h2f
00031       kPedestal = kOccupancy + nGain, // profile2d
00032       kPNOccupancy = kPedestal + nGain,
00033       kPNPedestal = kPNOccupancy + nPNGain, // profile2d
00034       nMESets = kPNPedestal + nPNGain
00035     };
00036 
00037     static void setMEData(std::vector<MEData>&);
00038 
00039   protected:
00040     std::vector<int> MGPAGains_;
00041     std::vector<int> MGPAGainsPN_;
00042 
00043     bool enable_[BinService::nDCC];
00044   };
00045 
00046   inline void PedestalTask::analyze(const void* _p, Collections _collection){
00047     switch(_collection){
00048     case kEBDigi:
00049     case kEEDigi:
00050       runOnDigis(*static_cast<const EcalDigiCollection*>(_p));
00051       break;
00052     case kPnDiodeDigi:
00053       runOnPnDigis(*static_cast<const EcalPnDiodeDigiCollection*>(_p));
00054       break;
00055     default:
00056       break;
00057     }
00058   }
00059 
00060 }
00061 
00062 #endif