Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:07:19

0001 #ifndef LedTask_H
0002 #define LedTask_H
0003 
0004 #include "DQWorkerTask.h"
0005 
0006 #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"
0007 
0008 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
0009 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0010 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0011 
0012 namespace ecaldqm {
0013 
0014   class LedTask : public DQWorkerTask {
0015   public:
0016     LedTask();
0017     ~LedTask() override {}
0018 
0019     void addDependencies(DependencySet&) override;
0020 
0021     bool filterRunType(short const*) override;
0022 
0023     void beginRun(edm::Run const&, edm::EventSetup const&) override;
0024     void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0025     void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override;
0026 
0027     bool analyze(void const*, Collections) override;
0028 
0029     void runOnRawData(EcalRawDataCollection const&);
0030     void runOnDigis(EEDigiCollection const&);
0031     void runOnPnDigis(EcalPnDiodeDigiCollection const&);
0032     void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const&);
0033 
0034     void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
0035 
0036   private:
0037     void setParams(edm::ParameterSet const&) override;
0038 
0039     std::map<int, unsigned> wlToME_;
0040 
0041     bool enable_[nEEDCC];
0042     unsigned wavelength_[nEEDCC];
0043     unsigned rtHalf_[nEEDCC];
0044     std::map<unsigned, float> pnAmp_;
0045 
0046     int emptyLS_;
0047     int emptyLSLimit_;
0048     int isemptyLS;
0049   };
0050 
0051   inline bool LedTask::analyze(void const* _p, Collections _collection) {
0052     switch (_collection) {
0053       case kEcalRawData:
0054         if (_p)
0055           runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
0056         return true;
0057         break;
0058       case kEEDigi:
0059         if (_p)
0060           runOnDigis(*static_cast<EEDigiCollection const*>(_p));
0061         return true;
0062         break;
0063       case kPnDiodeDigi:
0064         if (_p)
0065           runOnPnDigis(*static_cast<EcalPnDiodeDigiCollection const*>(_p));
0066         return true;
0067         break;
0068       case kEELaserLedUncalibRecHit:
0069         if (_p)
0070           runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
0071         return true;
0072         break;
0073       default:
0074         break;
0075     }
0076 
0077     return false;
0078   }
0079 
0080 }  // namespace ecaldqm
0081 
0082 #endif