DTNoiseTask

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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
#ifndef DTNoiseTask_H
#define DTNoiseTask_H

/** \class DTNoiseTask
 *  No description available.
 *
 *  \authors G. Mila , G. Cerminara - INFN Torino
 */

#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"

#include "DQMServices/Core/interface/DQMStore.h"

#include "DataFormats/MuonDetId/interface/DTChamberId.h"
#include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
#include "DataFormats/DTDigi/interface/DTDigi.h"
#include "DataFormats/DTDigi/interface/DTDigiCollection.h"

#include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"

// RecHit
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Utilities/interface/InputTag.h"

namespace edm {
  class ParameterSet;
  class EventSetup;
  class Event;
}  // namespace edm

class DTGeometry;
class DTTtrig;

//-class DTNoiseTask : public edm::EDAnalyzer {
class DTNoiseTask : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
public:
  /// Constructor
  DTNoiseTask(const edm::ParameterSet& ps);

  /// Destructor
  ~DTNoiseTask() override;

  // Operations
  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;

protected:
  void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;

  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& setup) final {}
  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& setup) override;

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

private:
  void bookHistos(DQMStore::IBooker&, DTChamberId chId);
  void bookHistos(DQMStore::IBooker&, DTSuperLayerId slId);

  // The label to retrieve the digis
  edm::EDGetTokenT<DTDigiCollection> dtDigiToken_;
  // counter of processed events
  int evtNumber;
  //switch for time boxes filling
  bool doTimeBoxHistos;
  // Lable of 4D segments in the event
  edm::EDGetTokenT<DTRecSegment4DCollection> recHits4DToken_;
  //switch for segment veto
  bool doSegmentVeto;

  edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
  const DTGeometry* dtGeom;
  edm::ESGetToken<DTTtrig, DTTtrigRcd> tTrigMapToken_;
  const DTTtrig* tTrigMap;

  //tTrig map per Station
  std::map<DTChamberId, double> tTrigStMap;

  //the noise histos (Hz)
  std::map<DTChamberId, MonitorElement*> noiseHistos;

  //map for histo normalization
  std::map<DTChamberId, int> mapEvt;

  //the time boxes
  std::map<DTSuperLayerId, MonitorElement*> tbHistos;

  MonitorElement* nEventMonitor;

  // safe margin (ns) between ttrig and beginning of counting area
  double safeMargin;
};
#endif

/* Local Variables: */
/* show-trailing-whitespace: t */
/* truncate-lines: t */
/* End: */