Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef ESDaqInfoTask_h
0002 #define ESDaqInfoTask_h
0003 
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 
0008 #include "Geometry/EcalMapping/interface/ESElectronicsMapper.h"  // definition in line 75
0009 #include "DQMServices/Core/interface/DQMStore.h"
0010 
0011 class ESDaqInfoTask : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchLuminosityBlocks> {
0012 public:
0013   typedef dqm::legacy::MonitorElement MonitorElement;
0014   typedef dqm::legacy::DQMStore DQMStore;
0015 
0016   /// Constructor
0017   ESDaqInfoTask(const edm::ParameterSet& ps);
0018 
0019   /// Destructor
0020   ~ESDaqInfoTask() override;
0021 
0022 protected:
0023   /// Analyze
0024   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0025 
0026   /// BeginJob
0027   void beginJob(void) override;
0028 
0029   /// EndJob
0030   void endJob(void) override;
0031 
0032   /// BeginLuminosityBlock
0033   void beginLuminosityBlock(const edm::LuminosityBlock& lumiBlock, const edm::EventSetup& iSetup) override;
0034 
0035   /// EndLuminosityBlock
0036   void endLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override;
0037 
0038   /// Reset
0039   void reset(void);
0040 
0041 private:
0042   DQMStore* dqmStore_;
0043   edm::ESGetToken<RunInfo, RunInfoRcd> runInfoToken_;
0044   std::string prefixME_;
0045 
0046   bool mergeRuns_;
0047 
0048   MonitorElement* meESDaqFraction_;
0049   MonitorElement* meESDaqActive_[56];
0050   MonitorElement* meESDaqActiveMap_;
0051 
0052   MonitorElement* meESDaqError_;
0053 
0054   int ESFedRangeMin_;
0055   int ESFedRangeMax_;
0056 
0057   ESElectronicsMapper* es_mapping_;
0058 
0059   bool ESOnFed_[56];
0060 
0061   int getFEDNumber(const int x, const int y) {
0062     int iz = (x < 40) ? 1 : 2;
0063     int ip = (y >= 40) ? 1 : 2;
0064     int ix = (x < 40) ? x : x - 40;
0065     int iy = (y < 40) ? y : y - 40;
0066     return (*es_mapping_).getFED(iz, ip, ix + 1, iy + 1);
0067   }
0068 };
0069 
0070 #endif