CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Attributes
EwkElecTauHistManager Class Reference

#include <EwkTauDQM.h>

Public Types

typedef EwkTauDQM::DQMStore DQMStore
 
typedef EwkTauDQM::MonitorElement MonitorElement
 

Public Member Functions

void bookHistograms (DQMStore::IBooker &)
 
 EwkElecTauHistManager (const edm::ParameterSet &)
 
void fillHistograms (const edm::Event &, const edm::EventSetup &)
 
void finalizeHistograms ()
 

Private Types

enum  {
  kPassedPreselection = 1, kPassedTrigger = 2, kPassedElectronId = 3, kPassedElectronTrackIso = 4,
  kPassedElectronEcalIso = 5, kPassedTauLeadTrack = 6, kPassedTauLeadTrackPt = 7, kPassedTauDiscrAgainstElectrons = 8,
  kPassedTauDiscrAgainstMuons = 9, kPassedTauTrackIso = 10, kPassedTauEcalIso = 11
}
 
typedef std::vector< std::string > vstring
 

Private Attributes

edm::InputTag beamSpotSource_
 
edm::InputTag caloMEtSource_
 
int cfgError_
 
std::string dqmDirectory_
 
double electronEcalIsoCut_
 
double electronEtaCut_
 
int electronIsoMode_
 
double electronPtCut_
 
edm::InputTag electronSource_
 
double electronTrackIsoCut_
 
MonitorElementhCaloMEtPt_
 
MonitorElementhCutFlowSummary_
 
MonitorElementhElecTauAcoplanarity_
 
MonitorElementhElecTauCharge_
 
MonitorElementhElectronEcalIsoPt_
 
MonitorElementhElectronEta_
 
MonitorElementhElectronPhi_
 
MonitorElementhElectronPt_
 
MonitorElementhElectronTrackIsoPt_
 
vstring hltPaths_
 
MonitorElementhMtElecPFMEt_
 
MonitorElementhPFMEtPt_
 
MonitorElementhTauJetEta_
 
MonitorElementhTauJetPt_
 
MonitorElementhVertexZ_
 
MonitorElementhVisMass_
 
int maxNumWarnings_
 
unsigned numEventsAnalyzed_
 
unsigned numEventsSelected_
 
long numWarningsBeamSpot_
 
long numWarningsCaloMEt_
 
long numWarningsElectron_
 
long numWarningsHLTpath_
 
long numWarningsPFMEt_
 
long numWarningsTauDiscrAgainstElectrons_
 
long numWarningsTauDiscrAgainstMuons_
 
long numWarningsTauDiscrByEcalIso_
 
long numWarningsTauDiscrByLeadTrackFinding_
 
long numWarningsTauDiscrByLeadTrackPtCut_
 
long numWarningsTauDiscrByTrackIso_
 
long numWarningsTauJet_
 
long numWarningsTriggerResults_
 
long numWarningsVertex_
 
edm::InputTag pfMEtSource_
 
edm::InputTag tauDiscrAgainstElectrons_
 
edm::InputTag tauDiscrAgainstMuons_
 
edm::InputTag tauDiscrByEcalIso_
 
edm::InputTag tauDiscrByLeadTrackFinding_
 
edm::InputTag tauDiscrByLeadTrackPtCut_
 
edm::InputTag tauDiscrByTrackIso_
 
double tauJetEtaCut_
 
double tauJetPtCut_
 
edm::InputTag tauJetSource_
 
edm::InputTag triggerResultsSource_
 
edm::InputTag vertexSource_
 
double visMassCut_
 

Detailed Description

Booking and filling of histograms for data-quality monitoring purposes in Z –> electron + tau-jet channel

Author
Joshua Swanson (modified by Christian Veelken)

Definition at line 68 of file EwkTauDQM.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 70 of file EwkTauDQM.h.

◆ MonitorElement

Definition at line 71 of file EwkTauDQM.h.

◆ vstring

typedef std::vector<std::string> EwkElecTauHistManager::vstring
private

Definition at line 98 of file EwkTauDQM.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
kPassedPreselection 
kPassedTrigger 
kPassedElectronId 
kPassedElectronTrackIso 
kPassedElectronEcalIso 
kPassedTauLeadTrack 
kPassedTauLeadTrackPt 
kPassedTauDiscrAgainstElectrons 
kPassedTauDiscrAgainstMuons 
kPassedTauTrackIso 
kPassedTauEcalIso 

