ESDaqInfoTask

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#ifndef ESDaqInfoTask_h
#define ESDaqInfoTask_h

#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "Geometry/EcalMapping/interface/ESElectronicsMapper.h"  // definition in line 75
#include "DQMServices/Core/interface/DQMStore.h"

class ESDaqInfoTask : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchLuminosityBlocks> {
public:
  typedef dqm::legacy::MonitorElement MonitorElement;
  typedef dqm::legacy::DQMStore DQMStore;

  /// Constructor
  ESDaqInfoTask(const edm::ParameterSet& ps);

  /// Destructor
  ~ESDaqInfoTask() override;

protected:
  /// Analyze
  void analyze(const edm::Event& e, const edm::EventSetup& c) override;

  /// BeginJob
  void beginJob(void) override;

  /// EndJob
  void endJob(void) override;

  /// BeginLuminosityBlock
  void beginLuminosityBlock(const edm::LuminosityBlock& lumiBlock, const edm::EventSetup& iSetup) override;

  /// EndLuminosityBlock
  void endLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override;

  /// Reset
  void reset(void);

private:
  DQMStore* dqmStore_;
  edm::ESGetToken<RunInfo, RunInfoRcd> runInfoToken_;
  std::string prefixME_;

  bool mergeRuns_;

  MonitorElement* meESDaqFraction_;
  MonitorElement* meESDaqActive_[56];
  MonitorElement* meESDaqActiveMap_;

  MonitorElement* meESDaqError_;

  int ESFedRangeMin_;
  int ESFedRangeMax_;

  ESElectronicsMapper* es_mapping_;

  bool ESOnFed_[56];

  int getFEDNumber(const int x, const int y) {
    int iz = (x < 40) ? 1 : 2;
    int ip = (y >= 40) ? 1 : 2;
    int ix = (x < 40) ? x : x - 40;
    int iy = (y < 40) ? y : y - 40;
    return (*es_mapping_).getFED(iz, ip, ix + 1, iy + 1);
  }
};

#endif