CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DQM/EcalBarrelMonitorTasks/interface/LaserTask.h

Go to the documentation of this file.
00001 #ifndef LaserTask_H
00002 #define LaserTask_H
00003 
00004 #include "DQM/EcalCommon/interface/DQWorkerTask.h"
00005 
00006 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
00007 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00008 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00009 
00010 namespace ecaldqm {
00011 
00012   class LaserTask : public DQWorkerTask {
00013   public:
00014     LaserTask(const edm::ParameterSet &, const edm::ParameterSet &);
00015     ~LaserTask();
00016 
00017     bool filterRunType(const std::vector<short>&);
00018 
00019     void bookMEs();
00020 
00021     void beginRun(const edm::Run &, const edm::EventSetup &);
00022     void endEvent(const edm::Event &, const edm::EventSetup &);
00023 
00024     void analyze(const void*, Collections);
00025 
00026     void runOnRawData(const EcalRawDataCollection&);
00027     void runOnDigis(const EcalDigiCollection&);
00028     void runOnPnDigis(const EcalPnDiodeDigiCollection&);
00029     void runOnUncalibRecHits(const EcalUncalibratedRecHitCollection&, Collections);
00030 
00031     std::vector<int> const& getLaserWavelengths() const { return laserWavelengths_; }
00032     std::vector<int> const& getMGPAGainsPN() const { return MGPAGainsPN_; }
00033 
00034     enum Constants {
00035       nWL = 4,
00036       nPNGain = 2
00037     };
00038 
00039     enum MESets {
00040       kAmplitudeSummary, // profile2d
00041       kAmplitude = kAmplitudeSummary + nWL, // profile2d
00042       kOccupancy = kAmplitude + nWL,
00043       kTiming = kOccupancy + nWL, // profile2d
00044       kShape = kTiming + nWL,
00045       kAOverP = kShape + nWL, // profile2d
00046       kPNAmplitude = kAOverP + nWL, // profile2d
00047       kPNOccupancy = kPNAmplitude + nWL * nPNGain, // profile2d
00048       nMESets
00049     };
00050 
00051     static void setMEData(std::vector<MEData>&);
00052 
00053   private:
00054     std::vector<int> laserWavelengths_;
00055     std::vector<int> MGPAGainsPN_;
00056 
00057     bool enable_[BinService::nDCC];
00058     int wavelength_[BinService::nDCC];
00059     std::map<int, std::vector<float> > pnAmp_;
00060   };
00061 
00062   inline void LaserTask::analyze(const void* _p, Collections _collection){
00063     switch(_collection){
00064     case kEcalRawData:
00065       runOnRawData(*static_cast<const EcalRawDataCollection*>(_p));
00066       break;
00067     case kEBDigi:
00068     case kEEDigi:
00069       runOnDigis(*static_cast<const EcalDigiCollection*>(_p));
00070       break;
00071     case kPnDiodeDigi:
00072       runOnPnDigis(*static_cast<const EcalPnDiodeDigiCollection*>(_p));
00073       break;
00074     case kEBUncalibRecHit:
00075     case kEEUncalibRecHit:
00076       runOnUncalibRecHits(*static_cast<const EcalUncalibratedRecHitCollection*>(_p), _collection);
00077       break;
00078     default:
00079       break;
00080     }
00081   }
00082 
00083 }
00084 
00085 #endif