CMS 3D CMS Logo

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

#include <EwkTauDQM.h>

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 70 of file EwkTauDQM.h.

Member Typedef Documentation

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

Definition at line 97 of file EwkTauDQM.h.

Member Enumeration Documentation

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

Definition at line 155 of file EwkTauDQM.h.

Constructor & Destructor Documentation

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

Definition at line 106 of file EwkTauDQM.cc.

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

107  : dqmDirectory_(cfg.getParameter<std::string>("dqmDirectory")),
110  cfgError_(0),
124  numWarningsPFMEt_(0) {
126  cfg.getParameter<edm::InputTag>("triggerResultsSource");
127  vertexSource_ = cfg.getParameter<edm::InputTag>("vertexSource");
128  beamSpotSource_ = cfg.getParameter<edm::InputTag>("beamSpotSource");
129  electronSource_ = cfg.getParameter<edm::InputTag>("electronSource");
130  tauJetSource_ = cfg.getParameter<edm::InputTag>("tauJetSource");
131  caloMEtSource_ = cfg.getParameter<edm::InputTag>("caloMEtSource");
132  pfMEtSource_ = cfg.getParameter<edm::InputTag>("pfMEtSource");
133 
135  cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackFinding");
137  cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackPtCut");
138  tauDiscrByTrackIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByTrackIso");
139  tauDiscrByEcalIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByEcalIso");
141  cfg.getParameter<edm::InputTag>("tauDiscrAgainstElectrons");
143  cfg.getParameter<edm::InputTag>("tauDiscrAgainstMuons");
144 
145  hltPaths_ = cfg.getParameter<vstring>("hltPaths");
146 
147  electronEtaCut_ = cfg.getParameter<double>("electronEtaCut");
148  electronPtCut_ = cfg.getParameter<double>("electronPtCut");
149  electronTrackIsoCut_ = cfg.getParameter<double>("electronTrackIsoCut");
150  electronEcalIsoCut_ = cfg.getParameter<double>("electronEcalIsoCut");
151  std::string electronIsoMode_string =
152  cfg.getParameter<std::string>("electronIsoMode");
153  electronIsoMode_ = getIsoMode(electronIsoMode_string, cfgError_);
154 
155  tauJetEtaCut_ = cfg.getParameter<double>("tauJetEtaCut");
156  tauJetPtCut_ = cfg.getParameter<double>("tauJetPtCut");
157 
158  visMassCut_ = cfg.getParameter<double>("visMassCut");
159 
160  maxNumWarnings_ = cfg.exists("maxNumWarnings")
161  ? cfg.getParameter<int>("maxNumWarnings")
162  : 1;
163 }
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:186
T getParameter(std::string const &) const
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:83
edm::InputTag tauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:90
edm::InputTag electronSource_
Definition: EwkTauDQM.h:84
int getIsoMode(const std::string &isoMode_string, int &error)
Definition: EwkTauDQM.cc:1013
vector< string > vstring
Definition: ExoticaDQM.cc:8
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:89
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:183
bool exists(std::string const &parameterName) const
checks if a parameter exists
double electronEcalIsoCut_
Definition: EwkTauDQM.h:103
unsigned numEventsSelected_
Definition: EwkTauDQM.h:171
long numWarningsTauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:184
edm::InputTag caloMEtSource_
Definition: EwkTauDQM.h:86
double electronTrackIsoCut_
Definition: EwkTauDQM.h:102
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:94
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:185
std::string dqmDirectory_
Definition: EwkTauDQM.h:113
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:188
edm::InputTag tauDiscrByEcalIso_
Definition: EwkTauDQM.h:92
edm::InputTag tauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:93
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:91
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:177
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:82
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:87
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:85
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:81
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:170
long numWarningsTauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:187

Member Function Documentation

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

Definition at line 165 of file EwkTauDQM.cc.

References DQMStore::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, MonitorElement::setBinLabel(), and DQMStore::IBooker::setCurrentFolder().

Referenced by EwkTauDQM::bookHistograms().

