CMS 3D CMS Logo

EwkTauDQM.cc
Go to the documentation of this file.
2 
4 
7 
9 
11  //--- concatenate names of dqmRootDirectory and dqmSubDirectory;
12  // add "/" separator inbetween if necessary
14  if (!dirName.empty() && dirName.find_last_of(dqmSeparator) != (dirName.length() - 1))
15  dirName.append(dqmSeparator);
16  dirName.append(dqmSubDirectory);
17  return dirName;
18 }
19 
20 EwkTauDQM::EwkTauDQM(const edm::ParameterSet& cfg) : dqmDirectory_(cfg.getParameter<std::string>("dqmDirectory")) {
21  maxNumWarnings_ = cfg.exists("maxNumWarnings") ? cfg.getParameter<int>("maxNumWarnings") : 1;
22 
23  edm::ParameterSet cfgChannels = cfg.getParameter<edm::ParameterSet>("channels");
24 
25  edm::ParameterSet cfgElecTauChannel = cfgChannels.getParameter<edm::ParameterSet>("elecTauChannel");
26  std::string dqmSubDirectoryElecTauChannel = cfgElecTauChannel.getParameter<std::string>("dqmSubDirectory");
27  cfgElecTauChannel.addParameter<std::string>("dqmDirectory",
28  dqmDirectoryName(dqmDirectory_, dqmSubDirectoryElecTauChannel));
29  cfgElecTauChannel.addParameter<int>("maxNumWarnings", maxNumWarnings_);
30  elecTauHistManager_ = new EwkElecTauHistManager(cfgElecTauChannel);
31 
32  edm::ParameterSet cfgMuTauChannel = cfgChannels.getParameter<edm::ParameterSet>("muTauChannel");
33  std::string dqmSubDirectoryMuTauChannel = cfgMuTauChannel.getParameter<std::string>("dqmSubDirectory");
34  cfgMuTauChannel.addParameter<std::string>("dqmDirectory",
35  dqmDirectoryName(dqmDirectory_, dqmSubDirectoryMuTauChannel));
36  cfgMuTauChannel.addParameter<int>("maxNumWarnings", maxNumWarnings_);
37  muTauHistManager_ = new EwkMuTauHistManager(cfgMuTauChannel);
38 }
39 
41  delete elecTauHistManager_;
42  delete muTauHistManager_;
43 }
44 
48 }
49 
50 void EwkTauDQM::analyze(const edm::Event& evt, const edm::EventSetup& es) {
53 }
54 
58 }
59 
60 //-------------------------------------------------------------------------------
61 // code specific to Z --> e + tau-jet channel
62 //-------------------------------------------------------------------------------
63 
65 
67 
85 
86 #include "TMath.h"
87 
88 #include <iostream>
89 #include <iomanip>
90 
92  : dqmDirectory_(cfg.getParameter<std::string>("dqmDirectory")),
93  numEventsAnalyzed_(0),
94  numEventsSelected_(0),
95  cfgError_(0),
96  numWarningsTriggerResults_(0),
97  numWarningsHLTpath_(0),
98  numWarningsVertex_(0),
99  numWarningsBeamSpot_(0),
100  numWarningsElectron_(0),
101  numWarningsTauJet_(0),
102  numWarningsTauDiscrByLeadTrackFinding_(0),
103  numWarningsTauDiscrByLeadTrackPtCut_(0),
104  numWarningsTauDiscrByTrackIso_(0),
105  numWarningsTauDiscrByEcalIso_(0),
106  numWarningsTauDiscrAgainstElectrons_(0),
107  numWarningsTauDiscrAgainstMuons_(0),
108  numWarningsCaloMEt_(0),
109  numWarningsPFMEt_(0) {
110  triggerResultsSource_ = cfg.getParameter<edm::InputTag>("triggerResultsSource");
111  vertexSource_ = cfg.getParameter<edm::InputTag>("vertexSource");
112  beamSpotSource_ = cfg.getParameter<edm::InputTag>("beamSpotSource");
113  electronSource_ = cfg.getParameter<edm::InputTag>("electronSource");
114  tauJetSource_ = cfg.getParameter<edm::InputTag>("tauJetSource");
115  caloMEtSource_ = cfg.getParameter<edm::InputTag>("caloMEtSource");
116  pfMEtSource_ = cfg.getParameter<edm::InputTag>("pfMEtSource");
117 
118  tauDiscrByLeadTrackFinding_ = cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackFinding");
119  tauDiscrByLeadTrackPtCut_ = cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackPtCut");
120  tauDiscrByTrackIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByTrackIso");
121  tauDiscrByEcalIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByEcalIso");
122  tauDiscrAgainstElectrons_ = cfg.getParameter<edm::InputTag>("tauDiscrAgainstElectrons");
123  tauDiscrAgainstMuons_ = cfg.getParameter<edm::InputTag>("tauDiscrAgainstMuons");
124 
125  hltPaths_ = cfg.getParameter<vstring>("hltPaths");
126 
127  electronEtaCut_ = cfg.getParameter<double>("electronEtaCut");
128  electronPtCut_ = cfg.getParameter<double>("electronPtCut");
129  electronTrackIsoCut_ = cfg.getParameter<double>("electronTrackIsoCut");
130  electronEcalIsoCut_ = cfg.getParameter<double>("electronEcalIsoCut");
131  std::string electronIsoMode_string = cfg.getParameter<std::string>("electronIsoMode");
132  electronIsoMode_ = getIsoMode(electronIsoMode_string, cfgError_);
133 
134  tauJetEtaCut_ = cfg.getParameter<double>("tauJetEtaCut");
135  tauJetPtCut_ = cfg.getParameter<double>("tauJetPtCut");
136 
137  visMassCut_ = cfg.getParameter<double>("visMassCut");
138 
139  maxNumWarnings_ = cfg.exists("maxNumWarnings") ? cfg.getParameter<int>("maxNumWarnings") : 1;
140 }
141 
144  hElectronPt_ = iBooker.book1D("ElectronPt", "P_{T}^{e}", 20, 0., 100.);
145  hElectronEta_ = iBooker.book1D("ElectronEta", "#eta_{e}", 20, -4.0, +4.0);
146  hElectronPhi_ = iBooker.book1D("ElectronPhi", "#phi_{e}", 20, -TMath::Pi(), +TMath::Pi());
147  hElectronTrackIsoPt_ = iBooker.book1D("ElectronTrackIsoPt", "Electron Track Iso.", 20, -0.01, 0.5);
148  hElectronEcalIsoPt_ = iBooker.book1D("ElectronEcalIsoPt", "Electron Ecal Iso.", 20, -0.01, 0.5);
149  hTauJetPt_ = iBooker.book1D("TauJetPt", "P_{T}^{#tau-Jet}", 20, 0., 100.);
150  hTauJetEta_ = iBooker.book1D("TauJetEta", "#eta_{#tau-Jet}", 20, -4.0, +4.0);
151  hVisMass_ = iBooker.book1D("VisMass", "e + #tau-Jet visible Mass", 20, 20., 120.);
152  hMtElecPFMEt_ = iBooker.book1D("MtElecPFMEt", "e + E_{T}^{miss} (PF) transverse Mass", 20, 20., 120.);
154  iBooker.book1D("ElecTauAcoplanarity", "#Delta #phi_{e #tau-Jet}", 20, -TMath::Pi(), +TMath::Pi());
155  hElecTauCharge_ = iBooker.book1D("ElecTauCharge", "Q_{e * #tau-Jet}", 5, -2.5, +2.5);
156  hVertexZ_ = iBooker.book1D("VertexZ", "Event Vertex z-Position", 20, -25., +25.);
157  hCaloMEtPt_ = iBooker.book1D("CaloMEtPt", "E_{T}^{miss} (Calo)", 20, 0., 100.);
158  hPFMEtPt_ = iBooker.book1D("PFMEtPt", "E_{T}^{miss} (PF)", 20, 0., 100.);
159  hCutFlowSummary_ = iBooker.book1D("CutFlowSummary", "Cut-flow Summary", 11, 0.5, 11.5);
165  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrack, "#tau lead. Track");
166  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrackPt, "#tau lead. Track P_{T}");
168  hCutFlowSummary_->setBinLabel(kPassedTauDiscrAgainstMuons, "#tau anti-#mu Discr.");
169  hCutFlowSummary_->setBinLabel(kPassedTauTrackIso, "#tau Track Iso.");
170  hCutFlowSummary_->setBinLabel(kPassedTauEcalIso, "#tau Ecal Iso.");
171 }
172 
174  if (cfgError_)
175  return;
176 
177  //-----------------------------------------------------------------------------
178  // access event-level information
179  //-----------------------------------------------------------------------------
180 
181  bool readError = false;
182 
183  //--- get decision of high-level trigger for the event
185  readEventData(evt,
187  hltDecision,
190  readError,
191  "Failed to access Trigger results");
192  if (readError)
193  return;
194 
195  const edm::TriggerNames& triggerNames = evt.triggerNames(*hltDecision);
196 
197  bool isTriggered = false;
198  for (vstring::const_iterator hltPath = hltPaths_.begin(); hltPath != hltPaths_.end(); ++hltPath) {
199  unsigned int index = triggerNames.triggerIndex(*hltPath);
200  if (index < triggerNames.size()) {
201  if (hltDecision->accept(index))
202  isTriggered = true;
203  } else {
205  edm::LogWarning("EwkElecTauHistManager") << " Undefined HLT path = " << (*hltPath) << " !!";
207  continue;
208  }
209  }
210 
211  //--- get reconstructed primary event vertex of the event
212  // (take as "the" primary event vertex the first entry in the collection
213  // of vertex objects, corresponding to the vertex associated to the highest
214  // Pt sum of tracks)
216  readEventData(evt,
221  readError,
222  "Failed to access Vertex collection");
223  if (readError)
224  return;
225 
226  const reco::Vertex* theEventVertex = (!vertexCollection->empty()) ? &(vertexCollection->at(0)) : nullptr;
227 
228  //--- get beam-spot (expected vertex position) for the event
231  evt, beamSpotSource_, beamSpot, numWarningsBeamSpot_, maxNumWarnings_, readError, "Failed to access Beam-spot");
232  if (readError)
233  return;
234 
235  //--- get collections of reconstructed electrons from the event
237  readEventData(evt,
239  electrons,
242  readError,
243  "Failed to access Electron collection");
244  if (readError)
245  return;
246 
248 
249  double theElectronTrackIsoPt = 1.e+3;
250  double theElectronEcalIsoPt = 1.e+3;
251  if (theElectron) {
252  theElectronTrackIsoPt = theElectron->dr03TkSumPt();
253  theElectronEcalIsoPt = theElectron->dr03EcalRecHitSumEt();
254 
255  if (electronIsoMode_ == kRelativeIso && theElectron->pt() > 0.) {
256  theElectronTrackIsoPt /= theElectron->pt();
257  theElectronEcalIsoPt /= theElectron->pt();
258  }
259  }
260 
261  //--- get collections of reconstructed tau-jets from the event
263  readEventData(evt,
265  tauJets,
268  readError,
269  "Failed to access Tau-jet collection");
270  if (readError)
271  return;
272 
273  //--- get collections of tau-jet discriminators for those tau-jets
275  readEventData(evt,
280  readError,
281  "Failed to access collection of pf. Tau discriminators by "
282  "leading Track finding");
284  readEventData(evt,
289  readError,
290  "Failed to access collection of pf. Tau discriminators by "
291  "leading Track Pt cut");
293  readEventData(evt,
298  readError,
299  "Failed to access collection of pf. Tau discriminators by "
300  "Track isolation");
302  readEventData(evt,
307  readError,
308  "Failed to access collection of pf. Tau discriminators by ECAL "
309  "isolation");
311  readEventData(evt,
316  readError,
317  "Failed to access collection of pf. Tau discriminators against "
318  "Electrons");
320  readEventData(evt,
325  readError,
326  "Failed to access collection of pf. Tau discriminators against Muons");
327  if (readError)
328  return;
329 
330  int theTauJetIndex = -1;
331  const reco::PFTau* theTauJet = getTheTauJet(*tauJets, tauJetEtaCut_, tauJetPtCut_, theTauJetIndex);
332 
333  double theTauDiscrByLeadTrackFinding = -1.;
334  double theTauDiscrByLeadTrackPtCut = -1.;
335  double theTauDiscrByTrackIso = -1.;
336  double theTauDiscrByEcalIso = -1.;
337  double theTauDiscrAgainstElectrons = -1.;
338  double theTauDiscrAgainstMuons = -1.;
339  if (theTauJetIndex != -1) {
340  reco::PFTauRef theTauJetRef(tauJets, theTauJetIndex);
341  theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
342  theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
343  theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
344  theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
345  theTauDiscrAgainstElectrons = (*tauDiscrAgainstElectrons)[theTauJetRef];
346  theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
347  }
348 
349  //--- get missing transverse momentum
350  // measured by calorimeters/reconstructed by particle-flow algorithm
351  edm::Handle<reco::CaloMETCollection> caloMEtCollection;
352  readEventData(evt,
354  caloMEtCollection,
357  readError,
358  "Failed to access calo. MET collection");
359  if (readError)
360  return;
361 
362  const reco::CaloMET& caloMEt = caloMEtCollection->at(0);
363 
364  edm::Handle<reco::PFMETCollection> pfMEtCollection;
365  readEventData(evt,
366  pfMEtSource_,
367  pfMEtCollection,
370  readError,
371  "Failed to access pf. MET collection");
372  if (readError)
373  return;
374 
375  const reco::PFMET& pfMEt = pfMEtCollection->at(0);
376 
377  if (!(theElectron && theTauJet && theTauJetIndex != -1))
378  return;
379 
380  //-----------------------------------------------------------------------------
381  // compute EWK tau analysis specific quantities
382  //-----------------------------------------------------------------------------
383 
384  double dPhiElecTau = calcDeltaPhi(theElectron->phi(), theTauJet->phi());
385 
386  double mElecTau = (theElectron->p4() + theTauJet->p4()).M();
387 
388  // double mtElecCaloMEt = calcMt(theElectron->px(), theElectron->py(),
389  // caloMEt.px(), caloMEt.py());
390  double mtElecPFMEt = calcMt(theElectron->px(), theElectron->py(), pfMEt.px(), pfMEt.py());
391 
392  // double pZetaCaloMEt = calcPzeta(theElectron->p4(), theTauJet->p4(),
393  // caloMEt.px(), caloMEt.py());
394  // double pZetaPFMEt = calcPzeta(theElectron->p4(), theTauJet->p4(),
395  // pfMEt.px(), pfMEt.py());
396 
397  //-----------------------------------------------------------------------------
398  // apply selection criteria; fill histograms
399  //-----------------------------------------------------------------------------
400 
401  //--- fill electron multiplicity histogram
402  unsigned numIdElectrons = 0;
403  for (reco::GsfElectronCollection::const_iterator electron = electrons->begin(); electron != electrons->end();
404  ++electron) {
405  if (passesElectronId(*electron)) {
406  ++numIdElectrons;
407  }
408  }
409 
410  // hNumIdElectrons_->Fill(numIdElectrons);
411 
413 
414  bool isSelected = false;
415  bool fullSelect = false;
416  int cutFlowStatus = -1;
417 
418  if (mElecTau > visMassCut_) {
419  cutFlowStatus = kPassedPreselection;
420  }
421  if (cutFlowStatus == kPassedPreselection && (isTriggered || hltPaths_.empty())) {
422  cutFlowStatus = kPassedTrigger;
423  }
424  if (cutFlowStatus == kPassedTrigger && passesElectronId(*theElectron)) {
425  cutFlowStatus = kPassedElectronId;
426  hElectronTrackIsoPt_->Fill(theElectronTrackIsoPt);
427  }
428  if (cutFlowStatus == kPassedElectronId && theElectronTrackIsoPt < electronTrackIsoCut_) {
429  cutFlowStatus = kPassedElectronTrackIso;
430  hElectronEcalIsoPt_->Fill(theElectronEcalIsoPt);
431  }
432  if (cutFlowStatus == kPassedElectronTrackIso && theElectronEcalIsoPt < electronEcalIsoCut_) {
433  cutFlowStatus = kPassedElectronEcalIso;
434  }
435  if (cutFlowStatus == kPassedElectronEcalIso && theTauDiscrByLeadTrackFinding > 0.5) {
436  cutFlowStatus = kPassedTauLeadTrack;
437  // if ( theTauJet->leadTrack().isAvailable() )
438  // hTauLeadTrackPt_->Fill(theTauJet->leadTrack()->pt());
439  }
440  if (cutFlowStatus == kPassedTauLeadTrack && theTauDiscrByLeadTrackPtCut > 0.5) {
441  cutFlowStatus = kPassedTauLeadTrackPt;
442  // hTauTrackIsoPt_->Fill(theTauJet->isolationPFChargedHadrCandsPtSum());
443  }
444  if (cutFlowStatus == kPassedTauLeadTrackPt && theTauDiscrAgainstElectrons > 0.5) {
445  cutFlowStatus = kPassedTauDiscrAgainstElectrons;
446  // hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
447  }
448  if (cutFlowStatus == kPassedTauDiscrAgainstElectrons && theTauDiscrAgainstMuons > 0.5) {
449  cutFlowStatus = kPassedTauDiscrAgainstMuons;
450  isSelected = true;
451  }
452  if (cutFlowStatus == kPassedTauDiscrAgainstMuons && theTauDiscrByTrackIso > 0.5) {
453  cutFlowStatus = kPassedTauTrackIso;
454  // hTauEcalIsoPt_->Fill(theTauJet->isolationPFGammaCandsEtSum());
455  }
456  if (cutFlowStatus == kPassedTauTrackIso && theTauDiscrByEcalIso > 0.5) {
457  cutFlowStatus = kPassedTauEcalIso;
458  fullSelect = true;
459  // hTauDiscrAgainstElectrons_->Fill(theTauDiscrAgainstElectrons);
460  }
461 
462  for (int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
463  hCutFlowSummary_->Fill(iCut);
464  }
465 
466  if (isSelected) {
467  hElectronPt_->Fill(theElectron->pt());
468  hElectronEta_->Fill(theElectron->eta());
469  hElectronPhi_->Fill(theElectron->phi());
470 
471  hTauJetPt_->Fill(theTauJet->pt());
472  hTauJetEta_->Fill(theTauJet->eta());
473  // hTauJetPhi_->Fill(theTauJet->phi());
474 
475  // hTauJetCharge_->Fill(theTauJet->charge());
476  // if ( theTauJet->signalTracks().isAvailable() )
477  // hTauJetNumSignalTracks_->Fill(theTauJet->signalTracks().size());
478  // if ( theTauJet->isolationTracks().isAvailable() )
479  // hTauJetNumIsoTracks_->Fill(theTauJet->isolationTracks().size());
480 
481  if (fullSelect) {
482  hVisMass_->Fill(mElecTau);
483  }
484  // hMtElecCaloMEt_->Fill(mtElecCaloMEt);
485  hMtElecPFMEt_->Fill(mtElecPFMEt);
486  // hPzetaCaloMEt_->Fill(pZetaCaloMEt);
487  // hPzetaPFMEt_->Fill(pZetaPFMEt);
488  hElecTauAcoplanarity_->Fill(dPhiElecTau);
489  hElecTauCharge_->Fill(theElectron->charge() * theTauJet->charge());
490 
491  if (theEventVertex) {
492  // hVertexChi2_->Fill(theEventVertex->normalizedChi2());
493  hVertexZ_->Fill(theEventVertex->z());
494  // hVertexD0_->Fill(getVertexD0(*theEventVertex, *beamSpot));
495  }
496 
497  hCaloMEtPt_->Fill(caloMEt.pt());
498  // hCaloMEtPhi_->Fill(caloMEt.phi());
499 
500  hPFMEtPt_->Fill(pfMEt.pt());
501  // hPFMEtPhi_->Fill(pfMEt.phi());
502  }
503 
504  if (isSelected)
506 }
507 
509  edm::LogInfo("EwkElecTauHistManager") << "Filter-Statistics Summary:" << std::endl
510  << " Events analyzed = " << numEventsAnalyzed_ << std::endl
511  << " Events selected = " << numEventsSelected_;
512  if (numEventsAnalyzed_ > 0) {
513  double eff = numEventsSelected_ / (double)numEventsAnalyzed_;
514  edm::LogInfo("") << "Overall efficiency = " << std::setprecision(4) << eff * 100. << " +/- " << std::setprecision(4)
515  << TMath::Sqrt(eff * (1 - eff) / numEventsAnalyzed_) * 100. << ")%";
516  }
517 }
518 
519 //-------------------------------------------------------------------------------
520 // code specific to Z --> mu + tau-jet channel
521 //-------------------------------------------------------------------------------
522 
524 
526 
544 
545 #include "TMath.h"
546 
547 #include <iostream>
548 #include <iomanip>
549 
551  : dqmDirectory_(cfg.getParameter<std::string>("dqmDirectory")),
552  numEventsAnalyzed_(0),
553  numEventsSelected_(0),
554  cfgError_(0),
555  numWarningsTriggerResults_(0),
556  numWarningsHLTpath_(0),
557  numWarningsVertex_(0),
558  numWarningsBeamSpot_(0),
559  numWarningsMuon_(0),
560  numWarningsTauJet_(0),
561  numWarningsTauDiscrByLeadTrackFinding_(0),
562  numWarningsTauDiscrByLeadTrackPtCut_(0),
563  numWarningsTauDiscrByTrackIso_(0),
564  numWarningsTauDiscrByEcalIso_(0),
565  numWarningsTauDiscrAgainstMuons_(0),
566  numWarningsCaloMEt_(0),
567  numWarningsPFMEt_(0) {
568  triggerResultsSource_ = cfg.getParameter<edm::InputTag>("triggerResultsSource");
569  vertexSource_ = cfg.getParameter<edm::InputTag>("vertexSource");
570  beamSpotSource_ = cfg.getParameter<edm::InputTag>("beamSpotSource");
571  muonSource_ = cfg.getParameter<edm::InputTag>("muonSource");
572  tauJetSource_ = cfg.getParameter<edm::InputTag>("tauJetSource");
573  caloMEtSource_ = cfg.getParameter<edm::InputTag>("caloMEtSource");
574  pfMEtSource_ = cfg.getParameter<edm::InputTag>("pfMEtSource");
575 
576  tauDiscrByLeadTrackFinding_ = cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackFinding");
577  tauDiscrByLeadTrackPtCut_ = cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackPtCut");
578  tauDiscrByTrackIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByTrackIso");
579  tauDiscrByEcalIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByEcalIso");
580  tauDiscrAgainstMuons_ = cfg.getParameter<edm::InputTag>("tauDiscrAgainstMuons");
581 
582  hltPaths_ = cfg.getParameter<vstring>("hltPaths");
583 
584  muonEtaCut_ = cfg.getParameter<double>("muonEtaCut");
585  muonPtCut_ = cfg.getParameter<double>("muonPtCut");
586  muonTrackIsoCut_ = cfg.getParameter<double>("muonTrackIsoCut");
587  muonEcalIsoCut_ = cfg.getParameter<double>("muonEcalIsoCut");
588  muonCombIsoCut_ = cfg.getParameter<double>("muonCombIsoCut");
589  std::string muonIsoMode_string = cfg.getParameter<std::string>("muonIsoMode");
590  muonIsoMode_ = getIsoMode(muonIsoMode_string, cfgError_);
591 
592  tauJetEtaCut_ = cfg.getParameter<double>("tauJetEtaCut");
593  tauJetPtCut_ = cfg.getParameter<double>("tauJetPtCut");
594 
595  visMassCut_ = cfg.getParameter<double>("visMassCut");
596  deltaRCut_ = cfg.getParameter<double>("deltaRCut");
597 
598  maxNumWarnings_ = cfg.exists("maxNumWarnings") ? cfg.getParameter<int>("maxNumWarnings") : 1;
599 }
600 
603 
604  hMuonPt_ = iBooker.book1D("MuonPt", "P_{T}^{#mu}", 20, 0., 100.);
605  hMuonEta_ = iBooker.book1D("MuonEta", "#eta_{#mu}", 20, -4.0, +4.0);
606  hMuonPhi_ = iBooker.book1D("MuonPhi", "#phi_{#mu}", 20, -TMath::Pi(), +TMath::Pi());
607  hMuonTrackIsoPt_ = iBooker.book1D("MuonTrackIsoPt", "Muon Track Iso.", 20, -0.01, 10.);
608  hMuonEcalIsoPt_ = iBooker.book1D("MuonEcalIsoPt", "Muon Ecal Iso.", 20, -0.01, 10.);
609  hMuonCombIsoPt_ = iBooker.book1D("MuonCombIsoPt", "Muon Comb Iso.", 20, -0.01, 1.);
610 
611  hTauJetPt_ = iBooker.book1D("TauJetPt", "P_{T}^{#tau-Jet}", 20, 0., 100.);
612  hTauJetEta_ = iBooker.book1D("TauJetEta", "#eta_{#tau-Jet}", 20, -4.0, +4.0);
613  hTauJetPhi_ = iBooker.book1D("TauJetPhi", "#phi_{#tau-Jet}", 20, -TMath::Pi(), +TMath::Pi());
614  hTauLeadTrackPt_ = iBooker.book1D("TauLeadTrackPt", "P_{T}^{#tau-Jetldg trk}", 20, 0., 50.);
615  hTauTrackIsoPt_ = iBooker.book1D("TauTrackIsoPt", "Tau Track Iso.", 20, -0.01, 40.);
616  hTauEcalIsoPt_ = iBooker.book1D("TauEcalIsoPt", "Tau Ecal Iso.", 10, -0.01, 10.);
617  hTauDiscrAgainstMuons_ = iBooker.book1D("TauDiscrAgainstMuons", "Tau Discr. against Muons", 2, -0.5, +1.5);
618  hTauJetNumSignalTracks_ = iBooker.book1D("TauJetNumSignalTracks", "Num. Tau signal Cone Tracks", 20, -0.5, +19.5);
619  hTauJetNumIsoTracks_ = iBooker.book1D("TauJetNumIsoTracks", "Num. Tau isolation Cone Tracks", 20, -0.5, +19.5);
620 
621  hVisMass_ = iBooker.book1D("VisMass", "#mu + #tau-Jet visible Mass", 20, 0., 120.);
622  hVisMassFinal_ = iBooker.book1D("VisMassFinal", "#mu + #tau-Jet visible final Mass", 20, 0., 120.);
623  hMtMuPFMEt_ = iBooker.book1D("MtMuPFMEt", "#mu + E_{T}^{miss} (PF) transverse Mass", 20, 0., 120.);
625  iBooker.book1D("MuTauAcoplanarity", "#Delta #phi_{#mu #tau-Jet}", 20, -TMath::Pi(), +TMath::Pi());
626  hMuTauDeltaR_ = iBooker.book1D("MuTauDeltaR", "#Delta R_{#mu #tau-Jet}", 20, 0, 5);
627  hVertexZ_ = iBooker.book1D("VertexZ", "Event Vertex z-Position", 20, -25., +25.);
628  hCaloMEtPt_ = iBooker.book1D("CaloMEtPt", "E_{T}^{miss} (Calo)", 20, 0., 100.);
629  hPFMEtPt_ = iBooker.book1D("PFMEtPt", "E_{T}^{miss} (PF)", 20, 0., 100.);
630  hCutFlowSummary_ = iBooker.book1D("CutFlowSummary", "Cut-flow Summary", 11, 0.5, 11.5);
636  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrack, "#tau lead. Track");
637  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrackPt, "#tau lead. Track P_{T}");
638  hCutFlowSummary_->setBinLabel(kPassedTauTrackIso, "#tau Track Iso.");
639  hCutFlowSummary_->setBinLabel(kPassedTauEcalIso, "#tau Ecal Iso.");
640  hCutFlowSummary_->setBinLabel(kPassedTauDiscrAgainstMuons, "#tau anti-#mu Discr.");
641  hCutFlowSummary_->setBinLabel(kPassedDeltaR, "#DeltaR(#mu,#tau) ");
642 }
643 
645  if (cfgError_)
646  return;
647 
648  //-----------------------------------------------------------------------------
649  // access event-level information
650  //-----------------------------------------------------------------------------
651 
652  bool readError = false;
653 
654  //--- get decision of high-level trigger for the event
656  readEventData(evt,
658  hltDecision,
661  readError,
662  "Failed to access Trigger results");
663  if (readError)
664  return;
665 
666  const edm::TriggerNames& triggerNames = evt.triggerNames(*hltDecision);
667 
668  bool isTriggered = false;
669  for (vstring::const_iterator hltPath = hltPaths_.begin(); hltPath != hltPaths_.end(); ++hltPath) {
670  unsigned int index = triggerNames.triggerIndex(*hltPath);
671  if (index < triggerNames.size()) {
672  if (hltDecision->accept(index))
673  isTriggered = true;
674  } else {
676  edm::LogWarning("EwkMuTauHistManager") << " Undefined HLT path = " << (*hltPath) << " !!";
678  continue;
679  }
680  }
681 
682  //--- get reconstructed primary event vertex of the event
683  // (take as "the" primary event vertex the first entry in the collection
684  // of vertex objects, corresponding to the vertex associated to the highest
685  // Pt sum of tracks)
687  readEventData(evt,
692  readError,
693  "Failed to access Vertex collection");
694  if (readError)
695  return;
696 
697  const reco::Vertex* theEventVertex = (!vertexCollection->empty()) ? &(vertexCollection->at(0)) : nullptr;
698 
699  //--- get beam-spot (expected vertex position) for the event
702  evt, beamSpotSource_, beamSpot, numWarningsBeamSpot_, maxNumWarnings_, readError, "Failed to access Beam-spot");
703  if (readError)
704  return;
705 
706  //--- get collections of reconstructed muons from the event
709  evt, muonSource_, muons, numWarningsMuon_, maxNumWarnings_, readError, "Failed to access Muon collection");
710  if (readError)
711  return;
712 
713  const reco::Muon* theMuon = getTheMuon(*muons, muonEtaCut_, muonPtCut_);
714 
715  double theMuonTrackIsoPt = 1.e+3;
716  double theMuonEcalIsoPt = 1.e+3;
717  double theMuonCombIsoPt = 1.e+3;
718 
719  if (theMuon) {
720  theMuonTrackIsoPt = theMuon->isolationR05().sumPt;
721  // mu.isolationR05().emEt + mu.isolationR05().hadEt +
722  // mu.isolationR05().sumPt
723  theMuonEcalIsoPt = theMuon->isolationR05().emEt;
724 
725  if (muonIsoMode_ == kRelativeIso && theMuon->pt() > 0.) {
726  theMuonTrackIsoPt /= theMuon->pt();
727  theMuonEcalIsoPt /= theMuon->pt();
728  theMuonCombIsoPt = (theMuon->isolationR05().sumPt + theMuon->isolationR05().emEt) / theMuon->pt();
729  // std::cout<<"Rel Iso ="<<theMuonCombIsoPt<<std::endl;
730  }
731  }
732 
733  //--- get collections of reconstructed tau-jets from the event
735  readEventData(evt,
737  tauJets,
740  readError,
741  "Failed to access Tau-jet collection");
742  if (readError)
743  return;
744 
745  //--- get collections of tau-jet discriminators for those tau-jets
747  readEventData(evt,
752  readError,
753  "Failed to access collection of pf. Tau discriminators by "
754  "leading Track finding");
756  readEventData(evt,
761  readError,
762  "Failed to access collection of pf. Tau discriminators by "
763  "leading Track Pt cut");
765  readEventData(evt,
770  readError,
771  "Failed to access collection of pf. Tau discriminators by "
772  "Track isolation");
774  readEventData(evt,
779  readError,
780  "Failed to access collection of pf. Tau discriminators by ECAL "
781  "isolation");
783  readEventData(evt,
788  readError,
789  "Failed to access collection of pf. Tau discriminators against Muons");
790  if (readError)
791  return;
792 
793  int theTauJetIndex = -1;
794  const reco::PFTau* theTauJet = getTheTauJet(*tauJets, tauJetEtaCut_, tauJetPtCut_, theTauJetIndex);
795 
796  double theTauDiscrByLeadTrackFinding = -1.;
797  double theTauDiscrByLeadTrackPtCut = -1.;
798  double theTauDiscrByTrackIso = -1.;
799  double theTauDiscrByEcalIso = -1.;
800  double theTauDiscrAgainstMuons = -1.;
801  if (theTauJetIndex != -1) {
802  reco::PFTauRef theTauJetRef(tauJets, theTauJetIndex);
803  theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
804  theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
805  theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
806  theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
807  theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
808  }
809 
810  //--- get missing transverse momentum
811  // measured by calorimeters/reconstructed by particle-flow algorithm
812  edm::Handle<reco::CaloMETCollection> caloMEtCollection;
813  readEventData(evt,
815  caloMEtCollection,
818  readError,
819  "Failed to access calo. MET collection");
820  if (readError)
821  return;
822 
823  const reco::CaloMET& caloMEt = caloMEtCollection->at(0);
824 
825  edm::Handle<reco::PFMETCollection> pfMEtCollection;
826  readEventData(evt,
827  pfMEtSource_,
828  pfMEtCollection,
831  readError,
832  "Failed to access pf. MET collection");
833  if (readError)
834  return;
835 
836  const reco::PFMET& pfMEt = pfMEtCollection->at(0);
837 
838  if (!(theMuon && theTauJet && theTauJetIndex != -1))
839  return;
840 
841  //-----------------------------------------------------------------------------
842  // compute EWK tau analysis specific quantities
843  //-----------------------------------------------------------------------------
844 
845  double dPhiMuTau = calcDeltaPhi(theMuon->phi(), theTauJet->phi());
846  // double dRMuTau = calcDeltaR(theMuon->p4(), theTauJet->p4());
847  double dRMuTau = fabs(ROOT::Math::VectorUtil::DeltaR(theMuon->p4(), theTauJet->p4()));
848  double mMuTau = (theMuon->p4() + theTauJet->p4()).M();
849 
850  // double mtMuCaloMEt = calcMt(theMuon->px(), theMuon->px(), caloMEt.px(),
851  // caloMEt.py());
852  double mtMuPFMEt = calcMt(theMuon->px(), theMuon->px(), pfMEt.px(), pfMEt.py());
853 
854  // double pZetaCaloMEt = calcPzeta(theMuon->p4(), theTauJet->p4(),
855  // caloMEt.px(), caloMEt.py());
856  // double pZetaPFMEt = calcPzeta(theMuon->p4(), theTauJet->p4(), pfMEt.px(),
857  // pfMEt.py());
858 
859  //-----------------------------------------------------------------------------
860  // apply selection criteria; fill histograms
861  //-----------------------------------------------------------------------------
862 
863  //--- fill muon multiplicity histogram
864  unsigned numGlobalMuons = 0;
865  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
866  if (muon->isGlobalMuon()) {
867  ++numGlobalMuons;
868  }
869  }
870 
871  // hNumGlobalMuons_->Fill(numGlobalMuons);
872 
874 
875  bool isSelected = false;
876  int cutFlowStatus = -1;
877 
878  // if ( muonIsoMode_ == kAbsoluteIso){
879  if (mMuTau > visMassCut_) {
880  cutFlowStatus = kPassedPreselection;
881  }
882  if (cutFlowStatus == kPassedPreselection && (isTriggered || hltPaths_.empty())) {
883  cutFlowStatus = kPassedTrigger;
884  }
885  if (cutFlowStatus == kPassedTrigger && (theMuon->isGlobalMuon() || theMuon->isTrackerMuon())) {
886  cutFlowStatus = kPassedMuonId;
887  }
888 
889  if (cutFlowStatus == kPassedMuonId && (theTauDiscrByLeadTrackFinding > 0.5) && (theTauJet->eta() < tauJetEtaCut_) &&
890  (theTauJet->pt() > tauJetPtCut_)) {
891  cutFlowStatus = kPassedTauLeadTrack;
892  }
893  if (cutFlowStatus == kPassedTauLeadTrack && theTauDiscrByLeadTrackPtCut > 0.5) {
894  cutFlowStatus = kPassedTauLeadTrackPt;
895  // hTauTrackIsoPt_->Fill(theTauJet->isolationPFChargedHadrCandsPtSum());
896  }
897  if (cutFlowStatus == kPassedTauLeadTrackPt && theTauDiscrAgainstMuons > 0.5) {
898  cutFlowStatus = kPassedTauDiscrAgainstMuons;
899  // hTauEcalIsoPt_->Fill(theTauJet->isolationPFGammaCandsEtSum());
900  }
901  if (cutFlowStatus == kPassedTauDiscrAgainstMuons && dRMuTau > deltaRCut_) {
902  cutFlowStatus = kPassedDeltaR;
903  // hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
904 
905  hMuonPt_->Fill(theMuon->pt());
906  hMuonEta_->Fill(theMuon->eta());
907  hMuonPhi_->Fill(theMuon->phi());
908 
909  hTauJetPt_->Fill(theTauJet->pt());
910  hTauJetEta_->Fill(theTauJet->eta());
911  hTauJetPhi_->Fill(theTauJet->phi());
912 
913  // hTauJetCharge_->Fill(theTauJet->charge());
914  if (theTauJet->signalTracks().isAvailable())
916  if (theTauJet->isolationTracks().isAvailable())
918 
919  hVisMass_->Fill(mMuTau);
920  // hMtMuCaloMEt_->Fill(mtMuCaloMEt);
921  hMtMuPFMEt_->Fill(mtMuPFMEt);
922  // hPzetaCaloMEt_->Fill(pZetaCaloMEt);
923  // hPzetaPFMEt_->Fill(pZetaPFMEt);
924  hMuTauAcoplanarity_->Fill(dPhiMuTau);
925  hMuTauDeltaR_->Fill(dRMuTau);
926  // hMuTauCharge_->Fill(theMuon->charge() + theTauJet->charge());
927 
928  if (theEventVertex) {
929  // hVertexChi2_->Fill(theEventVertex->normalizedChi2());
930  hVertexZ_->Fill(theEventVertex->z());
931  // hVertexD0_->Fill(getVertexD0(*theEventVertex, *beamSpot));
932  }
933 
934  hCaloMEtPt_->Fill(caloMEt.pt());
935  // hCaloMEtPhi_->Fill(caloMEt.phi());
936 
937  hPFMEtPt_->Fill(pfMEt.pt());
938  // hPFMEtPhi_->Fill(pfMEt.phi());
939  hMuonTrackIsoPt_->Fill(theMuonTrackIsoPt);
940  hMuonEcalIsoPt_->Fill(theMuonEcalIsoPt);
941  hMuonCombIsoPt_->Fill(theMuonCombIsoPt);
942  // hMuonCombIsoPt_->Fill((theMuonTrackIsoPt+theMuonEcalIsoPt)/theMuon->pt());
943 
944  // std::cout<<"Rel Iso Hist =
945  // "<<(theMuonTrackIsoPt+theMuonEcalIsoPt)/theMuon->pt()<<std::endl;
948  hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
949  if (theTauJet->leadTrack().isAvailable())
950  hTauLeadTrackPt_->Fill(theTauJet->leadTrack()->pt());
951  }
952 
953  if ((cutFlowStatus == kPassedDeltaR) && (((theMuonTrackIsoPt < muonTrackIsoCut_) && (muonIsoMode_ == kAbsoluteIso)) ||
954  ((1 > 0) && (muonIsoMode_ == kRelativeIso)))) {
955  cutFlowStatus = kPassedMuonTrackIso;
956  // isSelected = true;
957  }
958  if (cutFlowStatus == kPassedMuonTrackIso &&
959  (((theMuonEcalIsoPt < muonEcalIsoCut_) && (muonIsoMode_ == kAbsoluteIso)) ||
960  ((theMuonCombIsoPt < muonCombIsoCut_) && (muonIsoMode_ == kRelativeIso)))) {
961  cutFlowStatus = kPassedMuonEcalIso;
962  // isSelected = true;
963  }
964 
965  if (cutFlowStatus == kPassedMuonEcalIso && theTauDiscrByTrackIso > 0.5) {
966  cutFlowStatus = kPassedTauTrackIso;
967  }
968 
969  if (cutFlowStatus == kPassedTauTrackIso && theTauDiscrByEcalIso > 0.5) {
970  cutFlowStatus = kPassedTauEcalIso;
971  isSelected = true;
972  }
973 
974  for (int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
975  hCutFlowSummary_->Fill(iCut);
976  }
977 
978  for (int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
979  hCutFlowSummary_->Fill(iCut);
980  }
981 
982  // }
983 
984  if (isSelected) {
985  hVisMassFinal_->Fill(mMuTau);
987  }
988 }
989 
991  edm::LogInfo("EwkMuTauHistManager") << "Filter-Statistics Summary:" << std::endl
992  << " Events analyzed = " << numEventsAnalyzed_ << std::endl
993  << " Events selected = " << numEventsSelected_;
994  if (numEventsAnalyzed_ > 0) {
995  double eff = numEventsSelected_ / (double)numEventsAnalyzed_;
996  edm::LogInfo("") << "Overall efficiency = " << std::setprecision(4) << eff * 100. << " +/- " << std::setprecision(4)
997  << TMath::Sqrt(eff * (1 - eff) / numEventsAnalyzed_) * 100. << ")%";
998  }
999 }
1000 
1001 //-------------------------------------------------------------------------------
1002 // common auxiliary functions used by different channels
1003 //-------------------------------------------------------------------------------
1004 
1006 
1007 #include <TMath.h>
1008 
1009 int getIsoMode(const std::string& isoMode_string, int& error) {
1010  int isoMode_int;
1011  if (isoMode_string == "absoluteIso") {
1012  isoMode_int = kAbsoluteIso;
1013  } else if (isoMode_string == "relativeIso") {
1014  isoMode_int = kRelativeIso;
1015  } else {
1016  edm::LogError("getIsoMode") << " Failed to decode isoMode string = " << isoMode_string << " !!";
1017  isoMode_int = kUndefinedIso;
1018  error = 1;
1019  }
1020  return isoMode_int;
1021 }
1022 
1023 double calcDeltaPhi(double phi1, double phi2) {
1024  double deltaPhi = phi1 - phi2;
1025 
1026  if (deltaPhi < 0.)
1027  deltaPhi = -deltaPhi;
1028 
1029  if (deltaPhi > TMath::Pi())
1030  deltaPhi = 2 * TMath::Pi() - deltaPhi;
1031 
1032  return deltaPhi;
1033 }
1034 
1035 double calcMt(double px1, double py1, double px2, double py2) {
1036  double pt1 = TMath::Sqrt(px1 * px1 + py1 * py1);
1037  double pt2 = TMath::Sqrt(px2 * px2 + py2 * py2);
1038 
1039  double p1Dotp2 = px1 * px2 + py1 * py2;
1040  double cosAlpha = p1Dotp2 / (pt1 * pt2);
1041 
1042  return TMath::Sqrt(2 * pt1 * pt2 * (1 - cosAlpha));
1043 }
1044 
1047  double pxMEt,
1048  double pyMEt) {
1049  double cosPhi1 = cos(p1.phi());
1050  double sinPhi1 = sin(p1.phi());
1051  double cosPhi2 = cos(p2.phi());
1052  double sinPhi2 = sin(p2.phi());
1053  double zetaX = cosPhi1 + cosPhi2;
1054  double zetaY = sinPhi1 + sinPhi2;
1055  double zetaR = TMath::Sqrt(zetaX * zetaX + zetaY * zetaY);
1056  if (zetaR > 0.) {
1057  zetaX /= zetaR;
1058  zetaY /= zetaR;
1059  }
1060 
1061  double pxVis = p1.px() + p2.px();
1062  double pyVis = p1.py() + p2.py();
1063  double pZetaVis = pxVis * zetaX + pyVis * zetaY;
1064 
1065  double px = pxVis + pxMEt;
1066  double py = pyVis + pyMEt;
1067  double pZeta = px * zetaX + py * zetaY;
1068 
1069  return pZeta - 1.5 * pZetaVis;
1070 }
1071 
1073  if ((TMath::Abs(electron.eta()) < 1.479 || TMath::Abs(electron.eta()) > 1.566) && // cut ECAL barrel/endcap crack
1074  electron.deltaPhiSuperClusterTrackAtVtx() < 0.8 && electron.deltaEtaSuperClusterTrackAtVtx() < 0.01 &&
1075  electron.sigmaIetaIeta() < 0.03) {
1076  return true;
1077  } else {
1078  return false;
1079  }
1080 }
1081 
1083  if (passesElectronPreId(electron) && ((TMath::Abs(electron.eta()) > 1.566 && // electron reconstructed in ECAL
1084  // endcap
1085  electron.sigmaEtaEta() < 0.03 && electron.hcalOverEcal() < 0.05 &&
1086  TMath::Abs(electron.deltaEtaSuperClusterTrackAtVtx()) < 0.009 &&
1087  TMath::Abs(electron.deltaPhiSuperClusterTrackAtVtx()) < 0.7) ||
1088  (TMath::Abs(electron.eta()) < 1.479 && // electron reconstructed in ECAL
1089  // barrel
1090  electron.sigmaEtaEta() < 0.01 && electron.hcalOverEcal() < 0.12 &&
1091  TMath::Abs(electron.deltaEtaSuperClusterTrackAtVtx()) < 0.007 &&
1092  TMath::Abs(electron.deltaPhiSuperClusterTrackAtVtx()) < 0.8))) {
1093  return true;
1094  } else {
1095  return false;
1096  }
1097 }
1098 
1100  double electronEtaCut,
1101  double electronPtCut) {
1102  const reco::GsfElectron* theElectron = nullptr;
1103 
1104  for (reco::GsfElectronCollection::const_iterator electron = electrons.begin(); electron != electrons.end();
1105  ++electron) {
1106  if (TMath::Abs(electron->eta()) < electronEtaCut && electron->pt() > electronPtCut &&
1108  if (theElectron == nullptr || electron->pt() > theElectron->pt())
1109  theElectron = &(*electron);
1110  }
1111  }
1112 
1113  return theElectron;
1114 }
1115 
1117  const reco::Muon* theMuon = nullptr;
1118 
1119  for (reco::MuonCollection::const_iterator muon = muons.begin(); muon != muons.end(); ++muon) {
1120  if (TMath::Abs(muon->eta()) < muonEtaCut && muon->pt() > muonPtCut) {
1121  if (theMuon == nullptr || muon->pt() > theMuon->pt())
1122  theMuon = &(*muon);
1123  }
1124  }
1125 
1126  return theMuon;
1127 }
1128 
1130  double tauJetEtaCut,
1131  double tauJetPtCut,
1132  int& theTauJetIndex) {
1133  const reco::PFTau* theTauJet = nullptr;
1134  theTauJetIndex = -1;
1135 
1136  int numTauJets = tauJets.size();
1137  for (int iTauJet = 0; iTauJet < numTauJets; ++iTauJet) {
1138  const reco::PFTau& tauJet = tauJets.at(iTauJet);
1139 
1140  if (fabs(tauJet.eta()) < tauJetEtaCut && tauJet.pt() > tauJetPtCut) {
1141  if (theTauJet == nullptr || tauJet.pt() > theTauJet->pt()) {
1142  theTauJet = &tauJet;
1143  theTauJetIndex = iTauJet;
1144  }
1145  }
1146  }
1147 
1148  return theTauJet;
1149 }
1150 
1152  double dX = vertex.x() - beamSpot.x0();
1153  double dY = vertex.y() - beamSpot.y0();
1154  return TMath::Sqrt(dX * dX + dY * dY);
1155 }
MonitorElement * hCutFlowSummary_
Definition: EwkTauDQM.h:306
edm::InputTag tauDiscrByEcalIso_
Definition: EwkTauDQM.h:242
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:187
bool accept() const
Has at least one path accepted the event?
const double Pi
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:233
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkTauDQM.cc:1023
double muonCombIsoCut_
Definition: EwkTauDQM.h:253
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:152
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:283
void bookHistograms(DQMStore::IBooker &)
Definition: EwkTauDQM.cc:142
double calcMt(double px1, double py1, double px2, double py2)
Definition: EwkTauDQM.cc:1035
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:239
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * hTauJetPhi_
Definition: EwkTauDQM.h:277
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:237
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:84
std::vector< PFTau > PFTauCollection
collection of PFTau objects
Definition: PFTauFwd.h:9
EwkMuTauHistManager(const edm::ParameterSet &)
Definition: EwkTauDQM.cc:550
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:6
double pt() const final
transverse momentum
edm::InputTag tauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:91
double z() const
z coordinate
Definition: Vertex.h:133
MonitorElement * hElecTauAcoplanarity_
Definition: EwkTauDQM.h:142
edm::InputTag electronSource_
Definition: EwkTauDQM.h:85
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
int getIsoMode(const std::string &isoMode_string, int &error)
Definition: EwkTauDQM.cc:1009
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:241
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:339
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:137
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: EwkTauDQM.cc:50
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:90
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:338
double getVertexD0(const reco::Vertex &vertex, const reco::BeamSpot &beamSpot)
Definition: EwkTauDQM.cc:1151
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:337
MonitorElement * hMuonPhi_
Definition: EwkTauDQM.h:270
std::vector< std::string > vstring
Definition: EwkTauDQM.h:246
MonitorElement * hElectronEcalIsoPt_
Definition: EwkTauDQM.h:122
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
MonitorElement * hTauEcalIsoPt_
Definition: EwkTauDQM.h:280
std::string dqmDirectory_
Definition: EwkTauDQM.h:37
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:184
double electronEcalIsoCut_
Definition: EwkTauDQM.h:104
unsigned numEventsSelected_
Definition: EwkTauDQM.h:172
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:303
unsigned numEventsSelected_
Definition: EwkTauDQM.h:323
std::string dqmDirectory_
Definition: EwkTauDQM.h:264
float isolationPFGammaCandsEtSum() const
Definition: PFTau.cc:333
edm::InputTag tauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:240
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: EwkTauDQM.cc:45
~EwkTauDQM() override
Definition: EwkTauDQM.cc:40
Log< level::Error, false > LogError
std::string dqmDirectoryName(const std::string &dqmRootDirectory, const std::string &dqmSubDirectory)
Definition: EwkTauDQM.cc:10
MonitorElement * hCutFlowSummary_
Definition: EwkTauDQM.h:155
long numWarningsTauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:185
edm::InputTag caloMEtSource_
Definition: EwkTauDQM.h:87
double electronTrackIsoCut_
Definition: EwkTauDQM.h:103
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:95
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:146
const LorentzVector & p4() const final
four-momentum Lorentz vector
void fillHistograms(const edm::Event &, const edm::EventSetup &)
Definition: EwkTauDQM.cc:644
MonitorElement * hTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:281
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
bool isTrackerMuon() const override
Definition: Muon.h:304
MonitorElement * hMuonEcalIsoPt_
Definition: EwkTauDQM.h:272
void fillHistograms(const edm::Event &, const edm::EventSetup &)
Definition: EwkTauDQM.cc:173
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:186
MonitorElement * hElecTauCharge_
Definition: EwkTauDQM.h:143
double muonTrackIsoCut_
Definition: EwkTauDQM.h:251
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:232
float dr03TkSumPt() const
Definition: GsfElectron.h:557
void Fill(long long x)
const reco::GsfElectron * getTheElectron(const reco::GsfElectronCollection &electrons, double electronEtaCut, double electronPtCut)
Definition: EwkTauDQM.cc:1099
MonitorElement * hElectronTrackIsoPt_
Definition: EwkTauDQM.h:121
MonitorElement * hTauJetNumSignalTracks_
Definition: EwkTauDQM.h:283
double px() const final
x coordinate of momentum vector
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:235
MonitorElement * hMuonEta_
Definition: EwkTauDQM.h:269
void dqmEndRun(const edm::Run &, const edm::EventSetup &) override
Definition: EwkTauDQM.cc:55
bool passesElectronId(const reco::GsfElectron &electron)
Definition: EwkTauDQM.cc:1082
MonitorElement * hVisMassFinal_
Definition: EwkTauDQM.h:288
MonitorElement * hTauLeadTrackPt_
Definition: EwkTauDQM.h:278
EwkElecTauHistManager * elecTauHistManager_
Definition: EwkTauDQM.h:40
MonitorElement * hElectronEta_
Definition: EwkTauDQM.h:119
bool isAvailable() const
Definition: Ref.h:541
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
float emEt
ecal sum-Et
Definition: MuonIsolation.h:7
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int maxNumWarnings_
Definition: EwkTauDQM.h:38
edm::InputTag caloMEtSource_
Definition: EwkTauDQM.h:236
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:329
std::string dqmDirectory_
Definition: EwkTauDQM.h:114
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:189
MonitorElement * hMtMuPFMEt_
Definition: EwkTauDQM.h:290
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:149
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:275
const reco::Muon * getTheMuon(const reco::MuonCollection &muons, double muonEtaCut, double muonPtCut)
Definition: EwkTauDQM.cc:1116
virtual const reco::TrackRefVector & signalTracks() const
Definition: BaseTau.cc:26
edm::InputTag tauDiscrByEcalIso_
Definition: EwkTauDQM.h:93
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:297
virtual reco::TrackRef leadTrack() const
Definition: BaseTau.cc:24
const reco::PFTau * getTheTauJet(const reco::PFTauCollection &tauJets, double tauJetEtaCut, double tauJetPtCut, int &theTauJetIndex)
Definition: EwkTauDQM.cc:1129
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:125
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:217
double py() const final
y coordinate of momentum vector
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void finalizeHistograms()
Definition: EwkTauDQM.cc:990
MonitorElement * hTauTrackIsoPt_
Definition: EwkTauDQM.h:279
MonitorElement * hElectronPhi_
Definition: EwkTauDQM.h:120
double calcPzeta(const reco::Candidate::LorentzVector &p1, const reco::Candidate::LorentzVector &p2, double pxMEt, double pyMEt)
Definition: EwkTauDQM.cc:1045
edm::InputTag tauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:94
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:300
virtual const reco::TrackRefVector & isolationTracks() const
Definition: BaseTau.cc:28
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:335
MonitorElement * hMuonPt_
Definition: EwkTauDQM.h:268
Log< level::Info, false > LogInfo
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:92
MonitorElement * hMuTauDeltaR_
Definition: EwkTauDQM.h:287
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:178
float isolationPFChargedHadrCandsPtSum() const
Definition: PFTau.cc:330
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
edm::InputTag muonSource_
Definition: EwkTauDQM.h:234
EwkElecTauHistManager(const edm::ParameterSet &)
Definition: EwkTauDQM.cc:91
MonitorElement * hMuTauAcoplanarity_
Definition: EwkTauDQM.h:293
MonitorElement * hTauJetNumIsoTracks_
Definition: EwkTauDQM.h:284
MonitorElement * hMuonCombIsoPt_
Definition: EwkTauDQM.h:273
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:83
electronEtaCut
"HLT_Ele10_LW_L1R"
bool passesElectronPreId(const reco::GsfElectron &electron)
Definition: EwkTauDQM.cc:1072
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:88
EwkMuTauHistManager * muTauHistManager_
Definition: EwkTauDQM.h:41
std::vector< std::string > vstring
Definition: EwkTauDQM.h:98
void readEventData(const edm::Event &evt, const edm::InputTag &src, edm::Handle< T > &handle, long &numWarnings, int maxNumWarnings, bool &error, const char *errorMessage)
Definition: EwkTauDQM.h:374
void bookHistograms(DQMStore::IBooker &)
Definition: EwkTauDQM.cc:601
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:276
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:86
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:82
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:322
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:559
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:231
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:126
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:243
const std::string dqmRootDirectory
const std::string dqmSeparator
Definition: EwkTauDQM.cc:8
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:286
MonitorElement * hMuonTrackIsoPt_
Definition: EwkTauDQM.h:271
Log< level::Warning, false > LogWarning
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:171
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
long numWarningsTauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:188
double phi() const final
momentum azimuthal angle
EwkTauDQM(const edm::ParameterSet &)
Definition: EwkTauDQM.cc:20
MonitorElement * hElectronPt_
Definition: EwkTauDQM.h:118
const MuonIsolation & isolationR05() const
Definition: Muon.h:167
bool isGlobalMuon() const override
Definition: Muon.h:303
bool isAvailable() const
Definition: RefVector.h:233
MonitorElement * hMtElecPFMEt_
Definition: EwkTauDQM.h:139
Definition: Run.h:45
int charge() const final
electric charge
double muonEcalIsoCut_
Definition: EwkTauDQM.h:252
long numWarningsTauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:336
double eta() const final
momentum pseudorapidity