CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EwkElecDQM.cc
Go to the documentation of this file.
2 
6 
9 
12 
16 
17 //#include "DataFormats/MuonReco/interface/Muon.h"
18 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h" // I guess this is the right one??
19 // also need Fwd.h file ???
22 //#include "DataFormats/JetReco/interface/CaloJet.h"
23 //#include "DataFormats/METReco/interface/CaloMET.h"
24 //#include "DataFormats/METReco/interface/CaloMETCollection.h"
25 //#include "DataFormats/METReco/interface/CaloMETFwd.h"
26 
28 
32 
34 
36 
37 using namespace edm;
38 using namespace std;
39 using namespace reco;
40 
42  :
43  // Input collections
44  metTag_(cfg.getUntrackedParameter<edm::InputTag>("METTag",
45  edm::InputTag("met"))),
46  jetTag_(cfg.getUntrackedParameter<edm::InputTag>(
47  "JetTag", edm::InputTag("sisCone5CaloJets"))),
48  trigTag_(consumes<edm::TriggerResults>(
49  cfg.getUntrackedParameter<edm::InputTag>(
50  "TrigTag", edm::InputTag("TriggerResults::HLT")))),
51  elecTag_(consumes<edm::View<reco::GsfElectron> >(
52  cfg.getUntrackedParameter<edm::InputTag>(
53  "ElecTag", edm::InputTag("gsfElectrons")))),
54  metToken_(consumes<edm::View<reco::MET> >(
55  cfg.getUntrackedParameter<edm::InputTag>("METTag",
56  edm::InputTag("met")))),
57  jetToken_(consumes<edm::View<reco::Jet> >(
58  cfg.getUntrackedParameter<edm::InputTag>(
59  "JetTag", edm::InputTag("sisCone5CaloJets")))),
60  vertexTag_(consumes<edm::View<reco::Vertex> >(
61  cfg.getUntrackedParameter<edm::InputTag>(
62  "VertexTag", edm::InputTag("offlinePrimaryVertices")))),
63  beamSpotTag_(
64  consumes<reco::BeamSpot>(cfg.getUntrackedParameter<edm::InputTag>(
65  "BeamSpotTag", edm::InputTag("BeamSpot")))),
66 
67  // Main cuts
68  // muonTrig_(cfg.getUntrackedParameter<std::string> ("MuonTrig",
69  // "HLT_Mu9")),
70  // elecTrig_(cfg.getUntrackedParameter<std::vector< std::string >
71  // >("ElecTrig", "HLT_Ele10_SW_L1R")),
72  elecTrig_(
73  cfg.getUntrackedParameter<std::vector<std::string> >("ElecTrig")),
74  // ptCut_(cfg.getUntrackedParameter<double>("PtCut", 25.)),
75  ptCut_(cfg.getUntrackedParameter<double>("PtCut", 10.)),
76  // etaCut_(cfg.getUntrackedParameter<double>("EtaCut", 2.1)),
77  etaCut_(cfg.getUntrackedParameter<double>("EtaCut", 2.4)),
78  sieieCutBarrel_(cfg.getUntrackedParameter<double>("SieieBarrel", 0.01)),
79  sieieCutEndcap_(cfg.getUntrackedParameter<double>("SieieEndcap", 0.028)),
80  detainCutBarrel_(
81  cfg.getUntrackedParameter<double>("DetainBarrel", 0.0071)),
82  detainCutEndcap_(
83  cfg.getUntrackedParameter<double>("DetainEndcap", 0.0066)),
84  // isRelativeIso_(cfg.getUntrackedParameter<bool>("IsRelativeIso",
85  // true)),
86  // isCombinedIso_(cfg.getUntrackedParameter<bool>("IsCombinedIso",
87  // false)),
88  // isoCut03_(cfg.getUntrackedParameter<double>("IsoCut03", 0.1)),
89  ecalIsoCutBarrel_(
90  cfg.getUntrackedParameter<double>("EcalIsoCutBarrel", 5.7)),
91  ecalIsoCutEndcap_(
92  cfg.getUntrackedParameter<double>("EcalIsoCutEndcap", 5.0)),
93  hcalIsoCutBarrel_(
94  cfg.getUntrackedParameter<double>("HcalIsoCutBarrel", 8.1)),
95  hcalIsoCutEndcap_(
96  cfg.getUntrackedParameter<double>("HcalIsoCutEndcap", 3.4)),
97  trkIsoCutBarrel_(
98  cfg.getUntrackedParameter<double>("TrkIsoCutBarrel", 7.2)),
99  trkIsoCutEndcap_(
100  cfg.getUntrackedParameter<double>("TrkIsoCutEndcap", 5.1)),
101  mtMin_(cfg.getUntrackedParameter<double>("MtMin", -999999)),
102  mtMax_(cfg.getUntrackedParameter<double>("MtMax", 999999.)),
103  metMin_(cfg.getUntrackedParameter<double>("MetMin", -999999.)),
104  metMax_(cfg.getUntrackedParameter<double>("MetMax", 999999.)),
105  // acopCut_(cfg.getUntrackedParameter<double>("AcopCut", 2.)),
106 
107  // Muon quality cuts
108  // dxyCut_(cfg.getUntrackedParameter<double>("DxyCut", 0.2)),
109  // normalizedChi2Cut_(cfg.getUntrackedParameter<double>("NormalizedChi2Cut",
110  // 10.)),
111  // trackerHitsCut_(cfg.getUntrackedParameter<int>("TrackerHitsCut",
112  // 11)),
113  // isAlsoTrackerMuon_(cfg.getUntrackedParameter<bool>("IsAlsoTrackerMuon",
114  // true)),
115 
116  // Z rejection
117  // ptThrForZ1_(cfg.getUntrackedParameter<double>("PtThrForZ1", 20.)),
118  // ptThrForZ2_(cfg.getUntrackedParameter<double>("PtThrForZ2", 10.)),
119 
120  // Top rejection
121  eJetMin_(cfg.getUntrackedParameter<double>("EJetMin", 999999.)),
122  nJetMax_(cfg.getUntrackedParameter<int>("NJetMax", 999999)),
123  PUMax_(cfg.getUntrackedParameter<unsigned int>("PUMax", 60)),
124  PUBinCount_(cfg.getUntrackedParameter<unsigned int>("PUBinCount", 12)),
125  hltPrescaleProvider_(cfg, consumesCollector(), *this)
126  // caloJetCollection_(cfg.getUntrackedParameter<edm:InputTag>("CaloJetCollection","sisCone5CaloJets"))
127 {
128  isValidHltConfig_ = false;
129 }
130 
131 void EwkElecDQM::dqmBeginRun(const Run& iRun, const EventSetup& iSet) {
132  nall = 0;
133  nsel = 0;
134 
135  nrec = 0;
136  neid = 0;
137  niso = 0;
138  // nhlt = 0;
139  // nmet = 0;
140 
141  // passed as parameter to HLTConfigProvider::init(), not yet used
142  bool isConfigChanged = false;
143  // isValidHltConfig_ could be used to short-circuit analyze() in case of
144  // problems
146  hltPrescaleProvider_.init(iRun, iSet, "HLT", isConfigChanged);
147 
148  LogTrace("") << "isValidHltConfig_=" << isValidHltConfig_ << "\n";
149 }
150 
152  edm::Run const &, edm::EventSetup const &) {
153 
154  ibooker.setCurrentFolder("Physics/EwkElecDQM");
155 
156  char chtitle[256] = "";
157 
158  pt_before_ = ibooker.book1D("PT_BEFORECUTS",
159  "Electron transverse momentum [GeV]", 100, 0., 100.);
160  pt_after_ = ibooker.book1D("PT_LASTCUT",
161  "Electron transverse momentum [GeV]", 100, 0., 100.);
162 
163  eta_before_ = ibooker.book1D("ETA_BEFORECUTS",
164  "Electron pseudo-rapidity", 50, -2.5, 2.5);
165  eta_after_ = ibooker.book1D("ETA_LASTCUT",
166  "Electron pseudo-rapidity", 50, -2.5, 2.5);
167 
168  sieiebarrel_before_ = ibooker.book1D("SIEIEBARREL_BEFORECUTS",
169  "Electron #sigma_{i#etai#eta} (barrel)", 70, 0., 0.07);
170  sieiebarrel_after_ = ibooker.book1D("SIEIEBARREL_LASTCUT",
171  "Electron #sigma_{i#etai#eta} (barrel)", 70, 0., 0.07);
172 
173  sieieendcap_before_ = ibooker.book1D("SIEIEENDCAP_BEFORECUTS",
174  "Electron #sigma_{i#etai#eta} (endcap)", 70, 0., 0.07);
175  sieieendcap_after_ = ibooker.book1D("SIEIEENDCAP_LASTCUT",
176  "Electron #sigma_{i#etai#eta} (endcap)", 70, 0., 0.07);
177 
178  detainbarrel_before_ = ibooker.book1D("DETAINBARREL_BEFORECUTS",
179  "Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
180  detainbarrel_after_ = ibooker.book1D("DETAINBARREL_LASTCUT",
181  "Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
182 
183  detainendcap_before_ = ibooker.book1D("DETAINENDCAP_BEFORECUTS",
184  "Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
185  detainendcap_after_ = ibooker.book1D("DETAINENDCAP_LASTCUT",
186  "Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
187 
188  ecalisobarrel_before_ = ibooker.book1D("ECALISOBARREL_BEFORECUTS",
189  "Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
190  ecalisobarrel_after_ = ibooker.book1D("ECALISOBARREL_LASTCUT",
191  "Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
192 
193  ecalisoendcap_before_ = ibooker.book1D("ECALISOENDCAP_BEFORECUTS",
194  "Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
195  ecalisoendcap_after_ = ibooker.book1D("ECALISOENDCAP_LASTCUT",
196  "Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
197 
198  hcalisobarrel_before_ = ibooker.book1D("HCALISOBARREL_BEFORECUTS",
199  "Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
200  hcalisobarrel_after_ = ibooker.book1D("HCALISOBARREL_LASTCUT",
201  "Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
202 
203  hcalisoendcap_before_ = ibooker.book1D("HCALISOENDCAP_BEFORECUTS",
204  "Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
205  hcalisoendcap_after_ = ibooker.book1D("HCALISOENDCAP_LASTCUT",
206  "Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
207 
208  trkisobarrel_before_ = ibooker.book1D("TRKISOBARREL_BEFORECUTS",
209  "Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
210  trkisobarrel_after_ = ibooker.book1D("TRKISOBARREL_LASTCUT",
211  "Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
212 
213  trkisoendcap_before_ = ibooker.book1D("TRKISOENDCAP_BEFORECUTS",
214  "Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
215  trkisoendcap_after_ = ibooker.book1D("TRKISOENDCAP_LASTCUT",
216  "Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
217 
218  trig_before_ = ibooker.book1D("TRIG_BEFORECUTS", "Trigger response", 2, -0.5,
219  1.5); // elecTrig_ is now a vector of strings!
220  trig_after_ = ibooker.book1D("TRIG_LASTCUT", "Trigger response", 2, -0.5, 1.5);
221 
222  invmass_before_ = ibooker.book1D("INVMASS_BEFORECUTS",
223  "Di-electron invariant mass [GeV]", 100, 0., 200.);
224  invmass_after_ = ibooker.book1D("INVMASS_AFTERCUTS",
225  "Di-electron invariant mass [GeV]", 100, 0., 200.);
226 
227  invmassPU_before_ = ibooker.book2D("INVMASS_PU_BEFORECUTS",
228  "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count", 100, 0.,
229  200., PUBinCount_, -0.5, PUMax_ + 0.5);
230  invmassPU_afterZ_ = ibooker.book2D("INVMASS_PU_AFTERZCUTS",
231  "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count", 100, 0.,
232  200., PUBinCount_, -0.5, PUMax_ + 0.5);
233 
234  npvs_before_ = ibooker.book1D("NPVs_BEFORECUTS",
235  "Number of Valid Primary Vertices; nGoodPVs", PUMax_ + 1, -0.5, PUMax_ + 0.5);
236 
237  npvs_afterZ_ = ibooker.book1D("NPVs_AFTERZCUTS",
238  "Number of Valid Primary Vertices; nGoodPVs", PUMax_ + 1, -0.5, PUMax_ + 0.5);
239 
240  nelectrons_before_ = ibooker.book1D("NELECTRONS_BEFORECUTS",
241  "Number of electrons in event", 10, -0.5, 9.5);
242  nelectrons_after_ = ibooker.book1D("NELECTRONS_AFTERCUTS",
243  "Number of electrons in event", 10, -0.5, 9.5);
244 
245  snprintf(chtitle, 255, "Transverse mass (%s) [GeV]", metTag_.label().data());
246  mt_before_ = ibooker.book1D("MT_BEFORECUTS", chtitle, 150, 0., 300.);
247  mt_after_ = ibooker.book1D("MT_LASTCUT", chtitle, 150, 0., 300.);
248 
249 
250  snprintf(chtitle, 255, "Missing transverse energy (%s) [GeV]",
251  metTag_.label().data());
252  met_before_ = ibooker.book1D("MET_BEFORECUTS", chtitle, 100, 0., 200.);
253  met_after_ = ibooker.book1D("MET_LASTCUT", chtitle, 100, 0., 200.);
254 
255  snprintf(chtitle, 255, "Number of jets (%s) above %.2f GeV",
256  jetTag_.label().data(), eJetMin_);
257  njets_before_ = ibooker.book1D("NJETS_BEFORECUTS", chtitle, 10, -0.5, 9.5);
258  njets_after_ = ibooker.book1D("NJETS_LASTCUT", chtitle, 10, -0.5, 9.5);
259 
260  snprintf(chtitle, 255, "Jet with highest E_{T} (%s)", jetTag_.label().data());
261  jet_et_before_ = ibooker.book1D("JETET1_BEFORECUTS", chtitle, 20, 0., 200.0);
262  jet_et_after_ = ibooker.book1D("JETET1_AFTERCUTS", chtitle, 20, 0., 200.0);
263 
264  snprintf(chtitle, 255, "Eta of Jet with highest E_{T} (%s)",
265  jetTag_.label().data());
266  jet_eta_before_ = ibooker.book1D("JETETA1_BEFORECUTS", chtitle, 20, -5, 5);
267  jet_eta_after_ = ibooker.book1D("JETETA1_AFTERCUTS", chtitle, 20, -5, 5);
268 
269 }
270 
271 void EwkElecDQM::endRun(const Run& r, const EventSetup&) {
272 
273  // overall
274  double all = nall;
275  double esel = nsel / all;
276  LogVerbatim("") << "\n>>>>>> SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
277  LogVerbatim("") << "Total number of events analyzed: " << nall << " [events]";
278  LogVerbatim("") << "Total number of events selected: " << nsel << " [events]";
279  LogVerbatim("") << "Overall efficiency: "
280  << "(" << setprecision(4) << esel * 100. << " +/- "
281  << setprecision(2) << sqrt(esel * (1 - esel) / all) * 100.
282  << ")%";
283 
284  double erec = nrec / all;
285  double eeid = neid / all;
286  double eiso = niso / all;
287  // double ehlt = nhlt/all;
288  // double emet = nmet/all;
289 
290  // general reconstruction step??
291  double num = nrec;
292  double eff = erec;
293  double err = sqrt(eff * (1 - eff) / all);
294  LogVerbatim("") << "Passing Pt/Eta/Quality cuts: " << num << " [events], ("
295  << setprecision(4) << eff * 100. << " +/- " << setprecision(2)
296  << err * 100. << ")%";
297 
298  // electron ID step
299  num = neid;
300  eff = eeid;
301  err = sqrt(eff * (1 - eff) / all);
302  double effstep = 0.;
303  double errstep = 0.;
304  if (nrec > 0) effstep = eeid / erec;
305  if (nrec > 0) errstep = sqrt(effstep * (1 - effstep) / nrec);
306  LogVerbatim("") << "Passing eID cuts: " << num << " [events], ("
307  << setprecision(4) << eff * 100. << " +/- " << setprecision(2)
308  << err * 100. << ")%, to previous step: (" << setprecision(4)
309  << effstep * 100. << " +/- " << setprecision(2)
310  << errstep * 100. << ")%";
311 
312  // isolation step
313  num = niso;
314  eff = eiso;
315  err = sqrt(eff * (1 - eff) / all);
316  effstep = 0.;
317  errstep = 0.;
318  if (neid > 0) effstep = eiso / eeid;
319  if (neid > 0) errstep = sqrt(effstep * (1 - effstep) / neid);
320  LogVerbatim("") << "Passing isolation cuts: " << num << " [events], ("
321  << setprecision(4) << eff * 100. << " +/- " << setprecision(2)
322  << err * 100. << ")%, to previous step: (" << setprecision(4)
323  << effstep * 100. << " +/- " << setprecision(2)
324  << errstep * 100. << ")%";
325 
326  // // trigger step
327  // num = nhlt;
328  // eff = ehlt;
329  // err = sqrt(eff*(1-eff)/all);
330  // effstep = 0.;
331  // errstep = 0.;
332  // if (niso>0) effstep = ehlt/eiso;
333  // if (niso>0) errstep = sqrt(effstep*(1-effstep)/niso);
334  // LogVerbatim("") << "Passing HLT criteria: " << num << "
335  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
336  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
337  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
338 
339  // trigger step
340  num = nsel;
341  eff = esel;
342  err = sqrt(eff * (1 - eff) / all);
343  effstep = 0.;
344  errstep = 0.;
345  if (niso > 0) effstep = esel / eiso;
346  if (niso > 0) errstep = sqrt(effstep * (1 - effstep) / niso);
347  LogVerbatim("") << "Passing HLT criteria: " << num << " [events], ("
348  << setprecision(4) << eff * 100. << " +/- " << setprecision(2)
349  << err * 100. << ")%, to previous step: (" << setprecision(4)
350  << effstep * 100. << " +/- " << setprecision(2)
351  << errstep * 100. << ")%";
352 
353  // // met/acoplanarity cuts
354  // num = nmet;
355  // eff = emet;
356  // err = sqrt(eff*(1-eff)/all);
357  // effstep = 0.;
358  // errstep = 0.;
359  // if (nhlt>0) effstep = emet/ehlt;
360  // if (nhlt>0) errstep = sqrt(effstep*(1-effstep)/nhlt);
361  // LogVerbatim("") << "Passing MET/acoplanarity cuts: " << num << "
362  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
363  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
364  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
365 
366  // // Z/top selection cuts ALSO LAST STEP so "sel" for "selection"
367  // num = nsel;
368  // eff = esel;
369  // err = sqrt(eff*(1-eff)/all);
370  // effstep = 0.;
371  // errstep = 0.;
372  // if (nmet>0) effstep = esel/emet;
373  // if (nmet>0) errstep = sqrt(effstep*(1-effstep)/nmet);
374  // LogVerbatim("") << "Passing Z/top rejection cuts: " << num << "
375  // [events], (" << setprecision(4) << eff*100. <<" +/- "<< setprecision(2) <<
376  // err*100. << ")%, to previous step: (" << setprecision(4) << effstep*100.
377  // << " +/- "<< setprecision(2) << errstep*100. <<")%";
378 
379  LogVerbatim("") << ">>>>>> SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
380 }
381 
382 inline void HERE(const char* msg) { std::cout << msg << "\n"; }
383 
384 void EwkElecDQM::analyze(const Event& ev, const EventSetup& iSet) {
385 
386  // Reset global event selection flags
387  bool rec_sel = false;
388  bool eid_sel = false;
389  bool iso_sel = false;
390  bool all_sel = false;
391 
392  // Electron collection
393  Handle<View<GsfElectron> > electronCollection;
394  if (!ev.getByToken(elecTag_, electronCollection)) {
395  // LogWarning("") << ">>> Electron collection does not exist !!!";
396  return;
397  }
398  unsigned int electronCollectionSize = electronCollection->size();
399 
400  // Beam spot
401  Handle<reco::BeamSpot> beamSpotHandle;
402  if (!ev.getByToken(beamSpotTag_, beamSpotHandle)) {
403  // LogWarning("") << ">>> No beam spot found !!!";
404  return;
405  }
406 
407  // MET
408  double met_px = 0.;
409  double met_py = 0.;
411  if (!ev.getByToken(metToken_, metCollection)) {
412  // LogWarning("") << ">>> MET collection does not exist !!!";
413  return;
414  }
415 
416  const MET& met = metCollection->at(0);
417  met_px = met.px();
418  met_py = met.py();
419  // if (!metIncludesMuons_) {
420  // for (unsigned int i=0; i<muonCollectionSize; i++) {
421  // const Muon& mu = muonCollection->at(i);
422  // if (!mu.isGlobalMuon()) continue;
423  // met_px -= mu.px();
424  // met_py -= mu.py();
425  // }
426  // }
427  double met_et = sqrt(met_px * met_px + met_py * met_py);
428  LogTrace("") << ">>> MET, MET_px, MET_py: " << met_et << ", " << met_px
429  << ", " << met_py << " [GeV]";
430  met_before_->Fill(met_et);
431 
432  // Vertices in the event
433  int npvCount = 0;
435  if (!ev.getByToken(vertexTag_, vertexCollection)) {
436  LogError("") << ">>> Vertex collection does not exist !!!";
437  return;
438  }
439 
440  for (unsigned int i = 0; i < vertexCollection->size(); i++) {
441  const Vertex& vertex = vertexCollection->at(i);
442  if (vertex.isValid()) npvCount++;
443  }
444  npvs_before_->Fill(npvCount);
445 
446  // Trigger
448  if (!ev.getByToken(trigTag_, triggerResults)) {
449  // LogWarning("") << ">>> TRIGGER collection does not exist !!!";
450  return;
451  }
452  const edm::TriggerNames& trigNames = ev.triggerNames(*triggerResults);
453  bool trigger_fired = false;
454 
455  HLTConfigProvider const& hltConfigProvider = hltPrescaleProvider_.hltConfigProvider();
456 
457  /* very old code
458  for (unsigned int i=0; i<triggerResults->size(); i++) {
459  if (triggerResults->accept(i)) {
460  LogTrace("") << "Accept by: " << i << ", Trigger: " <<
461  trigNames.triggerName(i);
462  }
463  }
464  */
465 
466  // the following gives error on CRAFT08 data where itrig1=19 (vector index out
467  // of range)
468  /*
469  int itrig1 = trigNames.triggerIndex(muonTrig_);
470  if (triggerResults->accept(itrig1)) trigger_fired = true;
471  */
472  // suggested replacement: lm250909
473  /* Fix buggy trigger logic
474  for (unsigned int i=0; i<triggerResults->size(); i++)
475  {
476  std::string trigName = trigNames.triggerName(i);
477  bool found=false;
478 
479 // for (unsigned int j = 0; j < elecTrig_.size(); j++)
480 // {
481 // if ( trigName == elecTrig_.at(j) && triggerResults->accept(i))
482 // {
483 // trigger_fired = true;
484 // }
485 // }
486 
487 
488  for(unsigned int index=0; index<elecTrig_.size() && found==false; index++)
489 {
490  size_t trigPath = trigName.find(elecTrig_.at(index)); // 0 if found, pos
491 if not
492  if (trigPath==0) found=true;
493  }
494  if(!found) continue;
495 
496  bool prescaled=false;
497  for (unsigned int ps= 0; ps< hltConfigProvider.prescaleSize();
498 ps++){
499  const unsigned int prescaleValue =
500 hltConfigProvider.prescaleValue(ps, trigName) ;
501  if (prescaleValue != 1) prescaled =true;
502  }
503 
504  if(triggerResults->accept(i) && !prescaled) trigger_fired=true;
505 
506  }
507  */
508 
509  // get the prescale set for this event
510  const int prescaleSet = hltPrescaleProvider_.prescaleSet(ev, iSet);
511  if (prescaleSet == -1) {
512  LogTrace("") << "Failed to determine prescaleSet\n";
513  // std::cout << "Failed to determine prescaleSet. Check cmsRun GlobalTag\n";
514  return;
515  }
516 
517  for (unsigned int i = 0;
518  (i < triggerResults->size()) && (trigger_fired == false); i++) {
519  // skip trigger, if it did not fire
520  if (!triggerResults->accept(i)) continue;
521 
522  // skip trigger, if it is not on our list
523  bool found = false;
524  const std::string trigName = trigNames.triggerName(i);
525  for (unsigned int index = 0; index < elecTrig_.size() && found == false;
526  index++) {
527  if (trigName.find(elecTrig_.at(index)) == 0) found = true;
528  }
529  if (!found) continue;
530 
531  // skip trigger, if it is prescaled
532  if (hltConfigProvider.prescaleValue(prescaleSet, trigName) != 1) continue;
533 
534  // std::cout << "found unprescaled trigger that fired: " << trigName <<
535  // "\n";
536  trigger_fired = true;
537  }
538 
539  LogTrace("") << ">>> Trigger bit: " << trigger_fired << " for one of ( ";
540  for (unsigned int k = 0; k < elecTrig_.size(); k++) {
541  LogTrace("") << elecTrig_.at(k) << " ";
542  }
543  LogTrace("") << ")";
544  trig_before_->Fill(trigger_fired);
545 
546  // Jet collection
547  Handle<View<Jet> > jetCollection;
548  if (!ev.getByToken(jetToken_, jetCollection)) {
549  // LogError("") << ">>> JET collection does not exist !!!";
550  return;
551  }
552  float electron_et = -8.0;
553  float electron_eta = -8.0;
554  float electron_phi = -8.0;
555  float electron2_et = -9.0;
556  float electron2_eta = -9.0;
557  float electron2_phi = -9.0;
558  // need to get some electron info so jets can be cleaned of them
559  for (unsigned int i = 0; i < electronCollectionSize; i++) {
560  const GsfElectron& elec = electronCollection->at(i);
561 
562  if (i < 1) {
563  electron_et = elec.pt();
564  electron_eta = elec.eta();
565  electron_phi = elec.phi();
566  }
567  if (i == 2) {
568  electron2_et = elec.pt();
569  electron2_eta = elec.eta();
570  electron2_phi = elec.phi();
571  }
572  }
573 
574  float jet_et = -8.0;
575  float jet_eta = -8.0;
576  int jet_count = 0;
577  float jet2_et = -9.0;
578  unsigned int jetCollectionSize = jetCollection->size();
579  int njets = 0;
580  for (unsigned int i = 0; i < jetCollectionSize; i++) {
581  const Jet& jet = jetCollection->at(i);
582 
583  float jet_current_et = jet.et();
584  // cout << "jet_current_et " << jet_current_et << endl;
585  // if it overlaps with electron, it is not a jet
586  if (electron_et > 0.0 && fabs(jet.eta() - electron_eta) < 0.2 &&
587  calcDeltaPhi(jet.phi(), electron_phi) < 0.2)
588  continue;
589  if (electron2_et > 0.0 && fabs(jet.eta() - electron2_eta) < 0.2 &&
590  calcDeltaPhi(jet.phi(), electron2_phi) < 0.2)
591  continue;
592 
593  // if it has too low Et, throw away
594  // if (jet_current_et < eJetMin_) continue; //Keep if only want to plot
595  // above jet cut
596 
597  if (jet.et() > eJetMin_) {
598  njets++;
599  jet_count++;
600  }
601  if (jet_current_et > jet_et) {
602  jet2_et = jet_et; // 2nd highest jet get's et from current highest
603  jet_et = jet.et(); // current highest jet gets et from the new highest
604  jet_eta = jet.eta();
605  } else if (jet_current_et > jet2_et) {
606  jet2_et = jet.et();
607  }
608  }
609 
610  // Fill After all electron cuts (or both before and after)
611  if (jet_et > 10) // don't want low energy "jets"
612  {
613  jet_et_before_->Fill(jet_et);
614  // jet2_et_before_ ->Fill(jet2_et);
615  jet_eta_before_->Fill(jet_eta);
616  }
617 
618  LogTrace("") << ">>> Total number of jets: " << jetCollectionSize;
619  LogTrace("") << ">>> Number of jets above " << eJetMin_
620  << " [GeV]: " << njets;
621  njets_before_->Fill(njets);
622 
623  // Start counting
624  nall++;
625 
626  // Histograms per event should be done only once, so keep track of them
627  bool hlt_hist_done = false;
628  // bool minv_hist_done = false;
629  bool met_hist_done = false;
630  // bool nz1_hist_done = false;
631  // bool nz2_hist_done = false;
632  bool njets_hist_done = false;
633 
634  // Central selection criteria
635  // const int NFLAGS = 13; // number of individual selection criteria
636  const int NFLAGS = 11; // number of individual selection criteria
637  // 0: pt cut | rec
638  // 1: eta cut | rec
639  // 2: sieie | eid
640  // 3: detain | eid
641  // 4: ecal iso | iso
642  // 5: hcal iso | iso
643  // 6: trk iso | iso
644  // 7: trigger fired | hlt/all
645  bool electron_sel[NFLAGS];
646 
647  // for invariant mass calculation
648  // keep track of highest-pt electrons for initial (RECO) electrons
649  // and "good" electrons (passing all cuts)
650  // first array dimension is for first or second good electron
651  // second array dimension is for relevant quantities of good electron
652  // [0]: 1 for electron found or 0 for not found (if 0, no other quantities
653  // filled)
654  // [1]: mSqr
655  // [2]: E
656  // [3]: px
657  // [4]: py
658  // [5]: pz
659  // inv mass = sqrt(m_1^2 + m_2^2 + 2*(E_1*E_2 - (px1*px2 + py1*py2 + pz1+pz2)
660  // ) )
661  double electron[2][6];
662  double goodElectron[2][6];
663  nGoodElectrons = 0;
664  for (unsigned int i = 0; i < 2; i++) {
665  for (unsigned int j = 0; j < 6; j++) {
666  electron[i][j] = 0.;
667  goodElectron[i][j] = 0.;
668  }
669  }
670 
671  for (unsigned int i = 0; i < electronCollectionSize; i++) {
672  for (int j = 0; j < NFLAGS; ++j) {
673  electron_sel[j] = false;
674  }
675 
676  const GsfElectron& elec = electronCollection->at(i);
677  // if (!mu.isGlobalMuon()) continue;
678  // if (mu.globalTrack().isNull()) continue;
679  // if (mu.innerTrack().isNull()) continue;
680 
681  LogTrace("") << "> elec: processing electron number " << i << "...";
682  // reco::TrackRef gm = mu.globalTrack();
683  // reco::TrackRef tk = mu.innerTrack();
684  // should have stuff for electron track?
685 
686  if (i < 2) {
687  electron[i][0] = 1.;
688  electron[i][1] = elec.massSqr();
689  electron[i][2] = elec.energy();
690  electron[i][3] = elec.px();
691  electron[i][4] = elec.py();
692  electron[i][5] = elec.pz();
693  }
694 
695  // Pt,eta cuts
696  double pt = elec.pt();
697  double px = elec.px();
698  double py = elec.py();
699  double eta = elec.eta();
700  LogTrace("") << "\t... pt, eta: " << pt << " [GeV], " << eta;
701  ;
702  if (pt > ptCut_) electron_sel[0] = true;
703  if (fabs(eta) < etaCut_) electron_sel[1] = true;
704 
705  bool isBarrel = false;
706  bool isEndcap = false;
707  if (eta < 1.4442 && eta > -1.4442) {
708  isBarrel = true;
709  } else if ((eta > 1.56 && eta < 2.4) || (eta < -1.56 && eta > -2.4)) {
710  isEndcap = true;
711  }
712 
713  // // d0, chi2, nhits quality cuts
714  // double dxy = tk->dxy(beamSpotHandle->position());
715  // double normalizedChi2 = gm->normalizedChi2();
716  // double trackerHits = tk->numberOfValidHits();
717  // LogTrace("") << "\t... dxy, normalizedChi2, trackerHits,
718  // isTrackerMuon?: " << dxy << " [cm], " << normalizedChi2 << ", " <<
719  // trackerHits << ", " << mu.isTrackerMuon();
720  // if (fabs(dxy)<dxyCut_) muon_sel[2] = true;
721  // if (normalizedChi2<normalizedChi2Cut_) muon_sel[3] = true;
722  // if (trackerHits>=trackerHitsCut_) muon_sel[4] = true;
723  // if (mu.isTrackerMuon()) muon_sel[5] = true;
724 
725  pt_before_->Fill(pt);
726  eta_before_->Fill(eta);
727  // dxy_before_->Fill(dxy);
728  // chi2_before_->Fill(normalizedChi2);
729  // nhits_before_->Fill(trackerHits);
730  // tkmu_before_->Fill(mu.isTrackerMuon());
731 
732  // Electron ID cuts
733  double sieie = (double)elec.sigmaIetaIeta();
734  double detain =
735  (double)elec.deltaEtaSuperClusterTrackAtVtx(); // think this is detain
736  if (sieie < sieieCutBarrel_ && isBarrel) electron_sel[2] = true;
737  if (sieie < sieieCutEndcap_ && isEndcap) electron_sel[2] = true;
738  if (detain < detainCutBarrel_ && isBarrel) electron_sel[3] = true;
739  if (detain < detainCutEndcap_ && isEndcap) electron_sel[3] = true;
740  if (isBarrel) {
741  LogTrace("") << "\t... sieie value " << sieie << " (barrel), pass? "
742  << electron_sel[2];
743  LogTrace("") << "\t... detain value " << detain << " (barrel), pass? "
744  << electron_sel[3];
745  } else if (isEndcap) {
746  LogTrace("") << "\t... sieie value " << sieie << " (endcap), pass? "
747  << electron_sel[2];
748  LogTrace("") << "\t... detain value " << detain << " (endcap), pass? "
749  << electron_sel[2];
750  }
751 
752  if (isBarrel) {
753  sieiebarrel_before_->Fill(sieie);
754  detainbarrel_before_->Fill(detain);
755  } else if (isEndcap) {
756  sieieendcap_before_->Fill(sieie);
757  detainendcap_before_->Fill(detain);
758  }
759 
760  // Isolation cuts
761  // double isovar = mu.isolationR03().sumPt;
762  double ecalisovar = elec.dr03EcalRecHitSumEt(); // picked one set!
763  double hcalisovar = elec.dr03HcalTowerSumEt(); // try others if
764  double trkisovar = elec.dr04TkSumPt(); // doesn't work
765  // if (isCombinedIso_) {
766  // isovar += mu.isolationR03().emEt;
767  // isovar += mu.isolationR03().hadEt;
768  //}
769  // if (isRelativeIso_) isovar /= pt;
770  if (ecalisovar < ecalIsoCutBarrel_ && isBarrel) electron_sel[4] = true;
771  if (ecalisovar < ecalIsoCutEndcap_ && isEndcap) electron_sel[4] = true;
772  if (hcalisovar < hcalIsoCutBarrel_ && isBarrel) electron_sel[5] = true;
773  if (hcalisovar < hcalIsoCutEndcap_ && isEndcap) electron_sel[5] = true;
774  if (trkisovar < trkIsoCutBarrel_ && isBarrel) electron_sel[6] = true;
775  if (trkisovar < trkIsoCutEndcap_ && isEndcap) electron_sel[6] = true;
776  if (isBarrel) {
777  LogTrace("") << "\t... ecal isolation value " << ecalisovar
778  << " (barrel), pass? " << electron_sel[4];
779  LogTrace("") << "\t... hcal isolation value " << hcalisovar
780  << " (barrel), pass? " << electron_sel[5];
781  LogTrace("") << "\t... trk isolation value " << trkisovar
782  << " (barrel), pass? " << electron_sel[6];
783  } else if (isEndcap) {
784  LogTrace("") << "\t... ecal isolation value " << ecalisovar
785  << " (endcap), pass? " << electron_sel[4];
786  LogTrace("") << "\t... hcal isolation value " << hcalisovar
787  << " (endcap), pass? " << electron_sel[5];
788  LogTrace("") << "\t... trk isolation value " << trkisovar
789  << " (endcap), pass? " << electron_sel[6];
790  }
791 
792  // iso_before_->Fill(isovar);
793  if (isBarrel) {
794  ecalisobarrel_before_->Fill(ecalisovar);
795  hcalisobarrel_before_->Fill(hcalisovar);
796  trkisobarrel_before_->Fill(trkisovar);
797  } else if (isEndcap) {
798  ecalisoendcap_before_->Fill(ecalisovar);
799  hcalisoendcap_before_->Fill(hcalisovar);
800  trkisoendcap_before_->Fill(trkisovar);
801  }
802 
803  // HLT
804  if (trigger_fired) electron_sel[7] = true;
805 
806  // // MET/MT cuts
807  double w_et = met_et + pt;
808  double w_px = met_px + px;
809  double w_py = met_py + py;
810 
811  double massT = w_et * w_et - w_px * w_px - w_py * w_py;
812  massT = (massT > 0) ? sqrt(massT) : 0;
813 
814  LogTrace("") << "\t... W mass, W_et, W_px, W_py: " << massT << ", " << w_et
815  << ", " << w_px << ", " << w_py << " [GeV]";
816  if (massT > mtMin_ && massT < mtMax_) electron_sel[8] = true;
817  mt_before_->Fill(massT);
818  if (met_et > metMin_ && met_et < metMax_) electron_sel[9] = true;
819 
820  // // Acoplanarity cuts
821  // Geom::Phi<double> deltaphi(mu.phi()-atan2(met_py,met_px));
822  // double acop = deltaphi.value();
823  // if (acop<0) acop = - acop;
824  // acop = M_PI - acop;
825  // LogTrace("") << "\t... acoplanarity: " << acop;
826  // if (acop<acopCut_) muon_sel[10] = true;
827  // acop_before_->Fill(acop);
828 
829  // // Remaining flags (from global event information)
830  // if (nmuonsForZ1<1 || nmuonsForZ2<2) muon_sel[11] = true;
831  if (njets <= nJetMax_) electron_sel[10] = true;
832 
833  // Collect necessary flags "per electron"
834  int flags_passed = 0;
835  bool rec_sel_this = true;
836  bool eid_sel_this = true;
837  bool iso_sel_this = true;
838  bool all_sel_this = true;
839  for (int j = 0; j < NFLAGS; ++j) {
840  if (electron_sel[j]) flags_passed += 1;
841  if (j < 2 && !electron_sel[j]) rec_sel_this = false;
842  if (j < 4 && !electron_sel[j]) eid_sel_this = false;
843  if (j < 7 && !electron_sel[j]) iso_sel_this = false;
844  if (!electron_sel[j]) all_sel_this = false;
845  }
846 
847  if (all_sel_this) {
848  if (nGoodElectrons < 2) {
849  goodElectron[nGoodElectrons][0] = 1.;
850  goodElectron[nGoodElectrons][1] = elec.massSqr();
851  goodElectron[nGoodElectrons][2] = elec.energy();
852  goodElectron[nGoodElectrons][3] = elec.px();
853  goodElectron[nGoodElectrons][4] = elec.py();
854  goodElectron[nGoodElectrons][5] = elec.pz();
855  }
856  nGoodElectrons++;
857  }
858 
859  // // "rec" => pt,eta and quality cuts are satisfied
860  // if (rec_sel_this) rec_sel = true;
861  // // "iso" => "rec" AND "muon is isolated"
862  // if (iso_sel_this) iso_sel = true;
863  // // "hlt" => "iso" AND "event is triggered"
864  // if (hlt_sel_this) hlt_sel = true;
865  // // "all" => "met" AND "Z/top rejection cuts"
866  // if (all_sel_this) all_sel = true;
867 
868  // "rec" => pt,eta cuts are satisfied
869  if (rec_sel_this) rec_sel = true;
870  // "eid" => "rec" AND "electron passes ID"
871  if (eid_sel_this) iso_sel = true;
872  // "iso" => "eid" AND "electron is isolated"
873  if (iso_sel_this) iso_sel = true;
874  // "met" => "iso" AND "MET/MT"
875  // "all" => "met" AND "event is triggered"
876  if (all_sel_this) all_sel = true;
877 
878  // Do N-1 histograms now (and only once for global event quantities)
879  if (flags_passed >= (NFLAGS - 1)) {
880  if (!electron_sel[0] || flags_passed == NFLAGS) {
881  pt_after_->Fill(pt);
882  }
883  if (!electron_sel[1] || flags_passed == NFLAGS) {
884  eta_after_->Fill(eta);
885  }
886  if (!electron_sel[2] || flags_passed == NFLAGS) {
887  if (isBarrel) {
888  sieiebarrel_after_->Fill(sieie);
889  } else if (isEndcap) {
890  sieieendcap_after_->Fill(sieie);
891  }
892  }
893  if (!electron_sel[3] || flags_passed == NFLAGS) {
894  if (isBarrel) {
895  detainbarrel_after_->Fill(detain);
896  } else if (isEndcap) {
897  detainendcap_after_->Fill(detain);
898  }
899  }
900  if (!electron_sel[4] || flags_passed == NFLAGS) {
901  if (isBarrel) {
902  ecalisobarrel_after_->Fill(ecalisovar);
903  } else if (isEndcap) {
904  ecalisoendcap_after_->Fill(ecalisovar);
905  }
906  }
907  if (!electron_sel[5] || flags_passed == NFLAGS) {
908  if (isBarrel) {
909  hcalisobarrel_after_->Fill(hcalisovar);
910  } else if (isEndcap) {
911  hcalisoendcap_after_->Fill(hcalisovar);
912  }
913  }
914  if (!electron_sel[6] || flags_passed == NFLAGS) {
915  if (isBarrel) {
916  trkisobarrel_after_->Fill(trkisovar);
917  } else if (isEndcap) {
918  trkisoendcap_after_->Fill(trkisovar);
919  }
920  }
921  // if (!electron_sel[3] || flags_passed==NFLAGS)
922  // {
923  // detain_after_->Fill(detain);
924  // }
925  // if (!electron_sel[4] || flags_passed==NFLAGS)
926  // {
927  // ecaliso_after_->Fill(trackerHits);
928  // }
929  // if (!electron_sel[5] || flags_passed==NFLAGS)
930  // {
931  // tkelectr_after_->Fill(electr.isTrackerElectron());
932  // }
933  // if (!electron_sel[6] || flags_passed==NFLAGS)
934  // {
935  // iso_after_->Fill(isovar);
936  // }
937  if (!electron_sel[7] || flags_passed == NFLAGS) {
938  if (!hlt_hist_done) {
939  trig_after_->Fill(trigger_fired);
940  }
941  }
942  hlt_hist_done = true;
943  if (!electron_sel[8] || flags_passed == NFLAGS) {
944  mt_after_->Fill(massT);
945  }
946  if (!electron_sel[9] || flags_passed == NFLAGS) {
947  if (!met_hist_done) {
948  met_after_->Fill(met_et);
949  }
950  }
951  met_hist_done = true;
952  // if (!muon_sel[10] || flags_passed==NFLAGS)
953  // acop_after_->Fill(acop);
954  // if (!muon_sel[11] || flags_passed==NFLAGS)
955  // if (!nz1_hist_done)
956  // nz1_after_->Fill(nmuonsForZ1);
957  // nz1_hist_done = true;
958  // if (!muon_sel[11] || flags_passed==NFLAGS)
959  // if (!nz2_hist_done)
960  // nz2_after_->Fill(nmuonsForZ2);
961  // nz2_hist_done = true;
962  if (!electron_sel[10] || flags_passed == NFLAGS) {
963  if (!njets_hist_done) {
964  njets_after_->Fill(njets);
965  if (jet_et > 10) // don't want low energy "jets"
966  {
967  jet_et_after_->Fill(jet_et);
968  jet_eta_after_->Fill(jet_eta);
969  }
970  }
971  }
972  njets_hist_done = true;
973 
974  } // end N-1 histos block
975 
976  } // end loop through electrons
977 
978  // inv mass = sqrt(m_1^2 + m_2^2 + 2*(E_1*E_2 - (px1*px2 + py1*py2 + pz1+pz2)
979  // ) )
980  double invMass = 0;
981 
982  nelectrons_before_->Fill(electronCollectionSize);
983  if (electronCollectionSize > 1) {
984  invMass = sqrt(electron[0][1] + electron[1][1] +
985  2 * (electron[0][2] * electron[1][2] -
986  (electron[0][3] * electron[1][3] +
987  electron[0][4] * electron[1][4] +
988  electron[0][5] * electron[1][5])));
989  invmass_before_->Fill(invMass);
990  invmassPU_before_->Fill(invMass, npvCount);
991  }
992 
994  if (nGoodElectrons > 1) {
995  invMass = sqrt(goodElectron[0][1] + goodElectron[1][1] +
996  2 * (goodElectron[0][2] * goodElectron[1][2] -
997  (goodElectron[0][3] * goodElectron[1][3] +
998  goodElectron[0][4] * goodElectron[1][4] +
999  goodElectron[0][5] * goodElectron[1][5])));
1000  invmass_after_->Fill(invMass);
1001  invmassPU_afterZ_->Fill(invMass, npvCount);
1002  npvs_afterZ_->Fill(npvCount);
1003  }
1004 
1005  // Collect final flags
1006  if (rec_sel) nrec++;
1007  if (eid_sel) neid++;
1008  if (iso_sel) niso++;
1009  // if (hlt_sel) nhlt++;
1010  // if (met_sel) nmet++;
1011 
1012  if (all_sel) {
1013  nsel++;
1014  LogTrace("") << ">>>> Event ACCEPTED";
1015  } else {
1016  LogTrace("") << ">>>> Event REJECTED";
1017  }
1018 
1019  return;
1020 }
1021 
1022 // This always returns only a positive deltaPhi
1023 double EwkElecDQM::calcDeltaPhi(double phi1, double phi2) {
1024 
1025  double deltaPhi = phi1 - phi2;
1026 
1027  if (deltaPhi < 0) deltaPhi = -deltaPhi;
1028 
1029  if (deltaPhi > 3.1415926) {
1030  deltaPhi = 2 * 3.1415926 - deltaPhi;
1031  }
1032 
1033  return deltaPhi;
1034 }
1035 
1036 // Local Variables:
1037 // show-trailing-whitespace: t
1038 // truncate-lines: t
1039 // End:
MonitorElement * ecalisoendcap_after_
Definition: EwkElecDQM.h:141
MonitorElement * jet_et_after_
Definition: EwkElecDQM.h:188
int i
Definition: DBlmapReader.cc:9
unsigned int nGoodElectrons
Definition: EwkElecDQM.h:105
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
Definition: EwkElecDQM.cc:131
MonitorElement * invmass_after_
Definition: EwkElecDQM.h:159
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
unsigned int nall
Definition: EwkElecDQM.h:96
MonitorElement * hcalisobarrel_after_
Definition: EwkElecDQM.h:144
tuple cfg
Definition: looper.py:293
unsigned int nsel
Definition: EwkElecDQM.h:102
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: EwkElecDQM.cc:384
double metMax_
Definition: EwkElecDQM.h:76
MonitorElement * nelectrons_before_
Definition: EwkElecDQM.h:167
double sieieCutBarrel_
Definition: EwkElecDQM.h:58
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
Definition: EwkElecDQM.h:50
virtual double energy() const final
energy
MonitorElement * sieieendcap_before_
Definition: EwkElecDQM.h:116
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
MonitorElement * sieieendcap_after_
Definition: EwkElecDQM.h:117
Base class for all types of Jets.
Definition: Jet.h:20
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:60
MonitorElement * ecalisobarrel_before_
Definition: EwkElecDQM.h:137
edm::InputTag jetTag_
Definition: EwkElecDQM.h:44
bool isBarrel(GeomDetEnumerators::SubDetector m)
MonitorElement * sieiebarrel_before_
Definition: EwkElecDQM.h:113
MonitorElement * hcalisobarrel_before_
Definition: EwkElecDQM.h:143
virtual double phi() const final
momentum azimuthal angle
float dr04TkSumPt() const
Definition: GsfElectron.h:502
MonitorElement * detainbarrel_after_
Definition: EwkElecDQM.h:120
MonitorElement * ecalisobarrel_after_
Definition: EwkElecDQM.h:138
bool ev
MonitorElement * detainendcap_before_
Definition: EwkElecDQM.h:122
MonitorElement * trig_before_
Definition: EwkElecDQM.h:155
MonitorElement * sieiebarrel_after_
Definition: EwkElecDQM.h:114
MonitorElement * detainbarrel_before_
Definition: EwkElecDQM.h:119
tuple vertexCollection
MonitorElement * mt_before_
Definition: EwkElecDQM.h:170
MonitorElement * nelectrons_after_
Definition: EwkElecDQM.h:168
MonitorElement * hcalisoendcap_before_
Definition: EwkElecDQM.h:146
MonitorElement * npvs_afterZ_
Definition: EwkElecDQM.h:165
void Fill(long long x)
unsigned int niso
Definition: EwkElecDQM.h:99
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkElecDQM.cc:1023
MonitorElement * mt_after_
Definition: EwkElecDQM.h:171
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
double ecalIsoCutEndcap_
Definition: EwkElecDQM.h:68
float sigmaIetaIeta() const
Definition: GsfElectron.h:416
MonitorElement * jet_et_before_
Definition: EwkElecDQM.h:187
double detainCutEndcap_
Definition: EwkElecDQM.h:61
MonitorElement * njets_after_
Definition: EwkElecDQM.h:186
MonitorElement * pt_before_
Definition: EwkElecDQM.h:107
MonitorElement * pt_after_
Definition: EwkElecDQM.h:108
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecTag_
Definition: EwkElecDQM.h:46
double metMin_
Definition: EwkElecDQM.h:75
double trkIsoCutEndcap_
Definition: EwkElecDQM.h:72
unsigned int PUBinCount_
Definition: EwkElecDQM.h:91
Definition: MET.h:42
virtual void endRun(const edm::Run &, const edm::EventSetup &)
Definition: EwkElecDQM.cc:271
T sqrt(T t)
Definition: SSEVec.h:18
unsigned int nrec
Definition: EwkElecDQM.h:97
MonitorElement * hcalisoendcap_after_
Definition: EwkElecDQM.h:147
int nJetMax_
Definition: EwkElecDQM.h:88
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
EwkElecDQM(const edm::ParameterSet &)
Definition: EwkElecDQM.cc:41
int j
Definition: DBlmapReader.cc:9
double ecalIsoCutBarrel_
Definition: EwkElecDQM.h:67
double trkIsoCutBarrel_
Definition: EwkElecDQM.h:71
edm::InputTag metTag_
Definition: EwkElecDQM.h:43
virtual double py() const final
y coordinate of momentum vector
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
Definition: EwkElecDQM.h:48
MonitorElement * invmass_before_
Definition: EwkElecDQM.h:158
MonitorElement * ecalisoendcap_before_
Definition: EwkElecDQM.h:140
unsigned int PUMax_
Definition: EwkElecDQM.h:91
static std::string const triggerResults
Definition: EdmProvDump.cc:41
MonitorElement * jet_eta_after_
Definition: EwkElecDQM.h:190
MonitorElement * trig_after_
Definition: EwkElecDQM.h:156
bool isEndcap(GeomDetEnumerators::SubDetector m)
virtual double pz() const final
z coordinate of momentum vector
#define LogTrace(id)
MonitorElement * jet_eta_before_
Definition: EwkElecDQM.h:189
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
unsigned int neid
Definition: EwkElecDQM.h:98
double etaCut_
Definition: EwkElecDQM.h:56
double hcalIsoCutBarrel_
Definition: EwkElecDQM.h:69
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
bool isValidHltConfig_
Definition: EwkElecDQM.h:93
MonitorElement * detainendcap_after_
Definition: EwkElecDQM.h:123
MonitorElement * njets_before_
Definition: EwkElecDQM.h:185
MonitorElement * invmassPU_afterZ_
Definition: EwkElecDQM.h:161
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * trkisobarrel_before_
Definition: EwkElecDQM.h:149
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
double sieieCutEndcap_
Definition: EwkElecDQM.h:59
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
Definition: EwkElecDQM.h:49
MonitorElement * met_before_
Definition: EwkElecDQM.h:173
MonitorElement * trkisoendcap_before_
Definition: EwkElecDQM.h:152
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
Definition: EwkElecDQM.h:47
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
HLTConfigProvider const & hltConfigProvider() const
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< edm::TriggerResults > trigTag_
Definition: EwkElecDQM.h:45
void HERE(const char *msg)
MonitorElement * met_after_
Definition: EwkElecDQM.h:174
double eJetMin_
Definition: EwkElecDQM.h:87
MonitorElement * trkisobarrel_after_
Definition: EwkElecDQM.h:150
double mtMax_
Definition: EwkElecDQM.h:74
MonitorElement * eta_after_
Definition: EwkElecDQM.h:111
double detainCutBarrel_
Definition: EwkElecDQM.h:60
const std::vector< std::string > elecTrig_
Definition: EwkElecDQM.h:54
MonitorElement * npvs_before_
Definition: EwkElecDQM.h:163
MonitorElement * trkisoendcap_after_
Definition: EwkElecDQM.h:153
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:495
HLTPrescaleProvider hltPrescaleProvider_
Definition: EwkElecDQM.h:94
virtual double px() const final
x coordinate of momentum vector
virtual double et() const final
transverse energy
tuple cout
Definition: gather_cfg.py:145
virtual double eta() const final
momentum pseudorapidity
string metCollection
Definition: MT2Analyzer.py:466
double hcalIsoCutEndcap_
Definition: EwkElecDQM.h:70
MonitorElement * eta_before_
Definition: EwkElecDQM.h:110
MonitorElement * invmassPU_before_
Definition: EwkElecDQM.h:160
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
virtual double massSqr() const final
mass squared
Definition: Run.h:43
double mtMin_
Definition: EwkElecDQM.h:73
virtual double pt() const final
transverse momentum
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: EwkElecDQM.cc:151
double ptCut_
Definition: EwkElecDQM.h:55