165  {
167  hElectronPt_ = iBooker.book1D("ElectronPt", "P_{T}^{e}", 20, 0., 100.);
168  hElectronEta_ = iBooker.book1D("ElectronEta", "#eta_{e}", 20, -4.0, +4.0);
169  hElectronPhi_ = iBooker.book1D("ElectronPhi", "#phi_{e}", 20, -TMath::Pi(),
170  +TMath::Pi());
171  hElectronTrackIsoPt_ = iBooker.book1D(
172  "ElectronTrackIsoPt", "Electron Track Iso.", 20, -0.01, 0.5);
173  hElectronEcalIsoPt_ = iBooker.book1D("ElectronEcalIsoPt",
174  "Electron Ecal Iso.", 20, -0.01, 0.5);
175  hTauJetPt_ = iBooker.book1D("TauJetPt", "P_{T}^{#tau-Jet}", 20, 0., 100.);
176  hTauJetEta_ =
177  iBooker.book1D("TauJetEta", "#eta_{#tau-Jet}", 20, -4.0, +4.0);
178  hVisMass_ =
179  iBooker.book1D("VisMass", "e + #tau-Jet visible Mass", 20, 20., 120.);
180  hMtElecPFMEt_ = iBooker.book1D(
181  "MtElecPFMEt", "e + E_{T}^{miss} (PF) transverse Mass", 20, 20., 120.);
183  iBooker.book1D("ElecTauAcoplanarity", "#Delta #phi_{e #tau-Jet}", 20,
184  -TMath::Pi(), +TMath::Pi());
186  iBooker.book1D("ElecTauCharge", "Q_{e * #tau-Jet}", 5, -2.5, +2.5);
187  hVertexZ_ =
188  iBooker.book1D("VertexZ", "Event Vertex z-Position", 20, -25., +25.);
189  hCaloMEtPt_ =
190  iBooker.book1D("CaloMEtPt", "E_{T}^{miss} (Calo)", 20, 0., 100.);
191  hPFMEtPt_ = iBooker.book1D("PFMEtPt", "E_{T}^{miss} (PF)", 20, 0., 100.);
193  iBooker.book1D("CutFlowSummary", "Cut-flow Summary", 11, 0.5, 11.5);
199  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrack, "#tau lead. Track");
201  "#tau lead. Track P_{T}");
203  "#tau anti-e Discr.");
205  "#tau anti-#mu Discr.");
206  hCutFlowSummary_->setBinLabel(kPassedTauTrackIso, "#tau Track Iso.");
207  hCutFlowSummary_->setBinLabel(kPassedTauEcalIso, "#tau Ecal Iso.");
208 }
const double Pi
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:151
MonitorElement * hElecTauAcoplanarity_
Definition: EwkTauDQM.h:141
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:136
MonitorElement * hElectronEcalIsoPt_
Definition: EwkTauDQM.h:121
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 * hCutFlowSummary_
Definition: EwkTauDQM.h:154
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:145
MonitorElement * hElecTauCharge_
Definition: EwkTauDQM.h:142
MonitorElement * hElectronTrackIsoPt_
Definition: EwkTauDQM.h:120
MonitorElement * hElectronEta_
Definition: EwkTauDQM.h:118
std::string dqmDirectory_
Definition: EwkTauDQM.h:113
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:148
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:124
MonitorElement * hElectronPhi_
Definition: EwkTauDQM.h:119
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:125
MonitorElement * hElectronPt_
Definition: EwkTauDQM.h:117
MonitorElement * hMtElecPFMEt_
Definition: EwkTauDQM.h:138
void EwkElecTauHistManager::fillHistograms ( const edm::Event evt,
const edm::EventSetup es 
)

Definition at line 210 of file EwkTauDQM.cc.

