Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef IntegrityTask_H
0002 #define IntegrityTask_H
0003 
0004 #include "DQWorkerTask.h"
0005 
0006 #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"
0007 
0008 #include "DataFormats/DetId/interface/DetIdCollection.h"
0009 #include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h"
0010 
0011 namespace ecaldqm {
0012 
0013   class IntegrityTask : public DQWorkerTask {
0014   public:
0015     IntegrityTask();
0016     ~IntegrityTask() override {}
0017 
0018     void beginEvent(edm::Event const&, edm::EventSetup const&, bool const&, bool&) override;
0019 
0020     bool analyze(void const*, Collections) override;
0021 
0022     template <class C>
0023     void runOnDetIdCollection(C const&, Collections);
0024     void runOnElectronicsIdCollection(EcalElectronicsIdCollection const&, Collections);
0025   };
0026 
0027   inline bool IntegrityTask::analyze(void const* _p, Collections _collection) {
0028     switch (_collection) {
0029       case kEBGainErrors:
0030       case kEBChIdErrors:
0031       case kEBGainSwitchErrors:
0032         if (_p)
0033           runOnDetIdCollection(*static_cast<EBDetIdCollection const*>(_p), _collection);
0034         return true;
0035       case kEEGainErrors:
0036       case kEEChIdErrors:
0037       case kEEGainSwitchErrors:
0038         if (_p)
0039           runOnDetIdCollection(*static_cast<EEDetIdCollection const*>(_p), _collection);
0040         return true;
0041         break;
0042       case kTowerIdErrors:
0043       case kBlockSizeErrors:
0044         if (_p)
0045           runOnElectronicsIdCollection(*static_cast<EcalElectronicsIdCollection const*>(_p), _collection);
0046         return true;
0047         break;
0048       default:
0049         break;
0050     }
0051 
0052     return false;
0053   }
0054 
0055 }  // namespace ecaldqm
0056 
0057 #endif