DTLocalTriggerLutTask

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
#ifndef DTLocalTriggerLutTask_H
#define DTLocalTriggerLutTask_H

/*
 * \file DTLocalTriggerLutTask.h
 *
 * \author D. Fasanella - INFN Bologna
 *
*/

#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/DQMOneEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"

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

class DTGeometry;
class DTTrigGeomUtils;
class DTChamberId;
class L1MuDTChambPhDigi;

typedef std::array<std::array<std::array<int, 13>, 5>, 6> DTArr3int;
typedef std::array<std::array<std::array<int, 15>, 5>, 6> DTArr3bool;
typedef std::array<std::array<std::array<const L1MuDTChambPhDigi*, 15>, 5>, 6> DTArr3Digi;

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

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

  /// Destructor
  ~DTLocalTriggerLutTask() override;

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

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

  /// Find best (highest qual) TM trigger segments
  void searchTMBestIn(std::vector<L1MuDTChambPhDigi> const* trigs);
  void searchTMBestOut(std::vector<L1MuDTChambPhDigi> const* trigs);

  /// 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;
  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& context) final {}

  const int wheelArrayShift = 3;

private:
  /// Get the top folder
  std::string& topFolder() { return baseFolder; }

  /// Book histos
  void bookHistos(DQMStore::IBooker& ibooker, DTChamberId chId);

private:
  int nEvents;
  int nLumis;
  int nPhiBins, nPhibBins;
  double rangePhi, rangePhiB;

  std::string baseFolder;
  bool detailedAnalysis;
  bool overUnderIn;

  edm::EDGetTokenT<L1MuDTChambPhContainer> tm_TokenIn_;
  edm::EDGetTokenT<L1MuDTChambPhContainer> tm_TokenOut_;
  edm::EDGetTokenT<DTRecSegment4DCollection> seg_Token_;

  DTArr3int trigQualBestIn;
  DTArr3int trigQualBestOut;
  DTArr3Digi trigBestIn;
  DTArr3Digi trigBestOut;
  DTArr3bool track_ok;  // CB controlla se serve

  edm::ParameterSet parameters;
  edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
  const DTGeometry* muonGeom;
  DTTrigGeomUtils* trigGeomUtils;

  std::map<uint32_t, std::map<std::string, MonitorElement*> > chHistos;
  std::map<int, std::map<std::string, MonitorElement*> > whHistos;
};

#endif

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