18 #include "TLorentzVector.h"
46 cout <<
"[EfficiencyAnalyzer] Parameters initialization" <<endl;
94 cout <<
"[EfficiencyAnalyzer] Parameters initialization DONE" <<endl;
100 LogTrace(
metname)<<
"[EfficiencyAnalyzer] Analyze the mu in different eta regions";
112 iEvent.
getByLabel(
"offlineBeamSpot", beamSpotHandle);
113 beamSpot = *beamSpotHandle;
119 TLorentzVector Mu1, Mu2;
124 for (reco::MuonCollection::const_iterator recoMu1 = muons->begin(); recoMu1!=muons->end(); ++recoMu1) {
126 LogTrace(
metname)<<
"[EfficiencyAnalyzer] loop over first muons" << endl;
130 float combIso = (Iso_muon.
emEt + Iso_muon.
hadEt + Iso_muon.
sumPt);
133 if (!recoMu1->isGlobalMuon())
continue;
137 float muPt1 = recoCombinedGlbTrack1->pt();
138 Mu1.SetPxPyPzE(recoCombinedGlbTrack1->px(), recoCombinedGlbTrack1->py(),recoCombinedGlbTrack1->pz(), recoCombinedGlbTrack1->p());
142 if (recoMu1->isGlobalMuon() && recoMu1->isTrackerMuon() && recoMu1->combinedMuon()->normalizedChi2()<10.
143 && recoMu1->combinedMuon()->hitPattern().numberOfValidMuonHits()>0 && fabs(recoMu1->combinedMuon()->dxy(beamSpot.
position()))<0.2 && recoMu1->combinedMuon()->hitPattern().numberOfValidPixelHits()>0 && recoMu1->numberOfMatches() > 1) {
146 if (muPt1 > 15 && (combIso/muPt1) < 0.1 ) {
149 for (reco::MuonCollection::const_iterator recoMu2 = muons->begin(); recoMu2!=muons->end(); ++recoMu2){
151 LogTrace(
metname)<<
"[EfficiencyAnalyzer] loop over second muon" <<endl;
153 if (recoMu2 == recoMu1)
continue;
156 if (recoMu2->eta() < 1.479 ) isMB =
true;
157 if (recoMu2->eta() >= 1.479 ) isME =
true;
161 Mu2.SetPxPyPzE(recoMu2->px(), recoMu2->py(), recoMu2->pz(), recoMu2->p());
163 if (!recoMu2->isTrackerMuon())
continue;
165 if ( recoMu2->pt() < 5 )
continue;
167 if ( (recoMu1->charge())*(recoMu2->charge()) > 0 )
continue;
169 float Minv = (Mu1+Mu2).M();
171 if ( Minv < 70 || Minv > 110 )
continue;
188 if (recoMu2->isGlobalMuon() && recoMu2->isTrackerMuon() && recoMu2->combinedMuon()->normalizedChi2()<10. && recoMu2->combinedMuon()->hitPattern().numberOfValidMuonHits()>0 && fabs(recoMu2->combinedMuon()->dxy(beamSpot.
position()))<0.2 && recoMu2->combinedMuon()->hitPattern().numberOfValidPixelHits()>0 && recoMu2->numberOfMatches() > 1) {
T getParameter(std::string const &) const
float sumPt
sum-pt of tracks
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * h_allProbes_eta
edm::ParameterSet parameters
MonitorElement * h_allProbes_pt
MonitorElement * h_passProbes_TightMu_hp_eta
MonitorElement * h_passProbes_TightMu_eta
MonitorElement * h_passProbes_TightMu_phi
MonitorElement * h_passProbes_TightMu_pt
MonitorElement * h_passProbes_TightMu_barrel_pt
edm::InputTag theMuonCollectionLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
MonitorElement * h_passProbes_TightMu_endcap_pt
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
MonitorElement * test_TightMu_Minv
edm::InputTag theTrackCollectionLabel
const Point & position() const
position
MonitorElement * h_allProbes_hp_eta
virtual ~EfficiencyAnalyzer()
MonitorElement * h_allProbes_phi
MonitorElement * h_allProbes_endcap_pt
EfficiencyAnalyzer(const edm::ParameterSet &pset, MuonServiceProxy *theService)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * h_allProbes_barrel_pt