CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes
RecoMuonValidator::MuonME Struct Reference

Public Types

typedef MonitorElementMEP
 

Public Member Functions

void bookHistos (DQMStore::IBooker &ibooker, const string &dirName, const HistoDimensions &hDim)
 
void fill (const TrackingParticle *simRef, const Muon *muonRef)
 

Public Attributes

bool doAbsEta_
 
MEP hChi2_
 
MEP hChi2_vs_Eta_
 
MEP hChi2Norm_
 
MEP hChi2Norm_vs_Eta_
 
MEP hChi2Prob_
 
MEP hChi2Prob_vs_Eta_
 
MEP hdPt_vs_Eta_
 
MEP hdPt_vs_Pt_
 
MEP hErrDxy_
 
MEP hErrDz_
 
MEP hErrEta_
 
MEP hErrEta_vs_Eta_
 
MEP hErrP_
 
MEP hErrP_vs_Eta_
 
MEP hErrP_vs_P_
 
MEP hErrPBarrel_
 
MEP hErrPEndcap_
 
MEP hErrPhi_
 
MEP hErrPOverlap_
 
MEP hErrPt_
 
MEP hErrPt_PF_
 
MEP hErrPt_vs_Eta_
 
MEP hErrPt_vs_Pt_
 
MEP hErrPtBarrel_
 
MEP hErrPtEndcap_
 
MEP hErrPtOverlap_
 
MEP hErrQPt_PF_
 
MEP hErrQPt_vs_Eta_
 
MEP hErrQPt_vs_Pt_
 
MEP hEta_
 
MEP hMisQEta_
 
MEP hMisQPt_
 
MEP hNDof_
 
MEP hNDof_vs_Eta_
 
MEP hNHits_
 
MEP hNHits_vs_Eta_
 
MEP hNHits_vs_Pt_
 
MEP hNLostHits_
 
MEP hNLostHits_vs_Eta_
 
MEP hNLostHits_vs_Pt_
 
MEP hNMuon_
 
MEP hNMuonHits_
 
MEP hNMuonHits_vs_Eta_
 
MEP hNMuonHits_vs_Pt_
 
MEP hNRecoToSim_
 
MEP hNSim_
 
MEP hNSimHits_
 
MEP hNSimToReco_
 
MEP hNTrackerHits_
 
MEP hNTrackerHits_vs_Eta_
 
MEP hNTrackerHits_vs_Pt_
 
MEP hNTrks_
 
MEP hNTrksEta_
 
MEP hNTrksPt_
 
MEP hP_
 
MEP hPFMomAssCorrectness
 
MEP hPhi_
 
MEP hPt_
 
MEP hPt_vs_PFMomAssCorrectness
 
MEP hPullDxy_
 
MEP hPullDz_
 
MEP hPullEta_
 
MEP hPullEta_vs_Eta_
 
MEP hPullEta_vs_Pt_
 
MEP hPullPhi_
 
MEP hPullPhi_vs_Eta_
 
MEP hPullPt_
 
MEP hPullPt_vs_Eta_
 
MEP hPullPt_vs_Pt_
 
MEP hPullQPt_
 
MEP hSimDxy_
 
MEP hSimDz_
 
MEP hSimEta_
 
MEP hSimP_
 
MEP hSimPhi_
 
MEP hSimPt_
 
bool usePFMuon_
 

Detailed Description

Definition at line 28 of file RecoMuonValidator.cc.

Member Typedef Documentation

Definition at line 29 of file RecoMuonValidator.cc.

Member Function Documentation

void RecoMuonValidator::MuonME::bookHistos ( DQMStore::IBooker ibooker,
const string &  dirName,
const HistoDimensions hDim 
)
inline

Definition at line 82 of file RecoMuonValidator.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), RecoMuonValidator::HistoDimensions::doAbsEta, RecoMuonValidator::HistoDimensions::maxDxy, RecoMuonValidator::HistoDimensions::maxDz, RecoMuonValidator::HistoDimensions::maxErrDxy, RecoMuonValidator::HistoDimensions::maxErrDz, RecoMuonValidator::HistoDimensions::maxErrEta, RecoMuonValidator::HistoDimensions::maxErrP, RecoMuonValidator::HistoDimensions::maxErrPhi, RecoMuonValidator::HistoDimensions::maxErrPt, RecoMuonValidator::HistoDimensions::maxErrQPt, RecoMuonValidator::HistoDimensions::maxEta, RecoMuonValidator::HistoDimensions::maxP, RecoMuonValidator::HistoDimensions::maxPhi, RecoMuonValidator::HistoDimensions::maxPt, RecoMuonValidator::HistoDimensions::minDxy, RecoMuonValidator::HistoDimensions::minDz, RecoMuonValidator::HistoDimensions::minErrDxy, RecoMuonValidator::HistoDimensions::minErrDz, RecoMuonValidator::HistoDimensions::minErrEta, RecoMuonValidator::HistoDimensions::minErrP, RecoMuonValidator::HistoDimensions::minErrPhi, RecoMuonValidator::HistoDimensions::minErrPt, RecoMuonValidator::HistoDimensions::minErrQPt, RecoMuonValidator::HistoDimensions::minEta, RecoMuonValidator::HistoDimensions::minP, RecoMuonValidator::HistoDimensions::minPhi, RecoMuonValidator::HistoDimensions::minPt, RecoMuonValidator::HistoDimensions::nAssoc, RecoMuonValidator::HistoDimensions::nBinDxy, RecoMuonValidator::HistoDimensions::nBinDz, RecoMuonValidator::HistoDimensions::nBinErr, RecoMuonValidator::HistoDimensions::nBinEta, RecoMuonValidator::HistoDimensions::nBinP, RecoMuonValidator::HistoDimensions::nBinPhi, RecoMuonValidator::HistoDimensions::nBinPt, RecoMuonValidator::HistoDimensions::nBinPull, RecoMuonValidator::HistoDimensions::nDof, nHits, RecoMuonValidator::HistoDimensions::nTrks, dqm::implementation::NavigatorBase::setCurrentFolder(), RecoMuonValidator::HistoDimensions::usePFMuon, and RecoMuonValidator::HistoDimensions::wPull.

