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 
4 /*
5  * \file L1TEfficiencyMuons.h
6  *
7  * $Date: 2013/03/18 17:17:52 $
8  * $Revision: 1.2 $
9  * \author J. Pela, C. Battilana
10  *
11  */
12 
13 // system include files
14 #include <memory>
15 #include <unistd.h>
16 
17 // user include files
24 
26 
31 
33 
36 
47 
49 
53 
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 
93  edm::ESHandle<Propagator> propagatorAlong,
94  edm::ESHandle<Propagator> propagatorOpposite);
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  // Event
132  void analyze (const edm::Event& e, const edm::EventSetup& c);
133 
134  // Job
135  void beginJob();
136  void endJob ();
137 
138  // Run
139  void beginRun(const edm::Run& run, const edm::EventSetup& iSetup);
140  void endRun (const edm::Run& run, const edm::EventSetup& iSetup);
141 
142  // Luminosity Block
143  virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
144  virtual void endLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
145 
146 private:
147 
148  // Booking
149  void bookControlHistos();
150  void bookEfficiencyHistos(int ptCut);
151 
152  // Helper Functions
154  bool matchHlt(edm::Handle<trigger::TriggerEvent> & triggerEvent,
155  const reco::Muon * mu);
156 
157  // Cut and Matching
161 
162 private:
163 
164  bool m_verbose;
165  DQMStore* dbe; // The DQM Service Handle
166 
168 
172 
173  // histos
174  std::map<int, std::map<std::string, MonitorElement*> > m_EfficiencyHistos;
175  std::map<std::string, MonitorElement*> m_ControlHistos;
176 
177  // helper variables
178  std::vector<const reco::Muon*> m_TightMuons;
179  std::vector<const reco::Muon*> m_ProbeMuons;
180  std::vector<MuonGmtPair> m_MuonGmtPairs;
181 
182  // config params
183  std::vector<int> m_GmtPtCuts;
184 
187 
190 
193  std::vector<std::string> m_trigNames;
194  std::vector<int> m_trigIndices;
195 
199  // CB ignored at present
200  // float m_MinMuonDR;
201 
202 };
203 
204 #endif
std::vector< std::string > m_trigNames
MuonGmtPair(const reco::Muon *muon, const L1MuGMTExtendedCand *gmt)
void getTightMuons(edm::Handle< reco::MuonCollection > &muons, const reco::Vertex &vertex)
virtual void endLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
edm::ESHandle< Propagator > m_propagatorOpposite
edm::ESHandle< Propagator > m_propagatorAlong
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > &vertex, edm::Handle< reco::BeamSpot > &beamSpot)
std::vector< MuonGmtPair > m_MuonGmtPairs
double gmtPt() const
virtual void beginLuminosityBlock(edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
edm::ESHandle< Propagator > m_propagatorAlong
edm::ESHandle< Propagator > m_propagatorOpposite
Definition: DDAxes.h:10
bool isGlobalMuon() const
Definition: Muon.h:219
float float float z
const L1MuGMTExtendedCand * m_gmt
edm::ESHandle< MagneticField > m_BField
void beginRun(const edm::Run &run, const edm::EventSetup &iSetup)
std::vector< const reco::Muon * > m_ProbeMuons
std::map< int, std::map< std::string, MonitorElement * > > m_EfficiencyHistos
TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho)
const reco::Muon * m_muon
L1TEfficiencyMuons_Offline(const edm::ParameterSet &ps)
void getMuonGmtPairs(edm::Handle< L1MuGMTReadoutCollection > &gmtCands)
const int mu
Definition: Constants.h:23
void getProbeMuons(edm::Handle< edm::TriggerResults > &trigResults, edm::Handle< trigger::TriggerEvent > &trigEvent)
void endRun(const edm::Run &run, const edm::EventSetup &iSetup)
void analyze(const edm::Event &e, const edm::EventSetup &c)
std::map< std::string, MonitorElement * > m_ControlHistos
float ptValue() const
Definition: L1MuGMTCand.cc:130
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)
std::vector< const reco::Muon * > m_TightMuons
edm::ESHandle< MagneticField > m_BField
tuple muons
Definition: patZpeak.py:38
bool matchHlt(edm::Handle< trigger::TriggerEvent > &triggerEvent, const reco::Muon *mu)
Definition: Run.h:36
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:55