Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PNDiodeTask_H
0002 #define PNDiodeTask_H
0003 
0004 #include "DQWorkerTask.h"
0005 
0006 #include "DQM/EcalCommon/interface/EcalDQMCommonUtils.h"
0007 
0008 #include "DataFormats/EcalDetId/interface/EcalDetIdCollections.h"
0009 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0010 
0011 namespace ecaldqm {
0012 
0013   class PNDiodeTask : public DQWorkerTask {
0014   public:
0015     PNDiodeTask();
0016     ~PNDiodeTask() override {}
0017 
0018     bool filterRunType(short const*) override;
0019 
0020     bool analyze(void const*, Collections) override;
0021 
0022     void runOnErrors(EcalElectronicsIdCollection const&, Collections);
0023     void runOnPnDigis(EcalPnDiodeDigiCollection const&);
0024 
0025   protected:
0026     bool enable_[ecaldqm::nDCC];
0027   };
0028 
0029   inline bool PNDiodeTask::analyze(void const* _p, Collections _collection) {
0030     switch (_collection) {
0031       case kMEMTowerIdErrors:
0032       case kMEMBlockSizeErrors:
0033       case kMEMChIdErrors:
0034       case kMEMGainErrors:
0035         if (_p)
0036           runOnErrors(*static_cast<EcalElectronicsIdCollection const*>(_p), _collection);
0037         return true;
0038         break;
0039       case kPnDiodeDigi:
0040         if (_p)
0041           runOnPnDigis(*static_cast<EcalPnDiodeDigiCollection const*>(_p));
0042         return true;
0043         break;
0044       default:
0045         break;
0046     }
0047 
0048     return false;
0049   }
0050 
0051 }  // namespace ecaldqm
0052 
0053 #endif