References edm::HLTGlobalStatus::accept(), ecalDrivenElectronSeedsParameters_cff::beamSpot, beamSpotSource_, calcDeltaPhi(), calcMt(), caloMEtSource_, cfgError_, reco::LeafCandidate::charge(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::dr03HcalTowerSumEt(), reco::GsfElectron::dr03TkSumPt(), metsig::electron, electronEcalIsoCut_, electronEtaCut_, electronIsoMode_, electronPtCut_, electrons_cff::electrons, electronSource_, electronTrackIsoCut_, reco::LeafCandidate::eta(), MonitorElement::Fill(), getTheElectron(), getTheTauJet(), hCaloMEtPt_, hCutFlowSummary_, hElecTauAcoplanarity_, hElecTauCharge_, hElectronEcalIsoPt_, hElectronEta_, hElectronPhi_, hElectronPt_, hElectronTrackIsoPt_, TriggerAnalyzer::hltPath, hltPaths_, hMtElecPFMEt_, hPFMEtPt_, hTauJetEta_, hTauJetPt_, hVertexZ_, hVisMass_, 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(), edm::TriggerNames::size(), tauDiscrAgainstElectrons_, tauDiscrAgainstMuons_, tauDiscrByLeadTrackFinding_, tauDiscrByLeadTrackPtCut_, tauDiscrByTrackIso_, tauJetEtaCut_, tauJetPtCut_, tauJetSource_, edm::TriggerNames::triggerIndex(), edm::Event::triggerNames(), triggerResultsSource_, particleFlowSuperClusterECAL_cfi::vertexCollection, vertexSource_, visMassCut_, and reco::Vertex::z().

Referenced by EwkTauDQM::analyze().

211  {
212  if (cfgError_) return;
213 
214  //-----------------------------------------------------------------------------
215  // access event-level information
216  //-----------------------------------------------------------------------------
217 
218  bool readError = false;
219 
220  //--- get decision of high-level trigger for the event
222  readEventData(evt, triggerResultsSource_, hltDecision,
224  "Failed to access Trigger results");
225  if (readError) return;
226 
227  const edm::TriggerNames& triggerNames = evt.triggerNames(*hltDecision);
228 
229  bool isTriggered = false;
230  for (vstring::const_iterator hltPath = hltPaths_.begin();
231  hltPath != hltPaths_.end(); ++hltPath) {
232  unsigned int index = triggerNames.triggerIndex(*hltPath);
233  if (index < triggerNames.size()) {
234  if (hltDecision->accept(index)) isTriggered = true;
235  } else {
237  edm::LogWarning("EwkElecTauHistManager")
238  << " Undefined HLT path = " << (*hltPath) << " !!";
240  continue;
241  }
242  }
243 
244  //--- get reconstructed primary event vertex of the event
245  // (take as "the" primary event vertex the first entry in the collection
246  // of vertex objects, corresponding to the vertex associated to the highest
247  // Pt sum of tracks)
249  readEventData(evt, vertexSource_, vertexCollection, numWarningsVertex_,
250  maxNumWarnings_, readError,
251  "Failed to access Vertex collection");
252  if (readError) return;
253 
254  const reco::Vertex* theEventVertex =
255  (!vertexCollection->empty()) ? &(vertexCollection->at(0)) : nullptr;
256 
257  //--- get beam-spot (expected vertex position) for the event
260  maxNumWarnings_, readError, "Failed to access Beam-spot");
261  if (readError) return;
262 
263  //--- get collections of reconstructed electrons from the event
266  maxNumWarnings_, readError,
267  "Failed to access Electron collection");
268  if (readError) return;
269 
270  const reco::GsfElectron* theElectron =
272 
273  double theElectronTrackIsoPt = 1.e+3;
274  double theElectronEcalIsoPt = 1.e+3;
275  double theElectronHcalIsoPt = 1.e+3;
276  if (theElectron) {
277  theElectronTrackIsoPt = theElectron->dr03TkSumPt();
278  theElectronEcalIsoPt = theElectron->dr03EcalRecHitSumEt();
279  theElectronHcalIsoPt = theElectron->dr03HcalTowerSumEt();
280 
281  if (electronIsoMode_ == kRelativeIso && theElectron->pt() > 0.) {
282  theElectronTrackIsoPt /= theElectron->pt();
283  theElectronEcalIsoPt /= theElectron->pt();
284  theElectronHcalIsoPt /= theElectron->pt();
285  }
286  }
287 
288  //--- get collections of reconstructed tau-jets from the event
291  maxNumWarnings_, readError,
292  "Failed to access Tau-jet collection");
293  if (readError) return;
294 
295  //--- get collections of tau-jet discriminators for those tau-jets
296  edm::Handle<reco::PFTauDiscriminator> tauDiscrByLeadTrackFinding;
297  readEventData(evt, tauDiscrByLeadTrackFinding_, tauDiscrByLeadTrackFinding,
299  readError,
300  "Failed to access collection of pf. Tau discriminators by "
301  "leading Track finding");
302  edm::Handle<reco::PFTauDiscriminator> tauDiscrByLeadTrackPtCut;
303  readEventData(evt, tauDiscrByLeadTrackPtCut_, tauDiscrByLeadTrackPtCut,
305  readError,
306  "Failed to access collection of pf. Tau discriminators by "
307  "leading Track Pt cut");
308  edm::Handle<reco::PFTauDiscriminator> tauDiscrByTrackIso;
309  readEventData(evt, tauDiscrByTrackIso_, tauDiscrByTrackIso,
311  "Failed to access collection of pf. Tau discriminators by "
312  "Track isolation");
313  edm::Handle<reco::PFTauDiscriminator> tauDiscrByEcalIso;
314  readEventData(evt, tauDiscrByTrackIso_, tauDiscrByEcalIso,
316  "Failed to access collection of pf. Tau discriminators by ECAL "
317  "isolation");
318  edm::Handle<reco::PFTauDiscriminator> tauDiscrAgainstElectrons;
319  readEventData(evt, tauDiscrAgainstElectrons_, tauDiscrAgainstElectrons,
321  readError,
322  "Failed to access collection of pf. Tau discriminators against "
323  "Electrons");
324  edm::Handle<reco::PFTauDiscriminator> tauDiscrAgainstMuons;
326  evt, tauDiscrAgainstMuons_, tauDiscrAgainstMuons,
328  "Failed to access collection of pf. Tau discriminators against Muons");
329  if (readError) return;
330 
331  int theTauJetIndex = -1;
332  const reco::PFTau* theTauJet =
333  getTheTauJet(*tauJets, tauJetEtaCut_, tauJetPtCut_, theTauJetIndex);
334 
335  double theTauDiscrByLeadTrackFinding = -1.;
336  double theTauDiscrByLeadTrackPtCut = -1.;
337  double theTauDiscrByTrackIso = -1.;
338  double theTauDiscrByEcalIso = -1.;
339  double theTauDiscrAgainstElectrons = -1.;
340  double theTauDiscrAgainstMuons = -1.;
341  if (theTauJetIndex != -1) {
342  reco::PFTauRef theTauJetRef(tauJets, theTauJetIndex);
343  theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
344  theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
345  theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
346  theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
347  theTauDiscrAgainstElectrons = (*tauDiscrAgainstElectrons)[theTauJetRef];
348  theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
349  }
350 
351  //--- get missing transverse momentum
352  // measured by calorimeters/reconstructed by particle-flow algorithm
353  edm::Handle<reco::CaloMETCollection> caloMEtCollection;
354  readEventData(evt, caloMEtSource_, caloMEtCollection, numWarningsCaloMEt_,
355  maxNumWarnings_, readError,
356  "Failed to access calo. MET collection");
357  if (readError) return;
358 
359  const reco::CaloMET& caloMEt = caloMEtCollection->at(0);
360 
361  edm::Handle<reco::PFMETCollection> pfMEtCollection;
362  readEventData(evt, pfMEtSource_, pfMEtCollection, numWarningsPFMEt_,
363  maxNumWarnings_, readError,
364  "Failed to access pf. MET collection");
365  if (readError) return;
366 
367  const reco::PFMET& pfMEt = pfMEtCollection->at(0);
368 
369  if (!(theElectron && theTauJet && theTauJetIndex != -1)) return;
370 
371  //-----------------------------------------------------------------------------
372  // compute EWK tau analysis specific quantities
373  //-----------------------------------------------------------------------------
374 
375  double dPhiElecTau = calcDeltaPhi(theElectron->phi(), theTauJet->phi());
376 
377  double mElecTau = (theElectron->p4() + theTauJet->p4()).M();
378 
379  // double mtElecCaloMEt = calcMt(theElectron->px(), theElectron->py(),
380  // caloMEt.px(), caloMEt.py());
381  double mtElecPFMEt =
382  calcMt(theElectron->px(), theElectron->py(), pfMEt.px(), pfMEt.py());
383 
384  // double pZetaCaloMEt = calcPzeta(theElectron->p4(), theTauJet->p4(),
385  // caloMEt.px(), caloMEt.py());
386  // double pZetaPFMEt = calcPzeta(theElectron->p4(), theTauJet->p4(),
387  // pfMEt.px(), pfMEt.py());
388 
389  //-----------------------------------------------------------------------------
390  // apply selection criteria; fill histograms
391  //-----------------------------------------------------------------------------
392 
393  //--- fill electron multiplicity histogram
394  unsigned numIdElectrons = 0;
395  for (reco::GsfElectronCollection::const_iterator electron =
396  electrons->begin();
397  electron != electrons->end(); ++electron) {
398  if (passesElectronId(*electron)) {
399  ++numIdElectrons;
400  }
401  }
402 
403  // hNumIdElectrons_->Fill(numIdElectrons);
404 
406 
407  bool isSelected = false;
408  bool fullSelect = false;
409  int cutFlowStatus = -1;
410 
411  if (mElecTau > visMassCut_) {
412  cutFlowStatus = kPassedPreselection;
413  }
414  if (cutFlowStatus == kPassedPreselection &&
415  (isTriggered || hltPaths_.empty())) {
416  cutFlowStatus = kPassedTrigger;
417  }
418  if (cutFlowStatus == kPassedTrigger && passesElectronId(*theElectron)) {
419  cutFlowStatus = kPassedElectronId;
420  hElectronTrackIsoPt_->Fill(theElectronTrackIsoPt);
421  }
422  if (cutFlowStatus == kPassedElectronId &&
423  theElectronTrackIsoPt < electronTrackIsoCut_) {
424  cutFlowStatus = kPassedElectronTrackIso;
425  hElectronEcalIsoPt_->Fill(theElectronEcalIsoPt);
426  }
427  if (cutFlowStatus == kPassedElectronTrackIso &&
428  theElectronEcalIsoPt < electronEcalIsoCut_) {
429  cutFlowStatus = kPassedElectronEcalIso;
430  }
431  if (cutFlowStatus == kPassedElectronEcalIso &&
432  theTauDiscrByLeadTrackFinding > 0.5) {
433  cutFlowStatus = kPassedTauLeadTrack;
434  // if ( theTauJet->leadTrack().isAvailable() )
435  // hTauLeadTrackPt_->Fill(theTauJet->leadTrack()->pt());
436  }
437  if (cutFlowStatus == kPassedTauLeadTrack &&
438  theTauDiscrByLeadTrackPtCut > 0.5) {
439  cutFlowStatus = kPassedTauLeadTrackPt;
440  // hTauTrackIsoPt_->Fill(theTauJet->isolationPFChargedHadrCandsPtSum());
441  }
442  if (cutFlowStatus == kPassedTauLeadTrackPt &&
443  theTauDiscrAgainstElectrons > 0.5) {
444  cutFlowStatus = kPassedTauDiscrAgainstElectrons;
445  // hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
446  }
447  if (cutFlowStatus == kPassedTauDiscrAgainstElectrons &&
448  theTauDiscrAgainstMuons > 0.5) {
449  cutFlowStatus = kPassedTauDiscrAgainstMuons;
450  isSelected = true;
451  }
452  if (cutFlowStatus == kPassedTauDiscrAgainstMuons &&
453  theTauDiscrByTrackIso > 0.5) {
454  cutFlowStatus = kPassedTauTrackIso;
455  // hTauEcalIsoPt_->Fill(theTauJet->isolationPFGammaCandsEtSum());
456  }
457  if (cutFlowStatus == kPassedTauTrackIso && theTauDiscrByEcalIso > 0.5) {
458  cutFlowStatus = kPassedTauEcalIso;
459  fullSelect = true;
460  // hTauDiscrAgainstElectrons_->Fill(theTauDiscrAgainstElectrons);
461  }
462 
463  for (int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
464  hCutFlowSummary_->Fill(iCut);
465  }
466 
467  if (isSelected) {
468  hElectronPt_->Fill(theElectron->pt());
469  hElectronEta_->Fill(theElectron->eta());
470  hElectronPhi_->Fill(theElectron->phi());
471 
472  hTauJetPt_->Fill(theTauJet->pt());
473  hTauJetEta_->Fill(theTauJet->eta());
474  // hTauJetPhi_->Fill(theTauJet->phi());
475 
476  // hTauJetCharge_->Fill(theTauJet->charge());
477  // if ( theTauJet->signalTracks().isAvailable() )
478  // hTauJetNumSignalTracks_->Fill(theTauJet->signalTracks().size());
479  // if ( theTauJet->isolationTracks().isAvailable() )
480  // hTauJetNumIsoTracks_->Fill(theTauJet->isolationTracks().size());
481 
482  if (fullSelect) {
483  hVisMass_->Fill(mElecTau);
484  }
485  // hMtElecCaloMEt_->Fill(mtElecCaloMEt);
486  hMtElecPFMEt_->Fill(mtElecPFMEt);
487  // hPzetaCaloMEt_->Fill(pZetaCaloMEt);
488  // hPzetaPFMEt_->Fill(pZetaPFMEt);
489  hElecTauAcoplanarity_->Fill(dPhiElecTau);
490  hElecTauCharge_->Fill(theElectron->charge() * theTauJet->charge());
491 
492  if (theEventVertex) {
493  // hVertexChi2_->Fill(theEventVertex->normalizedChi2());
494  hVertexZ_->Fill(theEventVertex->z());
495  // hVertexD0_->Fill(getVertexD0(*theEventVertex, *beamSpot));
496  }
497 
498  hCaloMEtPt_->Fill(caloMEt.pt());
499  // hCaloMEtPhi_->Fill(caloMEt.phi());
500 
501  hPFMEtPt_->Fill(pfMEt.pt());
502  // hPFMEtPhi_->Fill(pfMEt.phi());
503  }
504 
505  if (isSelected) ++numEventsSelected_;
506 }
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:186
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkTauDQM.cc:1028
MonitorElement * hPFMEtPt_
Definition: EwkTauDQM.h:151
double calcMt(double px1, double py1, double px2, double py2)
Definition: EwkTauDQM.cc:1038
edm::InputTag beamSpotSource_
Definition: EwkTauDQM.h:83
double eta() const final
momentum pseudorapidity
edm::InputTag tauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:90
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:225
MonitorElement * hElecTauAcoplanarity_
Definition: EwkTauDQM.h:141
edm::InputTag electronSource_
Definition: EwkTauDQM.h:84
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:136
edm::InputTag tauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:89
MonitorElement * hElectronEcalIsoPt_
Definition: EwkTauDQM.h:121
double px() const final
x coordinate of momentum vector
bool accept() const
Has at least one path accepted the event?
long numWarningsTauDiscrByLeadTrackFinding_
Definition: EwkTauDQM.h:183
double electronEcalIsoCut_
Definition: EwkTauDQM.h:103
unsigned numEventsSelected_
Definition: EwkTauDQM.h:171
double pt() const final
transverse momentum
int charge() const final
electric charge
Definition: LeafCandidate.h:91
Strings::size_type size() const
Definition: TriggerNames.cc:39
MonitorElement * hCutFlowSummary_
Definition: EwkTauDQM.h:154
long numWarningsTauDiscrByLeadTrackPtCut_
Definition: EwkTauDQM.h:184
edm::InputTag caloMEtSource_
Definition: EwkTauDQM.h:86
double electronTrackIsoCut_
Definition: EwkTauDQM.h:102
edm::InputTag tauDiscrAgainstMuons_
Definition: EwkTauDQM.h:94
MonitorElement * hVertexZ_
Definition: EwkTauDQM.h:145
long numWarningsTauDiscrByTrackIso_
Definition: EwkTauDQM.h:185
void Fill(long long x)
MonitorElement * hElecTauCharge_
Definition: EwkTauDQM.h:142
const reco::GsfElectron * getTheElectron(const reco::GsfElectronCollection &electrons, double electronEtaCut, double electronPtCut)
Definition: EwkTauDQM.cc:1104
MonitorElement * hElectronTrackIsoPt_
Definition: EwkTauDQM.h:120
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
bool passesElectronId(const reco::GsfElectron &electron)
Definition: EwkTauDQM.cc:1086
MonitorElement * hElectronEta_
Definition: EwkTauDQM.h:118
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:188
float dr03TkSumPt() const
Definition: GsfElectron.h:543
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:148
double z() const
z coordinate
Definition: Vertex.h:115
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
const reco::PFTau * getTheTauJet(const reco::PFTauCollection &tauJets, double tauJetEtaCut, double tauJetPtCut, int &theTauJetIndex)
Definition: EwkTauDQM.cc:1135
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:124
MonitorElement * hElectronPhi_
Definition: EwkTauDQM.h:119
edm::InputTag tauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:93
edm::InputTag tauDiscrByTrackIso_
Definition: EwkTauDQM.h:91
long numWarningsTriggerResults_
Definition: EwkTauDQM.h:177
double py() const final
y coordinate of momentum vector
edm::InputTag vertexSource_
Definition: EwkTauDQM.h:82
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:544
edm::InputTag pfMEtSource_
Definition: EwkTauDQM.h:87
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:372
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:85
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:81
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:547
MonitorElement * hTauJetEta_
Definition: EwkTauDQM.h:125
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:170
long numWarningsTauDiscrAgainstElectrons_
Definition: EwkTauDQM.h:187
double phi() const final
momentum azimuthal angle
MonitorElement * hElectronPt_
Definition: EwkTauDQM.h:117
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
MonitorElement * hMtElecPFMEt_
Definition: EwkTauDQM.h:138
void EwkElecTauHistManager::finalizeHistograms ( )

