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 
402 
403  bool isSelected = false;
404  bool fullSelect = false;
405  int cutFlowStatus = -1;
406 
407  if (mElecTau > visMassCut_) {
408  cutFlowStatus = kPassedPreselection;
409  }
410  if (cutFlowStatus == kPassedPreselection && (isTriggered || hltPaths_.empty())) {
411  cutFlowStatus = kPassedTrigger;
412  }
413  if (cutFlowStatus == kPassedTrigger && passesElectronId(*theElectron)) {
414  cutFlowStatus = kPassedElectronId;
415  hElectronTrackIsoPt_->Fill(theElectronTrackIsoPt);
416  }
417  if (cutFlowStatus == kPassedElectronId && theElectronTrackIsoPt < electronTrackIsoCut_) {
418  cutFlowStatus = kPassedElectronTrackIso;
419  hElectronEcalIsoPt_->Fill(theElectronEcalIsoPt);
420  }
421  if (cutFlowStatus == kPassedElectronTrackIso && theElectronEcalIsoPt < electronEcalIsoCut_) {
422  cutFlowStatus = kPassedElectronEcalIso;
423  }
424  if (cutFlowStatus == kPassedElectronEcalIso && theTauDiscrByLeadTrackFinding > 0.5) {
425  cutFlowStatus = kPassedTauLeadTrack;
426  // if ( theTauJet->leadTrack().isAvailable() )
427  // hTauLeadTrackPt_->Fill(theTauJet->leadTrack()->pt());
428  }
429  if (cutFlowStatus == kPassedTauLeadTrack && theTauDiscrByLeadTrackPtCut > 0.5) {
430  cutFlowStatus = kPassedTauLeadTrackPt;
431  // hTauTrackIsoPt_->Fill(theTauJet->isolationPFChargedHadrCandsPtSum());
432  }
433  if (cutFlowStatus == kPassedTauLeadTrackPt && theTauDiscrAgainstElectrons > 0.5) {
434  cutFlowStatus = kPassedTauDiscrAgainstElectrons;
435  // hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
436  }
437  if (cutFlowStatus == kPassedTauDiscrAgainstElectrons && theTauDiscrAgainstMuons > 0.5) {
438  cutFlowStatus = kPassedTauDiscrAgainstMuons;
439  isSelected = true;
440  }
441  if (cutFlowStatus == kPassedTauDiscrAgainstMuons && theTauDiscrByTrackIso > 0.5) {
442  cutFlowStatus = kPassedTauTrackIso;
443  // hTauEcalIsoPt_->Fill(theTauJet->isolationPFGammaCandsEtSum());
444  }
445  if (cutFlowStatus == kPassedTauTrackIso && theTauDiscrByEcalIso > 0.5) {
446  cutFlowStatus = kPassedTauEcalIso;
447  fullSelect = true;
448  // hTauDiscrAgainstElectrons_->Fill(theTauDiscrAgainstElectrons);
449  }
450 
451  for (int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
452  hCutFlowSummary_->Fill(iCut);
453  }
454 
455  if (isSelected) {
456  hElectronPt_->Fill(theElectron->pt());
457  hElectronEta_->Fill(theElectron->eta());
458  hElectronPhi_->Fill(theElectron->phi());
459 
460  hTauJetPt_->Fill(theTauJet->pt());
461  hTauJetEta_->Fill(theTauJet->eta());
462  // hTauJetPhi_->Fill(theTauJet->phi());
463 
464  // hTauJetCharge_->Fill(theTauJet->charge());
465  // if ( theTauJet->signalTracks().isAvailable() )
466  // hTauJetNumSignalTracks_->Fill(theTauJet->signalTracks().size());
467  // if ( theTauJet->isolationTracks().isAvailable() )
468  // hTauJetNumIsoTracks_->Fill(theTauJet->isolationTracks().size());
469 
470  if (fullSelect) {
471  hVisMass_->Fill(mElecTau);
472  }
473  // hMtElecCaloMEt_->Fill(mtElecCaloMEt);
474  hMtElecPFMEt_->Fill(mtElecPFMEt);
475  // hPzetaCaloMEt_->Fill(pZetaCaloMEt);
476  // hPzetaPFMEt_->Fill(pZetaPFMEt);
477  hElecTauAcoplanarity_->Fill(dPhiElecTau);
478  hElecTauCharge_->Fill(theElectron->charge() * theTauJet->charge());
479 
480  if (theEventVertex) {
481  // hVertexChi2_->Fill(theEventVertex->normalizedChi2());
482  hVertexZ_->Fill(theEventVertex->z());
483  // hVertexD0_->Fill(getVertexD0(*theEventVertex, *beamSpot));
484  }
485 
486  hCaloMEtPt_->Fill(caloMEt.pt());
487  // hCaloMEtPhi_->Fill(caloMEt.phi());
488 
489  hPFMEtPt_->Fill(pfMEt.pt());
490  // hPFMEtPhi_->Fill(pfMEt.phi());
491  }
492 
493  if (isSelected)
495 }
496 
498  edm::LogInfo("EwkElecTauHistManager") << "Filter-Statistics Summary:" << std::endl
499  << " Events analyzed = " << numEventsAnalyzed_ << std::endl
500  << " Events selected = " << numEventsSelected_;
501  if (numEventsAnalyzed_ > 0) {
502  double eff = numEventsSelected_ / (double)numEventsAnalyzed_;
503  edm::LogInfo("") << "Overall efficiency = " << std::setprecision(4) << eff * 100. << " +/- " << std::setprecision(4)
504  << TMath::Sqrt(eff * (1 - eff) / numEventsAnalyzed_) * 100. << ")%";
505  }
506 }
507 
508 //-------------------------------------------------------------------------------
509 // code specific to Z --> mu + tau-jet channel
510 //-------------------------------------------------------------------------------
511 
513 
515 
533 
534 #include "TMath.h"
535 
536 #include <iostream>
537 #include <iomanip>
538 
540  : dqmDirectory_(cfg.getParameter<std::string>("dqmDirectory")),
541  numEventsAnalyzed_(0),
542  numEventsSelected_(0),
543  cfgError_(0),
544  numWarningsTriggerResults_(0),
545  numWarningsHLTpath_(0),
546  numWarningsVertex_(0),
547  numWarningsBeamSpot_(0),
548  numWarningsMuon_(0),
549  numWarningsTauJet_(0),
550  numWarningsTauDiscrByLeadTrackFinding_(0),
551  numWarningsTauDiscrByLeadTrackPtCut_(0),
552  numWarningsTauDiscrByTrackIso_(0),
553  numWarningsTauDiscrByEcalIso_(0),
554  numWarningsTauDiscrAgainstMuons_(0),
555  numWarningsCaloMEt_(0),
556  numWarningsPFMEt_(0) {
557  triggerResultsSource_ = cfg.getParameter<edm::InputTag>("triggerResultsSource");
558  vertexSource_ = cfg.getParameter<edm::InputTag>("vertexSource");
559  beamSpotSource_ = cfg.getParameter<edm::InputTag>("beamSpotSource");
560  muonSource_ = cfg.getParameter<edm::InputTag>("muonSource");
561  tauJetSource_ = cfg.getParameter<edm::InputTag>("tauJetSource");
562  caloMEtSource_ = cfg.getParameter<edm::InputTag>("caloMEtSource");
563  pfMEtSource_ = cfg.getParameter<edm::InputTag>("pfMEtSource");
564 
565  tauDiscrByLeadTrackFinding_ = cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackFinding");
566  tauDiscrByLeadTrackPtCut_ = cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackPtCut");
567  tauDiscrByTrackIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByTrackIso");
568  tauDiscrByEcalIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByEcalIso");
569  tauDiscrAgainstMuons_ = cfg.getParameter<edm::InputTag>("tauDiscrAgainstMuons");
570 
571  hltPaths_ = cfg.getParameter<vstring>("hltPaths");
572 
573  muonEtaCut_ = cfg.getParameter<double>("muonEtaCut");
574  muonPtCut_ = cfg.getParameter<double>("muonPtCut");
575  muonTrackIsoCut_ = cfg.getParameter<double>("muonTrackIsoCut");
576  muonEcalIsoCut_ = cfg.getParameter<double>("muonEcalIsoCut");
577  muonCombIsoCut_ = cfg.getParameter<double>("muonCombIsoCut");
578  std::string muonIsoMode_string = cfg.getParameter<std::string>("muonIsoMode");
579  muonIsoMode_ = getIsoMode(muonIsoMode_string, cfgError_);
580 
581  tauJetEtaCut_ = cfg.getParameter<double>("tauJetEtaCut");
582  tauJetPtCut_ = cfg.getParameter<double>("tauJetPtCut");
583 
584  visMassCut_ = cfg.getParameter<double>("visMassCut");
585  deltaRCut_ = cfg.getParameter<double>("deltaRCut");
586 
587  maxNumWarnings_ = cfg.exists("maxNumWarnings") ? cfg.getParameter<int>("maxNumWarnings") : 1;
588 }
589 
592 
593  hMuonPt_ = iBooker.book1D("MuonPt", "P_{T}^{#mu}", 20, 0., 100.);
594  hMuonEta_ = iBooker.book1D("MuonEta", "#eta_{#mu}", 20, -4.0, +4.0);
595  hMuonPhi_ = iBooker.book1D("MuonPhi", "#phi_{#mu}", 20, -TMath::Pi(), +TMath::Pi());
596  hMuonTrackIsoPt_ = iBooker.book1D("MuonTrackIsoPt", "Muon Track Iso.", 20, -0.01, 10.);
597  hMuonEcalIsoPt_ = iBooker.book1D("MuonEcalIsoPt", "Muon Ecal Iso.", 20, -0.01, 10.);
598  hMuonCombIsoPt_ = iBooker.book1D("MuonCombIsoPt", "Muon Comb Iso.", 20, -0.01, 1.);
599 
600  hTauJetPt_ = iBooker.book1D("TauJetPt", "P_{T}^{#tau-Jet}", 20, 0., 100.);
601  hTauJetEta_ = iBooker.book1D("TauJetEta", "#eta_{#tau-Jet}", 20, -4.0, +4.0);
602  hTauJetPhi_ = iBooker.book1D("TauJetPhi", "#phi_{#tau-Jet}", 20, -TMath::Pi(), +TMath::Pi());
603  hTauLeadTrackPt_ = iBooker.book1D("TauLeadTrackPt", "P_{T}^{#tau-Jetldg trk}", 20, 0., 50.);
604  hTauTrackIsoPt_ = iBooker.book1D("TauTrackIsoPt", "Tau Track Iso.", 20, -0.01, 40.);
605  hTauEcalIsoPt_ = iBooker.book1D("TauEcalIsoPt", "Tau Ecal Iso.", 10, -0.01, 10.);
606  hTauDiscrAgainstMuons_ = iBooker.book1D("TauDiscrAgainstMuons", "Tau Discr. against Muons", 2, -0.5, +1.5);
607  hTauJetNumSignalTracks_ = iBooker.book1D("TauJetNumSignalTracks", "Num. Tau signal Cone Tracks", 20, -0.5, +19.5);
608  hTauJetNumIsoTracks_ = iBooker.book1D("TauJetNumIsoTracks", "Num. Tau isolation Cone Tracks", 20, -0.5, +19.5);
609 
610  hVisMass_ = iBooker.book1D("VisMass", "#mu + #tau-Jet visible Mass", 20, 0., 120.);
611  hVisMassFinal_ = iBooker.book1D("VisMassFinal", "#mu + #tau-Jet visible final Mass", 20, 0., 120.);
612  hMtMuPFMEt_ = iBooker.book1D("MtMuPFMEt", "#mu + E_{T}^{miss} (PF) transverse Mass", 20, 0., 120.);
614  iBooker.book1D("MuTauAcoplanarity", "#Delta #phi_{#mu #tau-Jet}", 20, -TMath::Pi(), +TMath::Pi());
615  hMuTauDeltaR_ = iBooker.book1D("MuTauDeltaR", "#Delta R_{#mu #tau-Jet}", 20, 0, 5);
616  hVertexZ_ = iBooker.book1D("VertexZ", "Event Vertex z-Position", 20, -25., +25.);
617  hCaloMEtPt_ = iBooker.book1D("CaloMEtPt", "E_{T}^{miss} (Calo)", 20, 0., 100.);
618  hPFMEtPt_ = iBooker.book1D("PFMEtPt", "E_{T}^{miss} (PF)", 20, 0., 100.);
619  hCutFlowSummary_ = iBooker.book1D("CutFlowSummary", "Cut-flow Summary", 11, 0.5, 11.5);
625  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrack, "#tau lead. Track");
626  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrackPt, "#tau lead. Track P_{T}");
627  hCutFlowSummary_->setBinLabel(kPassedTauTrackIso, "#tau Track Iso.");
628  hCutFlowSummary_->setBinLabel(kPassedTauEcalIso, "#tau Ecal Iso.");
629  hCutFlowSummary_->setBinLabel(kPassedTauDiscrAgainstMuons, "#tau anti-#mu Discr.");
630  hCutFlowSummary_->setBinLabel(kPassedDeltaR, "#DeltaR(#mu,#tau) ");
631 }
632 
634  if (cfgError_)
635  return;
636 
637  //-----------------------------------------------------------------------------
638  // access event-level information
639  //-----------------------------------------------------------------------------
640 
641  bool readError = false;
642 
643  //--- get decision of high-level trigger for the event
645  readEventData(evt,
647  hltDecision,
650  readError,
651  "Failed to access Trigger results");
652  if (readError)
653  return;
654 
655  const edm::TriggerNames& triggerNames = evt.triggerNames(*hltDecision);
656 
657  bool isTriggered = false;
658  for (vstring::const_iterator hltPath = hltPaths_.begin(); hltPath != hltPaths_.end(); ++hltPath) {
659  unsigned int index = triggerNames.triggerIndex(*hltPath);
660  if (index < triggerNames.size()) {
661  if (hltDecision->accept(index))
662  isTriggered = true;
663  } else {
665  edm::LogWarning("EwkMuTauHistManager") << " Undefined HLT path = " << (*hltPath) << " !!";
667  continue;
668  }
669  }
670 
671  //--- get reconstructed primary event vertex of the event
672  // (take as "the" primary event vertex the first entry in the collection
673  // of vertex objects, corresponding to the vertex associated to the highest
674  // Pt sum of tracks)
676  readEventData(evt,
681  readError,
682  "Failed to access Vertex collection");
683  if (readError)
684  return;
685 
686  const reco::Vertex* theEventVertex = (!vertexCollection->empty()) ? &(vertexCollection->at(0)) : nullptr;
687 
688  //--- get beam-spot (expected vertex position) for the event
691  evt, beamSpotSource_, beamSpot, numWarningsBeamSpot_, maxNumWarnings_, readError, "Failed to access Beam-spot");
692  if (readError)
693  return;
694 
695  //--- get collections of reconstructed muons from the event
698  evt, muonSource_, muons, numWarningsMuon_, maxNumWarnings_, readError, "Failed to access Muon collection");
699  if (readError)
700  return;
701 
702  const reco::Muon* theMuon = getTheMuon(*muons, muonEtaCut_, muonPtCut_);
703 
704  double theMuonTrackIsoPt = 1.e+3;
705  double theMuonEcalIsoPt = 1.e+3;
706  double theMuonCombIsoPt = 1.e+3;
707 
708  if (theMuon) {
709  theMuonTrackIsoPt = theMuon->isolationR05().sumPt;
710  // mu.isolationR05().emEt + mu.isolationR05().hadEt +
711  // mu.isolationR05().sumPt
712  theMuonEcalIsoPt = theMuon->isolationR05().emEt;
713 
714  if (muonIsoMode_ == kRelativeIso && theMuon->pt() > 0.) {
715  theMuonTrackIsoPt /= theMuon->pt();
716  theMuonEcalIsoPt /= theMuon->pt();
717  theMuonCombIsoPt = (theMuon->isolationR05().sumPt + theMuon->isolationR05().emEt) / theMuon->pt();
718  // std::cout<<"Rel Iso ="<<theMuonCombIsoPt<<std::endl;
719  }
720  }
721 
722  //--- get collections of reconstructed tau-jets from the event
724  readEventData(evt,
726  tauJets,
729  readError,
730  "Failed to access Tau-jet collection");
731  if (readError)
732  return;
733 
734  //--- get collections of tau-jet discriminators for those tau-jets
736  readEventData(evt,
741  readError,
742  "Failed to access collection of pf. Tau discriminators by "
743  "leading Track finding");
745  readEventData(evt,
750  readError,
751  "Failed to access collection of pf. Tau discriminators by "
752  "leading Track Pt cut");
754  readEventData(evt,
759  readError,
760  "Failed to access collection of pf. Tau discriminators by "
761  "Track isolation");
763  readEventData(evt,
768  readError,
769  "Failed to access collection of pf. Tau discriminators by ECAL "
770  "isolation");
772  readEventData(evt,
777  readError,
778  "Failed to access collection of pf. Tau discriminators against Muons");
779  if (readError)
780  return;
781 
782  int theTauJetIndex = -1;
783  const reco::PFTau* theTauJet = getTheTauJet(*tauJets, tauJetEtaCut_, tauJetPtCut_, theTauJetIndex);
784 
785  double theTauDiscrByLeadTrackFinding = -1.;
786  double theTauDiscrByLeadTrackPtCut = -1.;
787  double theTauDiscrByTrackIso = -1.;
788  double theTauDiscrByEcalIso = -1.;
789  double theTauDiscrAgainstMuons = -1.;
790  if (theTauJetIndex != -1) {
791  reco::PFTauRef theTauJetRef(tauJets, theTauJetIndex);
792  theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
793  theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
794  theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
795  theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
796  theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
797  }
798 
799  //--- get missing transverse momentum
800  // measured by calorimeters/reconstructed by particle-flow algorithm
801  edm::Handle<reco::CaloMETCollection> caloMEtCollection;
802  readEventData(evt,
804  caloMEtCollection,
807  readError,
808  "Failed to access calo. MET collection");
809  if (readError)
810  return;
811 
812  const reco::CaloMET& caloMEt = caloMEtCollection->at(0);
813 
814  edm::Handle<reco::PFMETCollection> pfMEtCollection;
815  readEventData(evt,
816  pfMEtSource_,
817  pfMEtCollection,
820  readError,
821  "Failed to access pf. MET collection");
822  if (readError)
823  return;
824 
825  const reco::PFMET& pfMEt = pfMEtCollection->at(0);
826 
827  if (!(theMuon && theTauJet && theTauJetIndex != -1))
828  return;
829 
830  //-----------------------------------------------------------------------------
831  // compute EWK tau analysis specific quantities
832  //-----------------------------------------------------------------------------
833 
834  double dPhiMuTau = calcDeltaPhi(theMuon->phi(), theTauJet->phi());
835  // double dRMuTau = calcDeltaR(theMuon->p4(), theTauJet->p4());
836  double dRMuTau = fabs(ROOT::Math::VectorUtil::DeltaR(theMuon->p4(), theTauJet->p4()));
837  double mMuTau = (theMuon->p4() + theTauJet->p4()).M();
838 
839  // double mtMuCaloMEt = calcMt(theMuon->px(), theMuon->px(), caloMEt.px(),
840  // caloMEt.py());
841  double mtMuPFMEt = calcMt(theMuon->px(), theMuon->px(), pfMEt.px(), pfMEt.py());
842 
843  // double pZetaCaloMEt = calcPzeta(theMuon->p4(), theTauJet->p4(),
844  // caloMEt.px(), caloMEt.py());
845  // double pZetaPFMEt = calcPzeta(theMuon->p4(), theTauJet->p4(), pfMEt.px(),
846  // pfMEt.py());
847 
848  //-----------------------------------------------------------------------------
849  // apply selection criteria; fill histograms
850  //-----------------------------------------------------------------------------
851 
853 
854  bool isSelected = false;
855  int cutFlowStatus = -1;
856 
857  // if ( muonIsoMode_ == kAbsoluteIso){
858  if (mMuTau > visMassCut_) {
859  cutFlowStatus = kPassedPreselection;
860  }
861  if (cutFlowStatus == kPassedPreselection && (isTriggered || hltPaths_.empty())) {
862  cutFlowStatus = kPassedTrigger;
863  }
864  if (cutFlowStatus == kPassedTrigger && (theMuon->isGlobalMuon() || theMuon->isTrackerMuon())) {
865  cutFlowStatus = kPassedMuonId;
866  }
867 
868  if (cutFlowStatus == kPassedMuonId && (theTauDiscrByLeadTrackFinding > 0.5) && (theTauJet->eta() < tauJetEtaCut_) &&
869  (theTauJet->pt() > tauJetPtCut_)) {
870  cutFlowStatus = kPassedTauLeadTrack;
871  }
872  if (cutFlowStatus == kPassedTauLeadTrack && theTauDiscrByLeadTrackPtCut > 0.5) {
873  cutFlowStatus = kPassedTauLeadTrackPt;
874  // hTauTrackIsoPt_->Fill(theTauJet->isolationPFChargedHadrCandsPtSum());
875  }
876  if (cutFlowStatus == kPassedTauLeadTrackPt && theTauDiscrAgainstMuons > 0.5) {
877  cutFlowStatus = kPassedTauDiscrAgainstMuons;
878  // hTauEcalIsoPt_->Fill(theTauJet->isolationPFGammaCandsEtSum());
879  }
880  if (cutFlowStatus == kPassedTauDiscrAgainstMuons && dRMuTau > deltaRCut_) {
881  cutFlowStatus = kPassedDeltaR;
882  // hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
883 
884  hMuonPt_->Fill(theMuon->pt());
885  hMuonEta_->Fill(theMuon->eta());
886  hMuonPhi_->Fill(theMuon->phi());
887 
888  hTauJetPt_->Fill(theTauJet->pt());
889  hTauJetEta_->Fill(theTauJet->eta());
890  hTauJetPhi_->Fill(theTauJet->phi());
891 
892  // hTauJetCharge_->Fill(theTauJet->charge());
893  if (theTauJet->signalTracks().isAvailable())
895  if (theTauJet->isolationTracks().isAvailable())
897 
898  hVisMass_->Fill(mMuTau);
899  // hMtMuCaloMEt_->Fill(mtMuCaloMEt);
900  hMtMuPFMEt_->Fill(mtMuPFMEt);
901  // hPzetaCaloMEt_->Fill(pZetaCaloMEt);
902  // hPzetaPFMEt_->Fill(pZetaPFMEt);
903  hMuTauAcoplanarity_->Fill(dPhiMuTau);
904  hMuTauDeltaR_->Fill(dRMuTau);
905  // hMuTauCharge_->Fill(theMuon->charge() + theTauJet->charge());
906 
907  if (theEventVertex) {
908  // hVertexChi2_->Fill(theEventVertex->normalizedChi2());
909  hVertexZ_->Fill(theEventVertex->z());
910  // hVertexD0_->Fill(getVertexD0(*theEventVertex, *beamSpot));
911  }
912 
913  hCaloMEtPt_->Fill(caloMEt.pt());
914  // hCaloMEtPhi_->Fill(caloMEt.phi());
915 
916  hPFMEtPt_->Fill(pfMEt.pt());
917  // hPFMEtPhi_->Fill(pfMEt.phi());
918  hMuonTrackIsoPt_->Fill(theMuonTrackIsoPt);
919  hMuonEcalIsoPt_->Fill(theMuonEcalIsoPt);
920  hMuonCombIsoPt_->Fill(theMuonCombIsoPt);
921  // hMuonCombIsoPt_->Fill((theMuonTrackIsoPt+theMuonEcalIsoPt)/theMuon->pt());
922 
923  // std::cout<<"Rel Iso Hist =
924  // "<<(theMuonTrackIsoPt+theMuonEcalIsoPt)/theMuon->pt()<<std::endl;
927  hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
928  if (theTauJet->leadTrack().isAvailable())
929  hTauLeadTrackPt_->Fill(theTauJet->leadTrack()->pt());
930  }
931 
932  if ((cutFlowStatus == kPassedDeltaR) && (((theMuonTrackIsoPt < muonTrackIsoCut_) && (muonIsoMode_ == kAbsoluteIso)) ||
933  ((1 > 0) && (muonIsoMode_ == kRelativeIso)))) {
934  cutFlowStatus = kPassedMuonTrackIso;
935  // isSelected = true;
936  }
937  if (cutFlowStatus == kPassedMuonTrackIso &&
938  (((theMuonEcalIsoPt < muonEcalIsoCut_) && (muonIsoMode_ == kAbsoluteIso)) ||
939  ((theMuonCombIsoPt < muonCombIsoCut_) && (muonIsoMode_ == kRelativeIso)))) {
940  cutFlowStatus = kPassedMuonEcalIso;
941  // isSelected = true;
942  }
943 
944  if (cutFlowStatus == kPassedMuonEcalIso && theTauDiscrByTrackIso > 0.5) {
945  cutFlowStatus = kPassedTauTrackIso;
946  }
947 
948  if (cutFlowStatus == kPassedTauTrackIso && theTauDiscrByEcalIso > 0.5) {
949  cutFlowStatus = kPassedTauEcalIso;
950  isSelected = true;
951  }
952 
953  for (int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
954  hCutFlowSummary_->Fill(iCut);
955  }
956 
957  for (int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
958  hCutFlowSummary_->Fill(iCut);
959  }
960 
961  // }
962 
963  if (isSelected) {
964  hVisMassFinal_->Fill(mMuTau);
966  }
967 }
968 
970  edm::LogInfo("EwkMuTauHistManager") << "Filter-Statistics Summary:" << std::endl
971  << " Events analyzed = " << numEventsAnalyzed_ << std::endl
972  << " Events selected = " << numEventsSelected_;
973  if (numEventsAnalyzed_ > 0) {
974  double eff = numEventsSelected_ / (double)numEventsAnalyzed_;
975  edm::LogInfo("") << "Overall efficiency = " << std::setprecision(4) << eff * 100. << " +/- " << std::setprecision(4)
976  << TMath::Sqrt(eff * (1 - eff) / numEventsAnalyzed_) * 100. << ")%";
977  }
978 }
979 
980 //-------------------------------------------------------------------------------
981 // common auxiliary functions used by different channels
982 //-------------------------------------------------------------------------------
983 
985 
986 #include <TMath.h>
987 
988 int getIsoMode(const std::string& isoMode_string, int& error) {
989  int isoMode_int;
990  if (isoMode_string == "absoluteIso") {
991  isoMode_int = kAbsoluteIso;
992  } else if (isoMode_string == "relativeIso") {
993  isoMode_int = kRelativeIso;
994  } else {
995  edm::LogError("getIsoMode") << " Failed to decode isoMode string = " << isoMode_string << " !!";
996  isoMode_int = kUndefinedIso;
997  error = 1;
998  }
999  return isoMode_int;
1000 }
1001 
1002 double calcDeltaPhi(double phi1, double phi2) {
1003  double deltaPhi = phi1 - phi2;
1004 
1005  if (deltaPhi < 0.)
1006  deltaPhi = -deltaPhi;
1007 
1008  if (deltaPhi > TMath::Pi())
1009  deltaPhi = 2 * TMath::Pi() - deltaPhi;
1010 
1011  return deltaPhi;
1012 }
1013 
1014 double calcMt(double px1, double py1, double px2, double py2) {
1015  double pt1 = TMath::Sqrt(px1 * px1 + py1 * py1);
1016  double pt2 = TMath::Sqrt(px2 * px2 + py2 * py2);
1017 
1018  double p1Dotp2 = px1 * px2 + py1 * py2;
1019  double cosAlpha = p1Dotp2 / (pt1 * pt2);
1020 
1021  return TMath::Sqrt(2 * pt1 * pt2 * (1 - cosAlpha));
1022 }
1023 
1026  double pxMEt,
1027  double pyMEt) {
1028  double cosPhi1 = cos(p1.phi());
1029  double sinPhi1 = sin(p1.phi());
1030  double cosPhi2 = cos(p2.phi());
1031  double sinPhi2 = sin(p2.phi());
1032  double zetaX = cosPhi1 + cosPhi2;
1033  double zetaY = sinPhi1 + sinPhi2;
1034  double zetaR = TMath::Sqrt(zetaX * zetaX + zetaY * zetaY);
1035  if (zetaR > 0.) {
1036  zetaX /= zetaR;
1037  zetaY /= zetaR;
1038  }
1039 
1040  double pxVis = p1.px() + p2.px();
1041  double pyVis = p1.py() + p2.py();
1042  double pZetaVis = pxVis * zetaX + pyVis * zetaY;
1043 
1044  double px = pxVis + pxMEt;
1045  double py = pyVis + pyMEt;
1046  double pZeta = px * zetaX + py * zetaY;
1047 
1048  return pZeta - 1.5 * pZetaVis;
1049 }
1050 
1052  if ((TMath::Abs(electron.eta()) < 1.479 || TMath::Abs(electron.eta()) > 1.566) && // cut ECAL barrel/endcap crack
1053  electron.deltaPhiSuperClusterTrackAtVtx() < 0.8 && electron.deltaEtaSuperClusterTrackAtVtx() < 0.01 &&
1054  electron.sigmaIetaIeta() < 0.03) {
1055  return true;
1056  } else {
1057  return false;
1058  }
1059 }
1060 
1062  if (passesElectronPreId(electron) && ((TMath::Abs(electron.eta()) > 1.566 && // electron reconstructed in ECAL
1063  // endcap
1064  electron.sigmaEtaEta() < 0.03 && electron.hcalOverEcal() < 0.05 &&
1065  TMath::Abs(electron.deltaEtaSuperClusterTrackAtVtx()) < 0.009 &&
1066  TMath::Abs(electron.deltaPhiSuperClusterTrackAtVtx()) < 0.7) ||
1067  (TMath::Abs(electron.eta()) < 1.479 && // electron reconstructed in ECAL
1068  // barrel
1069  electron.sigmaEtaEta() < 0.01 && electron.hcalOverEcal() < 0.12 &&
1070  TMath::Abs(electron.deltaEtaSuperClusterTrackAtVtx()) < 0.007 &&
1071  TMath::Abs(electron.deltaPhiSuperClusterTrackAtVtx()) < 0.8))) {
1072  return true;
1073  } else {
1074  return false;
1075  }
1076 }
1077 
1079  double electronEtaCut,
1080  double electronPtCut) {
1081  const reco::GsfElectron* theElectron = nullptr;
1082 
1083  for (reco::GsfElectronCollection::const_iterator electron = electrons.begin(); electron != electrons.end();
1084  ++electron) {
1085  if (TMath::Abs(electron->eta()) < electronEtaCut && electron->pt() > electronPtCut &&
1087  if (theElectron == nullptr || electron->pt() > theElectron->pt())
1088  theElectron = &(*electron);
1089  }
1090  }
1091 
1092  return theElectron;
1093 }
1094 
1096  const reco::Muon* theMuon = nullptr;
1097 
1098  for (reco::MuonCollection::const_iterator muon = muons.begin(); muon != muons.end(); ++muon) {
1099  if (TMath::Abs(muon->eta()) < muonEtaCut && muon->pt() > muonPtCut) {
1100  if (theMuon == nullptr || muon->pt() > theMuon->pt())
1101  theMuon = &(*muon);
1102  }
1103  }
1104 
1105  return theMuon;
1106 }
1107 
1109  double tauJetEtaCut,
1110  double tauJetPtCut,
1111  int& theTauJetIndex) {
1112  const reco::PFTau* theTauJet = nullptr;
1113  theTauJetIndex = -1;
1114 
1115  int numTauJets = tauJets.size();
1116  for (int iTauJet = 0; iTauJet < numTauJets; ++iTauJet) {
1117  const reco::PFTau& tauJet = tauJets.at(iTauJet);
1118 
1119  if (fabs(tauJet.eta()) < tauJetEtaCut && tauJet.pt() > tauJetPtCut) {
1120  if (theTauJet == nullptr || tauJet.pt() > theTauJet->pt()) {
1121  theTauJet = &tauJet;
1122  theTauJetIndex = iTauJet;
1123  }
1124  }
1125  }
1126 
1127  return theTauJet;
1128 }
1129 
1131  double dX = vertex.x() - beamSpot.x0();
1132  double dY = vertex.y() - beamSpot.y0();
1133  return TMath::Sqrt(dX * dX + dY * dY);
1134 }
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:1002
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:1014
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:239
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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:539
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:134
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:988
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:1130
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
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
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:633
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:1078
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:1061
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:136
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:1095
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:1108
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:969
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:1024
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
float dX(const MatchPair &match)
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:1051
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:590
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
float dY(const MatchPair &match)
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