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 77 of file RecoMuonValidator.cc.

Member Typedef Documentation

Definition at line 78 of file RecoMuonValidator.cc.

Member Function Documentation

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

Definition at line 132 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().

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

Definition at line 283 of file RecoMuonValidator.cc.

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

Referenced by RecoMuonValidator::analyze().

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

Member Data Documentation

bool RecoMuonValidator::MuonME::doAbsEta_

Definition at line 125 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2_

Definition at line 122 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2_vs_Eta_

Definition at line 123 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Norm_

Definition at line 122 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Norm_vs_Eta_

Definition at line 123 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Prob_

Definition at line 122 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hChi2Prob_vs_Eta_

Definition at line 123 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hdPt_vs_Eta_

Definition at line 102 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hdPt_vs_Pt_

Definition at line 103 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrDxy_

Definition at line 94 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrDz_

Definition at line 94 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrEta_

Definition at line 91 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrEta_vs_Eta_

Definition at line 97 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_

Definition at line 91 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_vs_Eta_

Definition at line 96 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrP_vs_P_

Definition at line 97 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPBarrel_

Definition at line 92 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPEndcap_

Definition at line 92 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPhi_

Definition at line 91 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPOverlap_

Definition at line 92 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_

Definition at line 91 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_PF_

Definition at line 100 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_vs_Eta_

Definition at line 96 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPt_vs_Pt_

Definition at line 97 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtBarrel_

Definition at line 93 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtEndcap_

Definition at line 93 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrPtOverlap_

Definition at line 93 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_PF_

Definition at line 101 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_vs_Eta_

Definition at line 96 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hErrQPt_vs_Pt_

Definition at line 97 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hEta_

Definition at line 83 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hMisQEta_

Definition at line 88 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hMisQPt_

Definition at line 88 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNDof_

Definition at line 122 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNDof_vs_Eta_

Definition at line 123 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_

Definition at line 111 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_vs_Eta_

Definition at line 112 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNHits_vs_Pt_

Definition at line 112 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_

Definition at line 111 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_vs_Eta_

Definition at line 113 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNLostHits_vs_Pt_

Definition at line 113 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNMuon_

Definition at line 84 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_

Definition at line 111 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_vs_Eta_

Definition at line 115 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNMuonHits_vs_Pt_

Definition at line 115 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNRecoToSim_

Definition at line 109 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNSim_

Definition at line 84 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNSimHits_

Definition at line 108 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNSimToReco_

Definition at line 109 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_

Definition at line 111 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_vs_Eta_

Definition at line 114 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrackerHits_vs_Pt_

Definition at line 114 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrks_

Definition at line 87 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hNTrksEta_

Definition at line 87 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hNTrksPt_

Definition at line 87 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hP_

Definition at line 83 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPFMomAssCorrectness

Definition at line 104 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPhi_

Definition at line 83 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPt_

Definition at line 83 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPt_vs_PFMomAssCorrectness

Definition at line 105 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullDxy_

Definition at line 118 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullDz_

Definition at line 118 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_

Definition at line 118 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_vs_Eta_

Definition at line 119 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullEta_vs_Pt_

Definition at line 119 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPhi_

Definition at line 118 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPhi_vs_Eta_

Definition at line 119 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_

Definition at line 118 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_vs_Eta_

Definition at line 119 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullPt_vs_Pt_

Definition at line 119 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hPullQPt_

Definition at line 118 of file RecoMuonValidator.cc.

MEP RecoMuonValidator::MuonME::hSimDxy_

Definition at line 81 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimDz_

Definition at line 81 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimEta_

Definition at line 81 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimP_

Definition at line 81 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimPhi_

Definition at line 81 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

MEP RecoMuonValidator::MuonME::hSimPt_

Definition at line 81 of file RecoMuonValidator.cc.

Referenced by RecoMuonValidator::analyze().

bool RecoMuonValidator::MuonME::usePFMuon_

Definition at line 126 of file RecoMuonValidator.cc.