CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HiggsDQM.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
5 // Framework
14 
15 // Candidate handling
26 
29 
30 //#include
31 //"HiggsAnalysis/HiggsToZZ4Leptons/plugins/HZZ4LeptonsElectronAssociationMap.h"
32 //#include
33 //"HiggsAnalysis/HiggsToZZ4Leptons/plugins/HZZ4LeptonsMuonAssociationMap.h"
34 
35 // vertexing
36 // Transient tracks
44 
45 // Vertex utilities
47 
48 // Geometry
56 
62 
63 // RECO
64 // Isolation
65 //#include "HiggsAnalysis/HiggsToZZ4Leptons/plugins/CandidateHadIsolation.h"
66 //#include "HiggsAnalysis/HiggsToZZ4Leptons/plugins/CandidateTkIsolation.h"
74 
75 // MET
80 
82 #include "TLorentzVector.h"
83 
84 #include <iostream>
85 #include <iomanip>
86 #include <stdio.h>
87 #include <string>
88 #include <sstream>
89 #include <math.h>
90 
91 using namespace edm;
92 using namespace std;
93 using namespace reco;
94 
96  bool operator()(const Candidate& c1, const Candidate& c2) const {
97  return c1.pt() > c2.pt();
98  }
99 };
100 
102  const reco::Candidate& c2) {
103  return deltaR(c1, c2);
104 }
105 
107  const reco::Candidate& c2) {
108  return deltaPhi(c1.p4().phi(), c2.p4().phi());
109 }
110 
111 // This always returns only a positive deltaPhi
112 double HiggsDQM::calcDeltaPhi(double phi1, double phi2) {
113  double deltaPhi = phi1 - phi2;
114  if (deltaPhi < 0) deltaPhi = -deltaPhi;
115  if (deltaPhi > 3.1415926) {
116  deltaPhi = 2 * 3.1415926 - deltaPhi;
117  }
118  return deltaPhi;
119 }
120 
121 //
122 // -- Constructor
123 //
125  // cout<<"Entering HiggsDQM::HiggsDQM: "<<endl;
126 
127  edm::LogInfo("HZZ4LeptonsDQM") << " Creating HZZ4LeptonsDQM "
128  << "\n";
129 
130  bei_ = Service<DQMStore>().operator->();
131  bei_->setCurrentFolder("Physics/Higgs");
132  bookHistos(bei_);
133 
134  typedef std::vector<edm::InputTag> vtag;
135  // Get parameters from configuration file
136  theElecTriggerPathToPass = ps.getParameter<string>("elecTriggerPathToPass");
137  theMuonTriggerPathToPass = ps.getParameter<string>("muonTriggerPathToPass");
138  theTriggerResultsCollectionTag_ =
139  ps.getParameter<InputTag>("triggerResultsCollection");
140  theCaloJetCollectionLabel_ = ps.getParameter<InputTag>("caloJetCollection");
141  theTriggerResultsCollection_ =
142  consumes<edm::TriggerResults>(theTriggerResultsCollectionTag_);
143  theMuonCollectionToken_ = consumes<reco::MuonCollection>(
144  ps.getParameter<InputTag>("muonCollection"));
145  theElectronCollectionToken_ = consumes<reco::GsfElectronCollection>(
146  ps.getParameter<InputTag>("electronCollection"));
147  theCaloJetCollectionToken_ =
148  consumes<reco::CaloJetCollection>(theCaloJetCollectionLabel_);
149  theCaloMETCollectionToken_ = consumes<reco::CaloMETCollection>(
150  ps.getParameter<InputTag>("caloMETCollection"));
151  thePfMETCollectionToken_ = consumes<reco::PFMETCollection>(
152  ps.getParameter<InputTag>("pfMETCollection"));
153  vertexToken_ =
154  consumes<reco::VertexCollection>(ps.getUntrackedParameter<InputTag>(
155  "vertexCollection", InputTag("offlinePrimaryVertices")));
156 
157  // just to initialize
158  isValidHltConfig_ = false;
159  // cuts:
160  ptThrMu1_ = ps.getUntrackedParameter<double>("PtThrMu1");
161  ptThrMu2_ = ps.getUntrackedParameter<double>("PtThrMu2");
162 
163  // cout<<"...leaving HiggsDQM::HiggsDQM. "<<endl;
164 }
165 //
166 // -- Destructor
167 //
169  // cout<<"Entering HiggsDQM::~HiggsDQM: "<<endl;
170 
171  edm::LogInfo("HiggsDQM") << " Deleting HiggsDQM "
172  << "\n";
173 
174  // cout<<"...leaving HiggsDQM::~HiggsDQM. "<<endl;
175 }
176 //
177 // -- Begin Job
178 //
180  // cout<<"Entering HiggsDQM::beginJob: "<<endl;
181 
182  nLumiSecs_ = 0;
183  nEvents_ = 0;
184  pi = 3.14159265;
185 
186  // cout<<"...leaving HiggsDQM::beginJob. "<<endl;
187 }
188 //
189 // -- Begin Run
190 //
191 void HiggsDQM::beginRun(Run const& run, edm::EventSetup const& eSetup) {
192  edm::LogInfo("HiggsDQM") << "[HiggsDQM]: Begining of Run";
193  // passed as parameter to HLTConfigProvider::init(), not yet used
194  bool isConfigChanged = false;
195 
196  // isValidHltConfig_ used to short-circuit analyze() in case of problems
197  // const std::string hltProcessName( "HLT" );
198  const std::string hltProcessName = theTriggerResultsCollectionTag_.process();
199  isValidHltConfig_ =
200  hltConfigProvider_.init(run, eSetup, hltProcessName, isConfigChanged);
201 }
202 //
203 // -- Begin Luminosity Block
204 //
206  edm::EventSetup const& context) {
207  // cout<<"Entering HiggsDQM::beginLuminosityBlock: "<<endl;
208 
209  edm::LogInfo("HiggsDQM") << "[HiggsDQM]: Begin of LS transition";
210 
211  // cout<<"...leaving HiggsDQM::beginLuminosityBlock. "<<endl;
212 }
213 //
214 // -- Book histograms
215 //
217  bei->cd();
218  bei->setCurrentFolder("Physics/Higgs");
219  h_vertex_number =
220  bei->book1D("h_vertex_number", "Number of event vertices in collection",
221  10, -0.5, 9.5);
222  h_vertex_chi2 = bei->book1D("h_vertex_chi2", "Event Vertex #chi^{2}/n.d.o.f.",
223  100, 0.0, 2.0);
224  h_vertex_numTrks = bei->book1D(
225  "h_vertex_numTrks", "Event Vertex, number of tracks", 100, -0.5, 99.5);
226  h_vertex_sumTrks = bei->book1D(
227  "h_vertex_sumTrks", "Event Vertex, sum of track pt", 100, 0.0, 100.0);
228  h_vertex_d0 = bei->book1D("h_vertex_d0", "Event Vertex d0", 100, -10.0, 10.0);
229  h_jet_et = bei->book1D("h_jet_et", "Jet with highest E_{T} (from " +
230  theCaloJetCollectionLabel_.label() +
231  ");E_{T}(1^{st} jet) (GeV)",
232  20, 0., 200.0);
233  h_jet2_et = bei->book1D("h_jet2_et", "Jet with 2^{nd} highest E_{T} (from " +
234  theCaloJetCollectionLabel_.label() +
235  ");E_{T}(2^{nd} jet) (GeV)",
236  20, 0., 200.0);
237  h_jet_count = bei->book1D("h_jet_count",
238  "Number of " + theCaloJetCollectionLabel_.label() +
239  " (E_{T} > 15 GeV);Number of Jets",
240  8, -0.5, 7.5);
241  h_caloMet = bei->book1D("h_caloMet", "Calo Missing E_{T}; GeV", 20, 0.0, 100);
242  h_caloMet_phi = bei->book1D(
243  "h_caloMet_phi", "Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5);
244  h_pfMet = bei->book1D("h_pfMet", "Pf Missing E_{T}; GeV", 20, 0.0, 100);
245  h_pfMet_phi = bei->book1D("h_pfMet_phi", "Pf Missing E_{T} #phi;#phi(MET)",
246  35, -3.5, 3.5);
247  h_eMultiplicity =
248  bei_->book1D("NElectrons", "# of electrons per event", 10, 0., 10.);
249  h_mMultiplicity = bei_->book1D("NMuons", "# of muons per event", 10, 0., 10.);
250  h_ePt = bei_->book1D("ElePt", "Pt of electrons", 50, 0., 100.);
251  h_eEta = bei_->book1D("EleEta", "Eta of electrons", 100, -5., 5.);
252  h_ePhi = bei_->book1D("ElePhi", "Phi of electrons", 100, -3.5, 3.5);
253  h_mPt_GMTM =
254  bei_->book1D("MuonPt_GMTM", "Pt of global+tracker muons", 50, 0., 100.);
255  h_mEta_GMTM =
256  bei_->book1D("MuonEta_GMTM", "Eta of global+tracker muons", 60, -3., 3.);
257  h_mPhi_GMTM = bei_->book1D("MuonPhi_GMTM", "Phi of global+tracker muons", 70,
258  -3.5, 3.5);
259  h_mPt_GMPT = bei_->book1D("MuonPt_GMPT", "Pt of global prompt-tight muons",
260  50, 0., 100.);
261  h_mEta_GMPT = bei_->book1D("MuonEta_GMPT", "Eta of global prompt-tight muons",
262  60, -3., 3.);
263  h_mPhi_GMPT = bei_->book1D("MuonPhi_GMPT", "Phi of global prompt-tight muons",
264  70, -3.5, 3.5);
265  h_mPt_GM = bei_->book1D("MuonPt_GM", "Pt of global muons", 50, 0., 100.);
266  h_mEta_GM = bei_->book1D("MuonEta_GM", "Eta of global muons", 60, -3., 3.);
267  h_mPhi_GM = bei_->book1D("MuonPhi_GM", "Phi of global muons", 70, -3.5, 3.5);
268  h_mPt_TM = bei_->book1D("MuonPt_TM", "Pt of tracker muons", 50, 0., 100.);
269  h_mEta_TM = bei_->book1D("MuonEta_TM", "Eta of tracker muons", 60, -3., 3.);
270  h_mPhi_TM = bei_->book1D("MuonPhi_TM", "Phi of tracker muons", 70, -3.5, 3.5);
271  h_mPt_STAM = bei_->book1D("MuonPt_STAM", "Pt of STA muons", 50, 0., 100.);
272  h_mEta_STAM = bei_->book1D("MuonEta_STAM", "Eta of STA muons", 60, -3., 3.);
273  h_mPhi_STAM = bei_->book1D("MuonPhi_STAM", "Phi of STA muons", 70, -3.5, 3.5);
274  h_eCombIso = bei_->book1D("EleCombIso", "CombIso of electrons", 100, 0., 10.);
275  h_mCombIso = bei_->book1D("MuonCombIso", "CombIso of muons", 100, 0., 10.);
276  h_dimumass_GMGM = bei->book1D("DimuMass_GMGM", "Invariant mass of GMGM pairs",
277  100, 0., 200.);
278  h_dimumass_GMTM = bei->book1D("DimuMass_GMTM", "Invariant mass of GMTM pairs",
279  100, 0., 200.);
280  h_dimumass_TMTM = bei->book1D("DimuMass_TMTM", "Invariant mass of TMTM pairs",
281  100, 0., 200.);
282  h_dielemass =
283  bei->book1D("DieleMass", "Invariant mass of EE pairs", 100, 0., 200.);
284  h_lepcounts = bei->book1D(
285  "LeptonCounts", "LeptonCounts for multi lepton events", 49, 0., 49.);
286 
287  bei->cd();
288 }
289 //
290 // -- Analyze
291 //
292 void HiggsDQM::analyze(const edm::Event& e, const edm::EventSetup& eSetup) {
293  // cout<<"[HiggsDQM::analyze()] "<<endl;
294 
295  //-------------------------------
296  //--- Trigger Info
297  //-------------------------------
298  // short-circuit if hlt problems
299  if (!isValidHltConfig_) return;
300  // Did it pass certain HLT path?
301  Handle<TriggerResults> HLTresults;
302  e.getByToken(theTriggerResultsCollection_, HLTresults);
303  if (!HLTresults.isValid()) return;
304  // unsigned int triggerIndex_elec =
305  // hltConfig.triggerIndex(theElecTriggerPathToPass);
306  // unsigned int triggerIndex_muon =
307  // hltConfig.triggerIndex(theMuonTriggerPathToPass);
308  bool passed_electron_HLT = true;
309  bool passed_muon_HLT = true;
310  // if (triggerIndex_elec < HLTresults->size()) passed_electron_HLT =
311  // HLTresults->accept(triggerIndex_elec);
312  // if (triggerIndex_muon < HLTresults->size()) passed_muon_HLT =
313  // HLTresults->accept(triggerIndex_muon);
314  // if ( !(passed_electron_HLT || passed_muon_HLT) ) return;
315 
316  //-------------------------------
317  //--- Vertex Info
318  //-------------------------------
319  Handle<VertexCollection> vertexHandle;
320  e.getByToken(vertexToken_, vertexHandle);
321  if (vertexHandle.isValid()) {
322  VertexCollection vertexCollection = *(vertexHandle.product());
323  int vertex_number = vertexCollection.size();
324  VertexCollection::const_iterator v = vertexCollection.begin();
325  double vertex_chi2 = v->normalizedChi2(); // v->chi2();
326  double vertex_d0 = sqrt(v->x() * v->x() + v->y() * v->y());
327  // double vertex_ndof = v->ndof();cout << "ndof="<<vertex_ndof<<endl;
328  double vertex_numTrks = v->tracksSize();
329  double vertex_sumTrks = 0.0;
330  for (Vertex::trackRef_iterator vertex_curTrack = v->tracks_begin();
331  vertex_curTrack != v->tracks_end(); vertex_curTrack++) {
332  vertex_sumTrks += (*vertex_curTrack)->pt();
333  }
334  h_vertex_number->Fill(vertex_number);
335  h_vertex_chi2->Fill(vertex_chi2);
336  h_vertex_d0->Fill(vertex_d0);
337  h_vertex_numTrks->Fill(vertex_numTrks);
338  h_vertex_sumTrks->Fill(vertex_sumTrks);
339  }
340 
341  //-------------------------------
342  //--- Electrons
343  //-------------------------------
344  float nEle = 0;
345  Handle<GsfElectronCollection> electronCollection;
346  e.getByToken(theElectronCollectionToken_, electronCollection);
347  if (electronCollection.isValid()) {
348  int posEle = 0, negEle = 0;
349  // If it passed electron HLT and the collection was found, find electrons
350  // near Z mass
351  if (passed_electron_HLT) {
352  for (reco::GsfElectronCollection::const_iterator recoElectron =
353  electronCollection->begin();
354  recoElectron != electronCollection->end(); recoElectron++) {
355  // cout << "Electron with pt= " << recoElectron->pt() << " and
356  // eta" << recoElectron->eta() << " p=" << recoElectron->p() << endl;
357  h_ePt->Fill(recoElectron->pt());
358  h_eEta->Fill(recoElectron->eta());
359  h_ePhi->Fill(recoElectron->phi());
360  if (recoElectron->charge() == 1) {
361  posEle++;
362  } else if (recoElectron->charge() == -1) {
363  negEle++;
364  }
365  // Require electron to pass some basic cuts
366  // if ( recoElectron->et() < 20 || fabs(recoElectron->eta())>2.5 )
367  // continue;
368  // Tighter electron cuts
369  // if ( recoElectron->deltaPhiSuperClusterTrackAtVtx() > 0.58 ||
370  // recoElectron->deltaEtaSuperClusterTrackAtVtx() > 0.01 ||
371  // recoElectron->sigmaIetaIeta() > 0.027 ) continue;
372  } // end of loop over electrons
373  } // end if passed HLT
374  nEle = posEle + negEle;
375  if (nEle > 9.) nEle = 9.;
376  h_eMultiplicity->Fill(nEle);
377 
378  // Z->ee:
379  unsigned int eleCollectionSize = electronCollection->size();
380  for (unsigned int i = 0; i < eleCollectionSize; i++) {
381  const GsfElectron& ele = electronCollection->at(i);
382  double pt = ele.pt();
383  if (pt > ptThrMu1_) {
384  for (unsigned int j = i + 1; j < eleCollectionSize; j++) {
385  const GsfElectron& ele2 = electronCollection->at(j);
386  double pt2 = ele2.pt();
387  if (pt2 > ptThrMu2_) {
388  const math::XYZTLorentzVector ZRecoEE(
389  ele.px() + ele2.px(), ele.py() + ele2.py(),
390  ele.pz() + ele2.pz(), ele.p() + ele2.p());
391  h_dielemass->Fill(ZRecoEE.mass());
392  }
393  }
394  }
395  }
396  }
397 
398  //-------------------------------
399  //--- Muons
400  //-------------------------------
401  float nMu = 0;
402  Handle<MuonCollection> muonCollection;
403  e.getByToken(theMuonCollectionToken_, muonCollection);
404  if (muonCollection.isValid()) {
405  // Find the highest pt muons
406  int posMu = 0, negMu = 0;
407  TLorentzVector m1, m2;
408  if (passed_muon_HLT) {
409  for (reco::MuonCollection::const_iterator recoMuon =
410  muonCollection->begin();
411  recoMuon != muonCollection->end(); recoMuon++) {
412  // cout << "Muon with pt= " << muIter->pt() << " and eta" <<
413  // muIter->eta() << " p=" << muIter->p() << endl;
414  if (recoMuon->isGlobalMuon() && recoMuon->isTrackerMuon()) {
415  h_mPt_GMTM->Fill(recoMuon->pt());
416  h_mEta_GMTM->Fill(recoMuon->eta());
417  h_mPhi_GMTM->Fill(recoMuon->phi());
418  } else if (recoMuon->isGlobalMuon() &&
419  (muon::isGoodMuon((*recoMuon),
421  h_mPt_GMPT->Fill(recoMuon->pt());
422  h_mEta_GMPT->Fill(recoMuon->eta());
423  h_mPhi_GMPT->Fill(recoMuon->phi());
424  } else if (recoMuon->isGlobalMuon()) {
425  h_mPt_GM->Fill(recoMuon->pt());
426  h_mEta_GM->Fill(recoMuon->eta());
427  h_mPhi_GM->Fill(recoMuon->phi());
428  } else if (recoMuon->isTrackerMuon() &&
431  h_mPt_TM->Fill(recoMuon->pt());
432  h_mEta_TM->Fill(recoMuon->eta());
433  h_mPhi_TM->Fill(recoMuon->phi());
434  } else if (recoMuon->isStandAloneMuon()) {
435  h_mPt_STAM->Fill(recoMuon->pt());
436  h_mEta_STAM->Fill(recoMuon->eta());
437  h_mPhi_STAM->Fill(recoMuon->phi());
438  }
439  if (recoMuon->charge() == 1) {
440  posMu++;
441  } else if (recoMuon->charge() == -1) {
442  negMu++;
443  }
444  }
445  nMu = posMu + negMu;
446  if (nMu > 9.) nMu = 9.;
447  h_mMultiplicity->Fill(nMu);
448  }
449 
450  // Z->mumu:
451  unsigned int muonCollectionSize = muonCollection->size();
452  for (unsigned int i = 0; i < muonCollectionSize; i++) {
453  const Muon& mu = muonCollection->at(i);
454  // if (!mu.isGlobalMuon()) continue;
455  double pt = mu.pt();
456  if (pt > ptThrMu1_) {
457  for (unsigned int j = i + 1; j < muonCollectionSize; j++) {
458  const Muon& mu2 = muonCollection->at(j);
459  double pt2 = mu2.pt();
460  if (pt2 > ptThrMu2_) {
461  // Glb + Glb
462  if (mu.isGlobalMuon() && mu2.isGlobalMuon()) {
463  const math::XYZTLorentzVector ZRecoGMGM(
464  mu.px() + mu2.px(), mu.py() + mu2.py(), mu.pz() + mu2.pz(),
465  mu.p() + mu2.p());
466  h_dimumass_GMGM->Fill(ZRecoGMGM.mass());
467  }
468  // Glb + TM
469  else if (mu.isGlobalMuon() && mu2.isTrackerMuon()) {
470  const math::XYZTLorentzVector ZRecoGMTM(
471  mu.px() + mu2.px(), mu.py() + mu2.py(), mu.pz() + mu2.pz(),
472  mu.p() + mu2.p());
473  h_dimumass_GMTM->Fill(ZRecoGMTM.mass());
474  }
475  // TM + TM
476  else if (mu.isTrackerMuon() && mu2.isTrackerMuon()) {
477  const math::XYZTLorentzVector ZRecoTMTM(
478  mu.px() + mu2.px(), mu.py() + mu2.py(), mu.pz() + mu2.pz(),
479  mu.p() + mu2.p());
480  h_dimumass_TMTM->Fill(ZRecoTMTM.mass());
481  }
482  }
483  }
484  }
485  }
486  }
487 
488  //-------------------------------
489  //--- Jets
490  //-------------------------------
491  Handle<CaloJetCollection> caloJetCollection;
492  e.getByToken(theCaloJetCollectionToken_, caloJetCollection);
493  if (caloJetCollection.isValid()) {
494  float jet_et = -8.0;
495  // float jet_eta = -8.0; // UNUSED
496  // float jet_phi = -8.0; // UNUSED
497  int jet_count = 0;
498  float jet2_et = -9.0;
499  // float jet2_eta = -9.0; // UNUSED
500  // float jet2_phi = -9.0; // UNUSED
501  for (CaloJetCollection::const_iterator i_calojet =
502  caloJetCollection->begin();
503  i_calojet != caloJetCollection->end(); i_calojet++) {
504  float jet_current_et = i_calojet->et();
505  // if it overlaps with electron, it is not a jet
506  // if ( electron_et>0.0 && fabs(i_calojet->eta()-electron_eta ) < 0.2 &&
507  // calcDeltaPhi(i_calojet->phi(), electron_phi ) < 0.2) continue;
508  // if ( electron2_et>0.0&& fabs(i_calojet->eta()-electron2_eta) < 0.2 &&
509  // calcDeltaPhi(i_calojet->phi(), electron2_phi) < 0.2) continue;
510  // if it has too low Et, throw away
511  if (jet_current_et < 15) continue;
512  jet_count++;
513  if (jet_current_et > jet_et) {
514  jet2_et = jet_et; // 2nd highest jet get's et from current highest
515  // jet2_eta = jet_eta; // UNUSED
516  // jet2_phi = jet_phi; // UNUSED
517  jet_et = i_calojet->et(); // current highest jet gets et from the new
518  // highest
519  // jet_eta = i_calojet->eta(); // UNUSED
520  // jet_phi = i_calojet->phi(); // UNUSED
521  } else if (jet_current_et > jet2_et) {
522  jet2_et = i_calojet->et();
523  // jet2_eta = i_calojet->eta(); // UNUSED
524  // jet2_phi = i_calojet->phi(); // UNUSED
525  }
526  }
527  if (jet_et > 0.0) {
528  h_jet_et->Fill(jet_et);
529  h_jet_count->Fill(jet_count);
530  }
531  }
532 
533  //-------------------------------
534  //--- MET
535  //-------------------------------
536  Handle<CaloMETCollection> caloMETCollection;
537  e.getByToken(theCaloMETCollectionToken_, caloMETCollection);
538  if (caloMETCollection.isValid()) {
539  float caloMet = caloMETCollection->begin()->et();
540  float caloMet_phi = caloMETCollection->begin()->phi();
541  h_caloMet->Fill(caloMet);
542  h_caloMet_phi->Fill(caloMet_phi);
543  }
544  Handle<PFMETCollection> pfMETCollection;
545  e.getByToken(thePfMETCollectionToken_, pfMETCollection);
546  if (pfMETCollection.isValid()) {
547  float pfMet = pfMETCollection->begin()->et();
548  float pfMet_phi = pfMETCollection->begin()->phi();
549  h_pfMet->Fill(pfMet);
550  h_pfMet_phi->Fill(pfMet_phi);
551  }
552 
553  //-------------------------------------
554  //--- Events with more than 2 leptons:
555  //-------------------------------------
556  if (nMu + nEle > 2 && nMu + nEle < 10) {
557  if (nMu == 0 && nEle == 3) h_lepcounts->Fill(0);
558  if (nMu == 0 && nEle == 4) h_lepcounts->Fill(1);
559  if (nMu == 0 && nEle == 5) h_lepcounts->Fill(2);
560  if (nMu == 0 && nEle == 6) h_lepcounts->Fill(3);
561  if (nMu == 0 && nEle == 7) h_lepcounts->Fill(4);
562  if (nMu == 0 && nEle == 8) h_lepcounts->Fill(5);
563  if (nMu == 0 && nEle == 9) h_lepcounts->Fill(6);
564  if (nMu == 1 && nEle == 2) h_lepcounts->Fill(7);
565  if (nMu == 1 && nEle == 3) h_lepcounts->Fill(8);
566  if (nMu == 1 && nEle == 4) h_lepcounts->Fill(9);
567  if (nMu == 1 && nEle == 5) h_lepcounts->Fill(10);
568  if (nMu == 1 && nEle == 6) h_lepcounts->Fill(11);
569  if (nMu == 1 && nEle == 7) h_lepcounts->Fill(12);
570  if (nMu == 1 && nEle == 8) h_lepcounts->Fill(13);
571  if (nMu == 2 && nEle == 1) h_lepcounts->Fill(14);
572  if (nMu == 2 && nEle == 2) h_lepcounts->Fill(15);
573  if (nMu == 2 && nEle == 3) h_lepcounts->Fill(16);
574  if (nMu == 2 && nEle == 4) h_lepcounts->Fill(17);
575  if (nMu == 2 && nEle == 5) h_lepcounts->Fill(18);
576  if (nMu == 2 && nEle == 6) h_lepcounts->Fill(19);
577  if (nMu == 2 && nEle == 7) h_lepcounts->Fill(20);
578  if (nMu == 3 && nEle == 0) h_lepcounts->Fill(21);
579  if (nMu == 3 && nEle == 1) h_lepcounts->Fill(22);
580  if (nMu == 3 && nEle == 2) h_lepcounts->Fill(23);
581  if (nMu == 3 && nEle == 3) h_lepcounts->Fill(24);
582  if (nMu == 3 && nEle == 4) h_lepcounts->Fill(25);
583  if (nMu == 3 && nEle == 5) h_lepcounts->Fill(26);
584  if (nMu == 3 && nEle == 6) h_lepcounts->Fill(27);
585  if (nMu == 4 && nEle == 0) h_lepcounts->Fill(28);
586  if (nMu == 4 && nEle == 1) h_lepcounts->Fill(29);
587  if (nMu == 4 && nEle == 2) h_lepcounts->Fill(30);
588  if (nMu == 4 && nEle == 3) h_lepcounts->Fill(31);
589  if (nMu == 4 && nEle == 4) h_lepcounts->Fill(32);
590  if (nMu == 4 && nEle == 5) h_lepcounts->Fill(33);
591  if (nMu == 5 && nEle == 0) h_lepcounts->Fill(34);
592  if (nMu == 5 && nEle == 1) h_lepcounts->Fill(35);
593  if (nMu == 5 && nEle == 2) h_lepcounts->Fill(36);
594  if (nMu == 5 && nEle == 3) h_lepcounts->Fill(37);
595  if (nMu == 5 && nEle == 4) h_lepcounts->Fill(38);
596  if (nMu == 6 && nEle == 0) h_lepcounts->Fill(39);
597  if (nMu == 6 && nEle == 1) h_lepcounts->Fill(40);
598  if (nMu == 6 && nEle == 2) h_lepcounts->Fill(41);
599  if (nMu == 6 && nEle == 3) h_lepcounts->Fill(42);
600  if (nMu == 7 && nEle == 0) h_lepcounts->Fill(43);
601  if (nMu == 7 && nEle == 1) h_lepcounts->Fill(44);
602  if (nMu == 7 && nEle == 2) h_lepcounts->Fill(45);
603  if (nMu == 8 && nEle == 0) h_lepcounts->Fill(46);
604  if (nMu == 8 && nEle == 1) h_lepcounts->Fill(47);
605  if (nMu == 9 && nEle == 0) h_lepcounts->Fill(48);
606  }
607  if ((nMu + nEle) >= 10)
608  LogDebug("HiggsDQM") << "WARNING: " << nMu + nEle
609  << " leptons in this event: run=" << e.id().run()
610  << ", event=" << e.id().event() << "\n";
611 }
612 //
613 // -- End Luminosity Block
614 //
616  edm::EventSetup const& eSetup) {
617  // cout<<"Entering HiggsDQM::endLuminosityBlock: "<<endl;
618 
619  edm::LogInfo("HiggsDQM") << "[HiggsDQM]: End of LS transition, performing "
620  "the DQM client operation";
621 
622  nLumiSecs_++;
623  // cout << "nLumiSecs_: "<< nLumiSecs_ << endl;
624 
625  edm::LogInfo("HiggsDQM")
626  << "====================================================== " << endl
627  << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock()
628  << endl
629  << "====================================================== " << endl;
630 
631  // cout<<"...leaving HiggsDQM::endLuminosityBlock. "<<endl;
632 }
633 //
634 // -- End Run
635 //
636 void HiggsDQM::endRun(edm::Run const& run, edm::EventSetup const& eSetup) {
637  // cout<<"Entering HiggsDQM::endRun: "<<endl;
638 
639  // edm::LogVerbatim ("HiggsDQM") <<"[HiggsDQM]: End of Run, saving DQM output
640  // ";
641  // int iRun = run.run();
642 
643  // cout<<"...leaving HiggsDQM::endRun. "<<endl;
644 }
645 
646 //
647 // -- End Job
648 //
650  // cout<<"In HiggsDQM::endJob "<<endl;
651  edm::LogInfo("HiggsDQM") << "[HiggsDQM]: endjob called!";
652 }
653 
654 // Local Variables:
655 // show-trailing-whitespace: t
656 // truncate-lines: t
657 // End:
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
Definition: HiggsDQM.cc:191
void endJob()
Definition: HiggsDQM.cc:649
virtual double p() const GCC11_FINAL
magnitude of momentum vector
tuple caloMet
____________________________________________________________________________||
Definition: CaloMET_cfi.py:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
bool isTrackerMuon() const
Definition: Muon.h:219
bool isGlobalMuon() const
Definition: Muon.h:218
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
virtual double pz() const GCC11_FINAL
z coordinate of momentum vector
tuple vertexCollection
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
Definition: HiggsDQM.cc:205
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
Definition: HiggsDQM.cc:636
void bookHistos()
Definition: Histogram.h:33
const Double_t pi
LuminosityBlockNumber_t luminosityBlock() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
virtual float pt() const =0
transverse momentum
T sqrt(T t)
Definition: SSEVec.h:48
tuple pfMet
____________________________________________________________________________||
Definition: PFMET_cfi.py:4
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
Definition: HiggsDQM.cc:292
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
int j
Definition: DBlmapReader.cc:9
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
const int mu
Definition: Constants.h:22
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
Definition: HiggsDQM.cc:615
double Distance(const reco::Candidate &c1, const reco::Candidate &c2)
Definition: HiggsDQM.cc:101
bool isValid() const
Definition: HandleBase.h:76
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
double calcDeltaPhi(double phi1, double phi2)
Definition: HiggsDQM.cc:112
double DistancePhi(const reco::Candidate &c1, const reco::Candidate &c2)
Definition: HiggsDQM.cc:106
T const * product() const
Definition: Handle.h:81
edm::EventID id() const
Definition: EventBase.h:56
HiggsDQM(const edm::ParameterSet &ps)
Definition: HiggsDQM.cc:124
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
virtual ~HiggsDQM()
Definition: HiggsDQM.cc:168
void bookHistos(DQMStore *bei)
Definition: HiggsDQM.cc:216
bool operator()(const Candidate &c1, const Candidate &c2) const
Definition: HiggsDQM.cc:96
virtual float pt() const GCC11_FINAL
transverse momentum
Definition: Run.h:41
void beginJob()
Definition: HiggsDQM.cc:179
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector