CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TEfficiencyMuons_Offline.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYMUON_OFFLINE_H
2 #define DQMOFFLINE_L1TRIGGER_L1TEFFICIENCYMUON_OFFLINE_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 ~L1TEfficiencyMuons_Offline();
117 
118  protected:
119  // Luminosity Block
120  virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
121  virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
122  virtual void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup);
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);
130 
131  // Helper Functions
133  bool matchHlt(edm::Handle<trigger::TriggerEvent> & triggerEvent, const reco::Muon * mu);
134 
135  // Cut and Matching
139 
140  private:
141  bool m_verbose;
143 
147 
148  // histos
149  std::map<int, std::map<std::string, MonitorElement*> > m_EfficiencyHistos;
150  std::map<std::string, MonitorElement*> m_ControlHistos;
151 
152  // helper variables
153  std::vector<const reco::Muon*> m_TightMuons;
154  std::vector<const reco::Muon*> m_ProbeMuons;
155  std::vector<MuonGmtPair> m_MuonGmtPairs;
156 
157  std::vector<reco::MuonCollection> m_RecoMuons;
158  std::vector<l1t::MuonBxCollection> m_L1tMuons;
159  std::vector<reco::Muon> m_RecoRecoMuons;
161 
162  // config params
163  std::vector<int> m_GmtPtCuts;
171  std::vector<std::string> m_trigNames;
172  std::vector<int> m_trigIndices;
173 
177 
178  // CB ignored at present
179  // float m_MinMuonDR;
180 };
181 
182 #endif
std::vector< std::string > m_trigNames
edm::EDGetTokenT< edm::TriggerResults > m_trigProcess_token
edm::EDGetTokenT< l1t::MuonBxCollection > m_GmtInputTag
virtual void bookEfficiencyHistos(DQMStore::IBooker &ibooker, int ptCut)
void getTightMuons(edm::Handle< reco::MuonCollection > &muons, const reco::Vertex &vertex)
edm::ESHandle< Propagator > m_propagatorOpposite
void getMuonGmtPairs(edm::Handle< l1t::MuonBxCollection > &gmtCands)
edm::ESHandle< Propagator > m_propagatorAlong
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > &vertex, edm::Handle< reco::BeamSpot > &beamSpot)
edm::EDGetTokenT< trigger::TriggerEvent > m_trigInputTag
std::vector< MuonGmtPair > m_MuonGmtPairs
edm::EDGetTokenT< reco::BeamSpot > m_BsInputTag
double gmtPt() const
virtual void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
edm::ESHandle< Propagator > m_propagatorAlong
edm::ESHandle< Propagator > m_propagatorOpposite
virtual double phi() const final
momentum azimuthal angle
edm::ESHandle< MagneticField > m_BField
std::vector< const reco::Muon * > m_ProbeMuons
const l1t::Muon * m_regMu
virtual void dqmEndLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
double gmtPhi() const
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho)
const reco::Muon * m_muon
virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &iSetup) override
std::vector< l1t::MuonBxCollection > m_L1tMuons
std::vector< reco::Muon > m_RecoRecoMuons
L1TEfficiencyMuons_Offline(const edm::ParameterSet &ps)
const int mu
Definition: Constants.h:22
void getProbeMuons(edm::Handle< edm::TriggerResults > &trigResults, edm::Handle< trigger::TriggerEvent > &trigEvent)
int hwQual() const
Definition: L1Candidate.h:51
void analyze(const edm::Event &e, const edm::EventSetup &c)
std::map< std::string, MonitorElement * > m_ControlHistos
Definition: Muon.h:16
FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track)
void propagate(edm::ESHandle< MagneticField > bField, edm::ESHandle< Propagator > propagatorAlong, edm::ESHandle< Propagator > propagatorOpposite)
TrajectoryStateOnSurface surfExtrapTrkSam(reco::TrackRef track, double z)
virtual void bookControlHistos(DQMStore::IBooker &)
std::vector< const reco::Muon * > m_TightMuons
MuonGmtPair(const reco::Muon *muon, const l1t::Muon *regMu)
edm::ESHandle< MagneticField > m_BField
tuple muons
Definition: patZpeak.py:38
virtual void dqmBeginRun(const edm::Run &run, const edm::EventSetup &iSetup)
double gmtEta() const
virtual double eta() const final
momentum pseudorapidity
bool matchHlt(edm::Handle< trigger::TriggerEvent > &triggerEvent, const reco::Muon *mu)
edm::EDGetTokenT< reco::VertexCollection > m_VtxInputTag
edm::EDGetTokenT< reco::MuonCollection > m_MuonInputTag
Definition: Run.h:43
virtual double pt() const final
transverse momentum
std::vector< reco::MuonCollection > m_RecoMuons