File indexing completed on 2024-04-06 12:07:19
0001 #ifndef RawDataTask_H
0002 #define RawDataTask_H
0003
0004 #include "DQWorkerTask.h"
0005
0006 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0007 #include "DataFormats/EcalRawData/interface/EcalRawDataCollections.h"
0008
0009 #include "DataFormats/Provenance/interface/RunID.h"
0010
0011 namespace ecaldqm {
0012 class RawDataTask : public DQWorkerTask {
0013 public:
0014 RawDataTask();
0015 ~RawDataTask() override {}
0016
0017 void addDependencies(DependencySet&) override;
0018
0019 void beginRun(edm::Run const&, edm::EventSetup const&) override;
0020 void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override;
0021
0022 bool analyze(void const*, Collections) override;
0023
0024 void runOnSource(FEDRawDataCollection const&);
0025 void runOnRawData(EcalRawDataCollection const&);
0026
0027 enum Constants { nEventTypes = 25 };
0028
0029 private:
0030 edm::RunNumber_t runNumber_;
0031 int l1A_;
0032 int orbit_;
0033 int bx_;
0034 short triggerType_;
0035 int feL1Offset_;
0036 };
0037
0038 inline bool RawDataTask::analyze(void const* _p, Collections _collection) {
0039 switch (_collection) {
0040 case kSource:
0041 if (_p)
0042 runOnSource(*static_cast<FEDRawDataCollection const*>(_p));
0043 return true;
0044 break;
0045 case kEcalRawData:
0046 if (_p)
0047 runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
0048 return true;
0049 break;
0050 default:
0051 break;
0052 }
0053 return false;
0054 }
0055
0056 }
0057
0058 #endif