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

Member Typedef Documentation

Definition at line 69 of file EwkTauDQM.h.

Definition at line 70 of file EwkTauDQM.h.

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 91 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_.

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: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:1012
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 142 of file EwkTauDQM.cc.

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

Referenced by EwkTauDQM::bookHistograms().

142  {
143  iBooker.setCurrentFolder(dqmDirectory_);
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:151
MonitorElement * hElecTauAcoplanarity_
Definition: EwkTauDQM.h:141
MonitorElement * hVisMass_
Definition: EwkTauDQM.h:136
MonitorElement * hElectronEcalIsoPt_
Definition: EwkTauDQM.h:121
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 * hCaloMEtPt_
Definition: EwkTauDQM.h:148
MonitorElement * hTauJetPt_
Definition: EwkTauDQM.h:124
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:119
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 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::dr03HcalTowerSumEt(), reco::GsfElectron::dr03TkSumPt(), metsig::electron, 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_, zMuMuMuonUserData::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(), 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_, edm::TriggerNames::triggerIndex(), 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,
218  vertexCollection,
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 
247  const reco::GsfElectron* theElectron = getTheElectron(*electrons, electronEtaCut_, electronPtCut_);
248 
249  double theElectronTrackIsoPt = 1.e+3;
250  double theElectronEcalIsoPt = 1.e+3;
251  double theElectronHcalIsoPt = 1.e+3;
252  if (theElectron) {
253  theElectronTrackIsoPt = theElectron->dr03TkSumPt();
254  theElectronEcalIsoPt = theElectron->dr03EcalRecHitSumEt();
255  theElectronHcalIsoPt = theElectron->dr03HcalTowerSumEt();
256 
257  if (electronIsoMode_ == kRelativeIso && theElectron->pt() > 0.) {
258  theElectronTrackIsoPt /= theElectron->pt();
259  theElectronEcalIsoPt /= theElectron->pt();
260  theElectronHcalIsoPt /= theElectron->pt();
261  }
262  }
263 
264  //--- get collections of reconstructed tau-jets from the event
266  readEventData(evt,
268  tauJets,
271  readError,
272  "Failed to access Tau-jet collection");
273  if (readError)
274  return;
275 
276  //--- get collections of tau-jet discriminators for those tau-jets
278  readEventData(evt,
280  tauDiscrByLeadTrackFinding,
283  readError,
284  "Failed to access collection of pf. Tau discriminators by "
285  "leading Track finding");
287  readEventData(evt,
289  tauDiscrByLeadTrackPtCut,
292  readError,
293  "Failed to access collection of pf. Tau discriminators by "
294  "leading Track Pt cut");
296  readEventData(evt,
298  tauDiscrByTrackIso,
301  readError,
302  "Failed to access collection of pf. Tau discriminators by "
303  "Track isolation");
305  readEventData(evt,
307  tauDiscrByEcalIso,
310  readError,
311  "Failed to access collection of pf. Tau discriminators by ECAL "
312  "isolation");
314  readEventData(evt,
316  tauDiscrAgainstElectrons,
319  readError,
320  "Failed to access collection of pf. Tau discriminators against "
321  "Electrons");
323  readEventData(evt,
325  tauDiscrAgainstMuons,
328  readError,
329  "Failed to access collection of pf. Tau discriminators against Muons");
330  if (readError)
331  return;
332 
333  int theTauJetIndex = -1;
334  const reco::PFTau* theTauJet = getTheTauJet(*tauJets, tauJetEtaCut_, tauJetPtCut_, theTauJetIndex);
335 
336  double theTauDiscrByLeadTrackFinding = -1.;
337  double theTauDiscrByLeadTrackPtCut = -1.;
338  double theTauDiscrByTrackIso = -1.;
339  double theTauDiscrByEcalIso = -1.;
340  double theTauDiscrAgainstElectrons = -1.;
341  double theTauDiscrAgainstMuons = -1.;
342  if (theTauJetIndex != -1) {
343  reco::PFTauRef theTauJetRef(tauJets, theTauJetIndex);
344  theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
345  theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
346  theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
347  theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
348  theTauDiscrAgainstElectrons = (*tauDiscrAgainstElectrons)[theTauJetRef];
349  theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
350  }
351 
352  //--- get missing transverse momentum
353  // measured by calorimeters/reconstructed by particle-flow algorithm
354  edm::Handle<reco::CaloMETCollection> caloMEtCollection;
355  readEventData(evt,
357  caloMEtCollection,
360  readError,
361  "Failed to access calo. MET collection");
362  if (readError)
363  return;
364 
365  const reco::CaloMET& caloMEt = caloMEtCollection->at(0);
366 
367  edm::Handle<reco::PFMETCollection> pfMEtCollection;
368  readEventData(evt,
369  pfMEtSource_,
370  pfMEtCollection,
373  readError,
374  "Failed to access pf. MET collection");
375  if (readError)
376  return;
377 
378  const reco::PFMET& pfMEt = pfMEtCollection->at(0);
379 
380  if (!(theElectron && theTauJet && theTauJetIndex != -1))
381  return;
382 
383  //-----------------------------------------------------------------------------
384  // compute EWK tau analysis specific quantities
385  //-----------------------------------------------------------------------------
386 
387  double dPhiElecTau = calcDeltaPhi(theElectron->phi(), theTauJet->phi());
388 
389  double mElecTau = (theElectron->p4() + theTauJet->p4()).M();
390 
391  // double mtElecCaloMEt = calcMt(theElectron->px(), theElectron->py(),
392  // caloMEt.px(), caloMEt.py());
393  double mtElecPFMEt = calcMt(theElectron->px(), theElectron->py(), pfMEt.px(), pfMEt.py());
394 
395  // double pZetaCaloMEt = calcPzeta(theElectron->p4(), theTauJet->p4(),
396  // caloMEt.px(), caloMEt.py());
397  // double pZetaPFMEt = calcPzeta(theElectron->p4(), theTauJet->p4(),
398  // pfMEt.px(), pfMEt.py());
399 
400  //-----------------------------------------------------------------------------
401  // apply selection criteria; fill histograms
402  //-----------------------------------------------------------------------------
403 
404  //--- fill electron multiplicity histogram
405  unsigned numIdElectrons = 0;
406  for (reco::GsfElectronCollection::const_iterator electron = electrons->begin(); electron != electrons->end();
407  ++electron) {
408  if (passesElectronId(*electron)) {
409  ++numIdElectrons;
410  }
411  }
412 
413  // hNumIdElectrons_->Fill(numIdElectrons);
414 
416 
417  bool isSelected = false;
418  bool fullSelect = false;
419  int cutFlowStatus = -1;
420 
421  if (mElecTau > visMassCut_) {
422  cutFlowStatus = kPassedPreselection;
423  }
424  if (cutFlowStatus == kPassedPreselection && (isTriggered || hltPaths_.empty())) {
425  cutFlowStatus = kPassedTrigger;
426  }
427  if (cutFlowStatus == kPassedTrigger && passesElectronId(*theElectron)) {
428  cutFlowStatus = kPassedElectronId;
429  hElectronTrackIsoPt_->Fill(theElectronTrackIsoPt);
430  }
431  if (cutFlowStatus == kPassedElectronId && theElectronTrackIsoPt < electronTrackIsoCut_) {
432  cutFlowStatus = kPassedElectronTrackIso;
433  hElectronEcalIsoPt_->Fill(theElectronEcalIsoPt);
434  }
435  if (cutFlowStatus == kPassedElectronTrackIso && theElectronEcalIsoPt < electronEcalIsoCut_) {
436  cutFlowStatus = kPassedElectronEcalIso;
437  }
438  if (cutFlowStatus == kPassedElectronEcalIso && theTauDiscrByLeadTrackFinding > 0.5) {
439  cutFlowStatus = kPassedTauLeadTrack;
440  // if ( theTauJet->leadTrack().isAvailable() )
441  // hTauLeadTrackPt_->Fill(theTauJet->leadTrack()->pt());
442  }
443  if (cutFlowStatus == kPassedTauLeadTrack && theTauDiscrByLeadTrackPtCut > 0.5) {
444  cutFlowStatus = kPassedTauLeadTrackPt;
445  // hTauTrackIsoPt_->Fill(theTauJet->isolationPFChargedHadrCandsPtSum());
446  }
447  if (cutFlowStatus == kPassedTauLeadTrackPt && theTauDiscrAgainstElectrons > 0.5) {
448  cutFlowStatus = kPassedTauDiscrAgainstElectrons;
449  // hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
450  }
451  if (cutFlowStatus == kPassedTauDiscrAgainstElectrons && theTauDiscrAgainstMuons > 0.5) {
452  cutFlowStatus = kPassedTauDiscrAgainstMuons;
453  isSelected = true;
454  }
455  if (cutFlowStatus == kPassedTauDiscrAgainstMuons && theTauDiscrByTrackIso > 0.5) {
456  cutFlowStatus = kPassedTauTrackIso;
457  // hTauEcalIsoPt_->Fill(theTauJet->isolationPFGammaCandsEtSum());
458  }
459  if (cutFlowStatus == kPassedTauTrackIso && theTauDiscrByEcalIso > 0.5) {
460  cutFlowStatus = kPassedTauEcalIso;
461  fullSelect = true;
462  // hTauDiscrAgainstElectrons_->Fill(theTauDiscrAgainstElectrons);
463  }
464 
465  for (int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
466  hCutFlowSummary_->Fill(iCut);
467  }
468 
469  if (isSelected) {
470  hElectronPt_->Fill(theElectron->pt());
471  hElectronEta_->Fill(theElectron->eta());
472  hElectronPhi_->Fill(theElectron->phi());
473 
474  hTauJetPt_->Fill(theTauJet->pt());
475  hTauJetEta_->Fill(theTauJet->eta());
476  // hTauJetPhi_->Fill(theTauJet->phi());
477 
478  // hTauJetCharge_->Fill(theTauJet->charge());
479  // if ( theTauJet->signalTracks().isAvailable() )
480  // hTauJetNumSignalTracks_->Fill(theTauJet->signalTracks().size());
481  // if ( theTauJet->isolationTracks().isAvailable() )
482  // hTauJetNumIsoTracks_->Fill(theTauJet->isolationTracks().size());
483 
484  if (fullSelect) {
485  hVisMass_->Fill(mElecTau);
486  }
487  // hMtElecCaloMEt_->Fill(mtElecCaloMEt);
488  hMtElecPFMEt_->Fill(mtElecPFMEt);
489  // hPzetaCaloMEt_->Fill(pZetaCaloMEt);
490  // hPzetaPFMEt_->Fill(pZetaPFMEt);
491  hElecTauAcoplanarity_->Fill(dPhiElecTau);
492  hElecTauCharge_->Fill(theElectron->charge() * theTauJet->charge());
493 
494  if (theEventVertex) {
495  // hVertexChi2_->Fill(theEventVertex->normalizedChi2());
496  hVertexZ_->Fill(theEventVertex->z());
497  // hVertexD0_->Fill(getVertexD0(*theEventVertex, *beamSpot));
498  }
499 
500  hCaloMEtPt_->Fill(caloMEt.pt());
501  // hCaloMEtPhi_->Fill(caloMEt.phi());
502 
503  hPFMEtPt_->Fill(pfMEt.pt());
504  // hPFMEtPhi_->Fill(pfMEt.phi());
505  }
506 
507  if (isSelected)
509 }
long numWarningsTauDiscrByEcalIso_
Definition: EwkTauDQM.h:186
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkTauDQM.cc:1026
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:211
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
Strings::size_type size() const
Definition: TriggerNames.cc:31
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
MonitorElement * hElecTauCharge_
Definition: EwkTauDQM.h:142
void Fill(long long x)
const reco::GsfElectron * getTheElectron(const reco::GsfElectronCollection &electrons, double electronEtaCut, double electronPtCut)
Definition: EwkTauDQM.cc:1102
MonitorElement * hElectronTrackIsoPt_
Definition: EwkTauDQM.h:120
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:24
bool passesElectronId(const reco::GsfElectron &electron)
Definition: EwkTauDQM.cc:1085
MonitorElement * hElectronEta_
Definition: EwkTauDQM.h:118
long numWarningsTauDiscrAgainstMuons_
Definition: EwkTauDQM.h:188
float dr03TkSumPt() const
Definition: GsfElectron.h:521
MonitorElement * hCaloMEtPt_
Definition: EwkTauDQM.h:148
double z() const
z coordinate
Definition: Vertex.h:119
const LorentzVector & p4() const final
four-momentum Lorentz vector
const reco::PFTau * getTheTauJet(const reco::PFTauCollection &tauJets, double tauJetEtaCut, double tauJetPtCut, int &theTauJetIndex)
Definition: EwkTauDQM.cc:1132
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:523
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:373
edm::InputTag tauJetSource_
Definition: EwkTauDQM.h:85
edm::InputTag triggerResultsSource_
Definition: EwkTauDQM.h:81
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:526
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:265
MonitorElement * hMtElecPFMEt_
Definition: EwkTauDQM.h:138
void EwkElecTauHistManager::finalizeHistograms ( )

Definition at line 511 of file EwkTauDQM.cc.

References numEventsAnalyzed_, and numEventsSelected_.

Referenced by EwkTauDQM::dqmEndRun().

511  {
512  edm::LogInfo("EwkElecTauHistManager") << "Filter-Statistics Summary:" << std::endl
513  << " Events analyzed = " << numEventsAnalyzed_ << std::endl
514  << " Events selected = " << numEventsSelected_;
515  if (numEventsAnalyzed_ > 0) {
516  double eff = numEventsSelected_ / (double)numEventsAnalyzed_;
517  edm::LogInfo("") << "Overall efficiency = " << std::setprecision(4) << eff * 100. << " +/- " << std::setprecision(4)
518  << TMath::Sqrt(eff * (1 - eff) / numEventsAnalyzed_) * 100. << ")%";
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().