Definition at line 508 of file EwkTauDQM.cc.

References numEventsAnalyzed_, and numEventsSelected_.

Referenced by EwkTauDQM::endRun().

508  {
509  edm::LogInfo("EwkElecTauHistManager")
510  << "Filter-Statistics Summary:" << std::endl
511  << " Events analyzed = " << numEventsAnalyzed_ << std::endl
512  << " Events selected = " << numEventsSelected_;
513  if (numEventsAnalyzed_ > 0) {
514  double eff = numEventsSelected_ / (double)numEventsAnalyzed_;
515  edm::LogInfo("") << "Overall efficiency = " << std::setprecision(4)
516  << eff * 100. << " +/- " << std::setprecision(4)
517  << TMath::Sqrt(eff * (1 - eff) / numEventsAnalyzed_) * 100.
518  << ")%";
519  }
520 }
unsigned numEventsSelected_
Definition: EwkTauDQM.h:171
unsigned numEventsAnalyzed_
Definition: EwkTauDQM.h:170

Member Data Documentation

edm::InputTag EwkElecTauHistManager::beamSpotSource_
private

Definition at line 83 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::caloMEtSource_
private

Definition at line 86 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

int EwkElecTauHistManager::cfgError_
private

Definition at line 173 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

std::string EwkElecTauHistManager::dqmDirectory_
private