Referenced by RecoMuonValidator::bookHistograms().

84  {
85  ibooker.cd();
86  ibooker.setCurrentFolder(dirName);
87 
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 
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;
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  };
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
HistoDimensions hDim
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
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void RecoMuonValidator::MuonME::fill ( const TrackingParticle simRef,
const Muon muonRef 
)
inline

Definition at line 379 of file RecoMuonValidator.cc.

References TrackingParticle::charge(), reco::LeafCandidate::charge(), funct::cos(), reco::LeafCandidate::eta(), TrackingParticle::eta(), edm::Ref< C, T, F >::isNonnull(), TrackingParticle::momentum(), TrackingParticle::p(), reco::LeafCandidate::p(), reco::Muon::pfP4(), reco::LeafCandidate::phi(), TrackingParticle::phi(), TrackingParticle::pt(), reco::LeafCandidate::pt(), funct::sin(), reco::Muon::track(), TrackingParticle::vertex(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by RecoMuonValidator::analyze().

379  {
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  };
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
double pt() const final
transverse momentum
Vector momentum() const
spatial momentum vector
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double pt() const
Transverse momentum. Note this is taken from the first SimTrack only.
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
reco::Candidate::LorentzVector pfP4() const
Definition: Muon.h:97
void Fill(long long x)
float charge() const
Electric charge. Note this is taken from the first SimTrack only.
double p() const final
magnitude of momentum vector
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double p() const
Magnitude of momentum vector. Note this is taken from the first SimTrack only.
double eta() const
Momentum pseudorapidity. Note this is taken from the first SimTrack only.
Point vertex() const
Parent vertex position.
double phi() const final
momentum azimuthal angle
T x() const
Definition: PV3DBase.h:59
double phi() const
Momentum azimuthal angle. Note this is taken from the first SimTrack only.
int charge() const final
electric charge
double eta() const final
momentum pseudorapidity

Member Data Documentation

bool RecoMuonValidator::MuonME::doAbsEta_

Definition at line 76 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2_

Definition at line 73 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2_vs_Eta_

Definition at line 74 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Norm_

Definition at line 73 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Norm_vs_Eta_

Definition at line 74 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Prob_

Definition at line 73 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Prob_vs_Eta_

Definition at line 74 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hdPt_vs_Eta_

Definition at line 53 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hdPt_vs_Pt_

Definition at line 54 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrDxy_

Definition at line 45 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrDz_

Definition at line 45 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrEta_

Definition at line 42 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrEta_vs_Eta_

Definition at line 48 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_

Definition at line 42 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_vs_Eta_

Definition at line 47 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_vs_P_

Definition at line 48 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPBarrel_

Definition at line 43 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPEndcap_

Definition at line 43 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPhi_

Definition at line 42 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPOverlap_

Definition at line 43 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_

Definition at line 42 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_PF_

Definition at line 51 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_vs_Eta_

Definition at line 47 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_vs_Pt_

Definition at line 48 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtBarrel_

Definition at line 44 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtEndcap_

Definition at line 44 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtOverlap_

Definition at line 44 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_PF_

Definition at line 52 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_vs_Eta_

Definition at line 47 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_vs_Pt_

Definition at line 48 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hEta_

Definition at line 34 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hMisQEta_

Definition at line 39 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hMisQPt_

Definition at line 39 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNDof_

Definition at line 73 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNDof_vs_Eta_

Definition at line 74 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_

Definition at line 62 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_vs_Eta_

Definition at line 63 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_vs_Pt_

Definition at line 63 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_

Definition at line 62 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_vs_Eta_

Definition at line 64 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_vs_Pt_

Definition at line 64 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNMuon_

Definition at line 35 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_

Definition at line 62 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_vs_Eta_

Definition at line 66 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_vs_Pt_

Definition at line 66 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNRecoToSim_

Definition at line 60 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNSim_

Definition at line 35 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNSimHits_

Definition at line 59 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNSimToReco_

Definition at line 60 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_

Definition at line 62 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_vs_Eta_

Definition at line 65 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_vs_Pt_

Definition at line 65 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrks_

Definition at line 38 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNTrksEta_

Definition at line 38 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrksPt_

Definition at line 38 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hP_

Definition at line 34 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPFMomAssCorrectness

Definition at line 55 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPhi_

Definition at line 34 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPt_

Definition at line 34 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPt_vs_PFMomAssCorrectness

Definition at line 56 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullDxy_

Definition at line 69 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullDz_

Definition at line 69 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_

Definition at line 69 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_vs_Eta_

Definition at line 70 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_vs_Pt_

Definition at line 70 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPhi_

Definition at line 69 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPhi_vs_Eta_

Definition at line 70 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_

Definition at line 69 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_vs_Eta_

Definition at line 70 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_vs_Pt_

Definition at line 70 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullQPt_

Definition at line 69 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hSimDxy_

Definition at line 32 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimDz_

Definition at line 32 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimEta_

Definition at line 32 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimP_

Definition at line 32 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimPhi_

Definition at line 32 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimPt_

Definition at line 32 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

bool RecoMuonValidator::MuonME::usePFMuon_

Definition at line 77 of file RecoMuonValidator.cc.