File indexing completed on 2024-04-06 12:07:19
0001 #ifndef PedestalTask_H
0002 #define PedestalTask_H
0003
0004 #include "DQWorkerTask.h"
0005
0006 #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"
0007
0008 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0009
0010 namespace ecaldqm {
0011
0012 class PedestalTask : public DQWorkerTask {
0013 public:
0014 PedestalTask();
0015 ~PedestalTask() override {}
0016
0017 bool filterRunType(short const*) override;
0018
0019 bool analyze(void const*, Collections) override;
0020
0021 template <typename DigiCollection>
0022 void runOnDigis(DigiCollection const&);
0023 void runOnPnDigis(EcalPnDiodeDigiCollection const&);
0024
0025 private:
0026 void setParams(edm::ParameterSet const&) override;
0027
0028 std::map<int, unsigned> gainToME_;
0029 std::map<int, unsigned> pnGainToME_;
0030
0031 bool enable_[nDCC];
0032 };
0033
0034 inline bool PedestalTask::analyze(void const* _p, Collections _collection) {
0035 switch (_collection) {
0036 case kEBDigi:
0037 if (_p)
0038 runOnDigis(*static_cast<EBDigiCollection const*>(_p));
0039 return true;
0040 break;
0041 case kEEDigi:
0042 if (_p)
0043 runOnDigis(*static_cast<EEDigiCollection const*>(_p));
0044 return true;
0045 break;
0046 case kPnDiodeDigi:
0047 if (_p)
0048 runOnPnDigis(*static_cast<EcalPnDiodeDigiCollection const*>(_p));
0049 return true;
0050 break;
0051 default:
0052 break;
0053 }
0054
0055 return false;
0056 }
0057
0058 }
0059
0060 #endif