Definition at line 113 of file EwkTauDQM.h.

Referenced by bookHistograms().

double EwkElecTauHistManager::electronEcalIsoCut_
private

Definition at line 103 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

double EwkElecTauHistManager::electronEtaCut_
private

Definition at line 100 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

int EwkElecTauHistManager::electronIsoMode_
private

Definition at line 104 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

double EwkElecTauHistManager::electronPtCut_
private

Definition at line 101 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::electronSource_
private

Definition at line 84 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

double EwkElecTauHistManager::electronTrackIsoCut_
private

Definition at line 102 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hCaloMEtPt_
private

Definition at line 148 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hCutFlowSummary_
private

Definition at line 154 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hElecTauAcoplanarity_
private

Definition at line 141 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hElecTauCharge_
private

Definition at line 142 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hElectronEcalIsoPt_
private

Definition at line 121 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hElectronEta_
private

Definition at line 118 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hElectronPhi_
private

Definition at line 119 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hElectronPt_
private

Definition at line 117 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hElectronTrackIsoPt_
private

Definition at line 120 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

vstring EwkElecTauHistManager::hltPaths_
private

Definition at line 98 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hMtElecPFMEt_
private

Definition at line 138 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hPFMEtPt_
private

Definition at line 151 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hTauJetEta_
private