Definition at line 156 of file EwkTauDQM.h.

Constructor & Destructor Documentation

◆ EwkElecTauHistManager()

EwkElecTauHistManager::EwkElecTauHistManager ( const edm::ParameterSet cfg)

Definition at line 91 of file EwkTauDQM.cc.

References beamSpotSource_, caloMEtSource_, looper::cfg, cfgError_, electronEcalIsoCut_, electronEtaCut_, electronIsoMode_, electronPtCut_, electronSource_, electronTrackIsoCut_, getIsoMode(), hltPaths_, maxNumWarnings_, pfMEtSource_, AlCaHLTBitMon_QueryRunRegistry::string, tauDiscrAgainstElectrons_, tauDiscrAgainstMuons_, tauDiscrByEcalIso_, tauDiscrByLeadTrackFinding_, tauDiscrByLeadTrackPtCut_, tauDiscrByTrackIso_, tauJetEtaCut_, tauJetPtCut_, tauJetSource_, triggerResultsSource_, vertexSource_, and visMassCut_.

92  : dqmDirectory_(cfg.getParameter<std::string>("dqmDirectory")),
95  cfgError_(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 }
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:187
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:84
edm::InputTag tauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:91
edm::InputTag electronSource_
Definition: EwkTauDQM.h:85
int getIsoMode(const std::string &isoMode_string, int &error)
Definition: EwkTauDQM.cc:988
vector< string > vstring
Definition: ExoticaDQM.cc:7
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:90
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:184
double electronEcalIsoCut_
Definition: EwkTauDQM.h:104
unsigned numEventsSelected_
Definition: EwkTauDQM.h:172
long numWarningsTauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:185
edm::InputTag caloMEtSource_
Definition: EwkTauDQM.h:87
double electronTrackIsoCut_
Definition: EwkTauDQM.h:103
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:95
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:186
std::string dqmDirectory_
Definition: EwkTauDQM.h:114
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:189
edm::InputTag tauDiscrByEcalIso_
Definition: EwkTauDQM.h:93
edm::InputTag tauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:94
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:92
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:178
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:83
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:88
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:86
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:82
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:171
long numWarningsTauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:188

Member Function Documentation

◆ bookHistograms()

void EwkElecTauHistManager::bookHistograms ( DQMStore::IBooker iBooker)

Definition at line 142 of file EwkTauDQM.cc.

References dqm::implementation::IBooker::book1D(), dqmDirectory_, hCaloMEtPt_, hCutFlowSummary_, hElecTauAcoplanarity_, hElecTauCharge_, hElectronEcalIsoPt_, hElectronEta_, hElectronPhi_, hElectronPt_, hElectronTrackIsoPt_, hMtElecPFMEt_, hPFMEtPt_, hTauJetEta_, hTauJetPt_, hVertexZ_, hVisMass_, kPassedElectronEcalIso, kPassedElectronId, kPassedElectronTrackIso, kPassedPreselection, kPassedTauDiscrAgainstElectrons, kPassedTauDiscrAgainstMuons, kPassedTauEcalIso, kPassedTauLeadTrack, kPassedTauLeadTrackPt, kPassedTauTrackIso, kPassedTrigger, Pi, dqm::impl::MonitorElement::setBinLabel(), and dqm::implementation::NavigatorBase::setCurrentFolder().

Referenced by EwkTauDQM::bookHistograms().

142  {
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 }
const double Pi
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:152
MonitorElement * hElecTauAcoplanarity_
Definition: EwkTauDQM.h:142
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:137
MonitorElement * hElectronEcalIsoPt_
Definition: EwkTauDQM.h:122
MonitorElement * hCutFlowSummary_
Definition: EwkTauDQM.h:155
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:146
MonitorElement * hElecTauCharge_
Definition: EwkTauDQM.h:143
MonitorElement * hElectronTrackIsoPt_
Definition: EwkTauDQM.h:121
MonitorElement * hElectronEta_
Definition: EwkTauDQM.h:119
std::string dqmDirectory_
Definition: EwkTauDQM.h:114
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:149
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:125
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)
MonitorElement * hElectronPhi_
Definition: EwkTauDQM.h:120
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:126
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * hElectronPt_
Definition: EwkTauDQM.h:118
MonitorElement * hMtElecPFMEt_
Definition: EwkTauDQM.h:139

