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 using namespace reco;
69 using namespace trigger;
70 using namespace edm;
71 using namespace std;
72 
73 //
74 // helper class to manage GMT-Muon pariring
75 //
76 
77 class MuonGmtPair {
78 
79  public :
80 
82  m_muon(muon), m_gmt(gmt), m_eta(999.), m_phi_bar(999.), m_phi_end(999.) { };
83 
84  MuonGmtPair(const MuonGmtPair& muonGmtPair);
85 
86  ~MuonGmtPair() { };
87 
88  double dR();
89 
90  double eta() const { return m_eta; };
91  double phi() const { return fabs(m_eta)< 1.04 ? m_phi_bar : m_phi_end; };
92  double pt() const { return m_muon->isGlobalMuon() ? m_muon->globalTrack()->pt() : -1; };
93 
94  double gmtPt() const { return m_gmt ? m_gmt->ptValue() : -1.; };
95 
96  void propagate(edm::ESHandle<MagneticField> bField,
99 
100 private :
101 
102  // propagation private members
103  TrajectoryStateOnSurface cylExtrapTrkSam(reco::TrackRef track, double rho);
104  TrajectoryStateOnSurface surfExtrapTrkSam(reco::TrackRef track, double z);
105  FreeTrajectoryState freeTrajStateMuon(reco::TrackRef track);
106 
107 private :
108 
111 
115 
116  double m_eta;
117  double m_phi_bar;
118  double m_phi_end;
119 
120 };
121 
122 //
123 // DQM class declaration
124 //
125 
127 
128 public:
129 
130  L1TEfficiencyMuons_Offline(const edm::ParameterSet& ps); // Constructor
131  virtual ~L1TEfficiencyMuons_Offline(); // Destructor
132 
133 protected:
134 
135  // Luminosity Block
136  virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
137  virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& c);
138  virtual void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup);
139  virtual void bookControlHistos(DQMStore::IBooker &);
140  virtual void bookEfficiencyHistos(DQMStore::IBooker &ibooker, int ptCut);
141  virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run& run, const edm::EventSetup& iSetup) override;
142  //virtual void analyze (const edm::Event& e, const edm::EventSetup& c);
143 
144 private:
145 
146  void analyze (const edm::Event& e, const edm::EventSetup& c);
147 
148  // Helper Functions
150  bool matchHlt(edm::Handle<trigger::TriggerEvent> & triggerEvent,
151  const reco::Muon * mu);
152 
153  // Cut and Matching
154  void getMuonGmtPairs(edm::Handle<L1MuGMTReadoutCollection> & gmtCands);
155  void getTightMuons(edm::Handle<reco::MuonCollection> & muons, const reco::Vertex & vertex);
156  void getProbeMuons(edm::Handle<edm::TriggerResults> & trigResults,edm::Handle<trigger::TriggerEvent> & trigEvent);
157 
158 private:
159 
160  bool m_verbose;
161 
163 
167 
168  // histos
169  std::map<int, std::map<std::string, MonitorElement*> > m_EfficiencyHistos;
170  std::map<std::string, MonitorElement*> m_ControlHistos;
171 
172  // helper variables
173  std::vector<const reco::Muon*> m_TightMuons;
174  std::vector<const reco::Muon*> m_ProbeMuons;
175  std::vector<MuonGmtPair> m_MuonGmtPairs;
176 
177  // config params
178  std::vector<int> m_GmtPtCuts;
179 
182 
185 
189  std::vector<std::string> m_trigNames;
190  std::vector<int> m_trigIndices;
191 
195  // CB ignored at present
196  // float m_MinMuonDR;
197 
198 };
199 
200 #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
void bookHistograms(fwlite::EventContainer &eventCont)
const L1MuGMTExtendedCand * m_gmt
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