CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/DQM/EcalBarrelMonitorTasks/interface/TestPulseTask.h

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