CMS 3D CMS Logo

L1TMuonDQMOffline.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_L1TRIGGER_L1TMUONDQMOFFLINE_H
2 #define DQMOFFLINE_L1TRIGGER_L1TMUONDQMOFFLINE_H
3 
13 // system include files
14 #include <memory>
15 #include <unistd.h>
16 
17 // user include files
57 
58 #include "TRegexp.h"
59 #include "TString.h"
60 #include <iostream>
61 #include <fstream>
62 #include <utility>
63 #include <vector>
64 
65 //
66 // helper class to manage GMT-Muon pairing
67 //
68 
69 class MuonGmtPair {
70  public :
71  MuonGmtPair(const reco::Muon *muon, const l1t::Muon *regMu) :
72  m_muon(muon), m_regMu(regMu), m_eta(999.), m_phi_bar(999.), m_phi_end(999.) { };
73  MuonGmtPair(const MuonGmtPair& muonGmtPair);
74 
75  ~MuonGmtPair() { };
76 
77  double dR();
78  double eta() const { return m_muon->eta(); };
79  double phi() const { return m_muon->phi(); };
80  double pt() const { return m_muon->pt(); };
81  double gmtPt() const { return m_regMu ? m_regMu->pt() : -1.; };
82  int gmtQual() const { return m_regMu ? m_regMu->hwQual() : -1; };
83  double gmtPhi() const { return m_regMu ? m_regMu->phi() : -5.; };
84  double gmtEta() const { return m_regMu ? m_regMu->eta() : -5.; };
85 
89 
90  private :
91  // propagation private members
95 
96  private :
99 
103 
104  double m_eta;
105  double m_phi_bar;
106  double m_phi_end;
107 };
108 
109 //
110 // DQM class declaration
111 //
112 
114  public:
116  virtual ~L1TMuonDQMOffline();
117 
118  protected:
119  // Luminosity Block
120  virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
121  virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
122  virtual void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
123  virtual void bookControlHistos(DQMStore::IBooker &);
124  virtual void bookEfficiencyHistos(DQMStore::IBooker &ibooker, int ptCut);
125  virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;
126  //virtual void analyze (const edm::Event& e, const edm::EventSetup& c);
127 
128  private:
129  void analyze (const edm::Event& e, const edm::EventSetup& c) override;
130 
131  // Helper Functions
133  bool matchHlt(edm::Handle<trigger::TriggerEvent> & triggerEvent, const reco::Muon * mu);
134 
135  // Cut and Matching
136  void getMuonGmtPairs(edm::Handle<l1t::MuonBxCollection> & gmtCands);
137  void getTightMuons(edm::Handle<reco::MuonCollection> & muons, const reco::Vertex & vertex);
138  void getProbeMuons(edm::Handle<edm::TriggerResults> & trigResults,edm::Handle<trigger::TriggerEvent> & trigEvent);
139 
140  private:
142 
146 
147  // histos
148  std::map<int, std::map<std::string, MonitorElement*> > m_EfficiencyHistos;
149  std::map<std::string, MonitorElement*> m_ControlHistos;
150 
151  // helper variables
152  std::vector<const reco::Muon*> m_TightMuons;
153  std::vector<const reco::Muon*> m_ProbeMuons;
154  std::vector<MuonGmtPair> m_MuonGmtPairs;
155 
156  std::vector<reco::MuonCollection> m_RecoMuons;
157  std::vector<l1t::MuonBxCollection> m_L1tMuons;
158  std::vector<reco::Muon> m_RecoRecoMuons;
160 
161  // config params
162  bool m_verbose;
164  std::vector<int> m_GmtPtCuts;
172  std::vector<std::string> m_trigNames;
173  std::vector<double> m_effVsPtBins;
174  std::vector<double> m_effVsPhiBins;
175  std::vector<double> m_effVsEtaBins;
176 
177  std::vector<int> m_trigIndices;
178 
182 
183  // CB ignored at present
184  // float m_MinMuonDR;
185 };
186 
187 #endif
virtual double pt() const final
transverse momentum
edm::ESHandle< Propagator > m_propagatorOpposite
edm::EDGetTokenT< reco::BeamSpot > m_BsInputTag
edm::ESHandle< Propagator > m_propagatorOpposite
edm::ESHandle< Propagator > m_propagatorAlong
edm::EDGetTokenT< reco::MuonCollection > m_MuonInputTag
edm::EDGetTokenT< edm::TriggerResults > m_trigProcess_token
virtual double eta() const final
momentum pseudorapidity
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
double gmtPt() const
std::vector< double > m_effVsPhiBins
std::string m_HistFolder
void bookHistograms(fwlite::EventContainer &eventCont)
std::vector< const reco::Muon * > m_ProbeMuons
std::vector< std::string > m_trigNames
edm::ESHandle< MagneticField > m_BField
std::string m_trigProcess
virtual double phi() const final
momentum azimuthal angle
const l1t::Muon * m_regMu
std::vector< reco::Muon > m_RecoRecoMuons
edm::EDGetTokenT< l1t::MuonBxCollection > m_GmtInputTag
double phi() const
std::vector< double > m_effVsPtBins
double gmtPhi() const
TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho)
const reco::Muon * m_muon
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
const int mu
Definition: Constants.h:22
std::vector< MuonGmtPair > m_MuonGmtPairs
int hwQual() const
Definition: L1Candidate.h:51
Definition: Muon.h:16
edm::ESHandle< MagneticField > m_BField
edm::ESHandle< Propagator > m_propagatorAlong
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track)
double eta() const
void propagate(edm::ESHandle< MagneticField > bField, edm::ESHandle< Propagator > propagatorAlong, edm::ESHandle< Propagator > propagatorOpposite)
TrajectoryStateOnSurface surfExtrapTrkSam(reco::TrackRef track, double z)
int gmtQual() const
std::vector< int > m_GmtPtCuts
HLTConfigProvider m_hltConfig
BXVector< l1t::Muon > m_L1tL1tMuons
MuonGmtPair(const reco::Muon *muon, const l1t::Muon *regMu)
double pt() const
std::vector< double > m_effVsEtaBins
std::vector< const reco::Muon * > m_TightMuons
std::vector< l1t::MuonBxCollection > m_L1tMuons
std::map< std::string, MonitorElement * > m_ControlHistos
edm::EDGetTokenT< reco::VertexCollection > m_VtxInputTag
double gmtEta() const
edm::EDGetTokenT< trigger::TriggerEvent > m_trigInputTag
std::vector< reco::MuonCollection > m_RecoMuons
std::vector< int > m_trigIndices
Definition: Run.h:42