CMS 3D CMS Logo

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

Public Types

typedef MonitorElementMEP
 

Public Member Functions

void bookHistograms (DQMStore *dqm, 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 84 of file RecoMuonValidator.cc.

Member Typedef Documentation

Definition at line 85 of file RecoMuonValidator.cc.

Member Function Documentation

void RecoMuonValidator::MuonME::bookHistograms ( DQMStore dqm,
const string &  dirName,
const HistoDimensions hDim 
)
inline

Definition at line 139 of file RecoMuonValidator.cc.

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

Referenced by RecoMuonValidator::RecoMuonValidator().

140  {
141  dqm->cd();
142  dqm->setCurrentFolder(dirName.c_str());
143 
144  doAbsEta_ = hDim.doAbsEta;
145  usePFMuon_ = hDim.usePFMuon;
146 
147  //histograms for efficiency plots
148  hP_ = dqm->book1D("P" , "p of recoTracks" , hDim.nBinP , hDim.minP , hDim.maxP );
149  hPt_ = dqm->book1D("Pt" , "p_{T} of recoTracks", hDim.nBinPt , hDim.minPt , hDim.maxPt );
150  hEta_ = dqm->book1D("Eta", "#eta of recoTracks" , hDim.nBinEta, hDim.minEta, hDim.maxEta);
151  hPhi_ = dqm->book1D("Phi", "#phi of recoTracks" , hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
152 
153  hSimP_ = dqm->book1D("SimP" , "p of simTracks" , hDim.nBinP , hDim.minP , hDim.maxP );
154  hSimPt_ = dqm->book1D("SimPt" , "p_{T} of simTracks", hDim.nBinPt , hDim.minPt , hDim.maxPt );
155  hSimEta_ = dqm->book1D("SimEta", "#eta of simTracks" , hDim.nBinEta, hDim.minEta, hDim.maxEta);
156  hSimPhi_ = dqm->book1D("SimPhi", "#phi of simTracks" , hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
157  hSimDxy_ = dqm->book1D("SimDxy", "Dxy of simTracks" , hDim.nBinDxy, hDim.minDxy, hDim.maxDxy);
158  hSimDz_ = dqm->book1D("Dz", "Dz of simTracks" , hDim.nBinDz, hDim.minDz, hDim.maxDz);
159 
160  //track multiplicities
161  hNSim_ = dqm->book1D("NSim" , "Number of particles per event", hDim.nTrks, -0.5, hDim.nTrks+0.5);
162  hNMuon_ = dqm->book1D("NMuon", "Number of muons per event" , hDim.nTrks, -0.5, hDim.nTrks+0.5);
163 
164  // - Misc. variables
165  hNTrks_ = dqm->book1D("NTrks", "Number of reco tracks per event", hDim.nTrks, -0.5, hDim.nTrks+0.5);
166  hNTrksEta_ = dqm->book1D("NTrksEta", "Number of reco tracks vs #eta", hDim.nBinEta, hDim.minEta, hDim.maxEta);
167  hNTrksPt_ = dqm->book1D("NTrksPt", "Number of reco tracks vs p_{T}", hDim.nBinPt, hDim.minPt, hDim.maxPt);
168 
169  hMisQPt_ = dqm->book1D("MisQPt" , "Charge mis-id vs Pt" , hDim.nBinPt , hDim.minPt , hDim.maxPt );
170  hMisQEta_ = dqm->book1D("MisQEta", "Charge mis-id vs Eta", hDim.nBinEta, hDim.minEta, hDim.maxEta);
171 
172  // - Resolutions
173  hErrP_ = dqm->book1D("ErrP" , "#Delta(p)/p" , hDim.nBinErr, hDim.minErrP , hDim.maxErrP );
174  hErrPBarrel_ = dqm->book1D("ErrP_barrel" , "#Delta(p)/p" , hDim.nBinErr, hDim.minErrP , hDim.maxErrP );
175  hErrPOverlap_ = dqm->book1D("ErrP_overlap" , "#Delta(p)/p" , hDim.nBinErr, hDim.minErrP , hDim.maxErrP );
176  hErrPEndcap_ = dqm->book1D("ErrP_endcap" , "#Delta(p)/p" , hDim.nBinErr, hDim.minErrP , hDim.maxErrP );
177  hErrPt_ = dqm->book1D("ErrPt" , "#Delta(p_{T})/p_{T}", hDim.nBinErr, hDim.minErrPt , hDim.maxErrPt );
178  hErrPtBarrel_ = dqm->book1D("ErrPt_barrel" , "#Delta(p_{T})/p_{T}", hDim.nBinErr, hDim.minErrPt , hDim.maxErrPt );
179  hErrPtOverlap_ = dqm->book1D("ErrPt_overlap" , "#Delta(p_{T})/p_{T}", hDim.nBinErr, hDim.minErrPt , hDim.maxErrPt );
180  hErrPtEndcap_ = dqm->book1D("ErrPt_endcap" , "#Delta(p_{T})/p_{T}", hDim.nBinErr, hDim.minErrPt , hDim.maxErrPt );
181  hErrEta_ = dqm->book1D("ErrEta", "#sigma(#eta))" , hDim.nBinErr, hDim.minErrEta, hDim.maxErrEta);
182  hErrPhi_ = dqm->book1D("ErrPhi", "#sigma(#phi)" , hDim.nBinErr, hDim.minErrPhi, hDim.maxErrPhi);
183  hErrDxy_ = dqm->book1D("ErrDxy", "#sigma(d_{xy})" , hDim.nBinErr, hDim.minErrDxy, hDim.maxErrDxy);
184  hErrDz_ = dqm->book1D("ErrDz" , "#sigma(d_{z})" , hDim.nBinErr, hDim.minErrDz , hDim.maxErrDz );
185 
186  //PF-RECO comparisons
187  if (usePFMuon_) {
188  hErrPt_PF_ = dqm->book1D("ErrPt_PF" , "#Delta(p_{T})|_{PF}/p_{T}", hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt );
189  hErrQPt_PF_ = dqm->book1D("ErrQPt_PF" , "#Delta(q/p_{T})|_{PF}/(q/p_{T})", hDim.nBinErr, hDim.minErrQPt, hDim.maxErrQPt);
190 
191  hPFMomAssCorrectness = dqm->book1D("hPFMomAssCorrectness", "Corrected momentum assignement PF/RECO",2,0.5,2.5);
192  hPt_vs_PFMomAssCorrectness = dqm->book2D("hPt_vs_PFMomAssCorrectness", "Corrected momentum assignement PF/RECO", hDim.nBinPt, hDim.minPt, hDim.maxP, 2, 0.5, 2.5);
193 
194  hdPt_vs_Pt_ = dqm->book2D("dPt_vs_Pt", "#Delta(p_{T}) vs p_{T}", hDim.nBinPt, hDim.minPt, hDim.maxPt, hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
195  hdPt_vs_Eta_ = dqm->book2D("dPt_vs_Eta", "#Delta(p_{T}) vs #eta", hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
196  }
197 
198  // -- Resolutions vs Eta
199  hErrP_vs_Eta_ = dqm->book2D("ErrP_vs_Eta", "#Delta(p)/p vs #eta",
200  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, hDim.minErrP, hDim.maxErrP);
201  hErrPt_vs_Eta_ = dqm->book2D("ErrPt_vs_Eta", "#Delta(p_{T})/p_{T} vs #eta",
202  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
203  hErrQPt_vs_Eta_ = dqm->book2D("ErrQPt_vs_Eta", "#Delta(q/p_{T})/(q/p_{T}) vs #eta",
204  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, hDim.minErrQPt, hDim.maxErrQPt);
205  hErrEta_vs_Eta_ = dqm->book2D("ErrEta_vs_Eta", "#sigma(#eta) vs #eta",
206  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, hDim.minErrEta, hDim.maxErrEta);
207 
208  // -- Resolutions vs momentum
209  hErrP_vs_P_ = dqm->book2D("ErrP_vs_P", "#Delta(p)/p vs p",
210  hDim.nBinP, hDim.minP, hDim.maxP, hDim.nBinErr, hDim.minErrP, hDim.maxErrP);
211  hErrPt_vs_Pt_ = dqm->book2D("ErrPt_vs_Pt", "#Delta(p_{T})/p_{T} vs p_{T}",
212  hDim.nBinPt, hDim.minPt, hDim.maxPt, hDim.nBinErr, hDim.minErrPt, hDim.maxErrPt);
213  hErrQPt_vs_Pt_ = dqm->book2D("ErrQPt_vs_Pt", "#Delta(q/p_{T})/(q/p_{T}) vs p_{T}",
214  hDim.nBinPt, hDim.minPt, hDim.maxPt, hDim.nBinErr, hDim.minErrQPt, hDim.maxErrQPt);
215 
216  // - Pulls
217  hPullPt_ = dqm->book1D("PullPt" , "Pull(#p_{T})" , hDim.nBinPull, -hDim.wPull, hDim.wPull);
218  hPullEta_ = dqm->book1D("PullEta", "Pull(#eta)" , hDim.nBinPull, -hDim.wPull, hDim.wPull);
219  hPullPhi_ = dqm->book1D("PullPhi", "Pull(#phi)" , hDim.nBinPull, -hDim.wPull, hDim.wPull);
220  hPullQPt_ = dqm->book1D("PullQPt", "Pull(q/p_{T})", hDim.nBinPull, -hDim.wPull, hDim.wPull);
221  hPullDxy_ = dqm->book1D("PullDxy", "Pull(D_{xy})" , hDim.nBinPull, -hDim.wPull, hDim.wPull);
222  hPullDz_ = dqm->book1D("PullDz" , "Pull(D_{z})" , hDim.nBinPull, -hDim.wPull, hDim.wPull);
223 
224  // -- Pulls vs Eta
225  hPullPt_vs_Eta_ = dqm->book2D("PullPt_vs_Eta", "Pull(p_{T}) vs #eta",
226  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinPull, -hDim.wPull, hDim.wPull);
227  hPullEta_vs_Eta_ = dqm->book2D("PullEta_vs_Eta", "Pull(#eta) vs #eta",
228  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinPull, -hDim.wPull, hDim.wPull);
229  hPullPhi_vs_Eta_ = dqm->book2D("PullPhi_vs_Eta", "Pull(#phi) vs #eta",
230  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinPull, -hDim.wPull, hDim.wPull);
231 
232  // -- Pulls vs Pt
233  hPullPt_vs_Pt_ = dqm->book2D("PullPt_vs_Pt", "Pull(p_{T}) vs p_{T}",
234  hDim.nBinPt, hDim.minPt, hDim.maxPt, hDim.nBinPull, -hDim.wPull, hDim.wPull);
235  hPullEta_vs_Pt_ = dqm->book2D("PullEta_vs_Pt", "Pull(#eta) vs p_{T}",
236  hDim.nBinPt, hDim.minPt, hDim.maxPt, hDim.nBinPull, -hDim.wPull, hDim.wPull);
237 
238  // -- Number of Hits
239  const int nHits = 100;
240  hNHits_ = dqm->book1D("NHits", "Number of hits", nHits+1, -0.5, nHits+0.5);
241  hNHits_vs_Pt_ = dqm->book2D("NHits_vs_Pt", "Number of hits vs p_{T}",
242  hDim.nBinPt, hDim.minPt, hDim.maxPt, nHits/4+1, -0.25, nHits+0.25);
243  hNHits_vs_Eta_ = dqm->book2D("NHits_vs_Eta", "Number of hits vs #eta",
244  hDim.nBinEta, hDim.minEta, hDim.maxEta, nHits/4+1, -0.25, nHits+0.25);
245  hNSimHits_ = dqm->book1D("NSimHits", "Number of simHits", nHits+1, -0.5, nHits+0.5);
246 
247  const int nLostHits = 5;
248  hNLostHits_ = dqm->book1D("NLostHits", "Number of Lost hits", nLostHits+1, -0.5, nLostHits+0.5);
249  hNLostHits_vs_Pt_ = dqm->book2D("NLostHits_vs_Pt", "Number of lost Hits vs p_{T}",
250  hDim.nBinPt, hDim.minPt, hDim.maxPt, nLostHits+1, -0.5, nLostHits+0.5);
251  hNLostHits_vs_Eta_ = dqm->book2D("NLostHits_vs_Eta", "Number of lost Hits vs #eta",
252  hDim.nBinEta, hDim.minEta, hDim.maxEta, nLostHits+1, -0.5, nLostHits+0.5);
253 
254  const int nTrackerHits = 40;
255  hNTrackerHits_ = dqm->book1D("NTrackerHits", "Number of valid tracker hits", nTrackerHits+1, -0.5, nTrackerHits+0.5);
256  hNTrackerHits_vs_Pt_ = dqm->book2D("NTrackerHits_vs_Pt", "Number of valid traker hits vs p_{T}",
257  hDim.nBinPt, hDim.minPt, hDim.maxPt, nTrackerHits/4+1, -0.25, nTrackerHits+0.25);
258  hNTrackerHits_vs_Eta_ = dqm->book2D("NTrackerHits_vs_Eta", "Number of valid tracker hits vs #eta",
259  hDim.nBinEta, hDim.minEta, hDim.maxEta, nTrackerHits/4+1, -0.25, nTrackerHits+0.25);
260 
261  const int nMuonHits = 60;
262  hNMuonHits_ = dqm->book1D("NMuonHits", "Number of valid muon hits", nMuonHits+1, -0.5, nMuonHits+0.5);
263  hNMuonHits_vs_Pt_ = dqm->book2D("NMuonHits_vs_Pt", "Number of valid muon hits vs p_{T}",
264  hDim.nBinPt, hDim.minPt, hDim.maxPt, nMuonHits/4+1, -0.25, nMuonHits+0.25);
265  hNMuonHits_vs_Eta_ = dqm->book2D("NMuonHits_vs_Eta", "Number of valid muon hits vs #eta",
266  hDim.nBinEta, hDim.minEta, hDim.maxEta, nMuonHits/4+1, -0.25, nMuonHits+0.25);
267 
268  hNDof_ = dqm->book1D("NDof", "Number of DoF", hDim.nDof+1, -0.5, hDim.nDof+0.5);
269  hChi2_ = dqm->book1D("Chi2", "#Chi^{2}", hDim.nBinErr, 0, 200);
270  hChi2Norm_ = dqm->book1D("Chi2Norm", "Normalized #Chi^{2}", hDim.nBinErr, 0, 50);
271  hChi2Prob_ = dqm->book1D("Chi2Prob", "Prob(#Chi^{2})", hDim.nBinErr, 0, 1);
272 
273  hNDof_vs_Eta_ = dqm->book2D("NDof_vs_Eta", "Number of DoF vs #eta",
274  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nDof+1, -0.5, hDim.nDof+0.5);
275  hChi2_vs_Eta_ = dqm->book2D("Chi2_vs_Eta", "#Chi^{2} vs #eta",
276  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, 0., 200.);
277  hChi2Norm_vs_Eta_ = dqm->book2D("Chi2Norm_vs_Eta", "Normalized #Chi^{2} vs #eta",
278  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, 0., 50.);
279  hChi2Prob_vs_Eta_ = dqm->book2D("Chi2Prob_vs_Eta", "Prob(#Chi^{2}) vs #eta",
280  hDim.nBinEta, hDim.minEta, hDim.maxEta, hDim.nBinErr, 0., 1.);
281 
282  hNSimToReco_ = dqm->book1D("NSimToReco", "Number of associated reco tracks", hDim.nAssoc+1, -0.5, hDim.nAssoc+0.5);
283  hNRecoToSim_ = dqm->book1D("NRecoToSim", "Number of associated sim TP's", hDim.nAssoc+1, -0.5, hDim.nAssoc+0.5);
284 
285  };
unsigned int nAssoc
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
unsigned int nBinPhi
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
unsigned int nBinPull
unsigned int nTrks
unsigned int nBinDxy
unsigned int nBinEta
unsigned int nBinPt
unsigned int nBinErr
unsigned int nBinDz
unsigned int nBinP
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void RecoMuonValidator::MuonME::fill ( const TrackingParticle simRef,
const Muon muonRef 
)
inline

Definition at line 290 of file RecoMuonValidator.cc.

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

Referenced by RecoMuonValidator::analyze().

291  {
292 
293  const double simP = simRef->p();
294  const double simPt = simRef->pt();
295  const double simEta = doAbsEta_ ? fabs(simRef->eta()) : simRef->eta();
296  const double simPhi = simRef->phi();
297  const double simQ = simRef->charge();
298  const double simQPt = simQ/simPt;
299 
300  GlobalPoint simVtx(simRef->vertex().x(), simRef->vertex().y(), simRef->vertex().z());
301  GlobalVector simMom(simRef->momentum().x(), simRef->momentum().y(), simRef->momentum().z());
302  const double simDxy = -simVtx.x()*sin(simPhi)+simVtx.y()*cos(simPhi);
303  const double simDz = simVtx.z() - (simVtx.x()*simMom.x()+simVtx.y()*simMom.y())*simMom.z()/simMom.perp2();
304 
305  const double recoQ = muonRef->charge();
306  if ( simQ*recoQ < 0 ) {
307  hMisQPt_ ->Fill(simPt );
308  hMisQEta_->Fill(simEta);
309  }
310 
311  double recoP, recoPt, recoEta, recoPhi, recoQPt;
312  if (usePFMuon_) {
313  // const double origRecoP = muonRef->p();
314  const double origRecoPt = muonRef->pt();
315  // const double origRecoEta = muonRef->eta();
316  // const double origRecoPhi = muonRef->phi();
317  const double origRecoQPt = recoQ/origRecoPt;
318  recoP = muonRef->pfP4().P();
319  recoPt = muonRef->pfP4().Pt();
320  recoEta = muonRef->pfP4().Eta();
321  recoPhi = muonRef->pfP4().Phi();
322  recoQPt = recoQ/recoPt;
323  hErrPt_PF_->Fill((recoPt-origRecoPt)/origRecoPt);
324  hErrQPt_PF_->Fill((recoQPt-origRecoQPt)/origRecoQPt);
325 
326  hdPt_vs_Eta_->Fill(recoEta,recoPt-origRecoPt);
327  hdPt_vs_Pt_->Fill(recoPt,recoPt-origRecoPt);
328 
329  int theCorrectPFAss = (fabs(recoPt-simPt) < fabs(origRecoPt - simPt))? 1 : 2;
330  hPFMomAssCorrectness->Fill(theCorrectPFAss);
331  hPt_vs_PFMomAssCorrectness->Fill(simPt,theCorrectPFAss);
332  }
333 
334  else {
335  recoP = muonRef->p();
336  recoPt = muonRef->pt();
337  recoEta = muonRef->eta();
338  recoPhi = muonRef->phi();
339  recoQPt = recoQ/recoPt;
340  }
341 
342  const double errP = (recoP-simP)/simP;
343  const double errPt = (recoPt-simPt)/simPt;
344  const double errEta = (recoEta-simEta)/simEta;
345  const double errPhi = (recoPhi-simPhi)/simPhi;
346  const double errQPt = (recoQPt-simQPt)/simQPt;
347 
348  hP_ ->Fill(simP);
349  hPt_ ->Fill(simPt );
350  hEta_->Fill(simEta);
351  hPhi_->Fill(simPhi);
352 
353  hErrP_ ->Fill(errP );
354  hErrPt_ ->Fill(errPt );
355  hErrEta_->Fill(errEta);
356  hErrPhi_->Fill(errPhi);
357 
358  if(fabs(simEta) > 0. && fabs(simEta) < 0.8) {
359  hErrPBarrel_->Fill(errP);
360  hErrPtBarrel_->Fill(errPt);
361  } else if (fabs(simEta) > 0.8 && fabs(simEta) < 1.2) {
362  hErrPOverlap_->Fill(errP);
363  hErrPtOverlap_->Fill(errPt);
364  } else if (fabs(simEta) > 1.2 ){
365  hErrPEndcap_->Fill(errP);
366  hErrPtEndcap_->Fill(errPt);
367  }
368 
369  hErrP_vs_Eta_ ->Fill(simEta, errP );
370  hErrPt_vs_Eta_ ->Fill(simEta, errPt );
371  hErrQPt_vs_Eta_->Fill(simEta, errQPt);
372 
373  hErrP_vs_P_ ->Fill(simP , errP );
374  hErrPt_vs_Pt_ ->Fill(simPt , errPt );
375  hErrQPt_vs_Pt_->Fill(simQPt, errQPt);
376 
377  hErrEta_vs_Eta_->Fill(simEta, errEta);
378 
379  //access from track
380  reco::TrackRef recoRef = muonRef->track();
381  if (recoRef.isNonnull()) {
382 
383  // Number of reco-hits
384  const int nRecoHits = recoRef->numberOfValidHits();
385  const int nLostHits = recoRef->numberOfLostHits();
386 
387  hNHits_->Fill(nRecoHits);
388  hNHits_vs_Pt_ ->Fill(simPt , nRecoHits);
389  hNHits_vs_Eta_->Fill(simEta, nRecoHits);
390 
391  hNLostHits_->Fill(nLostHits);
392  hNLostHits_vs_Pt_ ->Fill(simPt , nLostHits);
393  hNLostHits_vs_Eta_->Fill(simEta, nLostHits);
394 
395  const double recoNDof = recoRef->ndof();
396  const double recoChi2 = recoRef->chi2();
397  const double recoChi2Norm = recoRef->normalizedChi2();
398  const double recoChi2Prob = TMath::Prob(recoRef->chi2(), static_cast<int>(recoRef->ndof()));
399 
400  hNDof_->Fill(recoNDof);
401  hChi2_->Fill(recoChi2);
402  hChi2Norm_->Fill(recoChi2Norm);
403  hChi2Prob_->Fill(recoChi2Prob);
404 
405  hNDof_vs_Eta_->Fill(simEta, recoNDof);
406  hChi2_vs_Eta_->Fill(simEta, recoChi2);
407  hChi2Norm_vs_Eta_->Fill(simEta, recoChi2Norm);
408  hChi2Prob_vs_Eta_->Fill(simEta, recoChi2Prob);
409 
410  const double recoDxy = recoRef->dxy();
411  const double recoDz = recoRef->dz();
412 
413  const double errDxy = (recoDxy-simDxy)/simDxy;
414  const double errDz = (recoDz-simDz)/simDz;
415  hErrDxy_->Fill(errDxy);
416  hErrDz_ ->Fill(errDz );
417 
418  const double pullPt = (recoPt-simPt)/recoRef->ptError();
419  const double pullQPt = (recoQPt-simQPt)/recoRef->qoverpError();
420  const double pullEta = (recoEta-simEta)/recoRef->etaError();
421  const double pullPhi = (recoPhi-simPhi)/recoRef->phiError();
422  const double pullDxy = (recoDxy-simDxy)/recoRef->dxyError();
423  const double pullDz = (recoDz-simDz)/recoRef->dzError();
424 
425  hPullPt_ ->Fill(pullPt );
426  hPullEta_->Fill(pullEta);
427  hPullPhi_->Fill(pullPhi);
428  hPullQPt_->Fill(pullQPt);
429  hPullDxy_->Fill(pullDxy);
430  hPullDz_ ->Fill(pullDz );
431 
432  hPullPt_vs_Eta_->Fill(simEta, pullPt);
433  hPullPt_vs_Pt_ ->Fill(simPt, pullPt);
434 
435  hPullEta_vs_Eta_->Fill(simEta, pullEta);
436  hPullPhi_vs_Eta_->Fill(simEta, pullPhi);
437 
438  hPullEta_vs_Pt_->Fill(simPt, pullEta);
439  }
440  };
virtual double p() const
magnitude of momentum vector
int charge() const
electric charge
Definition: ParticleBase.h:54
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual TrackRef track() const
reference to a Track
Definition: Muon.h:50
double pt() const
transverse momentum
Definition: ParticleBase.h:157
reco::Candidate::LorentzVector pfP4() const
Definition: Muon.h:103
virtual double eta() const
momentum pseudorapidity
void Fill(long long x)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
double phi() const
momentum azimuthal angle
Definition: ParticleBase.h:162
double p() const
magnitude of momentum vector
Definition: ParticleBase.h:99
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual int charge() const
electric charge
virtual double pt() const
transverse momentum
Vector momentum() const
spatial momentum vector
Definition: ParticleBase.h:86
const Point & vertex() const
vertex position
Definition: ParticleBase.h:228
T x() const
Definition: PV3DBase.h:61
virtual double phi() const
momentum azimuthal angle
double eta() const
momentum pseudorapidity
Definition: ParticleBase.h:173

Member Data Documentation

bool RecoMuonValidator::MuonME::doAbsEta_

Definition at line 132 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2_

Definition at line 129 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2_vs_Eta_

Definition at line 130 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Norm_

Definition at line 129 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Norm_vs_Eta_

Definition at line 130 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Prob_

Definition at line 129 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Prob_vs_Eta_

Definition at line 130 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hdPt_vs_Eta_

Definition at line 109 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hdPt_vs_Pt_

Definition at line 110 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrDxy_

Definition at line 101 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrDz_

Definition at line 101 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrEta_

Definition at line 98 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrEta_vs_Eta_

Definition at line 104 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_

Definition at line 98 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_vs_Eta_

Definition at line 103 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_vs_P_

Definition at line 104 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPBarrel_

Definition at line 99 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPEndcap_

Definition at line 99 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPhi_

Definition at line 98 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPOverlap_

Definition at line 99 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_

Definition at line 98 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_PF_

Definition at line 107 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_vs_Eta_

Definition at line 103 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_vs_Pt_

Definition at line 104 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtBarrel_

Definition at line 100 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtEndcap_

Definition at line 100 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtOverlap_

Definition at line 100 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_PF_

Definition at line 108 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_vs_Eta_

Definition at line 103 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_vs_Pt_

Definition at line 104 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hEta_

Definition at line 90 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hMisQEta_

Definition at line 95 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hMisQPt_

Definition at line 95 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNDof_

Definition at line 129 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNDof_vs_Eta_

Definition at line 130 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_

Definition at line 118 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_vs_Eta_

Definition at line 119 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_vs_Pt_

Definition at line 119 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_

Definition at line 118 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_vs_Eta_

Definition at line 120 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_vs_Pt_

Definition at line 120 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNMuon_

Definition at line 91 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_

Definition at line 118 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_vs_Eta_

Definition at line 122 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_vs_Pt_

Definition at line 122 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNRecoToSim_

Definition at line 116 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNSim_

Definition at line 91 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNSimHits_

Definition at line 115 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNSimToReco_

Definition at line 116 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_

Definition at line 118 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_vs_Eta_

Definition at line 121 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_vs_Pt_

Definition at line 121 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrks_

Definition at line 94 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNTrksEta_

Definition at line 94 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrksPt_

Definition at line 94 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hP_

Definition at line 90 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPFMomAssCorrectness

Definition at line 111 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPhi_

Definition at line 90 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPt_

Definition at line 90 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPt_vs_PFMomAssCorrectness

Definition at line 112 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullDxy_

Definition at line 125 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullDz_

Definition at line 125 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_

Definition at line 125 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_vs_Eta_

Definition at line 126 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_vs_Pt_

Definition at line 126 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPhi_

Definition at line 125 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPhi_vs_Eta_

Definition at line 126 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_

Definition at line 125 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_vs_Eta_

Definition at line 126 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_vs_Pt_

Definition at line 126 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullQPt_

Definition at line 125 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hSimDxy_

Definition at line 88 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimDz_

Definition at line 88 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimEta_

Definition at line 88 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimP_

Definition at line 88 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimPhi_

Definition at line 88 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimPt_

Definition at line 88 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

bool RecoMuonValidator::MuonME::usePFMuon_

Definition at line 133 of file RecoMuonValidator.cc.