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 
11 // system include files
12 #include <memory>
13 #include <unistd.h>
14 
15 // user include files
22 
24 
29 
31 
34 
45 
47 
51 
57 
59 
60 #include "TRegexp.h"
61 #include "TString.h"
62 
63 #include <iostream>
64 #include <fstream>
65 #include <utility>
66 #include <vector>
67 
68 
69 //
70 // helper class to manage GMT-Muon pariring
71 //
72 
73 class MuonGmtPair {
74 
75  public :
76 
78  m_muon(muon), m_gmt(gmt), m_eta(999.), m_phi_bar(999.), m_phi_end(999.) { };
79 
80  MuonGmtPair(const MuonGmtPair& muonGmtPair);
81 
82  ~MuonGmtPair() { };
83 
84  double dR();
85 
86  double eta() const { return m_eta; };
87  double phi() const { return fabs(m_eta)< 1.04 ? m_phi_bar : m_phi_end; };
88  double pt() const { return m_muon->isGlobalMuon() ? m_muon->globalTrack()->pt() : -1; };
89 
90  double gmtPt() const { return m_gmt ? m_gmt->ptValue() : -1.; };
91 
95 
96 private :
97 
98  // propagation private members
102 
103 private :
104 
107 
111 
112  double m_eta;
113  double m_phi_bar;
114  double m_phi_end;
115 
116 };
117 
118 //
119 // DQM class declaration
120 //
121 
123 
124 public:
125 
126  L1TEfficiencyMuons_Offline(const edm::ParameterSet& ps); // Constructor
127  virtual ~L1TEfficiencyMuons_Offline(); // Destructor
128 
129 protected:
130 
131  // Luminosity Block
132  virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
133  virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
134  virtual void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup);
135  virtual void bookControlHistos(DQMStore::IBooker &);
136  virtual void bookEfficiencyHistos(DQMStore::IBooker &ibooker, int ptCut);
137  virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;
138  //virtual void analyze (const edm::Event& e, const edm::EventSetup& c);
139 
140 private:
141 
142  void analyze (const edm::Event& e, const edm::EventSetup& c);
143 
144  // Helper Functions
146  bool matchHlt(edm::Handle<trigger::TriggerEvent> & triggerEvent,
147  const reco::Muon * mu);
148 
149  // Cut and Matching
153 
154 private:
155 
156  bool m_verbose;
157 
159 
163 
164  // histos
165  std::map<int, std::map<std::string, MonitorElement*> > m_EfficiencyHistos;
166  std::map<std::string, MonitorElement*> m_ControlHistos;
167 
168  // helper variables
169  std::vector<const reco::Muon*> m_TightMuons;
170  std::vector<const reco::Muon*> m_ProbeMuons;
171  std::vector<MuonGmtPair> m_MuonGmtPairs;
172 
173  // config params
174  std::vector<int> m_GmtPtCuts;
175 
178 
181 
185  std::vector<std::string> m_trigNames;
186  std::vector<int> m_trigIndices;
187 
191  // CB ignored at present
192  // float m_MinMuonDR;
193 
194 };
195 
196 #endif
std::vector< std::string > m_trigNames
edm::EDGetTokenT< edm::TriggerResults > m_trigProcess_token
edm::EDGetTokenT< L1MuGMTReadoutCollection > m_GmtInputTag
virtual void bookEfficiencyHistos(DQMStore::IBooker &ibooker, int ptCut)
MuonGmtPair(const reco::Muon *muon, const L1MuGMTExtendedCand *gmt)
void getTightMuons(edm::Handle< reco::MuonCollection > &muons, const reco::Vertex &vertex)
edm::ESHandle< Propagator > m_propagatorOpposite
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
bool isGlobalMuon() const
Definition: Muon.h:222
const L1MuGMTExtendedCand * m_gmt
edm::ESHandle< MagneticField > m_BField
std::vector< const reco::Muon * > m_ProbeMuons
virtual void dqmEndLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
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
L1TEfficiencyMuons_Offline(const edm::ParameterSet &ps)
void getMuonGmtPairs(edm::Handle< L1MuGMTReadoutCollection > &gmtCands)
const int mu
Definition: Constants.h:22
void getProbeMuons(edm::Handle< edm::TriggerResults > &trigResults, edm::Handle< trigger::TriggerEvent > &trigEvent)
void analyze(const edm::Event &e, const edm::EventSetup &c)
std::map< std::string, MonitorElement * > m_ControlHistos
float ptValue() const
Definition: L1MuGMTCand.cc:128
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
edm::ESHandle< MagneticField > m_BField
tuple muons
Definition: patZpeak.py:38
virtual void dqmBeginRun(const edm::Run &run, const edm::EventSetup &iSetup)
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 TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:54