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 pt() const { return m_muon->pt(); };
79  double eta() const { return m_muon->eta(); };
80  double phi() const { return m_muon->phi(); };
81  int charge() const {return m_muon->charge(); };
82  double gmtPt() const { return m_regMu ? m_regMu->pt() : -1.; };
83  double gmtEta() const { return m_regMu ? m_regMu->eta() : -5.; };
84  double gmtPhi() const { return m_regMu ? m_regMu->phi() : -5.; };
85  int gmtCharge() const {return m_regMu ? m_regMu->charge() : -5; };
86  int gmtQual() const { return m_regMu ? m_regMu->hwQual() : -1; };
87 
91 
92  private :
93  // propagation private members
97 
98  private :
101 
105 
106  double m_eta;
107  double m_phi_bar;
108  double m_phi_end;
109 };
110 
111 //
112 // DQM class declaration
113 //
114 
116  public:
118  ~L1TMuonDQMOffline() override;
119 
120  protected:
121  // Luminosity Block
122  void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c) override;
123  virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
124  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
125  virtual void bookControlHistos(DQMStore::IBooker &);
126  virtual void bookEfficiencyHistos(DQMStore::IBooker &ibooker, int ptCut);
127  virtual void bookResolutionHistos(DQMStore::IBooker &ibooker);
128  void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;
129  //virtual void analyze (const edm::Event& e, const edm::EventSetup& c);
130 
131  private:
132  void analyze (const edm::Event& e, const edm::EventSetup& c) override;
133 
134  // Helper Functions
136  bool matchHlt(edm::Handle<trigger::TriggerEvent> & triggerEvent, const reco::Muon * mu);
137 
138  // Cut and Matching
139  void getMuonGmtPairs(edm::Handle<l1t::MuonBxCollection> & gmtCands);
140  void getTightMuons(edm::Handle<reco::MuonCollection> & muons, const reco::Vertex & vertex);
141  void getProbeMuons(edm::Handle<edm::TriggerResults> & trigResults,edm::Handle<trigger::TriggerEvent> & trigEvent);
142 
143  private:
145 
149 
150  enum Resol
151  {
157 
163 
169 
175  };
176 
177  enum Control
178  {
182  };
183 
184  // histos
185  std::map<int, std::map<std::string, MonitorElement*> > m_EfficiencyHistos;
186  std::map<Resol, MonitorElement*> m_ResolutionHistos;
187  std::map<Control, MonitorElement*> m_ControlHistos;
188 
189  // helper variables
190  std::vector<const reco::Muon*> m_TightMuons;
191  std::vector<const reco::Muon*> m_ProbeMuons;
192  std::vector<MuonGmtPair> m_MuonGmtPairs;
193 
194  std::vector<reco::MuonCollection> m_RecoMuons;
195  std::vector<l1t::MuonBxCollection> m_L1tMuons;
196  std::vector<reco::Muon> m_RecoRecoMuons;
198 
199  // config params
200  bool m_verbose;
202  std::vector<int> m_GmtPtCuts;
203  double m_TagPtCut;
211  std::vector<std::string> m_trigNames;
212  std::vector<double> m_effVsPtBins;
213  std::vector<double> m_effVsPhiBins;
214  std::vector<double> m_effVsEtaBins;
215 
216  std::vector<int> m_trigIndices;
217 
221 
222  // CB ignored at present
223  // float m_MinMuonDR;
224 };
225 
226 #endif
edm::ESHandle< Propagator > m_propagatorOpposite
edm::EDGetTokenT< reco::BeamSpot > m_BsInputTag
double eta() const final
momentum pseudorapidity
edm::ESHandle< Propagator > m_propagatorOpposite
edm::ESHandle< Propagator > m_propagatorAlong
edm::EDGetTokenT< reco::MuonCollection > m_MuonInputTag
edm::EDGetTokenT< edm::TriggerResults > m_trigProcess_token
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
double gmtPt() const
std::vector< double > m_effVsPhiBins
double pt() const final
transverse momentum
int charge() const final
electric charge
Definition: LeafCandidate.h:91
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
int gmtCharge() const
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
int charge() const
std::vector< MuonGmtPair > m_MuonGmtPairs
int hwQual() const
Definition: L1Candidate.h:51
std::map< Resol, MonitorElement * > m_ResolutionHistos
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
edm::EDGetTokenT< reco::VertexCollection > m_VtxInputTag
double gmtEta() const
edm::EDGetTokenT< trigger::TriggerEvent > m_trigInputTag
std::vector< reco::MuonCollection > m_RecoMuons
double phi() const final
momentum azimuthal angle
std::map< Control, MonitorElement * > m_ControlHistos
std::vector< int > m_trigIndices
Definition: Run.h:43