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