CMS 3D CMS Logo

EwkDQM.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author Valentina Gori, University of Firenze
5  */
6 
8 
9 #include <vector>
10 #include <string>
11 #include <cmath>
12 
17 
21 
23 
26 
27 // Physics Objects
36 
37 #include "TLorentzVector.h"
38 
39 using namespace std;
40 using namespace edm;
41 using namespace reco;
42 
43 // EwkDQM::EwkDQM(const ParameterSet& parameters) {
45  eJetMin_ = parameters.getUntrackedParameter<double>("EJetMin", 999999.);
46 
47  // riguardare questa sintassi
48  // Get parameters from configuration file
49  thePFJetCollectionLabel_ =
50  parameters.getParameter<InputTag>("PFJetCollection");
51  theCaloMETCollectionLabel_ =
52  parameters.getParameter<InputTag>("caloMETCollection");
53  theTriggerResultsCollection_ =
54  parameters.getParameter<InputTag>("triggerResultsCollection");
55 
56  theElecTriggerPathToPass_ =
57  parameters.getParameter<std::vector<string> >("elecTriggerPathToPass");
58  theMuonTriggerPathToPass_ =
59  parameters.getParameter<std::vector<string> >("muonTriggerPathToPass");
60  theTriggerResultsToken_ = consumes<edm::TriggerResults>(
61  parameters.getParameter<InputTag>("triggerResultsCollection"));
62  theMuonCollectionLabel_ = consumes<reco::MuonCollection>(
63  parameters.getParameter<InputTag>("muonCollection"));
64  theElectronCollectionLabel_ = consumes<reco::GsfElectronCollection>(
65  parameters.getParameter<InputTag>("electronCollection"));
66  thePFJetCollectionToken_ = consumes<edm::View<reco::Jet> >(
67  parameters.getParameter<InputTag>("PFJetCollection"));
68  theCaloMETCollectionToken_ = consumes<edm::View<reco::MET> >(
69  parameters.getParameter<InputTag>("caloMETCollection"));
70  theVertexToken_ = consumes<reco::VertexCollection>(
71  parameters.getParameter<InputTag>("vertexCollection"));
72 
73  // just to initialize
74  isValidHltConfig_ = false;
75 
76  h_vertex_number = nullptr;
77  h_vertex_chi2 = nullptr;
78  h_vertex_numTrks = nullptr;
79  h_vertex_sumTrks = nullptr;
80  h_vertex_d0 = nullptr;
81 
82  h_jet_count = nullptr;
83  h_jet_et = nullptr;
84  h_jet_pt = nullptr;
85  h_jet_eta = nullptr;
86  h_jet_phi = nullptr;
87  h_jet2_et = nullptr;
88  // h_jet2_pt = 0;
89  h_jet2_eta = nullptr;
90  h_jet2_phi = nullptr;
91 
92  h_e1_et = nullptr;
93  h_e2_et = nullptr;
94  h_e1_eta = nullptr;
95  h_e2_eta = nullptr;
96  h_e1_phi = nullptr;
97  h_e2_phi = nullptr;
98 
99  h_m1_pt = nullptr;
100  h_m2_pt = nullptr;
101  h_m1_eta = nullptr;
102  h_m2_eta = nullptr;
103  h_m1_phi = nullptr;
104  h_m2_phi = nullptr;
105 
106  // h_t1_et = 0;
107  // h_t1_eta = 0;
108  // h_t1_phi = 0;
109 
110  h_met = nullptr;
111  h_met_phi = nullptr;
112 
113  h_e_invWMass = nullptr;
114  h_m_invWMass = nullptr;
115  h_mumu_invMass = nullptr;
116  h_ee_invMass = nullptr;
117 
118 }
119 
121 
123  edm::Run const &, edm::EventSetup const & ){
124  ibooker.setCurrentFolder("Physics/EwkDQM");
125 
126  char chtitle[256] = "";
127  const size_t title_s = sizeof(chtitle);
128 
129  logTraceName = "EwkAnalyzer";
130 
131  LogTrace(logTraceName) << "Parameters initialization";
132 
133  const float pi = 4 * atan(1);
134 
135  // Keep the number of plots and number of bins to a minimum!
136 
137  h_vertex_number = ibooker.book1D(
138  "vertex_number", "Number of event vertices in collection", 10, -0.5, 9.5);
139  h_vertex_chi2 = ibooker.book1D(
140  "vertex_chi2", "Event Vertex #chi^{2}/n.d.o.f.", 20, 0.0, 2.0);
141  h_vertex_numTrks = ibooker.book1D(
142  "vertex_numTrks", "Event Vertex, number of tracks", 20, -0.5, 59.5);
143  h_vertex_sumTrks = ibooker.book1D(
144  "vertex_sumTrks", "Event Vertex, sum of track pt", 20, 0.0, 100.0);
145  h_vertex_d0 = ibooker.book1D("vertex_d0", "Event Vertex d0", 20, 0.0, 0.05);
146 
147  h_jet_count = ibooker.book1D("jet_count", chtitle, 8, -0.5, 7.5);
148 
149  snprintf(chtitle, title_s, "Leading jet E_{T} (from %s);E_{T}(1^{st} jet) (GeV)",
150  thePFJetCollectionLabel_.label().data());
151  h_jet_et = ibooker.book1D("jet_et", chtitle, 20, 0., 200.0);
152 
153  snprintf(chtitle, title_s, "Leading jet p_{T} (from %s);p_{T}(1^{st} jet) (GeV/c)",
154  thePFJetCollectionLabel_.label().data());
155  h_jet_pt = ibooker.book1D("jet_pt", chtitle, 20, 0., 200.0);
156 
157  snprintf(chtitle, title_s, "Leading jet #eta (from %s); #eta (1^{st} jet)",
158  thePFJetCollectionLabel_.label().data());
159  h_jet_eta = ibooker.book1D("jet_eta", chtitle, 20, -10., 10.0);
160 
161  snprintf(chtitle, title_s, "Leading jet #phi (from %s); #phi(1^{st} jet)",
162  thePFJetCollectionLabel_.label().data());
163  h_jet_phi = ibooker.book1D("jet_phi", chtitle, 22, -1.1 * pi, 1.1 * pi);
164 
165  snprintf(chtitle, title_s,
166  "2^{nd} leading jet E_{T} (from %s);E_{T}(2^{nd} jet) (GeV)",
167  thePFJetCollectionLabel_.label().data());
168  h_jet2_et = ibooker.book1D("jet2_et", chtitle, 20, 0., 200.0);
169 
170  snprintf(chtitle, title_s, "2^{nd} leading jet #eta (from %s); #eta (2^{nd} jet)",
171  thePFJetCollectionLabel_.label().data());
172  h_jet2_eta = ibooker.book1D("jet2_eta", chtitle, 20, -10., 10.0);
173 
174  snprintf(chtitle, title_s, "2^{nd} leading jet #phi (from %s); #phi(2^{nd} jet)",
175  thePFJetCollectionLabel_.label().data());
176  h_jet2_phi = ibooker.book1D("jet2_phi", chtitle, 22, -1.1 * pi, 1.1 * pi);
177 
178  h_e1_et = ibooker.book1D("e1_et", "E_{T} of Leading Electron;E_{T} (GeV)", 20,
179  0.0, 100.0);
180  h_e2_et = ibooker.book1D("e2_et", "E_{T} of Second Electron;E_{T} (GeV)", 20,
181  0.0, 100.0);
182  h_e1_eta = ibooker.book1D("e1_eta", "#eta of Leading Electron;#eta", 20, -4.0, 4.0);
183 
184  h_e2_eta = ibooker.book1D("e2_eta", "#eta of Second Electron;#eta", 20, -4.0, 4.0);
185 
186  h_e1_phi = ibooker.book1D("e1_phi", "#phi of Leading Electron;#phi", 22,
187  -1.1 * pi, 1.1 * pi);
188  h_e2_phi = ibooker.book1D("e2_phi", "#phi of Second Electron;#phi", 22,
189  -1.1 * pi, 1.1 * pi);
190  h_m1_pt = ibooker.book1D(
191  "m1_pt", "p_{T} of Leading Muon;p_{T}(1^{st} #mu) (GeV)", 20, 0.0, 100.0);
192  h_m2_pt = ibooker.book1D(
193  "m2_pt", "p_{T} of Second Muon;p_{T}(2^{nd} #mu) (GeV)", 20, 0.0, 100.0);
194  h_m1_eta = ibooker.book1D("m1_eta", "#eta of Leading Muon;#eta(1^{st} #mu)",
195  20, -4.0, 4.0);
196  h_m2_eta = ibooker.book1D("m2_eta", "#eta of Second Muon;#eta(2^{nd} #mu)",
197  20, -4.0, 4.0);
198  h_m1_phi = ibooker.book1D("m1_phi", "#phi of Leading Muon;#phi(1^{st} #mu)",
199  20, (-1. - 1. / 10.) * pi, (1. + 1. / 10.) * pi);
200  h_m2_phi = ibooker.book1D("m2_phi", "#phi of Second Muon;#phi(2^{nd} #mu)",
201  20, (-1. - 1. / 10.) * pi, (1. + 1. / 10.) * pi);
202 
203  snprintf(chtitle, title_s, "Missing E_{T} (%s); GeV",
204  theCaloMETCollectionLabel_.label().data());
205  h_met = ibooker.book1D("met", chtitle, 20, 0.0, 100);
206  h_met_phi = ibooker.book1D("met_phi", "Missing E_{T} #phi;#phi(MET)", 22,
207  (-1. - 1. / 10.) * pi, (1. + 1. / 10.) * pi);
208 
209  h_e_invWMass = ibooker.book1D(
210  "we_invWMass", "W-> e #nu Transverse Mass;M_{T} (GeV)", 20, 0.0, 140.0);
211  h_m_invWMass = ibooker.book1D(
212  "wm_invWMass", "W-> #mu #nu Transverse Mass;M_{T} (GeV)", 20, 0.0, 140.0);
213  h_mumu_invMass = ibooker.book1D(
214  "z_mm_invMass", "#mu#mu Invariant Mass;InvMass (GeV)", 20, 40.0, 140.0);
215  h_ee_invMass = ibooker.book1D(
216  "z_ee_invMass", "ee Invariant Mass;InvMass (Gev)", 20, 40.0, 140.0);
217 }
218 
220 void EwkDQM::dqmBeginRun(const edm::Run& theRun, const edm::EventSetup& theSetup) {
221  // passed as parameter to HLTConfigProvider::init(), not yet used
222  bool isConfigChanged = false;
223 
224  // isValidHltConfig_ used to short-circuit analyze() in case of problems
225  const std::string hltProcessName(theTriggerResultsCollection_.process());
226  isValidHltConfig_ = hltConfigProvider_.init(theRun, theSetup, hltProcessName,
227  isConfigChanged);
228 }
229 
230 void EwkDQM::analyze(const Event& iEvent, const EventSetup& iSetup) {
231  // short-circuit if hlt problems
232  if (!isValidHltConfig_) return;
233 
234  LogTrace(logTraceName) << "Analysis of event # ";
235  // Did it pass certain HLT path?
236  Handle<TriggerResults> HLTresults;
237  iEvent.getByToken(theTriggerResultsToken_, HLTresults);
238  if (!HLTresults.isValid()) return;
239 
240  const edm::TriggerNames& trigNames = iEvent.triggerNames(*HLTresults);
241 
242  // a temporary, until we have a list of triggers of interest
243  std::vector<std::string> eleTrigPathNames;
244  std::vector<std::string> muTrigPathNames;
245 
246  // eleTrigPathNames.push_back(theElecTriggerPathToPass_);
247  // muTrigPathNames.push_back(theMuonTriggerPathToPass_);
248  // end of temporary
249 
250  bool passed_electron_HLT = false;
251  bool passed_muon_HLT = false;
252  for (unsigned int i = 0; i < HLTresults->size(); i++) {
253  const std::string& trigName = trigNames.triggerName(i);
254  // check if triggerName matches electronPath
255  for (unsigned int index = 0;
256  index < theElecTriggerPathToPass_.size() && !passed_electron_HLT;
257  index++) {
258  // 0 if found, pos if not
259  size_t trigPath = trigName.find(theElecTriggerPathToPass_[index]);
260  if (trigPath == 0) {
261  // cout << "MuonTrigger passed (=trigName): " << trigName <<endl;
262  passed_electron_HLT = HLTresults->accept(i);
263  }
264  }
265  // check if triggerName matches muonPath
266  for (unsigned int index = 0;
267  index < theMuonTriggerPathToPass_.size() && !passed_muon_HLT;
268  index++) {
269  // 0 if found, pos if not
270  size_t trigPath = trigName.find(theMuonTriggerPathToPass_[index]);
271  if (trigPath == 0) {
272  // cout << "MuonTrigger passed (=trigName): " << trigName <<endl;
273  passed_muon_HLT = HLTresults->accept(i);
274  }
275  }
276  }
277 
278  // we are interested in events with a valid electron or muon
279  if (!(passed_electron_HLT || passed_muon_HLT)) return;
280 
282  // Vertex information
283  Handle<VertexCollection> vertexHandle;
284  iEvent.getByToken(theVertexToken_, vertexHandle);
285  if (!vertexHandle.isValid()) return;
286  VertexCollection vertexCollection = *(vertexHandle.product());
287  VertexCollection::const_iterator v = vertexCollection.begin();
288  int vertex_number = vertexCollection.size();
289  double vertex_chi2 = v->normalizedChi2(); // v->chi2();
290  double vertex_d0 = sqrt(v->x() * v->x() + v->y() * v->y());
291  double vertex_numTrks = v->tracksSize();
292  double vertex_sumTrks = 0.0;
293  // std::cout << "vertex_d0=" << vertex_d0 << "\n";
294  // double vertex_ndof = v->ndof();cout << "ndof="<<vertex_ndof<<endl;
295  for (Vertex::trackRef_iterator vertex_curTrack = v->tracks_begin();
296  vertex_curTrack != v->tracks_end(); vertex_curTrack++)
297  vertex_sumTrks += (*vertex_curTrack)->pt();
298 
300  // Missing ET
301  Handle<View<MET> > caloMETCollection;
302  iEvent.getByToken(theCaloMETCollectionToken_, caloMETCollection);
303  if (!caloMETCollection.isValid()) return;
304  float missing_et = caloMETCollection->begin()->et();
305  float met_phi = caloMETCollection->begin()->phi();
306 
308  // grab "gaussian sum fitting" electrons
310  iEvent.getByToken(theElectronCollectionLabel_, electronCollection);
311  if (!electronCollection.isValid()) return;
312 
313  // Find the highest and 2nd highest electron
314  float electron_et = -8.0;
315  float electron_eta = -8.0;
316  float electron_phi = -8.0;
317  float electron2_et = -9.0;
318  float electron2_eta = -9.0;
319  float electron2_phi = -9.0;
320  float ee_invMass = -9.0;
321  TLorentzVector e1, e2;
322 
323  // If it passed electron HLT and the collection was found, find electrons near
324  // Z mass
325  if (passed_electron_HLT) {
326  for (reco::GsfElectronCollection::const_iterator recoElectron =
327  electronCollection->begin();
328  recoElectron != electronCollection->end(); recoElectron++) {
329  // Require electron to pass some basic cuts
330  if (recoElectron->et() < 20 || fabs(recoElectron->eta()) > 2.5) continue;
331 
332  // Tighter electron cuts
333  if (recoElectron->deltaPhiSuperClusterTrackAtVtx() > 0.58 ||
334  recoElectron->deltaEtaSuperClusterTrackAtVtx() > 0.01 ||
335  recoElectron->sigmaIetaIeta() > 0.027)
336  continue;
337 
338  if (recoElectron->et() > electron_et) {
339  electron2_et =
340  electron_et; // 2nd highest gets values from current highest
341  electron2_eta = electron_eta;
342  electron2_phi = electron_phi;
343  electron_et =
344  recoElectron->et(); // 1st highest gets values from new highest
345  electron_eta = recoElectron->eta();
346  electron_phi = recoElectron->phi();
347  e1 = TLorentzVector(recoElectron->momentum().x(),
348  recoElectron->momentum().y(),
349  recoElectron->momentum().z(), recoElectron->p());
350  } else if (recoElectron->et() > electron2_et) {
351  electron2_et = recoElectron->et();
352  electron2_eta = recoElectron->eta();
353  electron2_phi = recoElectron->phi();
354  e2 = TLorentzVector(recoElectron->momentum().x(),
355  recoElectron->momentum().y(),
356  recoElectron->momentum().z(), recoElectron->p());
357  }
358  } // end of loop over electrons
359  if (electron2_et > 0.0) {
360  TLorentzVector pair = e1 + e2;
361  ee_invMass = pair.M();
362  }
363  } // end of "are electrons valid"
365 
367  // Take the STA muon container
369  iEvent.getByToken(theMuonCollectionLabel_, muonCollection);
370  if (!muonCollection.isValid()) return;
371 
372  // Find the highest pt muons
373  float mm_invMass = -9.0;
374  float muon_pt = -9.0;
375  float muon_eta = -9.0;
376  float muon_phi = -9.0;
377  float muon2_pt = -9.0;
378  float muon2_eta = -9.0;
379  float muon2_phi = -9.0;
380  TLorentzVector m1, m2;
381 
382  if (passed_muon_HLT) {
383  for (reco::MuonCollection::const_iterator recoMuon =
384  muonCollection->begin();
385  recoMuon != muonCollection->end(); recoMuon++) {
386  // Require muon to pass some basic cuts
387  if (recoMuon->pt() < 20 || !recoMuon->isGlobalMuon()) continue;
388  // Some tighter muon cuts
389  if (recoMuon->globalTrack()->normalizedChi2() > 10) continue;
390 
391  if (recoMuon->pt() > muon_pt) {
392  muon2_pt = muon_pt; // 2nd highest gets values from current highest
393  muon2_eta = muon_eta;
394  muon2_phi = muon_phi;
395  muon_pt = recoMuon->pt(); // 1st highest gets values from new highest
396  muon_eta = recoMuon->eta();
397  muon_phi = recoMuon->phi();
398  m1 = TLorentzVector(recoMuon->momentum().x(), recoMuon->momentum().y(),
399  recoMuon->momentum().z(), recoMuon->p());
400  } else if (recoMuon->pt() > muon2_pt) {
401  muon2_pt = recoMuon->pt();
402  muon2_eta = recoMuon->eta();
403  muon2_phi = recoMuon->phi();
404  m2 = TLorentzVector(recoMuon->momentum().x(), recoMuon->momentum().y(),
405  recoMuon->momentum().z(), recoMuon->p());
406  }
407  }
408  }
409  if (muon2_pt > 0.0) {
410  TLorentzVector pair = m1 + m2;
411  mm_invMass = pair.M();
412  }
414 
416  // Find the highest et jet
417 
418  // Handle<CaloJetCollection> caloJetCollection;
420  iEvent.getByToken(thePFJetCollectionToken_, PFJetCollection);
421  if (!PFJetCollection.isValid()) return;
422 
423  unsigned int muonCollectionSize = muonCollection->size();
424  // unsigned int jetCollectionSize = jetCollection->size();
425  unsigned int PFJetCollectionSize = PFJetCollection->size();
426  int jet_count = 0;
427  // int LEADJET=-1; double max_pt=0;
428 
429  float jet_et = -80.0;
430  float jet_pt = -80.0; // prova
431  float jet_eta = -80.0; // now USED
432  float jet_phi = -80.0; // now USED
433  float jet2_et = -90.0;
434  float jet2_eta = -90.0; // now USED
435  float jet2_phi = -90.0; // now USED
436  // for (CaloJetCollection::const_iterator i_calojet =
437  // caloJetCollection->begin();
438  // i_calojet != caloJetCollection->end(); i_calojet++) {
439  // for (PFJetCollection::const_iterator i_pfjet = PFJetCollection->begin();
440  // i_pfjet != PFJetCollection->end(); i_pfjet++) {
441  // float jet_current_et = i_calojet->et();
442  // float jet_current_et = i_pfjet->et(); // e` identico a jet.et()
443  // jet_count++;
444 
445  // cleaning: va messo prima del riempimento dell'istogramma // This is in
446  // order to use PFJets
447  for (unsigned int i = 0; i < PFJetCollectionSize; i++) {
448  const Jet& jet = PFJetCollection->at(i);
449  // la classe "jet" viene definita qui!!!
450  double minDistance = 99999;
451  for (unsigned int j = 0; j < muonCollectionSize; j++) {
452  const Muon& mu = muonCollection->at(j);
453  double distance = sqrt((mu.eta() - jet.eta()) * (mu.eta() - jet.eta()) +
454  (mu.phi() - jet.phi()) * (mu.phi() - jet.phi()));
455  if (minDistance > distance) minDistance = distance;
456  }
457  if (minDistance < 0.3)
458  continue; // 0.3 is the isolation cone around the muon
459  // se la distanza muone-cono del jet e` minore di 0.3, passo avanti e non
460  // conteggio il mio jet
461 
462  // If it overlaps with ELECTRON, it is not a jet
463  if (electron_et > 0.0 && fabs(jet.eta() - electron_eta) < 0.2 &&
464  calcDeltaPhi(jet.phi(), electron_phi) < 0.2)
465  continue;
466  if (electron2_et > 0.0 && fabs(jet.eta() - electron2_eta) < 0.2 &&
467  calcDeltaPhi(jet.phi(), electron2_phi) < 0.2)
468  continue;
469 
470  // provo a cambiare la parte degli elettroni in modo simmetrico alla parte
471  // per i muoni
472 
473  // ...
474  // ...
475 
476  // if it has too low Et, throw away
477  if (jet.et() < eJetMin_) continue;
478  jet_count++;
479 
480  // ovvero: incrementa jet_count se:
481  // - non c'e un muone entro 0.3 di distanza dal cono del jet;
482  // - se il jet non si sovrappone ad un elettrone;
483  // - se l'energia trasversa e` maggiore della soglia impostata (15?)
484 
485  // if(jet.et()>max_pt) { LEADJET=i; max_pt=jet.et();}
486  // se l'energia del jet e` maggiore di max_pt, diventa "i"
487  // l'indice del jet piu` energetico e max_pt la sua energia
488 
489  // riguardare questo!!!
490  // fino ad ora, jet_et era inizializzato a -8.0
491  if (jet.et() > jet_et) {
492  jet2_et = jet_et; // 2nd highest jet gets et from current highest
493  // perche` prende l'energia del primo jet??
494  jet2_eta = jet_eta; // now USED
495  jet2_phi = jet_phi; // now USED
496  // jet_et = i_calojet->et(); // current highest jet gets
497  // et from the new highest
498  jet_et = jet.et(); // current highest jet gets et from the new highest
499  // ah, ok! lo riaggiorna solo dopo!
500  jet_pt = jet.pt(); // e` il pT del leading jet
501  jet_eta = jet.eta(); // now USED
502  jet_phi = jet.phi() * (Geom::pi() / 180.); // now USED
503  } else if (jet.et() > jet2_et) {
504  // jet2_et = i_calojet->et();
505  jet2_et = jet.et();
506  // jet2_eta = i_calojet->eta(); // UNUSED
507  // jet2_phi = i_calojet->phi(); // UNUSED
508  jet2_eta = jet.eta(); // now USED
509  jet2_phi = jet.phi(); // now USED
510  }
511  // questo elseif funziona
512  }
514 
516  // Fill Histograms //
518 
519  bool fill_e1 = false;
520  bool fill_e2 = false;
521  bool fill_m1 = false;
522  bool fill_m2 = false;
523  bool fill_met = false;
524 
525  // Was Z->ee found?
526  if (ee_invMass > 0.0) {
527  h_ee_invMass->Fill(ee_invMass);
528  fill_e1 = true;
529  fill_e2 = true;
530  }
531 
532  // Was Z->mu mu found?
533  if (mm_invMass > 0.0) {
534  h_mumu_invMass->Fill(mm_invMass);
535  fill_m1 = true;
536  fill_m2 = true;
537  h_jet2_et->Fill(jet2_et);
538  }
539 
540  // Was W->e nu found?
541  if (electron_et > 0.0 && missing_et > 20.0) {
542  float dphiW = fabs(met_phi - electron_phi);
543  float W_mt_e = sqrt(2 * missing_et * electron_et * (1 - cos(dphiW)));
544  h_e_invWMass->Fill(W_mt_e);
545  fill_e1 = true;
546  fill_met = true;
547  }
548 
549  // Was W->mu nu found?
550  if (muon_pt > 0.0 && missing_et > 20.0) {
551  float dphiW = fabs(met_phi - muon_phi);
552  float W_mt_m = sqrt(2 * missing_et * muon_pt * (1 - cos(dphiW)));
553  h_m_invWMass->Fill(W_mt_m);
554  fill_m1 = true;
555  fill_met = true;
556  }
557 
558  if (jet_et > -10.0) {
559  h_jet_et->Fill(jet_et);
560  h_jet_count->Fill(jet_count);
561  }
562 
563  if (jet_pt > 0.) {
564  h_jet_pt->Fill(jet_pt);
565  }
566 
567  if (jet_eta > -50.) {
568  h_jet_eta->Fill(jet_eta);
569  }
570 
571  if (jet_phi > -10.) {
572  h_jet_phi->Fill(jet_phi);
573  }
574 
575  if (jet2_et > -10.0) {
576  h_jet2_et->Fill(jet2_et);
577  }
578 
579  // if (jet2_pt>0.) {
580  // h_jet2_pt ->Fill(jet2_pt);
581  // }
582 
583  if (jet2_eta > -50.) {
584  h_jet2_eta->Fill(jet2_eta);
585  }
586 
587  if (jet2_phi > -10.) {
588  h_jet2_phi->Fill(jet2_phi);
589  }
590 
591  if (fill_e1 || fill_m1) {
592  h_vertex_number->Fill(vertex_number);
593  h_vertex_chi2->Fill(vertex_chi2);
594  h_vertex_d0->Fill(vertex_d0);
595  h_vertex_numTrks->Fill(vertex_numTrks);
596  h_vertex_sumTrks->Fill(vertex_sumTrks);
597  }
598 
599  if (fill_e1) {
600  h_e1_et->Fill(electron_et);
601  h_e1_eta->Fill(electron_eta);
602  h_e1_phi->Fill(electron_phi);
603  }
604  if (fill_e2) {
605  h_e2_et->Fill(electron2_et);
606  h_e2_eta->Fill(electron2_eta);
607  h_e2_phi->Fill(electron2_phi);
608  }
609  if (fill_m1) {
610  h_m1_pt->Fill(muon_pt);
611  h_m1_eta->Fill(muon_eta);
612  h_m1_phi->Fill(muon_phi);
613  }
614  if (fill_m2) {
615  h_m2_pt->Fill(muon2_pt);
616  h_m2_eta->Fill(muon2_eta);
617  h_m2_phi->Fill(muon2_phi);
618  }
619  if (fill_met) {
620  h_met->Fill(missing_et);
621  h_met_phi->Fill(met_phi);
622  }
624 }
625 
626 // This always returns only a positive deltaPhi
627 double EwkDQM::calcDeltaPhi(double phi1, double phi2) {
628  double deltaPhi = phi1 - phi2;
629 
630  if (deltaPhi < 0) deltaPhi = -deltaPhi;
631 
632  if (deltaPhi > 3.1415926) deltaPhi = 2 * 3.1415926 - deltaPhi;
633 
634  return deltaPhi;
635 }
636 
637 // Local Variables:
638 // show-trailing-whitespace: t
639 // truncate-lines: t
640 // End:
T getParameter(std::string const &) const
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkTauDQM.cc:1028
void analyze(const edm::Event &, const edm::EventSetup &) override
Get the analysis.
Definition: EwkDQM.cc:230
T getUntrackedParameter(std::string const &, T const &) const
double eta() const final
momentum pseudorapidity
EwkDQM(const edm::ParameterSet &)
Constructor.
Definition: EwkDQM.cc:44
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
bool accept() const
Has at least one path accepted the event?
double pt() const final
transverse momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
const Double_t pi
int iEvent
Definition: GenABIO.cc:230
Definition: Muon.py:1
Definition: Jet.py:1
double et() const final
transverse energy
~EwkDQM() override
Destructor.
Definition: EwkDQM.cc:120
T sqrt(T t)
Definition: SSEVec.h:18
unsigned int size() const
Get number of paths stored.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: EwkDQM.cc:122
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Definition: EwkDQM.cc:220
const int mu
Definition: Constants.h:22
bool isValid() const
Definition: HandleBase.h:74
#define LogTrace(id)
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
T const * product() const
Definition: Handle.h:81
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
std::vector< PFJet > PFJetCollection
collection of PFJet objects
fixed size matrix
HLT enums.
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:37
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkDQM.cc:627
constexpr double pi()
Definition: Pi.h:31
double phi() const final
momentum azimuthal angle
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
Definition: Run.h:44