File indexing completed on 2024-04-06 12:07:19
0001 #ifndef TestPulseTask_H
0002 #define TestPulseTask_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 TestPulseTask : public DQWorkerTask {
0015 public:
0016 TestPulseTask();
0017 ~TestPulseTask() override {}
0018
0019 bool filterRunType(short const*) override;
0020
0021 void addDependencies(DependencySet&) override;
0022
0023 bool analyze(void const*, Collections) override;
0024
0025 void runOnRawData(EcalRawDataCollection const&);
0026 template <typename DigiCollection>
0027 void runOnDigis(DigiCollection const&);
0028 void runOnPnDigis(EcalPnDiodeDigiCollection const&);
0029 void runOnUncalibRecHits(EcalUncalibratedRecHitCollection const&);
0030
0031 private:
0032 void setParams(edm::ParameterSet const&) override;
0033
0034 std::map<int, unsigned> gainToME_;
0035 std::map<int, unsigned> pnGainToME_;
0036
0037 bool enable_[nDCC];
0038 int gain_[nDCC];
0039 };
0040
0041 inline bool TestPulseTask::analyze(void const* _p, Collections _collection) {
0042 switch (_collection) {
0043 case kEcalRawData:
0044 if (_p)
0045 runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
0046 return true;
0047 break;
0048 case kEBDigi:
0049 if (_p)
0050 runOnDigis(*static_cast<EBDigiCollection const*>(_p));
0051 return true;
0052 break;
0053 case kEEDigi:
0054 if (_p)
0055 runOnDigis(*static_cast<EEDigiCollection const*>(_p));
0056 return true;
0057 break;
0058 case kPnDiodeDigi:
0059 if (_p)
0060 runOnPnDigis(*static_cast<EcalPnDiodeDigiCollection const*>(_p));
0061 return true;
0062 break;
0063 case kEBTestPulseUncalibRecHit:
0064 case kEETestPulseUncalibRecHit:
0065 if (_p)
0066 runOnUncalibRecHits(*static_cast<EcalUncalibratedRecHitCollection const*>(_p));
0067 return true;
0068 break;
0069 default:
0070 break;
0071 }
0072 return false;
0073 }
0074
0075 }
0076
0077 #endif