Go to the documentation of this file.00001 #ifndef LedTask_H
00002 #define LedTask_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 LedTask : public DQWorkerTask {
00013 public:
00014 LedTask(const edm::ParameterSet &, const edm::ParameterSet &);
00015 ~LedTask();
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&);
00030
00031 enum Constants {
00032 nWL = 2,
00033 nPNGain = 2
00034 };
00035
00036 enum MESets {
00037 kAmplitudeSummary,
00038 kAmplitude = kAmplitudeSummary + nWL,
00039 kOccupancy = kAmplitude + nWL,
00040 kShape = kOccupancy + nWL,
00041 kTiming = kShape + nWL,
00042 kAOverP = kTiming + nWL,
00043 kPNAmplitude = kAOverP + nWL,
00044 kPNOccupancy = kPNAmplitude + nWL * nPNGain,
00045 nMESets
00046 };
00047
00048 static void setMEData(std::vector<MEData>&);
00049
00050 private:
00051 std::vector<int> ledWavelengths_;
00052 std::vector<int> MGPAGainsPN_;
00053
00054 bool enable_[BinService::nDCC];
00055 int wavelength_[BinService::nDCC];
00056 std::map<int, std::vector<float> > pnAmp_;
00057 };
00058
00059 inline void LedTask::analyze(const void* _p, Collections _collection){
00060 switch(_collection){
00061 case kEcalRawData:
00062 runOnRawData(*static_cast<const EcalRawDataCollection*>(_p));
00063 break;
00064 case kEEDigi:
00065 runOnDigis(*static_cast<const EcalDigiCollection*>(_p));
00066 break;
00067 case kPnDiodeDigi:
00068 runOnPnDigis(*static_cast<const EcalPnDiodeDigiCollection*>(_p));
00069 break;
00070 case kEBUncalibRecHit:
00071 case kEEUncalibRecHit:
00072 runOnUncalibRecHits(*static_cast<const EcalUncalibratedRecHitCollection*>(_p));
00073 break;
00074 default:
00075 break;
00076 }
00077 }
00078
00079 }
00080
00081 #endif