CMS 3D CMS Logo

RecoMuonValidator.cc
Go to the documentation of this file.
2 
4 
7 //#include "DQMServices/Core/interface/DQMStore.h"
8 
12 
13 // for selection cut
15 
16 #include "TMath.h"
17 
18 using namespace std;
19 using namespace edm;
20 using namespace reco;
21 
24 
25 //
26 //Struct containing all histograms definitions
27 //
29  typedef MonitorElement* MEP;
30 
31  //general kinematics
32  MEP hSimP_, hSimPt_, hSimEta_, hSimPhi_, hSimDxy_, hSimDz_;
33  //only for efficiencies
34  MEP hP_, hPt_, hEta_, hPhi_;
35  MEP hNSim_, hNMuon_;
36 
37  //misc vars
38  MEP hNTrks_, hNTrksEta_, hNTrksPt_;
39  MEP hMisQPt_, hMisQEta_;
40 
41  //resolutions
42  MEP hErrP_, hErrPt_, hErrEta_, hErrPhi_;
43  MEP hErrPBarrel_, hErrPOverlap_, hErrPEndcap_;
44  MEP hErrPtBarrel_, hErrPtOverlap_, hErrPtEndcap_;
45  MEP hErrDxy_, hErrDz_;
46 
47  MEP hErrP_vs_Eta_, hErrPt_vs_Eta_, hErrQPt_vs_Eta_;
48  MEP hErrP_vs_P_, hErrPt_vs_Pt_, hErrQPt_vs_Pt_, hErrEta_vs_Eta_;
49 
50  //PF-RECO event-by-event comparisons
57 
58  //hit pattern
60  MEP hNSimToReco_, hNRecoToSim_;
61 
62  MEP hNHits_, hNLostHits_, hNTrackerHits_, hNMuonHits_;
63  MEP hNHits_vs_Pt_, hNHits_vs_Eta_;
64  MEP hNLostHits_vs_Pt_, hNLostHits_vs_Eta_;
65  MEP hNTrackerHits_vs_Pt_, hNTrackerHits_vs_Eta_;
66  MEP hNMuonHits_vs_Pt_, hNMuonHits_vs_Eta_;
67 
68  //pulls
69  MEP hPullPt_, hPullEta_, hPullPhi_, hPullQPt_, hPullDxy_, hPullDz_;
70  MEP hPullPt_vs_Eta_, hPullPt_vs_Pt_, hPullEta_vs_Eta_, hPullPhi_vs_Eta_, hPullEta_vs_Pt_;
71 
72  //chi2, ndof
73  MEP hNDof_, hChi2_, hChi2Norm_, hChi2Prob_;
74  MEP hNDof_vs_Eta_, hChi2_vs_Eta_, hChi2Norm_vs_Eta_, hChi2Prob_vs_Eta_;
75 
76  bool doAbsEta_;
77  bool usePFMuon_;
78 
79  //
80  //books histograms
81  //
82  void bookHistos(DQMStore::IBooker& ibooker, const string& dirName, const HistoDimensions& hDim)
83 
84  {
85  ibooker.cd();
86  ibooker.setCurrentFolder(dirName);
87 
88  doAbsEta_ = hDim.doAbsEta;
89  usePFMuon_ = hDim.usePFMuon;
90 
91  //histograms for efficiency plots
92  hP_ = ibooker.book1D("P", "p of recoTracks", hDim.nBinP, hDim.minP, hDim.maxP);
93  hPt_ = ibooker.book1D("Pt", "p_{T} of recoTracks", hDim.nBinPt, hDim.minPt, hDim.maxPt);
94  hEta_ = ibooker.book1D("Eta", "#eta of recoTracks", hDim.nBinEta, hDim.minEta, hDim.maxEta);
95  hPhi_ = ibooker.book1D("Phi", "#phi of recoTracks", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
96 
97  hSimP_ = ibooker.book1D("SimP", "p of simTracks", hDim.nBinP, hDim.minP, hDim.maxP);
98  hSimPt_ = ibooker.book1D("SimPt", "p_{T} of simTracks", hDim.nBinPt, hDim.minPt, hDim.maxPt);
99  hSimEta_ = ibooker.book1D("SimEta", "#eta of simTracks", hDim.nBinEta, hDim.minEta, hDim.maxEta);
100  hSimPhi_ = ibooker.book1D("SimPhi", "#phi of simTracks", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
101  hSimDxy_ = ibooker.book1D("SimDxy", "Dxy of simTracks", hDim.nBinDxy, hDim.minDxy, hDim.maxDxy);
102  hSimDz_ = ibooker.book1D("Dz", "Dz of simTracks", hDim.nBinDz, hDim.minDz, hDim.maxDz);
103 
104  //track multiplicities
105  hNSim_ = ibooker.book1D("NSim", "Number of particles per event", hDim.nTrks, -0.5, hDim.nTrks + 0.5);
106  hNMuon_ = ibooker.book1D("NMuon", "Number of muons per event", hDim.nTrks, -0.5, hDim.nTrks + 0.5);
107 
108  // - Misc. variables
109  hNTrks_ = ibooker.book1D("NTrks", "Number of reco tracks per event", hDim.nTrks, -0.5, hDim.nTrks + 0.5);
110  hNTrksEta_ = ibooker.book1D("NTrksEta", "Number of reco tracks vs #eta", hDim.nBinEta, hDim.minEta, hDim.maxEta);
111  hNTrksPt_ = ibooker.book1D("NTrksPt", "Number of reco tracks vs p_{T}", hDim.nBinPt, hDim.minPt, hDim.maxPt);
112 
113  hMisQPt_ = ibooker.book1D("MisQPt", "Charge mis-id vs Pt", hDim.nBinPt, hDim.minPt, hDim.maxPt);
114  hMisQEta_ = ibooker.book1D("MisQEta", "Charge mis-id vs Eta", hDim.nBinEta, hDim.minEta, hDim.maxEta);
115 
116  // - Resolutions
117  hErrP_ = ibooker.book1D("ErrP", "#Delta(p)/p", hDim.nBinErr, hDim.minErrP, hDim.maxErrP);
118  hErrPBarrel_ = ibooker.book1D("ErrP_barrel", "#Delta(p)/p", hDim.nBinErr, hDim.minErrP, hDim.maxErrP);
119  hErrPOverlap_ = ibooker.book1D("ErrP_overlap", "#Delta(p)/p", hDim.nBinErr, hDim.minErrP, hDim.maxErrP);
120  hErrPEndcap_ = ibooker.book1D("ErrP_endcap", "#Delta(p)/p", hDim.nBinErr, hDim.minErrP, hDim.maxErrP);
121  hErrPt_ = ibooker.book1D("ErrPt", "#Delta(p_{T})/p_{T}", hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
122  hErrPtBarrel_ = ibooker.book1D("ErrPt_barrel", "#Delta(p_{T})/p_{T}", hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
123  hErrPtOverlap_ = ibooker.book1D("ErrPt_overlap", "#Delta(p_{T})/p_{T}", hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
124  hErrPtEndcap_ = ibooker.book1D("ErrPt_endcap", "#Delta(p_{T})/p_{T}", hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
125  hErrEta_ = ibooker.book1D("ErrEta", "#sigma(#eta))", hDim.nBinErr, hDim.minErrEta, hDim.maxErrEta);
126  hErrPhi_ = ibooker.book1D("ErrPhi", "#sigma(#phi)", hDim.nBinErr, hDim.minErrPhi, hDim.maxErrPhi);
127  hErrDxy_ = ibooker.book1D("ErrDxy", "#sigma(d_{xy})", hDim.nBinErr, hDim.minErrDxy, hDim.maxErrDxy);
128  hErrDz_ = ibooker.book1D("ErrDz", "#sigma(d_{z})", hDim.nBinErr, hDim.minErrDz, hDim.maxErrDz);
129 
130  //PF-RECO comparisons
131  if (usePFMuon_) {
132  hErrPt_PF_ = ibooker.book1D("ErrPt_PF", "#Delta(p_{T})|_{PF}/p_{T}", hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
133  hErrQPt_PF_ =
134  ibooker.book1D("ErrQPt_PF", "#Delta(q/p_{T})|_{PF}/(q/p_{T})", hDim.nBinErr, hDim.minErrQPt, hDim.maxErrQPt);
135 
136  hPFMomAssCorrectness =
137  ibooker.book1D("hPFMomAssCorrectness", "Corrected momentum assignement PF/RECO", 2, 0.5, 2.5);
138  hPt_vs_PFMomAssCorrectness = ibooker.book2D("hPt_vs_PFMomAssCorrectness",
139  "Corrected momentum assignement PF/RECO",
140  hDim.nBinPt,
141  hDim.minPt,
142  hDim.maxP,
143  2,
144  0.5,
145  2.5);
146 
147  hdPt_vs_Pt_ = ibooker.book2D("dPt_vs_Pt",
148  "#Delta(p_{T}) vs p_{T}",
149  hDim.nBinPt,
150  hDim.minPt,
151  hDim.maxPt,
152  hDim.nBinErr,
153  hDim.minErrPt,
154  hDim.maxErrPt);
155  hdPt_vs_Eta_ = ibooker.book2D("dPt_vs_Eta",
156  "#Delta(p_{T}) vs #eta",
157  hDim.nBinEta,
158  hDim.minEta,
159  hDim.maxEta,
160  hDim.nBinErr,
161  hDim.minErrPt,
162  hDim.maxErrPt);
163  }
164 
165  // -- Resolutions vs Eta
166  hErrP_vs_Eta_ = ibooker.book2D("ErrP_vs_Eta",
167  "#Delta(p)/p vs #eta",
168  hDim.nBinEta,
169  hDim.minEta,
170  hDim.maxEta,
171  hDim.nBinErr,
172  hDim.minErrP,
173  hDim.maxErrP);
174  hErrPt_vs_Eta_ = ibooker.book2D("ErrPt_vs_Eta",
175  "#Delta(p_{T})/p_{T} vs #eta",
176  hDim.nBinEta,
177  hDim.minEta,
178  hDim.maxEta,
179  hDim.nBinErr,
180  hDim.minErrPt,
181  hDim.maxErrPt);
182  hErrQPt_vs_Eta_ = ibooker.book2D("ErrQPt_vs_Eta",
183  "#Delta(q/p_{T})/(q/p_{T}) vs #eta",
184  hDim.nBinEta,
185  hDim.minEta,
186  hDim.maxEta,
187  hDim.nBinErr,
188  hDim.minErrQPt,
189  hDim.maxErrQPt);
190  hErrEta_vs_Eta_ = ibooker.book2D("ErrEta_vs_Eta",
191  "#sigma(#eta) vs #eta",
192  hDim.nBinEta,
193  hDim.minEta,
194  hDim.maxEta,
195  hDim.nBinErr,
196  hDim.minErrEta,
197  hDim.maxErrEta);
198 
199  // -- Resolutions vs momentum
200  hErrP_vs_P_ = ibooker.book2D(
201  "ErrP_vs_P", "#Delta(p)/p vs p", hDim.nBinP, hDim.minP, hDim.maxP, hDim.nBinErr, hDim.minErrP, hDim.maxErrP);
202  hErrPt_vs_Pt_ = ibooker.book2D("ErrPt_vs_Pt",
203  "#Delta(p_{T})/p_{T} vs p_{T}",
204  hDim.nBinPt,
205  hDim.minPt,
206  hDim.maxPt,
207  hDim.nBinErr,
208  hDim.minErrPt,
209  hDim.maxErrPt);
210  hErrQPt_vs_Pt_ = ibooker.book2D("ErrQPt_vs_Pt",
211  "#Delta(q/p_{T})/(q/p_{T}) vs p_{T}",
212  hDim.nBinPt,
213  hDim.minPt,
214  hDim.maxPt,
215  hDim.nBinErr,
216  hDim.minErrQPt,
217  hDim.maxErrQPt);
218 
219  // - Pulls
220  hPullPt_ = ibooker.book1D("PullPt", "Pull(#p_{T})", hDim.nBinPull, -hDim.wPull, hDim.wPull);
221  hPullEta_ = ibooker.book1D("PullEta", "Pull(#eta)", hDim.nBinPull, -hDim.wPull, hDim.wPull);
222  hPullPhi_ = ibooker.book1D("PullPhi", "Pull(#phi)", hDim.nBinPull, -hDim.wPull, hDim.wPull);
223  hPullQPt_ = ibooker.book1D("PullQPt", "Pull(q/p_{T})", hDim.nBinPull, -hDim.wPull, hDim.wPull);
224  hPullDxy_ = ibooker.book1D("PullDxy", "Pull(D_{xy})", hDim.nBinPull, -hDim.wPull, hDim.wPull);
225  hPullDz_ = ibooker.book1D("PullDz", "Pull(D_{z})", hDim.nBinPull, -hDim.wPull, hDim.wPull);
226 
227  // -- Pulls vs Eta
228  hPullPt_vs_Eta_ = ibooker.book2D("PullPt_vs_Eta",
229  "Pull(p_{T}) vs #eta",
230  hDim.nBinEta,
231  hDim.minEta,
232  hDim.maxEta,
233  hDim.nBinPull,
234  -hDim.wPull,
235  hDim.wPull);
236  hPullEta_vs_Eta_ = ibooker.book2D("PullEta_vs_Eta",
237  "Pull(#eta) vs #eta",
238  hDim.nBinEta,
239  hDim.minEta,
240  hDim.maxEta,
241  hDim.nBinPull,
242  -hDim.wPull,
243  hDim.wPull);
244  hPullPhi_vs_Eta_ = ibooker.book2D("PullPhi_vs_Eta",
245  "Pull(#phi) vs #eta",
246  hDim.nBinEta,
247  hDim.minEta,
248  hDim.maxEta,
249  hDim.nBinPull,
250  -hDim.wPull,
251  hDim.wPull);
252 
253  // -- Pulls vs Pt
254  hPullPt_vs_Pt_ = ibooker.book2D("PullPt_vs_Pt",
255  "Pull(p_{T}) vs p_{T}",
256  hDim.nBinPt,
257  hDim.minPt,
258  hDim.maxPt,
259  hDim.nBinPull,
260  -hDim.wPull,
261  hDim.wPull);
262  hPullEta_vs_Pt_ = ibooker.book2D("PullEta_vs_Pt",
263  "Pull(#eta) vs p_{T}",
264  hDim.nBinPt,
265  hDim.minPt,
266  hDim.maxPt,
267  hDim.nBinPull,
268  -hDim.wPull,
269  hDim.wPull);
270 
271  // -- Number of Hits
272  const int nHits = 100;
273  hNHits_ = ibooker.book1D("NHits", "Number of hits", nHits + 1, -0.5, nHits + 0.5);
274  hNHits_vs_Pt_ = ibooker.book2D("NHits_vs_Pt",
275  "Number of hits vs p_{T}",
276  hDim.nBinPt,
277  hDim.minPt,
278  hDim.maxPt,
279  nHits / 4 + 1,
280  -0.25,
281  nHits + 0.25);
282  hNHits_vs_Eta_ = ibooker.book2D("NHits_vs_Eta",
283  "Number of hits vs #eta",
284  hDim.nBinEta,
285  hDim.minEta,
286  hDim.maxEta,
287  nHits / 4 + 1,
288  -0.25,
289  nHits + 0.25);
290  hNSimHits_ = ibooker.book1D("NSimHits", "Number of simHits", nHits + 1, -0.5, nHits + 0.5);
291 
292  const int nLostHits = 5;
293  hNLostHits_ = ibooker.book1D("NLostHits", "Number of Lost hits", nLostHits + 1, -0.5, nLostHits + 0.5);
294  hNLostHits_vs_Pt_ = ibooker.book2D("NLostHits_vs_Pt",
295  "Number of lost Hits vs p_{T}",
296  hDim.nBinPt,
297  hDim.minPt,
298  hDim.maxPt,
299  nLostHits + 1,
300  -0.5,
301  nLostHits + 0.5);
302  hNLostHits_vs_Eta_ = ibooker.book2D("NLostHits_vs_Eta",
303  "Number of lost Hits vs #eta",
304  hDim.nBinEta,
305  hDim.minEta,
306  hDim.maxEta,
307  nLostHits + 1,
308  -0.5,
309  nLostHits + 0.5);
310 
311  const int nTrackerHits = 40;
312  hNTrackerHits_ =
313  ibooker.book1D("NTrackerHits", "Number of valid tracker hits", nTrackerHits + 1, -0.5, nTrackerHits + 0.5);
314  hNTrackerHits_vs_Pt_ = ibooker.book2D("NTrackerHits_vs_Pt",
315  "Number of valid traker hits vs p_{T}",
316  hDim.nBinPt,
317  hDim.minPt,
318  hDim.maxPt,
319  nTrackerHits / 4 + 1,
320  -0.25,
321  nTrackerHits + 0.25);
322  hNTrackerHits_vs_Eta_ = ibooker.book2D("NTrackerHits_vs_Eta",
323  "Number of valid tracker hits vs #eta",
324  hDim.nBinEta,
325  hDim.minEta,
326  hDim.maxEta,
327  nTrackerHits / 4 + 1,
328  -0.25,
329  nTrackerHits + 0.25);
330 
331  const int nMuonHits = 60;
332  hNMuonHits_ = ibooker.book1D("NMuonHits", "Number of valid muon hits", nMuonHits + 1, -0.5, nMuonHits + 0.5);
333  hNMuonHits_vs_Pt_ = ibooker.book2D("NMuonHits_vs_Pt",
334  "Number of valid muon hits vs p_{T}",
335  hDim.nBinPt,
336  hDim.minPt,
337  hDim.maxPt,
338  nMuonHits / 4 + 1,
339  -0.25,
340  nMuonHits + 0.25);
341  hNMuonHits_vs_Eta_ = ibooker.book2D("NMuonHits_vs_Eta",
342  "Number of valid muon hits vs #eta",
343  hDim.nBinEta,
344  hDim.minEta,
345  hDim.maxEta,
346  nMuonHits / 4 + 1,
347  -0.25,
348  nMuonHits + 0.25);
349 
350  hNDof_ = ibooker.book1D("NDof", "Number of DoF", hDim.nDof + 1, -0.5, hDim.nDof + 0.5);
351  hChi2_ = ibooker.book1D("Chi2", "#Chi^{2}", hDim.nBinErr, 0, 200);
352  hChi2Norm_ = ibooker.book1D("Chi2Norm", "Normalized #Chi^{2}", hDim.nBinErr, 0, 50);
353  hChi2Prob_ = ibooker.book1D("Chi2Prob", "Prob(#Chi^{2})", hDim.nBinErr, 0, 1);
354 
355  hNDof_vs_Eta_ = ibooker.book2D("NDof_vs_Eta",
356  "Number of DoF vs #eta",
357  hDim.nBinEta,
358  hDim.minEta,
359  hDim.maxEta,
360  hDim.nDof + 1,
361  -0.5,
362  hDim.nDof + 0.5);
363  hChi2_vs_Eta_ = ibooker.book2D(
364  "Chi2_vs_Eta", "#Chi^{2} vs #eta", hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, 0., 200.);
365  hChi2Norm_vs_Eta_ = ibooker.book2D(
366  "Chi2Norm_vs_Eta", "Normalized #Chi^{2} vs #eta", hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, 0., 50.);
367  hChi2Prob_vs_Eta_ = ibooker.book2D(
368  "Chi2Prob_vs_Eta", "Prob(#Chi^{2}) vs #eta", hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, 0., 1.);
369 
370  hNSimToReco_ =
371  ibooker.book1D("NSimToReco", "Number of associated reco tracks", hDim.nAssoc + 1, -0.5, hDim.nAssoc + 0.5);
372  hNRecoToSim_ =
373  ibooker.book1D("NRecoToSim", "Number of associated sim TP's", hDim.nAssoc + 1, -0.5, hDim.nAssoc + 0.5);
374  };
375 
376  //
377  //Fill hists booked, simRef and muonRef are associated by hits
378  //
379  void fill(const TrackingParticle* simRef, const Muon* muonRef) {
380  const double simP = simRef->p();
381  const double simPt = simRef->pt();
382  const double simEta = doAbsEta_ ? fabs(simRef->eta()) : simRef->eta();
383  const double simPhi = simRef->phi();
384  const double simQ = simRef->charge();
385  const double simQPt = simQ / simPt;
386 
387  GlobalPoint simVtx(simRef->vertex().x(), simRef->vertex().y(), simRef->vertex().z());
388  GlobalVector simMom(simRef->momentum().x(), simRef->momentum().y(), simRef->momentum().z());
389  const double simDxy = -simVtx.x() * sin(simPhi) + simVtx.y() * cos(simPhi);
390  const double simDz = simVtx.z() - (simVtx.x() * simMom.x() + simVtx.y() * simMom.y()) * simMom.z() / simMom.perp2();
391 
392  const double recoQ = muonRef->charge();
393  if (simQ * recoQ < 0) {
394  hMisQPt_->Fill(simPt);
395  hMisQEta_->Fill(simEta);
396  }
397 
398  double recoP, recoPt, recoEta, recoPhi, recoQPt;
399  if (usePFMuon_) {
400  // const double origRecoP = muonRef->p();
401  const double origRecoPt = muonRef->pt();
402  // const double origRecoEta = muonRef->eta();
403  // const double origRecoPhi = muonRef->phi();
404  const double origRecoQPt = recoQ / origRecoPt;
405  recoP = muonRef->pfP4().P();
406  recoPt = muonRef->pfP4().Pt();
407  recoEta = muonRef->pfP4().Eta();
408  recoPhi = muonRef->pfP4().Phi();
409  recoQPt = recoQ / recoPt;
410  hErrPt_PF_->Fill((recoPt - origRecoPt) / origRecoPt);
411  hErrQPt_PF_->Fill((recoQPt - origRecoQPt) / origRecoQPt);
412 
413  hdPt_vs_Eta_->Fill(recoEta, recoPt - origRecoPt);
414  hdPt_vs_Pt_->Fill(recoPt, recoPt - origRecoPt);
415 
416  int theCorrectPFAss = (fabs(recoPt - simPt) < fabs(origRecoPt - simPt)) ? 1 : 2;
417  hPFMomAssCorrectness->Fill(theCorrectPFAss);
418  hPt_vs_PFMomAssCorrectness->Fill(simPt, theCorrectPFAss);
419  }
420 
421  else {
422  recoP = muonRef->p();
423  recoPt = muonRef->pt();
424  recoEta = muonRef->eta();
425  recoPhi = muonRef->phi();
426  recoQPt = recoQ / recoPt;
427  }
428 
429  const double errP = (recoP - simP) / simP;
430  const double errPt = (recoPt - simPt) / simPt;
431  const double errEta = (recoEta - simEta) / simEta;
432  const double errPhi = (recoPhi - simPhi) / simPhi;
433  const double errQPt = (recoQPt - simQPt) / simQPt;
434 
435  hP_->Fill(simP);
436  hPt_->Fill(simPt);
437  hEta_->Fill(simEta);
438  hPhi_->Fill(simPhi);
439 
440  hErrP_->Fill(errP);
441  hErrPt_->Fill(errPt);
442  hErrEta_->Fill(errEta);
443  hErrPhi_->Fill(errPhi);
444 
445  if (fabs(simEta) > 0. && fabs(simEta) < 0.8) {
446  hErrPBarrel_->Fill(errP);
447  hErrPtBarrel_->Fill(errPt);
448  } else if (fabs(simEta) > 0.8 && fabs(simEta) < 1.2) {
449  hErrPOverlap_->Fill(errP);
450  hErrPtOverlap_->Fill(errPt);
451  } else if (fabs(simEta) > 1.2) {
452  hErrPEndcap_->Fill(errP);
453  hErrPtEndcap_->Fill(errPt);
454  }
455 
456  hErrP_vs_Eta_->Fill(simEta, errP);
457  hErrPt_vs_Eta_->Fill(simEta, errPt);
458  hErrQPt_vs_Eta_->Fill(simEta, errQPt);
459 
460  hErrP_vs_P_->Fill(simP, errP);
461  hErrPt_vs_Pt_->Fill(simPt, errPt);
462  hErrQPt_vs_Pt_->Fill(simQPt, errQPt);
463 
464  hErrEta_vs_Eta_->Fill(simEta, errEta);
465 
466  //access from track
467  reco::TrackRef recoRef = muonRef->track();
468  if (recoRef.isNonnull()) {
469  // Number of reco-hits
470  const int nRecoHits = recoRef->numberOfValidHits();
471  const int nLostHits = recoRef->numberOfLostHits();
472 
473  hNHits_->Fill(nRecoHits);
474  hNHits_vs_Pt_->Fill(simPt, nRecoHits);
475  hNHits_vs_Eta_->Fill(simEta, nRecoHits);
476 
477  hNLostHits_->Fill(nLostHits);
478  hNLostHits_vs_Pt_->Fill(simPt, nLostHits);
479  hNLostHits_vs_Eta_->Fill(simEta, nLostHits);
480 
481  const double recoNDof = recoRef->ndof();
482  const double recoChi2 = recoRef->chi2();
483  const double recoChi2Norm = recoRef->normalizedChi2();
484  const double recoChi2Prob = TMath::Prob(recoRef->chi2(), static_cast<int>(recoRef->ndof()));
485 
486  hNDof_->Fill(recoNDof);
487  hChi2_->Fill(recoChi2);
488  hChi2Norm_->Fill(recoChi2Norm);
489  hChi2Prob_->Fill(recoChi2Prob);
490 
491  hNDof_vs_Eta_->Fill(simEta, recoNDof);
492  hChi2_vs_Eta_->Fill(simEta, recoChi2);
493  hChi2Norm_vs_Eta_->Fill(simEta, recoChi2Norm);
494  hChi2Prob_vs_Eta_->Fill(simEta, recoChi2Prob);
495 
496  const double recoDxy = recoRef->dxy();
497  const double recoDz = recoRef->dz();
498 
499  const double errDxy = (recoDxy - simDxy) / simDxy;
500  const double errDz = (recoDz - simDz) / simDz;
501  hErrDxy_->Fill(errDxy);
502  hErrDz_->Fill(errDz);
503 
504  const double pullPt = (recoPt - simPt) / recoRef->ptError();
505  const double pullQPt = (recoQPt - simQPt) / recoRef->qoverpError();
506  const double pullEta = (recoEta - simEta) / recoRef->etaError();
507  const double pullPhi = (recoPhi - simPhi) / recoRef->phiError();
508  const double pullDxy = (recoDxy - simDxy) / recoRef->dxyError();
509  const double pullDz = (recoDz - simDz) / recoRef->dzError();
510 
511  hPullPt_->Fill(pullPt);
512  hPullEta_->Fill(pullEta);
513  hPullPhi_->Fill(pullPhi);
514  hPullQPt_->Fill(pullQPt);
515  hPullDxy_->Fill(pullDxy);
516  hPullDz_->Fill(pullDz);
517 
518  hPullPt_vs_Eta_->Fill(simEta, pullPt);
519  hPullPt_vs_Pt_->Fill(simPt, pullPt);
520 
521  hPullEta_vs_Eta_->Fill(simEta, pullEta);
522  hPullPhi_vs_Eta_->Fill(simEta, pullPhi);
523 
524  hPullEta_vs_Pt_->Fill(simPt, pullEta);
525  }
526  };
527 };
528 
529 //
530 //struct defininiong histograms
531 //
533  typedef MonitorElement* MEP;
534 
535  //diffs
536  MEP hTrkToGlbDiffNTrackerHits_, hStaToGlbDiffNMuonHits_;
537  MEP hTrkToGlbDiffNTrackerHitsEta_, hStaToGlbDiffNMuonHitsEta_;
538  MEP hTrkToGlbDiffNTrackerHitsPt_, hStaToGlbDiffNMuonHitsPt_;
539 
540  //global muon hit pattern
541  MEP hNInvalidHitsGTHitPattern_, hNInvalidHitsITHitPattern_, hNInvalidHitsOTHitPattern_;
543 
544  //muon based momentum assignment
545  MEP hMuonP_, hMuonPt_, hMuonEta_, hMuonPhi_;
546  //track based kinematics
547  MEP hMuonTrackP_, hMuonTrackPt_, hMuonTrackEta_, hMuonTrackPhi_, hMuonTrackDxy_, hMuonTrackDz_;
548  //histograms for fractions
549  MEP hMuonAllP_, hMuonAllPt_, hMuonAllEta_, hMuonAllPhi_;
550 };
551 
552 //
553 //Constructor
554 //
556  : selector_(pset.getParameter<std::string>("selection")) {
557  // pset=ps;
558  verbose_ = pset.getUntrackedParameter<unsigned int>("verbose", 0);
559 
560  outputFileName_ = pset.getUntrackedParameter<string>("outputFileName", "");
561 
562  wantTightMuon_ = pset.getParameter<bool>("wantTightMuon");
564  primvertexLabel_ = pset.getParameter<edm::InputTag>("primaryVertex");
565  beamspotToken_ = consumes<reco::BeamSpot>(beamspotLabel_);
566  primvertexToken_ = consumes<reco::VertexCollection>(primvertexLabel_);
567 
568  // Set histogram dimensions from config
569 
570  hDim.nBinP = pset.getUntrackedParameter<unsigned int>("nBinP");
571  hDim.minP = pset.getUntrackedParameter<double>("minP");
572  hDim.maxP = pset.getUntrackedParameter<double>("maxP");
573 
574  hDim.nBinPt = pset.getUntrackedParameter<unsigned int>("nBinPt");
575  hDim.minPt = pset.getUntrackedParameter<double>("minPt");
576  hDim.maxPt = pset.getUntrackedParameter<double>("maxPt");
577 
578  doAbsEta_ = pset.getUntrackedParameter<bool>("doAbsEta");
580  hDim.nBinEta = pset.getUntrackedParameter<unsigned int>("nBinEta");
581  hDim.minEta = pset.getUntrackedParameter<double>("minEta");
582  hDim.maxEta = pset.getUntrackedParameter<double>("maxEta");
583 
584  hDim.nBinDxy = pset.getUntrackedParameter<unsigned int>("nBinDxy");
585  hDim.minDxy = pset.getUntrackedParameter<double>("minDxy");
586  hDim.maxDxy = pset.getUntrackedParameter<double>("maxDxy");
587 
588  hDim.nBinDz = pset.getUntrackedParameter<unsigned int>("nBinDz");
589  hDim.minDz = pset.getUntrackedParameter<double>("minDz");
590  hDim.maxDz = pset.getUntrackedParameter<double>("maxDz");
591 
592  hDim.nBinPhi = pset.getUntrackedParameter<unsigned int>("nBinPhi");
593  hDim.minPhi = pset.getUntrackedParameter<double>("minPhi", -TMath::Pi());
594  hDim.maxPhi = pset.getUntrackedParameter<double>("maxPhi", TMath::Pi());
595 
596  hDim.nBinErr = pset.getUntrackedParameter<unsigned int>("nBinErr");
597  hDim.nBinPull = pset.getUntrackedParameter<unsigned int>("nBinPull");
598 
599  hDim.wPull = pset.getUntrackedParameter<double>("wPull");
600 
601  hDim.minErrP = pset.getUntrackedParameter<double>("minErrP");
602  hDim.maxErrP = pset.getUntrackedParameter<double>("maxErrP");
603 
604  hDim.minErrPt = pset.getUntrackedParameter<double>("minErrPt");
605  hDim.maxErrPt = pset.getUntrackedParameter<double>("maxErrPt");
606 
607  hDim.minErrQPt = pset.getUntrackedParameter<double>("minErrQPt");
608  hDim.maxErrQPt = pset.getUntrackedParameter<double>("maxErrQPt");
609 
610  hDim.minErrEta = pset.getUntrackedParameter<double>("minErrEta");
611  hDim.maxErrEta = pset.getUntrackedParameter<double>("maxErrEta");
612 
613  hDim.minErrPhi = pset.getUntrackedParameter<double>("minErrPhi");
614  hDim.maxErrPhi = pset.getUntrackedParameter<double>("maxErrPhi");
615 
616  hDim.minErrDxy = pset.getUntrackedParameter<double>("minErrDxy");
617  hDim.maxErrDxy = pset.getUntrackedParameter<double>("maxErrDxy");
618 
619  hDim.minErrDz = pset.getUntrackedParameter<double>("minErrDz");
620  hDim.maxErrDz = pset.getUntrackedParameter<double>("maxErrDz");
621 
622  hDim.nTrks = pset.getUntrackedParameter<unsigned int>("nTrks");
623  hDim.nAssoc = pset.getUntrackedParameter<unsigned int>("nAssoc");
624  hDim.nDof = pset.getUntrackedParameter<unsigned int>("nDof", 55);
625 
626  // Labels for simulation and reconstruction tracks
627  simLabel_ = pset.getParameter<InputTag>("simLabel");
628  muonLabel_ = pset.getParameter<InputTag>("muonLabel");
629  simToken_ = consumes<TrackingParticleCollection>(simLabel_);
630  muonToken_ = consumes<edm::View<reco::Muon> >(muonLabel_);
631 
632  // Labels for sim-reco association
633  doAssoc_ = pset.getUntrackedParameter<bool>("doAssoc", true);
634  muAssocLabel_ = pset.getParameter<InputTag>("muAssocLabel");
635  if (doAssoc_) {
636  muAssocToken_ = consumes<reco::MuonToTrackingParticleAssociator>(muAssocLabel_);
637  }
638 
639  // Different momentum assignment and additional histos in case of PF muons
640  usePFMuon_ = pset.getUntrackedParameter<bool>("usePFMuon");
642 
643  //type of track
645  if (trackType == "inner")
647  else if (trackType == "outer")
649  else if (trackType == "global")
651  else if (trackType == "segments")
653  else
654  throw cms::Exception("Configuration") << "Track type '" << trackType << "' not supported.\n";
655 
656  // seedPropagatorName_ = pset.getParameter<string>("SeedPropagator");
657 
658  ParameterSet tpset = pset.getParameter<ParameterSet>("tpSelector");
659  tpSelector_ = TrackingParticleSelector(tpset.getParameter<double>("ptMin"),
660  tpset.getParameter<double>("ptMax"),
661  tpset.getParameter<double>("minRapidity"),
662  tpset.getParameter<double>("maxRapidity"),
663  tpset.getParameter<double>("tip"),
664  tpset.getParameter<double>("lip"),
665  tpset.getParameter<int>("minHit"),
666  tpset.getParameter<bool>("signalOnly"),
667  tpset.getParameter<bool>("intimeOnly"),
668  tpset.getParameter<bool>("chargedOnly"),
669  tpset.getParameter<bool>("stableOnly"),
670  tpset.getParameter<std::vector<int> >("pdgId"));
671 
672  // the service parameters
673  ParameterSet serviceParameters = pset.getParameter<ParameterSet>("ServiceParameters");
674 
675  // retrieve the instance of DQMService
676  dbe_ = Service<DQMStore>().operator->();
677  subsystemname_ = pset.getUntrackedParameter<std::string>("subSystemFolder", "YourSubsystem");
678 
679  subDir_ = pset.getUntrackedParameter<string>("subDir");
680  if (subDir_.empty())
681  subDir_ = "RecoMuonV";
682  if (subDir_[subDir_.size() - 1] == '/')
683  subDir_.erase(subDir_.size() - 1);
684 }
685 
687  edm::Run const& iRun,
688  edm::EventSetup const& /* iSetup */) {
689  // book histograms
690  ibooker.cd();
691 
692  ibooker.setCurrentFolder(subDir_);
693 
694  commonME_ = new CommonME;
695  muonME_ = new MuonME;
696 
697  //commonME
698  const int nHits = 100;
699 
700  // - diffs
701  commonME_->hTrkToGlbDiffNTrackerHits_ = ibooker.book1D("TrkGlbDiffNTrackerHits",
702  "Difference of number of tracker hits (tkMuon - globalMuon)",
703  2 * nHits + 1,
704  -nHits - 0.5,
705  nHits + 0.5);
706  commonME_->hStaToGlbDiffNMuonHits_ = ibooker.book1D("StaGlbDiffNMuonHits",
707  "Difference of number of muon hits (staMuon - globalMuon)",
708  2 * nHits + 1,
709  -nHits - 0.5,
710  nHits + 0.5);
711 
713  ibooker.book2D("TrkGlbDiffNTrackerHitsEta",
714  "Difference of number of tracker hits (tkMuon - globalMuon)",
715  hDim.nBinEta,
716  hDim.minEta,
717  hDim.maxEta,
718  2 * nHits + 1,
719  -nHits - 0.5,
720  nHits + 0.5);
721  commonME_->hStaToGlbDiffNMuonHitsEta_ = ibooker.book2D("StaGlbDiffNMuonHitsEta",
722  "Difference of number of muon hits (staMuon - globalMuon)",
723  hDim.nBinEta,
724  hDim.minEta,
725  hDim.maxEta,
726  2 * nHits + 1,
727  -nHits - 0.5,
728  nHits + 0.5);
729 
730  commonME_->hTrkToGlbDiffNTrackerHitsPt_ = ibooker.book2D("TrkGlbDiffNTrackerHitsPt",
731  "Difference of number of tracker hits (tkMuon - globalMuon)",
732  hDim.nBinPt,
733  hDim.minPt,
734  hDim.maxPt,
735  2 * nHits + 1,
736  -nHits - 0.5,
737  nHits + 0.5);
738  commonME_->hStaToGlbDiffNMuonHitsPt_ = ibooker.book2D("StaGlbDiffNMuonHitsPt",
739  "Difference of number of muon hits (staMuon - globalMuon)",
740  hDim.nBinPt,
741  hDim.minPt,
742  hDim.maxPt,
743  2 * nHits + 1,
744  -nHits - 0.5,
745  nHits + 0.5);
746 
747  // -global muon hit pattern
749  "NInvalidHitsGTHitPattern", "Number of invalid hits on a global track", nHits + 1, -0.5, nHits + 0.5);
751  "NInvalidHitsITHitPattern", "Number of invalid hits on an inner track", nHits + 1, -0.5, nHits + 0.5);
753  "NInvalidHitsOTHitPattern", "Number of invalid hits on an outer track", nHits + 1, -0.5, nHits + 0.5);
755  ibooker.book1D("hNDeltaInvalidHitsHitPattern",
756  "The discrepancy for Number of invalid hits on an global track and inner and outer tracks",
757  2 * nHits + 1,
758  -nHits - 0.5,
759  nHits + 0.5);
760 
761  //muon based kinematics
762  commonME_->hMuonP_ = ibooker.book1D("PMuon", "p of muon", hDim.nBinP, hDim.minP, hDim.maxP);
763  commonME_->hMuonPt_ = ibooker.book1D("PtMuon", "p_{T} of muon", hDim.nBinPt, hDim.minPt, hDim.maxPt);
764  commonME_->hMuonEta_ = ibooker.book1D("EtaMuon", "#eta of muon", hDim.nBinEta, hDim.minEta, hDim.maxEta);
765  commonME_->hMuonPhi_ = ibooker.book1D("PhiMuon", "#phi of muon", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
766  //track based kinematics
767  commonME_->hMuonTrackP_ = ibooker.book1D("PMuonTrack", "p of reco muon track", hDim.nBinP, hDim.minP, hDim.maxP);
769  ibooker.book1D("PtMuonTrack", "p_{T} of reco muon track", hDim.nBinPt, hDim.minPt, hDim.maxPt);
771  ibooker.book1D("EtaMuonTrack", "#eta of reco muon track", hDim.nBinEta, hDim.minEta, hDim.maxEta);
773  ibooker.book1D("PhiMuonTrack", "#phi of reco muon track", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
775  ibooker.book1D("DxyMuonTrack", "Dxy of reco muon track", hDim.nBinDxy, hDim.minDxy, hDim.maxDxy);
777  ibooker.book1D("DzMuonTrack", "Dz of reco muon track", hDim.nBinDz, hDim.minDz, hDim.maxDz);
778 
779  //histograms for fractions
780  commonME_->hMuonAllP_ = ibooker.book1D("PMuonAll", "p of muons of all types", hDim.nBinP, hDim.minP, hDim.maxP);
782  ibooker.book1D("PtMuonAll", "p_{T} of muon of all types", hDim.nBinPt, hDim.minPt, hDim.maxPt);
784  ibooker.book1D("EtaMuonAll", "#eta of muon of all types", hDim.nBinEta, hDim.minEta, hDim.maxEta);
786  ibooker.book1D("PhiMuonAll", "#phi of muon of all types", hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
787 
788  muonME_->bookHistos(ibooker, subDir_, hDim);
789 }
790 
791 //
792 //Destructor
793 //
795 
796 //
797 //Begin run
798 //
799 
800 void RecoMuonValidator::dqmBeginRun(const edm::Run&, const EventSetup& eventSetup) {}
801 
802 //
803 //End run
804 //
806  if (dbe_ && !outputFileName_.empty())
808 }
809 
810 //
811 //Analyze
812 //
813 void RecoMuonValidator::analyze(const Event& event, const EventSetup& eventSetup) {
814  // Look for the Primary Vertex (and use the BeamSpot instead, if you can't find it):
815  reco::Vertex::Point posVtx;
816  reco::Vertex::Error errVtx;
818  event.getByToken(primvertexToken_, recVtxs);
819  unsigned int theIndexOfThePrimaryVertex = 999.;
820  for (unsigned int ind = 0; ind < recVtxs->size(); ++ind) {
821  if ((*recVtxs)[ind].isValid() && !((*recVtxs)[ind].isFake())) {
822  theIndexOfThePrimaryVertex = ind;
823  break;
824  }
825  }
826  if (theIndexOfThePrimaryVertex < 100) {
827  posVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).position();
828  errVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).error();
829  } else {
830  LogInfo("RecoMuonValidator") << "reco::PrimaryVertex not found, use BeamSpot position instead\n";
831  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
832  event.getByToken(beamspotToken_, recoBeamSpotHandle);
833  reco::BeamSpot bs = *recoBeamSpotHandle;
834  posVtx = bs.position();
835  errVtx(0, 0) = bs.BeamWidthX();
836  errVtx(1, 1) = bs.BeamWidthY();
837  errVtx(2, 2) = bs.sigmaZ();
838  }
839  const reco::Vertex thePrimaryVertex(posVtx, errVtx);
840 
841  // Get TrackingParticles
843  event.getByToken(simToken_, simHandle);
844  const TrackingParticleCollection simColl = *(simHandle.product());
845 
846  // Get Muons
847  Handle<edm::View<Muon> > muonHandle;
848  event.getByToken(muonToken_, muonHandle);
849  View<Muon> muonColl = *(muonHandle.product());
850 
851  reco::MuonToTrackingParticleAssociator const* assoByHits = nullptr;
852  if (doAssoc_) {
854  event.getByToken(muAssocToken_, associatorBase);
855  assoByHits = associatorBase.product();
856  }
857 
858  const TrackingParticleCollection::size_type nSim = simColl.size();
859 
861  for (size_t i = 0; i < muonHandle->size(); ++i) {
862  Muons.push_back(muonHandle->refAt(i));
863  }
864 
866  for (size_t i = 0; i < nSim; ++i) {
867  allTPs.push_back(TrackingParticleRef(simHandle, i));
868  }
869 
870  muonME_->hNSim_->Fill(nSim);
871  muonME_->hNMuon_->Fill(muonColl.size());
872 
873  reco::MuonToSimCollection muonToSimColl;
874  reco::SimToMuonCollection simToMuonColl;
875 
876  if (doAssoc_) {
877  assoByHits->associateMuons(muonToSimColl, simToMuonColl, Muons, trackType_, allTPs);
878  } else {
879  /*
880  // SimToMuon associations
881  Handle<reco::RecoToSimCollection> simToTrkMuHandle;
882  event.getByLabel(trkMuAssocLabel_, simToTrkMuHandle);
883  trkSimRecColl = *(simToTrkMuHandle.product());
884 
885  Handle<reco::RecoToSimCollection> simToStaMuHandle;
886  event.getByLabel(staMuAssocLabel_, simToStaMuHandle);
887  staSimRecColl = *(simToStaMuHandle.product());
888 
889  Handle<reco::RecoToSimCollection> simToGlbMuHandle;
890  event.getByLabel(glbMuAssocLabel_, simToGlbMuHandle);
891  glbSimRecColl = *(simToGlbMuHandle.product());
892 
893  // MuonToSim associations
894  Handle<reco::SimToRecoCollection> trkMuToSimHandle;
895  event.getByLabel(trkMuAssocLabel_, trkMuToSimHandle);
896  trkRecSimColl = *(trkMuToSimHandle.product());
897 
898  Handle<reco::SimToRecoCollection> staMuToSimHandle;
899  event.getByLabel(staMuAssocLabel_, staMuToSimHandle);
900  staRecSimColl = *(staMuToSimHandle.product());
901 
902  Handle<reco::SimToRecoCollection> glbMuToSimHandle;
903  event.getByLabel(glbMuAssocLabel_, glbMuToSimHandle);
904  glbRecSimColl = *(glbMuToSimHandle.product());
905 */
906  }
907 
908  int glbNTrackerHits = 0;
909  int trkNTrackerHits = 0;
910  int glbNMuonHits = 0;
911  int staNMuonHits = 0;
912  int NTrackerHits = 0;
913  int NMuonHits = 0;
914 
915  // Analyzer reco::Muon
916  for (View<Muon>::const_iterator iMuon = muonColl.begin(); iMuon != muonColl.end(); ++iMuon) {
917  double muonP, muonPt, muonEta, muonPhi;
918  if (usePFMuon_) {
919  muonP = iMuon->pfP4().P();
920  muonPt = iMuon->pfP4().Pt();
921  muonEta = iMuon->pfP4().Eta();
922  muonPhi = iMuon->pfP4().Phi();
923  } else {
924  muonP = iMuon->p();
925  muonPt = iMuon->pt();
926  muonEta = iMuon->eta();
927  muonPhi = iMuon->phi();
928  }
929 
930  //histograms for fractions
931  commonME_->hMuonAllP_->Fill(muonP);
935 
936  if (!selector_(*iMuon))
937  continue;
938  if (wantTightMuon_) {
939  if (!muon::isTightMuon(*iMuon, thePrimaryVertex))
940  continue;
941  }
942 
943  TrackRef Track = iMuon->track();
944 
945  if (Track.isNonnull()) {
950 
951  //ip histograms
954  }
955 
956  if (iMuon->isGlobalMuon()) {
957  Track = iMuon->combinedMuon();
958  glbNTrackerHits = countTrackerHits(*Track);
959  glbNMuonHits = countMuonHits(*Track);
960  } else if (iMuon->isTrackerMuon()) {
961  Track = iMuon->track();
962  trkNTrackerHits = countTrackerHits(*Track);
963  } else {
964  Track = iMuon->standAloneMuon();
965  }
966 
967  NTrackerHits = countTrackerHits(*Track);
968  muonME_->hNTrackerHits_->Fill(NTrackerHits);
969  muonME_->hNTrackerHits_vs_Pt_->Fill(Track->pt(), NTrackerHits);
970  muonME_->hNTrackerHits_vs_Eta_->Fill(Track->eta(), NTrackerHits);
971 
972  NMuonHits = countMuonHits(*Track);
973  muonME_->hNMuonHits_->Fill(NMuonHits);
974  muonME_->hNMuonHits_vs_Pt_->Fill(Track->pt(), NMuonHits);
975  muonME_->hNMuonHits_vs_Eta_->Fill(Track->eta(), NMuonHits);
976 
977  //list of histos for each type
978 
979  // muonME_->hNTrks_->Fill();
981  muonME_->hNTrksPt_->Fill(Track->pt());
982 
983  commonME_->hMuonP_->Fill(muonP);
987 
988  if (iMuon->isGlobalMuon()) {
989  double gtHitPat = iMuon->globalTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
990  iMuon->globalTrack()->hitPattern().numberOfValidHits();
991 
992  double itHitPat = iMuon->innerTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
993  iMuon->innerTrack()->hitPattern().numberOfValidHits();
994 
995  double otHitPat = iMuon->outerTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS) -
996  iMuon->outerTrack()->hitPattern().numberOfValidHits();
997 
1001  commonME_->hNDeltaInvalidHitsHitPattern_->Fill(gtHitPat - itHitPat - otHitPat);
1002 
1003  //must be global and standalone
1004  if (iMuon->isStandAloneMuon()) {
1005  commonME_->hStaToGlbDiffNMuonHitsEta_->Fill(Track->eta(), staNMuonHits - glbNMuonHits);
1006  commonME_->hStaToGlbDiffNMuonHitsPt_->Fill(Track->pt(), staNMuonHits - glbNMuonHits);
1007  commonME_->hStaToGlbDiffNMuonHits_->Fill(staNMuonHits - glbNMuonHits);
1008  }
1009 
1010  //must be global and tracker
1011  if (iMuon->isTrackerMuon()) {
1012  commonME_->hTrkToGlbDiffNTrackerHitsEta_->Fill(Track->eta(), trkNTrackerHits - glbNTrackerHits);
1013  commonME_->hTrkToGlbDiffNTrackerHitsPt_->Fill(Track->pt(), trkNTrackerHits - glbNTrackerHits);
1014  commonME_->hTrkToGlbDiffNTrackerHits_->Fill(trkNTrackerHits - glbNTrackerHits);
1015  }
1016  }
1017 
1018  } //end of reco muon loop
1019 
1020  // Associate by hits
1021  for (TrackingParticleCollection::size_type i = 0; i < nSim; i++) {
1022  TrackingParticleRef simRef(simHandle, i);
1023  const TrackingParticle* simTP = simRef.get();
1024  if (!tpSelector_(*simTP))
1025  continue;
1026 
1027  //denominators for efficiency plots
1028  const double simP = simRef->p();
1029  const double simPt = simRef->pt();
1030  const double simEta = doAbsEta_ ? fabs(simRef->eta()) : simRef->eta();
1031  const double simPhi = simRef->phi();
1032 
1033  GlobalPoint simVtx(simRef->vertex().x(), simRef->vertex().y(), simRef->vertex().z());
1034  GlobalVector simMom(simRef->momentum().x(), simRef->momentum().y(), simRef->momentum().z());
1035  const double simDxy = -simVtx.x() * sin(simPhi) + simVtx.y() * cos(simPhi);
1036  const double simDz = simVtx.z() - (simVtx.x() * simMom.x() + simVtx.y() * simMom.y()) * simMom.z() / simMom.perp2();
1037 
1038  const unsigned int nSimHits = simRef->numberOfHits();
1039 
1040  muonME_->hSimP_->Fill(simP);
1041  muonME_->hSimPt_->Fill(simPt);
1042  muonME_->hSimEta_->Fill(simEta);
1043  muonME_->hSimPhi_->Fill(simPhi);
1044  muonME_->hSimDxy_->Fill(simDxy);
1045  muonME_->hSimDz_->Fill(simDz);
1046  muonME_->hNSimHits_->Fill(nSimHits);
1047 
1048  // Get sim-reco association for a simRef
1049  vector<pair<RefToBase<Muon>, double> > MuRefV;
1050  if (simToMuonColl.find(simRef) != simToMuonColl.end()) {
1051  MuRefV = simToMuonColl[simRef];
1052 
1053  if (!MuRefV.empty()) {
1054  muonME_->hNSimToReco_->Fill(MuRefV.size());
1055  const Muon* Mu = MuRefV.begin()->first.get();
1056  if (!selector_(*Mu))
1057  continue;
1058  if (wantTightMuon_) {
1059  if (!muon::isTightMuon(*Mu, thePrimaryVertex))
1060  continue;
1061  }
1062 
1063  muonME_->fill(&*simTP, Mu);
1064  }
1065  }
1066  }
1067 }
1068 
1071 
1072  int count = 0;
1073 
1074  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
1075  if ((*hit)->isValid()) {
1076  DetId recoid = (*hit)->geographicalId();
1077  if (recoid.det() == DetId::Muon)
1078  count++;
1079  }
1080  }
1081  return count;
1082 }
1083 
1086 
1087  int count = 0;
1088 
1089  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
1090  if ((*hit)->isValid()) {
1091  DetId recoid = (*hit)->geographicalId();
1092  if (recoid.det() == DetId::Tracker)
1093  count++;
1094  }
1095  }
1096  return count;
1097 }
1098 /* vim:set ts=2 sts=2 sw=2 expandtab: */
HLTObjectMonitor_cfi.muonPt
muonPt
Definition: HLTObjectMonitor_cfi.py:82
Vector3DBase
Definition: Vector3DBase.h:8
RecoMuonValidator::MuonME::bookHistos
void bookHistos(DQMStore::IBooker &ibooker, const string &dirName, const HistoDimensions &hDim)
Definition: RecoMuonValidator.cc:82
RecoMuonValidator::HistoDimensions::maxPt
double maxPt
Definition: RecoMuonValidator.h:89
RecoMuonValidator::HistoDimensions::minErrP
double minErrP
Definition: RecoMuonValidator.h:109
RecoMuonValidator::CommonME::hNDeltaInvalidHitsHitPattern_
MEP hNDeltaInvalidHitsHitPattern_
Definition: RecoMuonValidator.cc:542
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
RecoMuonValidator::HistoDimensions::nBinDxy
unsigned int nBinDxy
Definition: RecoMuonValidator.h:99
RecoMuonValidator::MuonME::hErrDz_
MEP hErrDz_
Definition: RecoMuonValidator.cc:45
RecoMuonValidator::MuonME::hNMuonHits_
MEP hNMuonHits_
Definition: RecoMuonValidator.cc:62
edm::View::begin
const_iterator begin() const
RecoMuonValidator::HistoDimensions::maxDxy
double maxDxy
Definition: RecoMuonValidator.h:100
RecoMuonValidator::MuonME::hSimDz_
MEP hSimDz_
Definition: RecoMuonValidator.cc:32
RecoMuonValidator::HistoDimensions::maxErrPt
double maxErrPt
Definition: RecoMuonValidator.h:110
mps_fire.i
i
Definition: mps_fire.py:428
RecoMuonValidator::HistoDimensions::minP
double minP
Definition: RecoMuonValidator.h:86
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
MessageLogger.h
RecoMuonValidator::simToken_
edm::EDGetTokenT< TrackingParticleCollection > simToken_
Definition: RecoMuonValidator.h:47
edm::Handle::product
T const * product() const
Definition: Handle.h:70
RecoMuonValidator::CommonME::hNInvalidHitsGTHitPattern_
MEP hNInvalidHitsGTHitPattern_
Definition: RecoMuonValidator.cc:541
TrackingParticle::eta
double eta() const
Momentum pseudorapidity. Note this is taken from the first SimTrack only.
Definition: TrackingParticle.h:151
reco::MuonToTrackingParticleAssociator
Definition: MuonToTrackingParticleAssociator.h:15
HLTObjectMonitor_cfi.muonEta
muonEta
Definition: HLTObjectMonitor_cfi.py:92
RecoMuonValidator::dbe_
DQMStore * dbe_
Definition: RecoMuonValidator.h:63
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
RecoMuonValidator::MuonME::hSimDxy_
MEP hSimDxy_
Definition: RecoMuonValidator.cc:32
reco::MuonToSimCollection
std::map< edm::RefToBase< reco::Muon >, std::vector< std::pair< TrackingParticleRef, double > >, RefToBaseSort > MuonToSimCollection
Definition: MuonTrackType.h:37
reco::TrackBase::p
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
RecoMuonValidator::MuonME::doAbsEta_
bool doAbsEta_
Definition: RecoMuonValidator.cc:76
edm::Run
Definition: Run.h:45
RecoMuonValidator::MuonME::hNMuon_
MEP hNMuon_
Definition: RecoMuonValidator.cc:35
RecoMuonValidator::MuonME::hSimPt_
MEP hSimPt_
Definition: RecoMuonValidator.cc:32
edm
HLT enums.
Definition: AlignableModifier.h:19
RecoMuonValidator::HistoDimensions::minDz
double minDz
Definition: RecoMuonValidator.h:103
reco::Vertex::Error
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:44
RecoMuonValidator::HistoDimensions::maxErrDz
double maxErrDz
Definition: RecoMuonValidator.h:115
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
RecoMuonValidator::CommonME::hMuonEta_
MEP hMuonEta_
Definition: RecoMuonValidator.cc:545
RecoMuonValidator::MuonME::hNSimHits_
MEP hNSimHits_
Definition: RecoMuonValidator.cc:59
RecoMuonValidator::MuonME::usePFMuon_
bool usePFMuon_
Definition: RecoMuonValidator.cc:77
RecoMuonValidator::commonME_
CommonME * commonME_
Definition: RecoMuonValidator.h:77
RecoMuonValidator::HistoDimensions::nBinP
unsigned int nBinP
Definition: RecoMuonValidator.h:85
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
RecoMuonValidator::MuonME::hErrPOverlap_
MEP hErrPOverlap_
Definition: RecoMuonValidator.cc:43
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
reco::OuterTk
Definition: MuonTrackType.h:28
RecoMuonValidator::MuonME::hNMuonHits_vs_Pt_
MEP hNMuonHits_vs_Pt_
Definition: RecoMuonValidator.cc:66
RecoMuonValidator::countMuonHits
virtual int countMuonHits(const reco::Track &track) const
Definition: RecoMuonValidator.cc:1069
RecoMuonValidator::MuonME::hPFMomAssCorrectness
MEP hPFMomAssCorrectness
Definition: RecoMuonValidator.cc:55
RecoMuonValidator::CommonME::hNInvalidHitsOTHitPattern_
MEP hNInvalidHitsOTHitPattern_
Definition: RecoMuonValidator.cc:541
RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsPt_
MEP hStaToGlbDiffNMuonHitsPt_
Definition: RecoMuonValidator.cc:538
TransientTrackingRecHit.h
RecoMuonValidator::MuonME::hPt_vs_PFMomAssCorrectness
MEP hPt_vs_PFMomAssCorrectness
Definition: RecoMuonValidator.cc:56
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
reco::InnerTk
Definition: MuonTrackType.h:28
edm::RefVector< TrackingParticleCollection >
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
RecoMuonValidator::simLabel_
edm::InputTag simLabel_
Definition: RecoMuonValidator.h:44
RecoMuonValidator.h
TransientTrack.h
RecoMuonValidator::HistoDimensions::minErrDxy
double minErrDxy
Definition: RecoMuonValidator.h:114
RecoMuonValidator::HistoDimensions::nBinPhi
unsigned int nBinPhi
Definition: RecoMuonValidator.h:96
RecoMuonValidator::CommonME::hMuonAllPt_
MEP hMuonAllPt_
Definition: RecoMuonValidator.cc:549
edm::Handle< reco::VertexCollection >
relativeConstraints.error
error
Definition: relativeConstraints.py:53
RecoMuonValidator::dqmEndRun
void dqmEndRun(edm::Run const &, edm::EventSetup const &) override
Definition: RecoMuonValidator.cc:805
RecoMuonValidator::MuonME::hNTrackerHits_vs_Eta_
MEP hNTrackerHits_vs_Eta_
Definition: RecoMuonValidator.cc:65
RecoMuonValidator::HistoDimensions::minDxy
double minDxy
Definition: RecoMuonValidator.h:100
RecoMuonValidator::HistoDimensions::maxDz
double maxDz
Definition: RecoMuonValidator.h:103
RecoMuonValidator::selector_
StringCutObjectSelector< reco::Muon > selector_
Definition: RecoMuonValidator.h:126
RecoMuonValidator::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: RecoMuonValidator.cc:686
Muon
Definition: Muon.py:1
RecoMuonValidator::HistoDimensions::minErrPhi
double minErrPhi
Definition: RecoMuonValidator.h:113
edm::Ref< TrackCollection >
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
RecoMuonValidator::trackType_
reco::MuonTrackType trackType_
Definition: RecoMuonValidator.h:72
TrackingParticle::charge
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
Definition: TrackingParticle.h:98
RecoMuonValidator::MuonME::hPullQPt_
MEP hPullQPt_
Definition: RecoMuonValidator.cc:69
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
DetId
Definition: DetId.h:17
RecoMuonValidator::HistoDimensions::minPt
double minPt
Definition: RecoMuonValidator.h:89
RecoMuonValidator::HistoDimensions::maxErrP
double maxErrP
Definition: RecoMuonValidator.h:109
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
RecoMuonValidator::HistoDimensions::maxErrEta
double maxErrEta
Definition: RecoMuonValidator.h:112
reco::TrackBase::standAloneMuon
Definition: TrackBase.h:108
RecoMuonValidator::CommonME::hMuonAllP_
MEP hMuonAllP_
Definition: RecoMuonValidator.cc:549
RecoMuonValidator::primvertexToken_
edm::EDGetTokenT< reco::VertexCollection > primvertexToken_
Definition: RecoMuonValidator.h:56
cms::cuda::bs
bs
Definition: HistoContainer.h:127
RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsEta_
MEP hStaToGlbDiffNMuonHitsEta_
Definition: RecoMuonValidator.cc:537
TrackingParticle::pt
double pt() const
Transverse momentum. Note this is taken from the first SimTrack only.
Definition: TrackingParticle.h:142
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
RecoMuonValidator::HistoDimensions::minErrPt
double minErrPt
Definition: RecoMuonValidator.h:110
RecoMuonValidator::HistoDimensions::nBinEta
unsigned int nBinEta
Definition: RecoMuonValidator.h:93
RecoMuonValidator::HistoDimensions::maxErrQPt
double maxErrQPt
Definition: RecoMuonValidator.h:111
RecoMuonValidator::countTrackerHits
virtual int countTrackerHits(const reco::Track &track) const
Definition: RecoMuonValidator.cc:1084
MuonSelectors.h
Service.h
RecoMuonValidator::MuonME::hNDof_
MEP hNDof_
Definition: RecoMuonValidator.cc:73
RecoMuonValidator::HistoDimensions::wPull
double wPull
Definition: RecoMuonValidator.h:106
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition: TrackingParticle.h:29
TrackingParticle::phi
double phi() const
Momentum azimuthal angle. Note this is taken from the first SimTrack only.
Definition: TrackingParticle.h:145
RecoMuonValidator::MuonME::hNDof_vs_Eta_
MEP hNDof_vs_Eta_
Definition: RecoMuonValidator.cc:74
reco::BeamSpot
Definition: BeamSpot.h:21
RecoMuonValidator::tpSelector_
TrackingParticleSelector tpSelector_
Definition: RecoMuonValidator.h:69
reco::modules::TrackingParticleSelector
SingleObjectSelector< TrackingParticleCollection, ::TrackingParticleSelector > TrackingParticleSelector
Definition: TrackingParticleSelector.cc:17
reco::Track
Definition: Track.h:27
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
RecoMuonValidator::MuonME::hSimPhi_
MEP hSimPhi_
Definition: RecoMuonValidator.cc:32
reco::SimToMuonCollection
std::map< TrackingParticleRef, std::vector< std::pair< edm::RefToBase< reco::Muon >, double > > > SimToMuonCollection
Definition: MuonTrackType.h:38
RecoMuonValidator::HistoDimensions::nTrks
unsigned int nTrks
Definition: RecoMuonValidator.h:117
TrackingParticle::momentum
Vector momentum() const
spatial momentum vector
Definition: TrackingParticle.h:106
TrackingParticle::vertex
Point vertex() const
Parent vertex position.
Definition: TrackingParticle.h:160
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
RecoMuonValidator::subDir_
std::string subDir_
Definition: RecoMuonValidator.h:59
RecoMuonValidator::HistoDimensions::maxP
double maxP
Definition: RecoMuonValidator.h:86
RecoMuonValidator::HistoDimensions::minErrQPt
double minErrQPt
Definition: RecoMuonValidator.h:111
RecoMuonValidator::MuonME::hErrQPt_vs_Pt_
MEP hErrQPt_vs_Pt_
Definition: RecoMuonValidator.cc:48
reco::TrackBase::dz
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
RecoMuonValidator::muonME_
MuonME * muonME_
Definition: RecoMuonValidator.h:74
RecoMuonValidator::hDim
HistoDimensions hDim
Definition: RecoMuonValidator.h:123
Point3DBase< float, GlobalTag >
reco::GlobalTk
Definition: MuonTrackType.h:28
RecoMuonValidator::beamspotToken_
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
Definition: RecoMuonValidator.h:55
dqm::implementation::DQMStore::save
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:761
reco::TrackBase::phi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
RecoMuonValidator::doAbsEta_
bool doAbsEta_
Definition: RecoMuonValidator.h:65
RecoMuonValidator::CommonME::hMuonAllPhi_
MEP hMuonAllPhi_
Definition: RecoMuonValidator.cc:549
RecoMuonValidator::HistoDimensions::minErrEta
double minErrEta
Definition: RecoMuonValidator.h:112
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::View::size
size_type size() const
HLTTauDQMOffline_cfi.Muons
Muons
Definition: HLTTauDQMOffline_cfi.py:51
RecoMuonValidator::CommonME::hMuonP_
MEP hMuonP_
Definition: RecoMuonValidator.cc:545
RecoMuonValidator::MuonME::hSimP_
MEP hSimP_
Definition: RecoMuonValidator.cc:32
RecoMuonValidator::muAssocLabel_
edm::InputTag muAssocLabel_
Definition: RecoMuonValidator.h:50
RecoMuonValidator::HistoDimensions::nBinPull
unsigned int nBinPull
Definition: RecoMuonValidator.h:105
edm::View
Definition: CaloClusterFwd.h:14
RecoMuonValidator::MuonME::hNLostHits_vs_Pt_
MEP hNLostHits_vs_Pt_
Definition: RecoMuonValidator.cc:64
RecoMuonValidator::HistoDimensions::nBinErr
unsigned int nBinErr
Definition: RecoMuonValidator.h:108
edm::ParameterSet
Definition: ParameterSet.h:47
RecoMuonValidator::CommonME
Definition: RecoMuonValidator.cc:532
RecoMuonValidator::MuonME::hNHits_vs_Pt_
MEP hNHits_vs_Pt_
Definition: RecoMuonValidator.cc:63
RecoMuonValidator::dqmBeginRun
void dqmBeginRun(const edm::Run &, const edm::EventSetup &eventSetup) override
Definition: RecoMuonValidator.cc:800
DetId::Tracker
Definition: DetId.h:25
RecoMuonValidator::HistoDimensions::usePFMuon
bool usePFMuon
Definition: RecoMuonValidator.h:120
RecoMuonValidator::MuonME::hNSim_
MEP hNSim_
Definition: RecoMuonValidator.cc:35
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
RecoMuonValidator::CommonME::hNInvalidHitsITHitPattern_
MEP hNInvalidHitsITHitPattern_
Definition: RecoMuonValidator.cc:541
TrackingRecHit::ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: TrackingRecHit.h:32
RecoMuonValidator::muonLabel_
edm::InputTag muonLabel_
Definition: RecoMuonValidator.h:45
RecoMuonValidator::outputFileName_
std::string outputFileName_
Definition: RecoMuonValidator.h:58
muon::isTightMuon
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
Definition: MuonSelectors.cc:880
RecoMuonValidator::usePFMuon_
bool usePFMuon_
Definition: RecoMuonValidator.h:67
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
RecoMuonValidator::HistoDimensions::maxErrDxy
double maxErrDxy
Definition: RecoMuonValidator.h:114
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
RecoMuonValidator::CommonME::hMuonTrackPt_
MEP hMuonTrackPt_
Definition: RecoMuonValidator.cc:547
HLTObjectMonitor_cfi.muonPhi
muonPhi
Definition: HLTObjectMonitor_cfi.py:102
edm::Service
Definition: Service.h:30
RecoMuonValidator::verbose_
unsigned int verbose_
Definition: RecoMuonValidator.h:42
reco::Muon::pfP4
reco::Candidate::LorentzVector pfP4() const
Definition: Muon.h:97
RecoMuonValidator::MuonME::hdPt_vs_Eta_
MEP hdPt_vs_Eta_
Definition: RecoMuonValidator.cc:53
RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHits_
MEP hStaToGlbDiffNMuonHits_
Definition: RecoMuonValidator.cc:536
RecoMuonValidator::MuonME::MEP
MonitorElement * MEP
Definition: RecoMuonValidator.cc:29
RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsPt_
MEP hTrkToGlbDiffNTrackerHitsPt_
Definition: RecoMuonValidator.cc:538
RecoMuonValidator::doAssoc_
bool doAssoc_
Definition: RecoMuonValidator.h:66
RecoMuonValidator::CommonME::hMuonTrackPhi_
MEP hMuonTrackPhi_
Definition: RecoMuonValidator.cc:547
RecoMuonValidator::MuonME::hPullPt_vs_Pt_
MEP hPullPt_vs_Pt_
Definition: RecoMuonValidator.cc:70
reco::LeafCandidate::charge
int charge() const final
electric charge
Definition: LeafCandidate.h:106
edm::EventSetup
Definition: EventSetup.h:57
RecoMuonValidator::CommonME::MEP
MonitorElement * MEP
Definition: RecoMuonValidator.cc:533
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
edm::RefToBaseVector
Definition: EDProductfwd.h:29
RecoMuonValidator::HistoDimensions::maxErrPhi
double maxErrPhi
Definition: RecoMuonValidator.h:113
RecoMuonValidator::MuonME::hNTrackerHits_
MEP hNTrackerHits_
Definition: RecoMuonValidator.cc:62
RecoMuonValidator::MuonME::hErrQPt_PF_
MEP hErrQPt_PF_
Definition: RecoMuonValidator.cc:52
RecoMuonValidator::CommonME::hMuonPt_
MEP hMuonPt_
Definition: RecoMuonValidator.cc:545
PbPb_ZMuSkimMuonDPG_cff.trackType
trackType
Definition: PbPb_ZMuSkimMuonDPG_cff.py:36
RecoMuonValidator::HistoDimensions::nAssoc
unsigned int nAssoc
Definition: RecoMuonValidator.h:117
RecoMuonValidator::MuonME::fill
void fill(const TrackingParticle *simRef, const Muon *muonRef)
Definition: RecoMuonValidator.cc:379
RecoMuonValidator::subsystemname_
std::string subsystemname_
Definition: RecoMuonValidator.h:60
reco::Muon::track
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
RecoMuonValidator::HistoDimensions::nBinPt
unsigned int nBinPt
Definition: RecoMuonValidator.h:88
Mu
Definition: L1GtObject.h:29
RecoMuonValidator::MuonME::hErrPt_
MEP hErrPt_
Definition: RecoMuonValidator.cc:42
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
std
Definition: JetResolutionObject.h:76
TSOS
TrajectoryStateOnSurface TSOS
Definition: RecoMuonValidator.cc:22
RecoMuonValidator::HistoDimensions::nBinDz
unsigned int nBinDz
Definition: RecoMuonValidator.h:102
StringCutObjectSelector.h
RecoMuonValidator::CommonME::hMuonTrackDxy_
MEP hMuonTrackDxy_
Definition: RecoMuonValidator.cc:547
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
TrackingParticle::p
double p() const
Magnitude of momentum vector. Note this is taken from the first SimTrack only.
Definition: TrackingParticle.h:112
RecoMuonValidator::MuonME
Definition: RecoMuonValidator.cc:28
RecoMuonValidator::muAssocToken_
edm::EDGetTokenT< reco::MuonToTrackingParticleAssociator > muAssocToken_
Definition: RecoMuonValidator.h:51
RecoMuonValidator::beamspotLabel_
edm::InputTag beamspotLabel_
Definition: RecoMuonValidator.h:53
RecoMuonValidator::CommonME::hMuonPhi_
MEP hMuonPhi_
Definition: RecoMuonValidator.cc:545
RecoMuonValidator::CommonME::hMuonTrackEta_
MEP hMuonTrackEta_
Definition: RecoMuonValidator.cc:547
RecoMuonValidator::HistoDimensions::minErrDz
double minErrDz
Definition: RecoMuonValidator.h:115
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
reco::MuonToTrackingParticleAssociator::associateMuons
void associateMuons(MuonToSimCollection &recoToSim, SimToMuonCollection &simToReco, const edm::RefToBaseVector< reco::Muon > &muons, MuonTrackType type, const edm::RefVector< TrackingParticleCollection > &tpColl) const
Definition: MuonToTrackingParticleAssociator.h:25
Exception
Definition: hltDiff.cc:246
RecoMuonValidator::MuonME::hErrPtOverlap_
MEP hErrPtOverlap_
Definition: RecoMuonValidator.cc:44
RecoMuonValidator::MuonME::hdPt_vs_Pt_
MEP hdPt_vs_Pt_
Definition: RecoMuonValidator.cc:54
MuonServiceProxy.h
reco::LeafCandidate::p
double p() const final
magnitude of momentum vector
Definition: LeafCandidate.h:123
RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsEta_
MEP hTrkToGlbDiffNTrackerHitsEta_
Definition: RecoMuonValidator.cc:537
RecoMuonValidator::MuonME::hErrQPt_vs_Eta_
MEP hErrQPt_vs_Eta_
Definition: RecoMuonValidator.cc:47
RecoMuonValidator::CommonME::hMuonTrackP_
MEP hMuonTrackP_
Definition: RecoMuonValidator.cc:547
RecoMuonValidator::MuonME::hMisQPt_
MEP hMisQPt_
Definition: RecoMuonValidator.cc:39
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
TrackingParticleCollection
std::vector< TrackingParticle > TrackingParticleCollection
Definition: TrackingParticleFwd.h:8
RecoMuonValidator::MuonME::hNMuonHits_vs_Eta_
MEP hNMuonHits_vs_Eta_
Definition: RecoMuonValidator.cc:66
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RecoMuonValidator::HistoDimensions::minEta
double minEta
Definition: RecoMuonValidator.h:94
dqm::implementation::IBooker
Definition: DQMStore.h:43
RecoMuonValidator::~RecoMuonValidator
~RecoMuonValidator() override
Definition: RecoMuonValidator.cc:794
RecoMuonValidator::MuonME::hSimEta_
MEP hSimEta_
Definition: RecoMuonValidator.cc:32
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
RecoMuonValidator::HistoDimensions::minPhi
double minPhi
Definition: RecoMuonValidator.h:97
RecoMuonValidator::CommonME::hMuonAllEta_
MEP hMuonAllEta_
Definition: RecoMuonValidator.cc:549
mps_fire.result
result
Definition: mps_fire.py:311
DetId::Muon
Definition: DetId.h:26
RecoMuonValidator::MuonME::hPt_
MEP hPt_
Definition: RecoMuonValidator.cc:34
edm::View::end
const_iterator end() const
RecoMuonValidator::HistoDimensions::maxEta
double maxEta
Definition: RecoMuonValidator.h:94
RecoMuonValidator::RecoMuonValidator
RecoMuonValidator(const edm::ParameterSet &pset)
Definition: RecoMuonValidator.cc:555
TrackingParticleRef
edm::Ref< TrackingParticleCollection > TrackingParticleRef
Definition: TrackingParticleFwd.h:10
RecoMuonValidator::MuonME::hNSimToReco_
MEP hNSimToReco_
Definition: RecoMuonValidator.cc:60
FTS
FreeTrajectoryState FTS
Definition: RecoMuonValidator.cc:23
RecoMuonValidator::primvertexLabel_
edm::InputTag primvertexLabel_
Definition: RecoMuonValidator.h:54
RecoMuonValidator::CommonME::hMuonTrackDz_
MEP hMuonTrackDz_
Definition: RecoMuonValidator.cc:547
RecoMuonValidator::HistoDimensions::nDof
unsigned int nDof
Definition: RecoMuonValidator.h:118
RecoMuonValidator::HistoDimensions::maxPhi
double maxPhi
Definition: RecoMuonValidator.h:97
event
Definition: event.py:1
RecoMuonValidator::HistoDimensions::doAbsEta
bool doAbsEta
Definition: RecoMuonValidator.h:91
edm::Event
Definition: Event.h:73
RecoMuonValidator::MuonME::hNTrksPt_
MEP hNTrksPt_
Definition: RecoMuonValidator.cc:38
reco::TrackBase::dxy
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608
reco::Segments
Definition: MuonTrackType.h:28
RecoMuonValidator::wantTightMuon_
bool wantTightMuon_
Definition: RecoMuonValidator.h:127
RecoMuonValidator::pset
edm::ParameterSet pset
Definition: RecoMuonValidator.h:61
RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHits_
MEP hTrkToGlbDiffNTrackerHits_
Definition: RecoMuonValidator.cc:536
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
RecoMuonValidator::MuonME::hNTrksEta_
MEP hNTrksEta_
Definition: RecoMuonValidator.cc:38
hit
Definition: SiStripHitEffFromCalibTree.cc:88
RecoMuonValidator::HistoDimensions
Definition: RecoMuonValidator.h:83
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
RecoMuonValidator::MuonME::hErrPt_PF_
MEP hErrPt_PF_
Definition: RecoMuonValidator.cc:51
RecoMuonValidator::analyze
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Definition: RecoMuonValidator.cc:813
RecoMuonValidator::muonToken_
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
Definition: RecoMuonValidator.h:48
RecoMuonValidator::MuonME::hNTrackerHits_vs_Pt_
MEP hNTrackerHits_vs_Pt_
Definition: RecoMuonValidator.cc:65