Definition at line 125 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hTauJetPt_
private

Definition at line 124 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hVertexZ_
private

Definition at line 145 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

MonitorElement* EwkElecTauHistManager::hVisMass_
private

Definition at line 136 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

int EwkElecTauHistManager::maxNumWarnings_
private

Definition at line 175 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

unsigned EwkElecTauHistManager::numEventsAnalyzed_
private

Definition at line 170 of file EwkTauDQM.h.

Referenced by fillHistograms(), and finalizeHistograms().

unsigned EwkElecTauHistManager::numEventsSelected_
private

Definition at line 171 of file EwkTauDQM.h.

Referenced by fillHistograms(), and finalizeHistograms().

long EwkElecTauHistManager::numWarningsBeamSpot_
private

Definition at line 180 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsCaloMEt_
private

Definition at line 189 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsElectron_
private

Definition at line 181 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsHLTpath_
private

Definition at line 178 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsPFMEt_
private

Definition at line 190 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsTauDiscrAgainstElectrons_
private

Definition at line 187 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsTauDiscrAgainstMuons_
private

Definition at line 188 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsTauDiscrByEcalIso_
private

Definition at line 186 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsTauDiscrByLeadTrackFinding_
private

Definition at line 183 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsTauDiscrByLeadTrackPtCut_
private

