Get the analysis.
344 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
346 if(recoMu->isGlobalMuon()) {
348 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is global - filling the histos";
349 if(recoMu->isTrackerMuon() && recoMu->isStandAloneMuon())
351 if(!(recoMu->isTrackerMuon()) && recoMu->isStandAloneMuon())
353 if(!recoMu->isStandAloneMuon())
354 LogTrace(
metname)<<
"[MuonRecoAnalyzer] ERROR: the mu is global but not standalone!";
368 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"eta", res, pull);
370 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"eta", res, pull);
372 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"eta", res, pull);
376 etaResolution[3]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoCombinedGlbTrack->eta());
377 etaResolution[4]->Fill(recoCombinedGlbTrack->eta(), -recoStaGlbTrack->eta()+recoCombinedGlbTrack->eta());
378 etaResolution[5]->Fill(recoCombinedGlbTrack->eta(), recoTkGlbTrack->eta()-recoStaGlbTrack->eta());
384 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"theta", res, pull);
387 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"theta", res, pull);
390 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"theta", res, pull);
394 thetaResolution[3]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoCombinedGlbTrack->theta());
395 thetaResolution[4]->Fill(recoCombinedGlbTrack->theta(), -recoStaGlbTrack->theta()+recoCombinedGlbTrack->theta());
396 thetaResolution[5]->Fill(recoCombinedGlbTrack->theta(), recoTkGlbTrack->theta()-recoStaGlbTrack->theta());
403 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"phi", res, pull);
405 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"phi", res, pull);
407 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"phi", res, pull);
410 phiResolution[3]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoCombinedGlbTrack->phi());
411 phiResolution[4]->Fill(recoCombinedGlbTrack->phi(), -recoStaGlbTrack->phi()+recoCombinedGlbTrack->phi());
412 phiResolution[5]->Fill(recoCombinedGlbTrack->phi(), recoTkGlbTrack->phi()-recoStaGlbTrack->phi());
420 probchi2GlbTrack[0]->Fill(TMath::Prob(recoCombinedGlbTrack->chi2(),recoCombinedGlbTrack->ndof()));
421 probchi2GlbTrack[1]->Fill(TMath::Prob(recoTkGlbTrack->chi2(),recoTkGlbTrack->ndof()));
422 probchi2GlbTrack[2]->Fill(TMath::Prob(recoStaGlbTrack->chi2(),recoStaGlbTrack->ndof()));
426 pGlbTrack[0]->Fill(recoCombinedGlbTrack->p());
428 pGlbTrack[2]->Fill(recoStaGlbTrack->p());
430 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
434 qGlbTrack[0]->Fill(recoCombinedGlbTrack->charge());
435 qGlbTrack[1]->Fill(recoTkGlbTrack->charge());
436 qGlbTrack[2]->Fill(recoStaGlbTrack->charge());
437 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge())
qGlbTrack[3]->
Fill(1);
439 if(recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge())
qGlbTrack[3]->
Fill(3);
441 if(recoStaGlbTrack->charge()==recoTkGlbTrack->charge())
qGlbTrack[3]->
Fill(5);
443 if(recoCombinedGlbTrack->charge()!=recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()!=recoTkGlbTrack->charge())
qGlbTrack[3]->
Fill(7);
444 if(recoCombinedGlbTrack->charge()==recoStaGlbTrack->charge() && recoCombinedGlbTrack->charge()==recoTkGlbTrack->charge())
qGlbTrack[3]->
Fill(8);
446 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverp", res, pull);
448 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
450 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverp", res, pull);
455 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverp", res, pull);
457 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
459 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverp", res, pull);
464 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"qOverpt", res, pull);
466 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
468 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"qOverpt", res, pull);
472 GetRes(recoTkGlbTrack, recoCombinedGlbTrack,
"oneOverpt", res, pull);
474 GetRes(recoCombinedGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
476 GetRes(recoTkGlbTrack, recoStaGlbTrack,
"oneOverpt", res, pull);
487 double bestTrackPt = recoBestTrack->pt();
489 double tunePBestTrackPt = recoTunePBestTrack->pt();
491 double tunePBestTrackRes = (bestTrackPt - tunePBestTrackPt) / bestTrackPt;
496 oneOverptResolution[3]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
497 oneOverptResolution[4]->Fill(recoCombinedGlbTrack->eta(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
498 oneOverptResolution[5]->Fill(recoCombinedGlbTrack->eta(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
499 oneOverptResolution[6]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
500 oneOverptResolution[7]->Fill(recoCombinedGlbTrack->phi(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
501 oneOverptResolution[8]->Fill(recoCombinedGlbTrack->phi(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
502 oneOverptResolution[9]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoCombinedGlbTrack->pt()));
503 oneOverptResolution[10]->Fill(recoCombinedGlbTrack->pt(),-(1/recoStaGlbTrack->pt())+(1/recoCombinedGlbTrack->pt()));
504 oneOverptResolution[11]->Fill(recoCombinedGlbTrack->pt(),(1/recoTkGlbTrack->pt())-(1/recoStaGlbTrack->pt()));
507 double rhGlb = recoCombinedGlbTrack->found();
509 double rhGlb_StaProvenance=0;
511 double rhGlb_TkProvenance=0;
513 recHit!=recoCombinedGlbTrack->recHitsEnd(); ++recHit){
514 if((*recHit)->isValid()){
515 DetId id = (*recHit)->geographicalId();
517 rhGlb_StaProvenance++;
519 rhGlb_TkProvenance++;
523 double rhStaGlb = recoStaGlbTrack->recHitsSize();
525 double rhTkGlb = recoTkGlbTrack->found();
527 double rhTkGlb_notValid = recoTkGlbTrack->lost();
530 rhAnalysis[0]->Fill(rhGlb_StaProvenance/rhGlb);
531 rhAnalysis[1]->Fill(rhGlb_TkProvenance/rhGlb);
532 rhAnalysis[2]->Fill(rhGlb_StaProvenance/rhStaGlb);
533 rhAnalysis[3]->Fill(rhGlb_TkProvenance/rhTkGlb);
534 rhAnalysis[4]->Fill(rhGlb/(rhStaGlb+rhTkGlb));
538 if(recoCombinedGlbTrack->charge()>0)
541 muVStkSytemRotation[1]->Fill(recoCombinedGlbTrack->pt(),recoTkGlbTrack->pt()/recoCombinedGlbTrack->pt());
546 if(recoMu->isTrackerMuon() && !(recoMu->isGlobalMuon())) {
547 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is tracker only - filling the histos";
548 if(recoMu->isStandAloneMuon())
550 if(!(recoMu->isStandAloneMuon()))
567 if(recoMu->isStandAloneMuon() && !(recoMu->isGlobalMuon())) {
568 LogTrace(
metname)<<
"[MuonRecoAnalyzer] The mu is STA only - filling the histos";
569 if(!(recoMu->isTrackerMuon()))
586 if(recoMu->isCaloMuon() && !(recoMu->isGlobalMuon()) && !(recoMu->isTrackerMuon()) && !(recoMu->isStandAloneMuon()))
594 if(recoMu->isStandAloneMuon()){
598 if(recoMu->isStandAloneMuon() && recoMu->isGlobalMuon()){
std::vector< MonitorElement * > oneOverpResolution
MonitorElement * qOverptPull
std::vector< MonitorElement * > ptGlbTrack
std::vector< MonitorElement * > chi2OvDFGlbTrack
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * etaStaTrack
std::vector< MonitorElement * > phiGlbTrack
MonitorElement * chi2OvDFStaTrack
MuonServiceProxy * theService
MonitorElement * phiStaTrack
MonitorElement * qOverpPull
std::vector< MonitorElement * > phiEfficiency
MonitorElement * etaTrack
MonitorElement * chi2OvDFTrack
std::vector< MonitorElement * > qOverptResolution
std::vector< MonitorElement * > etaGlbTrack
std::vector< MonitorElement * > pGlbTrack
std::vector< MonitorElement * > qOverpResolution
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * oneOverpPull
std::vector< MonitorElement * > qGlbTrack
std::vector< MonitorElement * > probchi2GlbTrack
std::vector< MonitorElement * > etaResolution
MonitorElement * oneOverptPull
MonitorElement * tunePResolution
std::vector< MonitorElement * > etaEfficiency
void GetRes(reco::TrackRef t1, reco::TrackRef t2, std::string par, float &res, float &pull)
MonitorElement * thetaStaTrack
std::vector< MonitorElement * > phiResolution
std::vector< MonitorElement * > thetaGlbTrack
MonitorElement * phiTrack
std::vector< MonitorElement * > oneOverptResolution
MonitorElement * probchi2Track
std::vector< MonitorElement * > muVStkSytemRotation
MonitorElement * probchi2StaTrack
MonitorElement * ptStaTrack
std::vector< MonitorElement * > rhAnalysis
MonitorElement * pStaTrack
MonitorElement * thetaTrack
std::vector< MonitorElement * > thetaResolution
MonitorElement * thetaPull
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
MonitorElement * qStaTrack