DTLocalTriggerBaseTask

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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
#ifndef DTLocalTriggerBaseTask_H
#define DTLocalTriggerBaseTask_H

/*
 * \file DTLocalTriggerBaseTask.h
 *
 * \author C. Battilana - CIEMAT
 *
*/

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

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

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

#include "Geometry/Records/interface/MuonGeometryRecord.h"

#include "DataFormats/DTDigi/interface/DTLocalTriggerCollection.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
#include "DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTPhContainer.h"

#include <vector>
#include <string>
#include <map>

class DTGeometry;
class DTTrigGeomUtils;
class DTChamberId;
class DTRecSegment4D;
class L1MuDTChambPhDigi;
class L1MuDTChambThDigi;
class L1Phase2MuDTPhDigi;
class DTTPGCompareUnit;
class DTTimeEvolutionHisto;

class DTLocalTriggerBaseTask : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
  friend class DTMonitorModule;

public:
  /// Constructor
  DTLocalTriggerBaseTask(const edm::ParameterSet& ps);

  /// Destructor
  ~DTLocalTriggerBaseTask() override;

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

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

  /// To reset the MEs
  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override;

  /// Perform trend plot operations
  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) override;

private:
  /// Run analysis on TM data
  void runTMAnalysis(std::vector<L1MuDTChambPhDigi> const* phInTrigs,
                     std::vector<L1MuDTChambPhDigi> const* phOutTrigs,
                     std::vector<L1MuDTChambThDigi> const* thTrigs);

  /// Run analysis on Phase2 readout for SliceTest
  void runAB7Analysis(std::vector<L1Phase2MuDTPhDigi> const* phTrigs);

  /// Get the Top folder (different between Physics and TP and TM)
  std::string& topFolder(std::string const& type) { return m_baseFolder[type == "TM"]; }

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

  /// Book the histograms
  void bookHistos(DQMStore::IBooker&, const DTChamberId& chamb);

  /// Book the histograms
  void bookHistos(DQMStore::IBooker&, int wh);

  /// Set Quality labels
  void setQLabels(MonitorElement* me, short int iaxis);
  void setQLabelsTheta(MonitorElement* me, short int iaxis);
  void setQLabelsPh2(MonitorElement* me, short int iaxis);

  int m_nEvents;
  int m_nEventsInLS;
  int m_nLumis;

  std::string m_baseFolder[2];
  bool m_tpMode;
  bool m_detailedAnalysis;

  bool m_processTM;
  bool m_processAB7;

  int m_targetBXTM;
  int m_bestAccRange;

  edm::ParameterSet m_params;
  DTTrigGeomUtils* m_trigGeomUtils;
  edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
  const DTGeometry* geom;

  std::vector<std::string> m_types;

  std::map<uint32_t, DTTPGCompareUnit> m_compMapIn;
  std::map<uint32_t, DTTPGCompareUnit> m_compMapOut;
  std::map<uint32_t, std::map<std::string, MonitorElement*> > m_chamberHistos;
  std::map<uint32_t, DTTimeEvolutionHisto*> m_trendHistos;
  MonitorElement* m_nEventMonitor;

  edm::EDGetTokenT<L1MuDTChambPhContainer> m_tm_phiIn_Token;
  edm::EDGetTokenT<L1MuDTChambPhContainer> m_tm_phiOut_Token;
  edm::EDGetTokenT<L1MuDTChambThContainer> m_tm_theta_Token;
  edm::EDGetTokenT<L1Phase2MuDTPhContainer> m_ab7_phi_Token;
};

#endif

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