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