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