Definition at line 184 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsTauDiscrByTrackIso_
private

Definition at line 185 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsTauJet_
private

Definition at line 182 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsTriggerResults_
private

Definition at line 177 of file EwkTauDQM.h.

Referenced by fillHistograms().

long EwkElecTauHistManager::numWarningsVertex_
private

Definition at line 179 of file EwkTauDQM.h.

Referenced by fillHistograms().

edm::InputTag EwkElecTauHistManager::pfMEtSource_
private

Definition at line 87 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::tauDiscrAgainstElectrons_
private

Definition at line 93 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::tauDiscrAgainstMuons_
private

Definition at line 94 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::tauDiscrByEcalIso_
private

Definition at line 92 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager().

edm::InputTag EwkElecTauHistManager::tauDiscrByLeadTrackFinding_
private

Definition at line 89 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::tauDiscrByLeadTrackPtCut_
private

Definition at line 90 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::tauDiscrByTrackIso_
private

Definition at line 91 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

double EwkElecTauHistManager::tauJetEtaCut_
private

Definition at line 106 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

double EwkElecTauHistManager::tauJetPtCut_
private

Definition at line 107 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::tauJetSource_
private

Definition at line 85 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::triggerResultsSource_
private

Definition at line 81 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

edm::InputTag EwkElecTauHistManager::vertexSource_
private

Definition at line 82 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().

double EwkElecTauHistManager::visMassCut_
private

Definition at line 109 of file EwkTauDQM.h.

Referenced by EwkElecTauHistManager(), and fillHistograms().