◆ fillHistograms()

void EwkElecTauHistManager::fillHistograms ( const edm::Event evt,
const edm::EventSetup es 
)

Definition at line 173 of file EwkTauDQM.cc.

References edm::HLTGlobalStatus::accept(), pwdgSkimBPark_cfi::beamSpot, beamSpotSource_, calcDeltaPhi(), calcMt(), caloMEtSource_, cfgError_, reco::LeafCandidate::charge(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::dr03TkSumPt(), electronEcalIsoCut_, electronEtaCut_, electronIsoMode_, electronPtCut_, pwdgSkimBPark_cfi::electrons, electronSource_, electronTrackIsoCut_, reco::LeafCandidate::eta(), dqm::impl::MonitorElement::Fill(), getTheElectron(), getTheTauJet(), hCaloMEtPt_, hCutFlowSummary_, hElecTauAcoplanarity_, hElecTauCharge_, hElectronEcalIsoPt_, hElectronEta_, hElectronPhi_, hElectronPt_, hElectronTrackIsoPt_, TriggerAnalyzer::hltPath, hltPaths_, hMtElecPFMEt_, hPFMEtPt_, hTauJetEta_, hTauJetPt_, hVertexZ_, hVisMass_, isSelected(), kPassedElectronEcalIso, kPassedElectronId, kPassedElectronTrackIso, kPassedPreselection, kPassedTauDiscrAgainstElectrons, kPassedTauDiscrAgainstMuons, kPassedTauEcalIso, kPassedTauLeadTrack, kPassedTauLeadTrackPt, kPassedTauTrackIso, kPassedTrigger, kRelativeIso, maxNumWarnings_, numEventsAnalyzed_, numEventsSelected_, numWarningsBeamSpot_, numWarningsCaloMEt_, numWarningsElectron_, numWarningsHLTpath_, numWarningsPFMEt_, numWarningsTauDiscrAgainstElectrons_, numWarningsTauDiscrAgainstMuons_, numWarningsTauDiscrByEcalIso_, numWarningsTauDiscrByLeadTrackFinding_, numWarningsTauDiscrByLeadTrackPtCut_, numWarningsTauDiscrByTrackIso_, numWarningsTauJet_, numWarningsTriggerResults_, numWarningsVertex_, reco::LeafCandidate::p4(), reco::GsfElectron::p4(), passesElectronId(), pfMEtSource_, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), readEventData(), ewkTauDQM_cfi::tauDiscrAgainstElectrons, tauDiscrAgainstElectrons_, ewkTauDQM_cfi::tauDiscrAgainstMuons, tauDiscrAgainstMuons_, ewkTauDQM_cfi::tauDiscrByEcalIso, ewkTauDQM_cfi::tauDiscrByLeadTrackFinding, tauDiscrByLeadTrackFinding_, ewkTauDQM_cfi::tauDiscrByLeadTrackPtCut, tauDiscrByLeadTrackPtCut_, ewkTauDQM_cfi::tauDiscrByTrackIso, tauDiscrByTrackIso_, tauJetEtaCut_, tauJetPtCut_, tauJetSource_, L1TEGammaOffline_cfi::triggerNames, edm::Event::triggerNames(), triggerResultsSource_, spclusmultinvestigator_cfi::vertexCollection, vertexSource_, visMassCut_, and reco::Vertex::z().

Referenced by EwkTauDQM::analyze().

173  {
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 }
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:187
bool accept() const
Has at least one path accepted the event?
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkTauDQM.cc:1002
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:152
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:283
double calcMt(double px1, double py1, double px2, double py2)
Definition: EwkTauDQM.cc:1014
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:84
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
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:137
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:90
MonitorElement * hElectronEcalIsoPt_
Definition: EwkTauDQM.h:122
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:184
double electronEcalIsoCut_
Definition: EwkTauDQM.h:104
unsigned numEventsSelected_
Definition: EwkTauDQM.h:172
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
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:95
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:146
const LorentzVector & p4() const final
four-momentum Lorentz vector
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:186
MonitorElement * hElecTauCharge_
Definition: EwkTauDQM.h:143
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
double px() const final
x coordinate of momentum vector
bool passesElectronId(const reco::GsfElectron &electron)
Definition: EwkTauDQM.cc:1061
MonitorElement * hElectronEta_
Definition: EwkTauDQM.h:119
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:189
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:149
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
MonitorElement * hElectronPhi_
Definition: EwkTauDQM.h:120
edm::InputTag tauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:94
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:92
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:178
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:83
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:88
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
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:86
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:82
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:559
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:126
Log< level::Warning, false > LogWarning
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:171
long numWarningsTauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:188
double phi() const final
momentum azimuthal angle
MonitorElement * hElectronPt_
Definition: EwkTauDQM.h:118
MonitorElement * hMtElecPFMEt_
Definition: EwkTauDQM.h:139
int charge() const final
electric charge
double eta() const final
momentum pseudorapidity

