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 
58 #include "TRegexp.h"
59 #include "TString.h"
60 
61 #include <iostream>
62 #include <fstream>
63 #include <utility>
64 #include <vector>
65 
66 using namespace reco;
67 using namespace trigger;
68 using namespace edm;
69 using namespace std;
70 
71 //
72 // helper class to manage GMT-Muon pariring
73 //
74 
75 class MuonGmtPair {
76 
77  public :
78 
80  m_muon(muon), m_gmt(gmt), m_eta(999.), m_phi_bar(999.), m_phi_end(999.) { };
81 
82  MuonGmtPair(const MuonGmtPair& muonGmtPair);
83 
84  ~MuonGmtPair() { };
85 
86  double dR();
87 
88  double eta() const { return m_eta; };
89  double phi() const { return fabs(m_eta)< 1.04 ? m_phi_bar : m_phi_end; };
90  double pt() const { return m_muon->isGlobalMuon() ? m_muon->globalTrack()->pt() : -1; };
91 
92  double gmtPt() const { return m_gmt ? m_gmt->ptValue() : -1.; };
93 
94  void propagate(edm::ESHandle<MagneticField> bField,
95  edm::ESHandle<Propagator> propagatorAlong,
96  edm::ESHandle<Propagator> propagatorOpposite);
97 
98 private :
99 
100  // propagation private members
101  TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho);
102  TrajectoryStateOnSurface surfExtrapTrkSam(reco::TrackRef track, double z);
103  FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track);
104 
105 private :
106 
109 
113 
114  double m_eta;
115  double m_phi_bar;
116  double m_phi_end;
117 
118 };
119 
120 //
121 // DQM class declaration
122 //
123 
125 
126 public:
127 
128  L1TEfficiencyMuons_Offline(const edm::ParameterSet& ps); // Constructor
129  virtual ~L1TEfficiencyMuons_Offline(); // Destructor
130 
131 protected:
132 
133  // Event
134  void analyze (const edm::Event& e, const edm::EventSetup& c);
135 
136  // Job
137  void beginJob();
138  void endJob ();
139 
140  // Run
141  void beginRun(const edm::Run& run, const edm::EventSetup& iSetup);
142  void endRun (const edm::Run& run, const edm::EventSetup& iSetup);
143 
144  // Luminosity Block
145  virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
146  virtual void endLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
147 
148 private:
149 
150  // Booking
151  void bookControlHistos();
152  void bookEfficiencyHistos(int ptCut);
153 
154  // Helper Functions
156  bool matchHlt(edm::Handle<trigger::TriggerEvent> & triggerEvent,
157  const reco::Muon * mu);
158 
159  // Cut and Matching
160  void getMuonGmtPairs(edm::Handle<L1MuGMTReadoutCollection> & gmtCands);
161  void getTightMuons(edm::Handle<reco::MuonCollection> & muons, const reco::Vertex & vertex);
162  void getProbeMuons(edm::Handle<edm::TriggerResults> & trigResults,edm::Handle<trigger::TriggerEvent> & trigEvent);
163 
164 private:
165 
166  bool m_verbose;
167  DQMStore* dbe; // The DQM Service Handle
168 
170 
174 
175  // histos
176  std::map<int, std::map<std::string, MonitorElement*> > m_EfficiencyHistos;
177  std::map<std::string, MonitorElement*> m_ControlHistos;
178 
179  // helper variables
180  std::vector<const reco::Muon*> m_TightMuons;
181  std::vector<const reco::Muon*> m_ProbeMuons;
182  std::vector<MuonGmtPair> m_MuonGmtPairs;
183 
184  // config params
185  std::vector<int> m_GmtPtCuts;
186 
189 
192 
196  std::vector<std::string> m_trigNames;
197  std::vector<int> m_trigIndices;
198 
202  // CB ignored at present
203  // float m_MinMuonDR;
204 
205 };
206 
207 #endif
std::vector< std::string > m_trigNames
edm::EDGetTokenT< edm::TriggerResults > m_trigProcess_token
edm::EDGetTokenT< BeamSpot > m_BsInputTag
edm::EDGetTokenT< L1MuGMTReadoutCollection > m_GmtInputTag
MuonGmtPair(const reco::Muon *muon, const L1MuGMTExtendedCand *gmt)
edm::ESHandle< Propagator > m_propagatorOpposite
edm::ESHandle< Propagator > m_propagatorAlong
edm::EDGetTokenT< trigger::TriggerEvent > m_trigInputTag
std::vector< MuonGmtPair > m_MuonGmtPairs
double gmtPt() const
edm::ESHandle< Propagator > m_propagatorAlong
edm::ESHandle< Propagator > m_propagatorOpposite
Definition: DDAxes.h:10
float float float z
const L1MuGMTExtendedCand * m_gmt
void beginJob()
Definition: Breakpoints.cc:15
edm::ESHandle< MagneticField > m_BField
std::vector< const reco::Muon * > m_ProbeMuons
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
const reco::Muon * m_muon
const int mu
Definition: Constants.h:22
std::map< std::string, MonitorElement * > m_ControlHistos
std::vector< const reco::Muon * > m_TightMuons
edm::ESHandle< MagneticField > m_BField
tuple muons
Definition: patZpeak.py:38
edm::EDGetTokenT< reco::MuonCollection > m_MuonInputTag
Definition: Run.h:41
edm::EDGetTokenT< VertexCollection > m_VtxInputTag