CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EwkMuDQM.cc
Go to the documentation of this file.
2 
6 
9 
12 
16 
21 
23 
27 
29 
31 
32 using namespace edm;
33 using namespace std;
34 using namespace reco;
35 
37  // Input collections
38  trigTag_(cfg.getUntrackedParameter<edm::InputTag> ("TrigTag", edm::InputTag("TriggerResults::HLT"))),
39  muonTag_(cfg.getUntrackedParameter<edm::InputTag> ("MuonTag", edm::InputTag("muons"))),
40  metTag_(cfg.getUntrackedParameter<edm::InputTag> ("METTag", edm::InputTag("pfmet"))),
41  jetTag_(cfg.getUntrackedParameter<edm::InputTag> ("JetTag", edm::InputTag("ak5PFJets"))),
42  vertexTag_(cfg.getUntrackedParameter<edm::InputTag> ("VertexTag", edm::InputTag("offlinePrimaryVertices"))),
43 
44  // Main cuts
45  ptCut_(cfg.getUntrackedParameter<double>("PtCut", 25.)),
46  etaCut_(cfg.getUntrackedParameter<double>("EtaCut", 2.1)),
47  isRelativeIso_(cfg.getUntrackedParameter<bool>("IsRelativeIso", true)),
48  isCombinedIso_(cfg.getUntrackedParameter<bool>("IsCombinedIso", false)),
49  isoCut03_(cfg.getUntrackedParameter<double>("IsoCut03", 0.1)),
50  mtMin_(cfg.getUntrackedParameter<double>("MtMin", 50.)),
51  mtMax_(cfg.getUntrackedParameter<double>("MtMax", 200.)),
52  metMin_(cfg.getUntrackedParameter<double>("MetMin", -999999.)),
53  metMax_(cfg.getUntrackedParameter<double>("MetMax", 999999.)),
54  acopCut_(cfg.getUntrackedParameter<double>("AcopCut", 999.)),
55 
56  // Muon quality cuts
57  dxyCut_(cfg.getUntrackedParameter<double>("DxyCut", 0.2)), // dxy < 0.2 cm
58  normalizedChi2Cut_(cfg.getUntrackedParameter<double>("NormalizedChi2Cut", 10.)), // chi2/ndof (of global fit) <10.0
59  trackerHitsCut_(cfg.getUntrackedParameter<int>("TrackerHitsCut", 11)), // Tracker Hits >10
60  pixelHitsCut_(cfg.getUntrackedParameter<int>("PixelHitsCut", 1)), // Pixel Hits >0
61  muonHitsCut_(cfg.getUntrackedParameter<int>("MuonHitsCut", 1)), // Valid Muon Hits >0
62  isAlsoTrackerMuon_(cfg.getUntrackedParameter<bool>("IsAlsoTrackerMuon", true)),
63  nMatchesCut_(cfg.getUntrackedParameter<int>("NMatchesCut", 2)), // At least 2 Chambers with matches
64 
65  // Z rejection
66  ptThrForZ1_(cfg.getUntrackedParameter<double>("PtThrForZ1", 20.)),
67  ptThrForZ2_(cfg.getUntrackedParameter<double>("PtThrForZ2", 10.)),
68 
69  // Top rejection
70  eJetMin_(cfg.getUntrackedParameter<double>("EJetMin", 999999.)),
71  nJetMax_(cfg.getUntrackedParameter<int>("NJetMax", 999999))
72 {
73  isValidHltConfig_ = false;
74 }
75 
76 void EwkMuDQM::beginRun(const Run& r, const EventSetup& iSet) {
77  nall = 0;
78  nsel = 0;
79 
80  nrec = 0;
81  niso = 0;
82  nhlt = 0;
83  nmet = 0;
84 
85 
86  // passed as parameter to HLTConfigProvider::init(), not yet used
87  bool isConfigChanged = false;
88  // isValidHltConfig_ used to short-circuit analyze() in case of problems
89  isValidHltConfig_ = hltConfigProvider_.init( r, iSet, "HLT", isConfigChanged );
90 
91 }
92 
93 
96  theDbe->setCurrentFolder("Physics/EwkMuDQM");
98 }
99 
101 
102  char chtitle[256] = "";
103  for (int i=0; i<2; ++i) {
104  snprintf(chtitle, 255, "Muon transverse momentum (global muon) [GeV]");
105  pt_before_ = theDbe->book1D("PT_BEFORECUTS",chtitle,100,0.,100.);
106  pt_after_ = theDbe->book1D("PT_LASTCUT",chtitle,100,0.,100.);
107 
108  snprintf(chtitle, 255, "Muon pseudo-rapidity");
109  eta_before_ = theDbe->book1D("ETA_BEFORECUTS",chtitle,50,-2.5,2.5);
110  eta_after_ = theDbe->book1D("ETA_LASTCUT",chtitle,50,-2.5,2.5);
111 
112  snprintf(chtitle, 255, "Muon transverse distance to beam spot [cm]");
113  dxy_before_ = theDbe->book1D("DXY_BEFORECUTS",chtitle,100,-0.5,0.5);
114  dxy_after_ = theDbe->book1D("DXY_LASTCUT",chtitle,100,-0.5,0.5);
115 
116  snprintf(chtitle, 255, "Quality-muon flag");
117  goodewkmuon_before_ = theDbe->book1D("GOODEWKMUON_BEFORECUTS",chtitle,2,-0.5,1.5);
118  goodewkmuon_after_ = theDbe->book1D("GOODEWKMUON_LASTCUT",chtitle,2,-0.5,1.5);
119 
120  if (isRelativeIso_) {
121  if (isCombinedIso_) {
122  snprintf(chtitle, 255, "Relative (combined) isolation variable");
123  } else {
124  snprintf(chtitle, 255, "Relative (tracker) isolation variable");
125  }
126  iso_before_ = theDbe->book1D("ISO_BEFORECUTS",chtitle,100, 0., 1.);
127  iso_after_ = theDbe->book1D("ISO_LASTCUT",chtitle,100, 0., 1.);
128  } else {
129  if (isCombinedIso_) {
130  snprintf(chtitle, 255, "Absolute (combined) isolation variable [GeV]");
131  } else {
132  snprintf(chtitle, 255, "Absolute (tracker) isolation variable [GeV]");
133  }
134  iso_before_ = theDbe->book1D("ISO_BEFORECUTS",chtitle,100, 0., 20.);
135  iso_after_ = theDbe->book1D("ISO_LASTCUT",chtitle,100, 0., 20.);
136  }
137 
138  snprintf(chtitle, 255, "HLT_Mu* Trigger response");
139  trig_before_ = theDbe->book1D("TRIG_BEFORECUTS",chtitle,2,-0.5,1.5);
140  trig_after_ = theDbe->book1D("TRIG_LASTCUT",chtitle,2,-0.5,1.5);
141 
142  snprintf(chtitle, 255, "Transverse mass (%s) [GeV]", metTag_.label().data());
143  mt_before_ = theDbe->book1D("MT_BEFORECUTS",chtitle,150,0.,300.);
144  mt_after_ = theDbe->book1D("MT_LASTCUT",chtitle,150,0.,300.);
145 
146  snprintf(chtitle, 255, "Missing transverse energy (%s) [GeV]", metTag_.label().data());
147  met_before_ = theDbe->book1D("MET_BEFORECUTS",chtitle,100,0.,200.);
148  met_after_ = theDbe->book1D("MET_LASTCUT",chtitle,100,0.,200.);
149 
150  snprintf(chtitle, 255, "MU-MET (%s) acoplanarity", metTag_.label().data());
151  acop_before_ = theDbe->book1D("ACOP_BEFORECUTS",chtitle,50,0.,M_PI);
152  acop_after_ = theDbe->book1D("ACOP_LASTCUT",chtitle,50,0.,M_PI);
153 
154  snprintf(chtitle, 255, "Z rejection: number of muons above %.2f GeV", ptThrForZ1_);
155  nz1_before_ = theDbe->book1D("NZ1_BEFORECUTS",chtitle,10,-0.5,9.5);
156  nz1_after_ = theDbe->book1D("NZ1_LASTCUT",chtitle,10,-0.5,9.5);
157 
158  snprintf(chtitle, 255, "Z rejection: number of muons above %.2f GeV", ptThrForZ2_);
159  nz2_before_ = theDbe->book1D("NZ2_BEFORECUTS",chtitle,10,-0.5,9.5);
160  nz2_after_ = theDbe->book1D("NZ2_LASTCUT",chtitle,10,-0.5,9.5);
161 
162  snprintf(chtitle, 255, "Number of jets (%s) above %.2f GeV", jetTag_.label().data(), eJetMin_);
163  njets_before_ = theDbe->book1D("NJETS_BEFORECUTS",chtitle,10,-0.5,9.5);
164  njets_after_ = theDbe->book1D("NJETS_LASTCUT",chtitle,10,-0.5,9.5);
165 
166  snprintf(chtitle, 255, "DiMuonMass (2 globals)");
167  dimuonmass_before_= theDbe->book1D("DIMUONMASS_BEFORECUTS",chtitle,100,0,200);
168  dimuonmass_after_= theDbe->book1D("DIMUONMASS_AFTERZCUTS",chtitle,100,0,200);
169 
170  snprintf(chtitle, 255, "Global pt for Muons in Z");
171  ptmuonZ_after_= theDbe->book1D("PT_AFTERZCUT",chtitle,100,0.,100.);
172 
173  snprintf(chtitle, 255, "Number of Valid Primary Vertices");
174  npvs_before_ = theDbe->book1D("NPVs_BEFORECUTS",chtitle,10,-0.5,9.5);
175  npvs_after_ = theDbe->book1D("NPVs_LASTCUT",chtitle,10,-0.5,9.5);
176 
177  snprintf(chtitle, 255, "Muon Charge");
178  muoncharge_before_ = theDbe->book1D("MUONCHARGE_BEFORECUTS",chtitle,3,-1.5,1.5);
179  muoncharge_after_ = theDbe->book1D("MUONCHARGE_LASTCUT",chtitle,3,-1.5,1.5);
180 
181  }
182 }
183 
184 
186 }
187 
188 void EwkMuDQM::endRun(const Run& r, const EventSetup& iSet) {
189 
190 }
191 
192 void EwkMuDQM::analyze (const Event & ev, const EventSetup & iSet) {
193 
194  // Reset global event selection flags
195  bool rec_sel = false;
196  bool iso_sel = false;
197  bool hlt_sel = false;
198  bool met_sel = false;
199  bool all_sel = false;
200 
201  // Muon collection
202  Handle<View<Muon> > muonCollection;
203  if (!ev.getByLabel(muonTag_, muonCollection)) {
204  //LogWarning("") << ">>> Muon collection does not exist !!!";
205  return;
206  }
207  unsigned int muonCollectionSize = muonCollection->size();
208 
209  // Beam spot
210  Handle<reco::BeamSpot> beamSpotHandle;
211  if (!ev.getByLabel(InputTag("offlineBeamSpot"), beamSpotHandle)) {
212  //LogWarning("") << ">>> No beam spot found !!!";
213  return;
214  }
215 
216 
217  // Loop to reject/control Z->mumu is done separately
218  unsigned int nmuonsForZ1 = 0;
219  unsigned int nmuonsForZ2 = 0;
220  bool cosmic = false;
221  for (unsigned int i=0; i<muonCollectionSize; i++) {
222  const Muon& mu = muonCollection->at(i);
223  if (!mu.isGlobalMuon()) continue;
224  double pt = mu.pt();
225  double dxy = mu.innerTrack()->dxy(beamSpotHandle->position());
226 
227  if (fabs(dxy)>1) { cosmic=true; break;}
228 
229  if (pt>ptThrForZ1_) nmuonsForZ1++;
230  if (pt>ptThrForZ2_) nmuonsForZ2++;
231 
232  for (unsigned int j=i+1; j<muonCollectionSize; j++) {
233  const Muon& mu2 = muonCollection->at(j);
234  if (mu2.isGlobalMuon() && (mu.charge()*mu2.charge()==-1) ){
235  const math::XYZTLorentzVector ZRecoGlb (mu.px()+mu2.px(), mu.py()+mu2.py() , mu.pz()+mu2.pz(), mu.p()+mu2.p());
236  dimuonmass_before_->Fill(ZRecoGlb.mass());
237  }
238  }
239  }
240  if(cosmic) return;
241 
242  LogTrace("") << "> Z rejection: muons above " << ptThrForZ1_ << " [GeV]: " << nmuonsForZ1;
243  LogTrace("") << "> Z rejection: muons above " << ptThrForZ2_ << " [GeV]: " << nmuonsForZ2;
244  nz1_before_->Fill(nmuonsForZ1);
245  nz2_before_->Fill(nmuonsForZ2);
246 
247  // MET
248  Handle<View<MET> > metCollection;
249  if (!ev.getByLabel(metTag_, metCollection)) {
250  //LogWarning("") << ">>> MET collection does not exist !!!";
251  return;
252  }
253  const MET& met = metCollection->at(0);
254  double met_et = met.pt();
255  LogTrace("") << ">>> MET, MET_px, MET_py: " << met_et << ", " << met.px() << ", " << met.py() << " [GeV]";
256  met_before_->Fill(met_et);
257 
258  // Vertices in the event
260  if (!ev.getByLabel(vertexTag_, vertexCollection)) {
261  LogError("") << ">>> Vertex collection does not exist !!!";
262  return;
263  }
264  unsigned int vertexCollectionSize = vertexCollection->size();
265 
266 
267 
268  int nvvertex = 0;
269  for (unsigned int i=0; i<vertexCollectionSize; i++) {
270  const Vertex& vertex = vertexCollection->at(i);
271  if (vertex.isValid()) nvvertex++;
272  }
273 
274  npvs_before_->Fill(nvvertex);
275 
276  bool trigger_fired = false;
277  Handle<TriggerResults> triggerResults;
278  if (!ev.getByLabel(trigTag_, triggerResults)) {
279  //LogWarning("") << ">>> TRIGGER collection does not exist !!!";
280  return;
281  }
282  const edm::TriggerNames & trigNames = ev.triggerNames(*triggerResults);
283 
284  for (unsigned int i=0; i<triggerResults->size(); i++)
285  {
286  const std::string trigName = trigNames.triggerName(i);
287  size_t found = trigName.find("HLT_Mu");
288  if ( found == std::string::npos) continue;
289 
290  bool prescaled=false;
291  for (unsigned int ps= 0; ps< hltConfigProvider_.prescaleSize(); ps++){
292  const unsigned int prescaleValue = hltConfigProvider_.prescaleValue(ps, trigName) ;
293  if (prescaleValue != 1) prescaled =true;
294  }
295  if(prescaled) continue;
296 
297  if( triggerResults->accept(i) ) trigger_fired=true;
298  }
299  trig_before_->Fill(trigger_fired);
300 
301 
302 
303 
304 
305 
306  // Jet collection
307  Handle<View<Jet> > jetCollection;
308  if (!ev.getByLabel(jetTag_, jetCollection)) {
309  //LogError("") << ">>> JET collection does not exist !!!";
310  return;
311  }
312  unsigned int jetCollectionSize = jetCollection->size();
313  int njets = 0;
314  for (unsigned int i=0; i<jetCollectionSize; i++) {
315  const Jet& jet = jetCollection->at(i);
316  double minDistance=99999; // This is in order to use PFJets
317  for (unsigned int i=0; i<muonCollectionSize; i++) {
318  const Muon& mu = muonCollection->at(i);
319  double distance = sqrt( (mu.eta()-jet.eta())*(mu.eta()-jet.eta()) +(mu.phi()-jet.phi())*(mu.phi()-jet.phi()) );
320  if (minDistance>distance) minDistance=distance;
321  }
322  if (minDistance<0.3) continue; // 0.3 is the isolation cone around the muon
323  if (jet.et()>eJetMin_) njets++;
324  }
325  LogTrace("") << ">>> Total number of jets: " << jetCollectionSize;
326  LogTrace("") << ">>> Number of jets above " << eJetMin_ << " [GeV]: " << njets;
327  njets_before_->Fill(njets);
328 
329  // Start counting
330  nall++;
331 
332  // Histograms per event shouldbe done only once, so keep track of them
333  bool hlt_hist_done = false;
334  bool met_hist_done = false;
335  bool nz1_hist_done = false;
336  bool nz2_hist_done = false;
337  bool njets_hist_done = false;
338  bool pv_hist_done = false;
339  bool charge_hist_done = false;
340 
341  // Central W->mu nu selection criteria
342  const int NFLAGS = 11;
343  bool muon_sel[NFLAGS];
344  bool muon4Z=false;
345 
346  for (unsigned int i=0; i<muonCollectionSize; i++) {
347  for (int j=0; j<NFLAGS; ++j) {
348  muon_sel[j] = false;
349  }
350 
351  const Muon& mu = muonCollection->at(i);
352  if (!mu.isGlobalMuon()) continue;
353  if (mu.globalTrack().isNull()) continue;
354  if (mu.innerTrack().isNull()) continue;
355 
356  LogTrace("") << "> Wsel: processing muon number " << i << "...";
357  reco::TrackRef gm = mu.globalTrack();
358  reco::TrackRef tk = mu.innerTrack();
359 
360  // Pt,eta cuts
361  double pt = mu.pt();
362  double eta = mu.eta();
363  LogTrace("") << "\t... pt, eta: " << pt << " [GeV], " << eta;;
364  if (pt>ptCut_) muon_sel[0] = true;
365  if (fabs(eta)<etaCut_) muon_sel[1] = true;
366 
367  double charge=mu.charge();
368 
369  // d0, chi2, nhits quality cuts
370  double dxy = gm->dxy(beamSpotHandle->position());
371  double normalizedChi2 = gm->normalizedChi2();
372  double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
373  int pixelHits = tk->hitPattern().numberOfValidPixelHits();
374  int muonHits = gm->hitPattern().numberOfValidMuonHits();
375  int nMatches = mu.numberOfMatches();
376 
377  LogTrace("") << "\t... dxy, normalizedChi2, trackerHits, isTrackerMuon?: " << dxy << " [cm], " << normalizedChi2 << ", " << trackerHits << ", " << mu.isTrackerMuon();
378  if (fabs(dxy)<dxyCut_) muon_sel[2] = true;
379 
380  bool quality=true;
381 
382  if (normalizedChi2>normalizedChi2Cut_) quality =false;
383  if (trackerHits<trackerHitsCut_) quality =false;
384  if (pixelHits<pixelHitsCut_) quality =false;
385  if (muonHits<muonHitsCut_) quality=false;;
386  if (!mu.isTrackerMuon()) quality=false;
387  if (nMatches<nMatchesCut_) quality=false;
388  muon_sel[3]=quality;
389 
390 
391  pt_before_->Fill(pt);
392  eta_before_->Fill(eta);
393  dxy_before_->Fill(dxy);
394  muoncharge_before_->Fill(charge);
395  goodewkmuon_before_->Fill(quality);
396 
397  // Isolation cuts
398  double isovar = mu.isolationR03().sumPt;
399  if (isCombinedIso_) {
400  isovar += mu.isolationR03().emEt;
401  isovar += mu.isolationR03().hadEt;
402  }
403  if (isRelativeIso_) isovar /= pt;
404  if (isovar<isoCut03_) muon_sel[4] = true;
405 
406  LogTrace("") << "\t... isolation value" << isovar <<", isolated? " << muon_sel[6];
407  iso_before_->Fill(isovar);
408 
409 
410  // HLT (not mtched to muon for the time being)
411  if (trigger_fired) muon_sel[5] = true;
412 
413  // For Z:
414  if (pt>ptThrForZ1_ && fabs(eta)<etaCut_ && fabs(dxy)<dxyCut_ && quality && trigger_fired && isovar<isoCut03_) { muon4Z = true;}
415 
416 
417  // MET/MT cuts
418  double w_et = met_et+mu.pt();
419  double w_px = met.px()+mu.px();
420  double w_py = met.py()+mu.py();
421 
422  double massT = w_et*w_et - w_px*w_px - w_py*w_py;
423  massT = (massT>0) ? sqrt(massT) : 0;
424 
425  LogTrace("") << "\t... W mass, W_et, W_px, W_py: " << massT << ", " << w_et << ", " << w_px << ", " << w_py << " [GeV]";
426  if (massT>mtMin_ && massT<mtMax_) muon_sel[6] = true;
427  mt_before_->Fill(massT);
428  if (met_et>metMin_ && met_et<metMax_) muon_sel[7] = true;
429 
430  // Acoplanarity cuts
431  Geom::Phi<double> deltaphi(mu.phi()-atan2(met.py(),met.px()));
432  double acop = deltaphi.value();
433  if (acop<0) acop = - acop;
434  acop = M_PI - acop;
435  LogTrace("") << "\t... acoplanarity: " << acop;
436  if (acop<acopCut_) muon_sel[8] = true;
437  acop_before_->Fill(acop);
438 
439  // Remaining flags (from global event information)
440  if (nmuonsForZ1<1 || nmuonsForZ2<2) muon_sel[9] = true;
441  if (njets<=nJetMax_) muon_sel[10] = true;
442 
443  // Collect necessary flags "per muon"
444  int flags_passed = 0;
445  bool rec_sel_this = true;
446  bool iso_sel_this = true;
447  bool hlt_sel_this = true;
448  bool met_sel_this = true;
449  bool all_sel_this = true;
450  for (int j=0; j<NFLAGS; ++j) {
451  if (muon_sel[j]) flags_passed += 1;
452  if (j<4 && !muon_sel[j]) rec_sel_this = false;
453  if (j<5 && !muon_sel[j]) iso_sel_this = false;
454  if (j<6 && !muon_sel[j]) hlt_sel_this = false;
455  if (j<8 && !muon_sel[j]) met_sel_this = false;
456  if (!muon_sel[j]) all_sel_this = false;
457  }
458 
459  // "rec" => pt,eta and quality cuts are satisfied
460  if (rec_sel_this) rec_sel = true;
461  // "iso" => "rec" AND "muon is isolated"
462  if (iso_sel_this) iso_sel = true;
463  // "hlt" => "iso" AND "event is triggered"
464  if (hlt_sel_this) hlt_sel = true;
465  // "met" => "hlt" AND "MET/MT and acoplanarity cuts"
466  if (met_sel_this) met_sel = true;
467  // "all" => "met" AND "Z/top rejection cuts"
468  if (all_sel_this) all_sel = true;
469 
470  // Do N-1 histograms now (and only once for global event quantities)
471  if (flags_passed >= (NFLAGS-1)) {
472  if (!muon_sel[0] || flags_passed==NFLAGS)
473  pt_after_->Fill(pt);
474  if (!muon_sel[1] || flags_passed==NFLAGS)
475  eta_after_->Fill(eta);
476  if (!muon_sel[2] || flags_passed==NFLAGS)
477  dxy_after_->Fill(dxy);
478  if (!muon_sel[3] || flags_passed==NFLAGS)
479  goodewkmuon_after_->Fill(quality);
480  if (!muon_sel[4] || flags_passed==NFLAGS)
481  iso_after_->Fill(isovar);
482  if (!muon_sel[5] || flags_passed==NFLAGS)
483  if (!hlt_hist_done) trig_after_->Fill(trigger_fired);
484  hlt_hist_done = true;
485  if (!muon_sel[6] || flags_passed==NFLAGS)
486  mt_after_->Fill(massT);
487  if (!muon_sel[7] || flags_passed==NFLAGS)
488  if (!met_hist_done) met_after_->Fill(met_et);
489  met_hist_done = true;
490  if (!muon_sel[8] || flags_passed==NFLAGS)
491  acop_after_->Fill(acop);
492  if (!muon_sel[9] || flags_passed==NFLAGS)
493  if (!nz1_hist_done) nz1_after_->Fill(nmuonsForZ1);
494  nz1_hist_done = true;
495  if (!muon_sel[9] || flags_passed==NFLAGS)
496  if (!nz2_hist_done) nz2_after_->Fill(nmuonsForZ2);
497  nz2_hist_done = true;
498  if (!muon_sel[10] || flags_passed==NFLAGS) {
499  if (!njets_hist_done) njets_after_->Fill(njets);
500  njets_hist_done = true;
501  if( flags_passed==NFLAGS ) {
502  if (!pv_hist_done) npvs_after_->Fill(nvvertex);
503  if (!charge_hist_done) muoncharge_after_->Fill(charge);
504  }
505  pv_hist_done=true; charge_hist_done=true;
506  }
507  }
508 
509 
510  // The cases in which the event is rejected as a Z are considered independently:
511  if ( muon4Z && !muon_sel[9]){
512  // Plots for 2 muons
513  bool usedMuon=false;
514  for (unsigned int j=i+1; j<muonCollectionSize; j++) {
515  const Muon& mu2 = muonCollection->at(j);
516  if (!mu2.isGlobalMuon()) continue;
517  if (mu2.charge() * charge != -1 ) continue;
518  double pt2 = mu2.pt(); if (pt2<=ptThrForZ1_) continue;
519  double eta2=mu2.eta(); if (fabs(eta2)>etaCut_) continue;
520  double isovar2 = mu2.isolationR03().sumPt;
521  if (isCombinedIso_) {
522  isovar2 += mu2.isolationR03().emEt;
523  isovar2 += mu2.isolationR03().hadEt;
524  }
525  if (isRelativeIso_) isovar2 /= pt2;
526  if (isovar2>=isoCut03_) continue;
527  const math::XYZTLorentzVector ZRecoGlb (mu.px()+mu2.px(), mu.py()+mu2.py() , mu.pz()+mu2.pz(), mu.p()+mu2.p());
528  dimuonmass_after_->Fill(ZRecoGlb.mass());
529  if(!usedMuon){ptmuonZ_after_->Fill(mu.pt()); usedMuon=true;}
530  }
531  }
532 
533 
534 
535  }
536 
537 
538 
539 
540 
541 
542  return;
543 
544 }
545 
MonitorElement * met_before_
Definition: EwkMuDQM.h:110
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:9
DQMStore * theDbe
Definition: EwkMuDQM.h:75
int i
Definition: DBlmapReader.cc:9
virtual double p() const
magnitude of momentum vector
double etaCut_
Definition: EwkMuDQM.h:39
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:208
unsigned int nall
Definition: EwkMuDQM.h:67
int nMatchesCut_
Definition: EwkMuDQM.h:55
virtual void endJob()
Definition: EwkMuDQM.cc:185
EwkMuDQM(const edm::ParameterSet &)
Definition: EwkMuDQM.cc:36
virtual void beginJob()
Definition: EwkMuDQM.cc:94
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:7
unsigned int nrec
Definition: EwkMuDQM.h:68
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
virtual double et() const
transverse energy
double mtMax_
Definition: EwkMuDQM.h:44
MonitorElement * npvs_before_
Definition: EwkMuDQM.h:134
virtual TrackRef innerTrack() const
Definition: Muon.h:38
MonitorElement * njets_before_
Definition: EwkMuDQM.h:122
MonitorElement * dxy_before_
Definition: EwkMuDQM.h:83
MonitorElement * trig_before_
Definition: EwkMuDQM.h:104
MonitorElement * trig_after_
Definition: EwkMuDQM.h:105
double metMax_
Definition: EwkMuDQM.h:46
bool isTrackerMuon() const
Definition: Muon.h:149
MonitorElement * muoncharge_before_
Definition: EwkMuDQM.h:137
Base class for all types of Jets.
Definition: Jet.h:21
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:61
double ptCut_
Definition: EwkMuDQM.h:38
double isoCut03_
Definition: EwkMuDQM.h:42
bool isGlobalMuon() const
Definition: Muon.h:148
edm::InputTag trigTag_
Definition: EwkMuDQM.h:31
double eJetMin_
Definition: EwkMuDQM.h:60
T eta() const
MonitorElement * acop_before_
Definition: EwkMuDQM.h:113
double charge(const std::vector< uint8_t > &Ampls)
tuple vertexCollection
MonitorElement * goodewkmuon_before_
Definition: EwkMuDQM.h:95
virtual double eta() const
momentum pseudorapidity
MonitorElement * eta_after_
Definition: EwkMuDQM.h:81
MonitorElement * pt_before_
Definition: EwkMuDQM.h:77
unsigned int nhlt
Definition: EwkMuDQM.h:70
void Fill(long long x)
MonitorElement * iso_before_
Definition: EwkMuDQM.h:101
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
MonitorElement * npvs_after_
Definition: EwkMuDQM.h:135
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
MonitorElement * njets_after_
Definition: EwkMuDQM.h:123
bool isNull() const
Checks for null.
Definition: Ref.h:246
virtual void endRun(const edm::Run &, const edm::EventSetup &)
Definition: EwkMuDQM.cc:188
double metMin_
Definition: EwkMuDQM.h:45
edm::InputTag muonTag_
Definition: EwkMuDQM.h:32
double ptThrForZ2_
Definition: EwkMuDQM.h:58
void init_histograms()
Definition: EwkMuDQM.cc:100
int nJetMax_
Definition: EwkMuDQM.h:61
MonitorElement * dimuonmass_after_
Definition: EwkMuDQM.h:126
Definition: MET.h:32
HLTConfigProvider hltConfigProvider_
Definition: EwkMuDQM.h:64
T sqrt(T t)
Definition: SSEVec.h:28
unsigned int nsel
Definition: EwkMuDQM.h:72
float emEt
ecal sum-Et
Definition: MuonIsolation.h:8
double dxyCut_
Definition: EwkMuDQM.h:49
virtual int charge() const
electric charge
int j
Definition: DBlmapReader.cc:9
bool isCombinedIso_
Definition: EwkMuDQM.h:41
MonitorElement * mt_after_
Definition: EwkMuDQM.h:108
MonitorElement * goodewkmuon_after_
Definition: EwkMuDQM.h:96
MonitorElement * muoncharge_after_
Definition: EwkMuDQM.h:138
MonitorElement * mt_before_
Definition: EwkMuDQM.h:107
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
#define LogTrace(id)
MonitorElement * eta_before_
Definition: EwkMuDQM.h:80
bool isRelativeIso_
Definition: EwkMuDQM.h:40
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
Definition: Muon.cc:40
T value() const
Explicit access to value in case implicit conversion not OK.
Definition: Phi.h:38
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:75
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
Definition: EwkMuDQM.cc:76
edm::InputTag jetTag_
Definition: EwkMuDQM.h:35
int pixelHitsCut_
Definition: EwkMuDQM.h:52
double normalizedChi2Cut_
Definition: EwkMuDQM.h:50
#define M_PI
Definition: BFit3D.cc:3
edm::InputTag metTag_
Definition: EwkMuDQM.h:33
MonitorElement * nz1_after_
Definition: EwkMuDQM.h:117
MonitorElement * pt_after_
Definition: EwkMuDQM.h:78
MonitorElement * iso_after_
Definition: EwkMuDQM.h:102
virtual double px() const
x coordinate of momentum vector
MonitorElement * nz2_after_
Definition: EwkMuDQM.h:120
virtual double pt() const
transverse momentum
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
MonitorElement * nz2_before_
Definition: EwkMuDQM.h:119
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
virtual double pz() const
z coordinate of momentum vector
std::string const & label() const
Definition: InputTag.h:25
int trackerHitsCut_
Definition: EwkMuDQM.h:51
double mtMin_
Definition: EwkMuDQM.h:43
double ptThrForZ1_
Definition: EwkMuDQM.h:57
MonitorElement * dxy_after_
Definition: EwkMuDQM.h:84
unsigned int prescaleSize() const
int muonHitsCut_
Definition: EwkMuDQM.h:53
MonitorElement * met_after_
Definition: EwkMuDQM.h:111
unsigned int niso
Definition: EwkMuDQM.h:69
edm::InputTag vertexTag_
Definition: EwkMuDQM.h:36
virtual double phi() const
momentum azimuthal angle
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: EwkMuDQM.cc:192
MonitorElement * nz1_before_
Definition: EwkMuDQM.h:116
Definition: Phi.h:20
virtual double py() const
y coordinate of momentum vector
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
MonitorElement * dimuonmass_before_
Definition: EwkMuDQM.h:125
const MuonIsolation & isolationR03() const
Definition: Muon.h:109
Definition: Run.h:32
double acopCut_
Definition: EwkMuDQM.h:47
unsigned int nmet
Definition: EwkMuDQM.h:71
bool isValidHltConfig_
Definition: EwkMuDQM.h:63
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:44
MonitorElement * ptmuonZ_after_
Definition: EwkMuDQM.h:140
MonitorElement * acop_after_
Definition: EwkMuDQM.h:114