◆ finalizeHistograms()

void EwkElecTauHistManager::finalizeHistograms ( )

Definition at line 497 of file EwkTauDQM.cc.

References numEventsAnalyzed_, and numEventsSelected_.

Referenced by EwkTauDQM::dqmEndRun().

497  {
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 }
unsigned numEventsSelected_
Definition: EwkTauDQM.h:172
Log< level::Info, false > LogInfo
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:171

Member Data Documentation

◆ beamSpotSource_

edm::InputTag EwkElecTauHistManager::beamSpotSource_
private

Definition at line 84 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ caloMEtSource_

edm::InputTag EwkElecTauHistManager::caloMEtSource_
private

Definition at line 87 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ cfgError_

int EwkElecTauHistManager::cfgError_
private

Definition at line 174 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ dqmDirectory_

std::string EwkElecTauHistManager::dqmDirectory_
private

Definition at line 114 of file EwkTauDQM.h.

Referenced by bookHistograms().

◆ electronEcalIsoCut_

double EwkElecTauHistManager::electronEcalIsoCut_
private

Definition at line 104 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ electronEtaCut_

double EwkElecTauHistManager::electronEtaCut_
private

Definition at line 101 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ electronIsoMode_

int EwkElecTauHistManager::electronIsoMode_
private

Definition at line 105 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ electronPtCut_

double EwkElecTauHistManager::electronPtCut_
private

Definition at line 102 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ electronSource_

edm::InputTag EwkElecTauHistManager::electronSource_
private

Definition at line 85 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ electronTrackIsoCut_

double EwkElecTauHistManager::electronTrackIsoCut_
private

Definition at line 103 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ hCaloMEtPt_

MonitorElement* EwkElecTauHistManager::hCaloMEtPt_
private

Definition at line 149 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hCutFlowSummary_

MonitorElement* EwkElecTauHistManager::hCutFlowSummary_
private

Definition at line 155 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hElecTauAcoplanarity_

MonitorElement* EwkElecTauHistManager::hElecTauAcoplanarity_
private

Definition at line 142 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hElecTauCharge_

MonitorElement* EwkElecTauHistManager::hElecTauCharge_
private

Definition at line 143 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hElectronEcalIsoPt_

MonitorElement* EwkElecTauHistManager::hElectronEcalIsoPt_
private

Definition at line 122 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hElectronEta_

MonitorElement* EwkElecTauHistManager::hElectronEta_
private

Definition at line 119 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hElectronPhi_

MonitorElement* EwkElecTauHistManager::hElectronPhi_
private

Definition at line 120 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hElectronPt_

MonitorElement* EwkElecTauHistManager::hElectronPt_
private

Definition at line 118 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hElectronTrackIsoPt_

MonitorElement* EwkElecTauHistManager::hElectronTrackIsoPt_
private

Definition at line 121 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hltPaths_

vstring EwkElecTauHistManager::hltPaths_
private

Definition at line 99 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ hMtElecPFMEt_

MonitorElement* EwkElecTauHistManager::hMtElecPFMEt_
private

Definition at line 139 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hPFMEtPt_

MonitorElement* EwkElecTauHistManager::hPFMEtPt_
private

Definition at line 152 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hTauJetEta_

MonitorElement* EwkElecTauHistManager::hTauJetEta_
private

Definition at line 126 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hTauJetPt_

MonitorElement* EwkElecTauHistManager::hTauJetPt_
private

Definition at line 125 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hVertexZ_

MonitorElement* EwkElecTauHistManager::hVertexZ_
private

Definition at line 146 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ hVisMass_

MonitorElement* EwkElecTauHistManager::hVisMass_
private

Definition at line 137 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

◆ maxNumWarnings_

int EwkElecTauHistManager::maxNumWarnings_
private

Definition at line 176 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ numEventsAnalyzed_

unsigned EwkElecTauHistManager::numEventsAnalyzed_
private

Definition at line 171 of file EwkTauDQM.h.

Referenced by fillHistograms(), and finalizeHistograms().

◆ numEventsSelected_

unsigned EwkElecTauHistManager::numEventsSelected_
private

Definition at line 172 of file EwkTauDQM.h.

Referenced by fillHistograms(), and finalizeHistograms().

◆ numWarningsBeamSpot_

long EwkElecTauHistManager::numWarningsBeamSpot_
private

Definition at line 181 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsCaloMEt_

long EwkElecTauHistManager::numWarningsCaloMEt_
private

Definition at line 190 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsElectron_

long EwkElecTauHistManager::numWarningsElectron_
private

Definition at line 182 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsHLTpath_

long EwkElecTauHistManager::numWarningsHLTpath_
private

Definition at line 179 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsPFMEt_

long EwkElecTauHistManager::numWarningsPFMEt_
private

Definition at line 191 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsTauDiscrAgainstElectrons_

long EwkElecTauHistManager::numWarningsTauDiscrAgainstElectrons_
private

Definition at line 188 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsTauDiscrAgainstMuons_

long EwkElecTauHistManager::numWarningsTauDiscrAgainstMuons_
private

Definition at line 189 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsTauDiscrByEcalIso_

long EwkElecTauHistManager::numWarningsTauDiscrByEcalIso_
private

Definition at line 187 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsTauDiscrByLeadTrackFinding_

long EwkElecTauHistManager::numWarningsTauDiscrByLeadTrackFinding_
private

Definition at line 184 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsTauDiscrByLeadTrackPtCut_

long EwkElecTauHistManager::numWarningsTauDiscrByLeadTrackPtCut_
private

Definition at line 185 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsTauDiscrByTrackIso_

long EwkElecTauHistManager::numWarningsTauDiscrByTrackIso_
private

Definition at line 186 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsTauJet_

long EwkElecTauHistManager::numWarningsTauJet_
private

Definition at line 183 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsTriggerResults_

long EwkElecTauHistManager::numWarningsTriggerResults_
private

Definition at line 178 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ numWarningsVertex_

long EwkElecTauHistManager::numWarningsVertex_
private

Definition at line 180 of file EwkTauDQM.h.

Referenced by fillHistograms().

◆ pfMEtSource_

edm::InputTag EwkElecTauHistManager::pfMEtSource_
private

Definition at line 88 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ tauDiscrAgainstElectrons_

edm::InputTag EwkElecTauHistManager::tauDiscrAgainstElectrons_
private

Definition at line 94 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ tauDiscrAgainstMuons_

edm::InputTag EwkElecTauHistManager::tauDiscrAgainstMuons_
private

Definition at line 95 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ tauDiscrByEcalIso_

edm::InputTag EwkElecTauHistManager::tauDiscrByEcalIso_
private

Definition at line 93 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager().

◆ tauDiscrByLeadTrackFinding_

edm::InputTag EwkElecTauHistManager::tauDiscrByLeadTrackFinding_
private

Definition at line 90 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ tauDiscrByLeadTrackPtCut_

edm::InputTag EwkElecTauHistManager::tauDiscrByLeadTrackPtCut_
private

Definition at line 91 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ tauDiscrByTrackIso_

edm::InputTag EwkElecTauHistManager::tauDiscrByTrackIso_
private

Definition at line 92 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ tauJetEtaCut_

double EwkElecTauHistManager::tauJetEtaCut_
private

Definition at line 107 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ tauJetPtCut_

double EwkElecTauHistManager::tauJetPtCut_
private

Definition at line 108 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ tauJetSource_

edm::InputTag EwkElecTauHistManager::tauJetSource_
private

Definition at line 86 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ triggerResultsSource_

edm::InputTag EwkElecTauHistManager::triggerResultsSource_
private

Definition at line 82 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ vertexSource_

edm::InputTag EwkElecTauHistManager::vertexSource_
private

Definition at line 83 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

◆ visMassCut_

double EwkElecTauHistManager::visMassCut_
private

Definition at line 110 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().