CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EwkDQM Class Reference

#include <EwkDQM.h>

Inheritance diagram for EwkDQM:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 Get the analysis. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
double calcDeltaPhi (double phi1, double phi2)
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
 EwkDQM (const edm::ParameterSet &)
 Constructor. More...
 
 ~EwkDQM () override
 Destructor. More...
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Attributes

double eJetMin_
 
MonitorElementh_e1_et
 
MonitorElementh_e1_eta
 
MonitorElementh_e1_phi
 
MonitorElementh_e2_et
 
MonitorElementh_e2_eta
 
MonitorElementh_e2_phi
 
MonitorElementh_e_invWMass
 
MonitorElementh_ee_invMass
 
MonitorElementh_jet2_et
 
MonitorElementh_jet2_eta
 
MonitorElementh_jet2_phi
 
MonitorElementh_jet_count
 
MonitorElementh_jet_et
 
MonitorElementh_jet_eta
 
MonitorElementh_jet_phi
 
MonitorElementh_jet_pt
 
MonitorElementh_m1_eta
 
MonitorElementh_m1_phi
 
MonitorElementh_m1_pt
 
MonitorElementh_m2_eta
 
MonitorElementh_m2_phi
 
MonitorElementh_m2_pt
 
MonitorElementh_m_invWMass
 
MonitorElementh_met
 
MonitorElementh_met_phi
 
MonitorElementh_mumu_invMass
 
MonitorElementh_vertex_chi2
 
MonitorElementh_vertex_d0
 
MonitorElementh_vertex_number
 
MonitorElementh_vertex_numTrks
 
MonitorElementh_vertex_sumTrks
 
HLTConfigProvider hltConfigProvider_
 
bool isValidHltConfig_
 
std::string logTraceName
 
edm::InputTag theCaloMETCollectionLabel_
 
edm::EDGetTokenT< edm::View< reco::MET > > theCaloMETCollectionToken_
 
std::vector< std::string > theElecTriggerPathToPass_
 
edm::EDGetTokenT< reco::GsfElectronCollectiontheElectronCollectionLabel_
 
edm::EDGetTokenT< reco::MuonCollectiontheMuonCollectionLabel_
 
std::vector< std::string > theMuonTriggerPathToPass_
 
edm::InputTag thePFJetCollectionLabel_
 
edm::EDGetTokenT< edm::View< reco::Jet > > thePFJetCollectionToken_
 
edm::InputTag theTriggerResultsCollection_
 
edm::EDGetTokenT< edm::TriggerResultstheTriggerResultsToken_
 
edm::EDGetTokenT< reco::VertexCollectiontheVertexToken_
 

Detailed Description

DQM offline for SMP V+Jets

Author
Valentina Gori, University of Firenze

Definition at line 30 of file EwkDQM.h.

Constructor & Destructor Documentation

EwkDQM::EwkDQM ( const edm::ParameterSet parameters)

Constructor.

Definition at line 44 of file EwkDQM.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

44  {
45  eJetMin_ = parameters.getUntrackedParameter<double>("EJetMin", 999999.);
46 
47  // riguardare questa sintassi
48  // Get parameters from configuration file
50  parameters.getParameter<InputTag>("PFJetCollection");
52  parameters.getParameter<InputTag>("caloMETCollection");
54  parameters.getParameter<InputTag>("triggerResultsCollection");
55 
57  parameters.getParameter<std::vector<string> >("elecTriggerPathToPass");
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 }
MonitorElement * h_e1_phi
Definition: EwkDQM.h:95
MonitorElement * h_vertex_d0
Definition: EwkDQM.h:78
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > theMuonTriggerPathToPass_
Definition: EwkDQM.h:60
edm::EDGetTokenT< edm::View< reco::Jet > > thePFJetCollectionToken_
Definition: EwkDQM.h:67
MonitorElement * h_jet2_phi
Definition: EwkDQM.h:89
MonitorElement * h_m1_phi
Definition: EwkDQM.h:102
MonitorElement * h_m_invWMass
Definition: EwkDQM.h:113
edm::EDGetTokenT< edm::TriggerResults > theTriggerResultsToken_
Definition: EwkDQM.h:64
MonitorElement * h_e1_eta
Definition: EwkDQM.h:93
MonitorElement * h_vertex_numTrks
Definition: EwkDQM.h:76
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
Definition: EwkDQM.h:65
MonitorElement * h_m1_pt
Definition: EwkDQM.h:98
edm::InputTag thePFJetCollectionLabel_
Definition: EwkDQM.h:61
MonitorElement * h_mumu_invMass
Definition: EwkDQM.h:114
bool isValidHltConfig_
Definition: EwkDQM.h:56
MonitorElement * h_jet_eta
Definition: EwkDQM.h:83
MonitorElement * h_jet_phi
Definition: EwkDQM.h:84
MonitorElement * h_e2_eta
Definition: EwkDQM.h:94
MonitorElement * h_m2_phi
Definition: EwkDQM.h:103
MonitorElement * h_e_invWMass
Definition: EwkDQM.h:112
std::vector< std::string > theElecTriggerPathToPass_
Definition: EwkDQM.h:59
edm::InputTag theCaloMETCollectionLabel_
Definition: EwkDQM.h:62
MonitorElement * h_vertex_sumTrks
Definition: EwkDQM.h:77
MonitorElement * h_e2_et
Definition: EwkDQM.h:92
MonitorElement * h_m1_eta
Definition: EwkDQM.h:100
MonitorElement * h_m2_eta
Definition: EwkDQM.h:101
edm::EDGetTokenT< edm::View< reco::MET > > theCaloMETCollectionToken_
Definition: EwkDQM.h:68
MonitorElement * h_vertex_chi2
Definition: EwkDQM.h:75
double eJetMin_
Definition: EwkDQM.h:71
MonitorElement * h_ee_invMass
Definition: EwkDQM.h:115
MonitorElement * h_e2_phi
Definition: EwkDQM.h:96
MonitorElement * h_met
Definition: EwkDQM.h:109
MonitorElement * h_e1_et
Definition: EwkDQM.h:91
MonitorElement * h_jet_et
Definition: EwkDQM.h:81
edm::InputTag theTriggerResultsCollection_
Definition: EwkDQM.h:63
edm::EDGetTokenT< reco::GsfElectronCollection > theElectronCollectionLabel_
Definition: EwkDQM.h:66
MonitorElement * h_met_phi
Definition: EwkDQM.h:110
MonitorElement * h_jet_pt
Definition: EwkDQM.h:82
MonitorElement * h_vertex_number
Definition: EwkDQM.h:74
edm::EDGetTokenT< reco::VertexCollection > theVertexToken_
Definition: EwkDQM.h:69
MonitorElement * h_m2_pt
Definition: EwkDQM.h:99
MonitorElement * h_jet_count
Definition: EwkDQM.h:80
MonitorElement * h_jet2_et
Definition: EwkDQM.h:86
MonitorElement * h_jet2_eta
Definition: EwkDQM.h:88
EwkDQM::~EwkDQM ( )
override

Destructor.

Definition at line 120 of file EwkDQM.cc.

120 {}

Member Function Documentation

void EwkDQM::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Get the analysis.

Definition at line 230 of file EwkDQM.cc.

References edm::HLTGlobalStatus::accept(), calcDeltaPhi(), funct::cos(), SoftLeptonByDistance_cfi::distance, ElectronMcFakeValidator_cfi::electronCollection, reco::LeafCandidate::et(), reco::LeafCandidate::eta(), edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), metsig::jet, LogTrace, RPCpg::mu, HiRecoMuon_cff::muonCollection, reco::LeafCandidate::phi(), Geom::pi(), edm::Handle< T >::product(), reco::LeafCandidate::pt(), edm::HLTGlobalStatus::size(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, edm::TriggerNames::triggerName(), edm::Event::triggerNames(), trigNames, findQualityFiles::v, and particleFlowSuperClusterECAL_cfi::vertexCollection.

230  {
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 }
MonitorElement * h_e1_phi
Definition: EwkDQM.h:95
MonitorElement * h_vertex_d0
Definition: EwkDQM.h:78
std::vector< std::string > theMuonTriggerPathToPass_
Definition: EwkDQM.h:60
double eta() const final
momentum pseudorapidity
edm::EDGetTokenT< edm::View< reco::Jet > > thePFJetCollectionToken_
Definition: EwkDQM.h:67
MonitorElement * h_jet2_phi
Definition: EwkDQM.h:89
MonitorElement * h_m1_phi
Definition: EwkDQM.h:102
MonitorElement * h_m_invWMass
Definition: EwkDQM.h:113
edm::EDGetTokenT< edm::TriggerResults > theTriggerResultsToken_
Definition: EwkDQM.h:64
MonitorElement * h_e1_eta
Definition: EwkDQM.h:93
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
MonitorElement * h_vertex_numTrks
Definition: EwkDQM.h:76
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
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
Definition: EwkDQM.h:65
MonitorElement * h_m1_pt
Definition: EwkDQM.h:98
MonitorElement * h_mumu_invMass
Definition: EwkDQM.h:114
bool isValidHltConfig_
Definition: EwkDQM.h:56
MonitorElement * h_jet_eta
Definition: EwkDQM.h:83
MonitorElement * h_jet_phi
Definition: EwkDQM.h:84
void Fill(long long x)
MonitorElement * h_e2_eta
Definition: EwkDQM.h:94
MonitorElement * h_m2_phi
Definition: EwkDQM.h:103
MonitorElement * h_e_invWMass
Definition: EwkDQM.h:112
std::vector< std::string > theElecTriggerPathToPass_
Definition: EwkDQM.h:59
MonitorElement * h_vertex_sumTrks
Definition: EwkDQM.h:77
Definition: Muon.py:1
Definition: Jet.py:1
double et() const final
transverse energy
T sqrt(T t)
Definition: SSEVec.h:18
unsigned int size() const
Get number of paths stored.
std::string logTraceName
Definition: EwkDQM.h:53
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
MonitorElement * h_e2_et
Definition: EwkDQM.h:92
MonitorElement * h_m1_eta
Definition: EwkDQM.h:100
const int mu
Definition: Constants.h:22
MonitorElement * h_m2_eta
Definition: EwkDQM.h:101
bool isValid() const
Definition: HandleBase.h:74
#define LogTrace(id)
edm::EDGetTokenT< edm::View< reco::MET > > theCaloMETCollectionToken_
Definition: EwkDQM.h:68
MonitorElement * h_vertex_chi2
Definition: EwkDQM.h:75
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
double eJetMin_
Definition: EwkDQM.h:71
MonitorElement * h_ee_invMass
Definition: EwkDQM.h:115
T const * product() const
Definition: Handle.h:74
MonitorElement * h_e2_phi
Definition: EwkDQM.h:96
MonitorElement * h_met
Definition: EwkDQM.h:109
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:22
MonitorElement * h_e1_et
Definition: EwkDQM.h:91
MonitorElement * h_jet_et
Definition: EwkDQM.h:81
std::vector< PFJet > PFJetCollection
collection of PFJet objects
edm::EDGetTokenT< reco::GsfElectronCollection > theElectronCollectionLabel_
Definition: EwkDQM.h:66
MonitorElement * h_met_phi
Definition: EwkDQM.h:110
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:37
MonitorElement * h_jet_pt
Definition: EwkDQM.h:82
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkDQM.cc:627
MonitorElement * h_vertex_number
Definition: EwkDQM.h:74
edm::EDGetTokenT< reco::VertexCollection > theVertexToken_
Definition: EwkDQM.h:69
MonitorElement * h_m2_pt
Definition: EwkDQM.h:99
MonitorElement * h_jet_count
Definition: EwkDQM.h:80
MonitorElement * h_jet2_et
Definition: EwkDQM.h:86
MonitorElement * h_jet2_eta
Definition: EwkDQM.h:88
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:256
void EwkDQM::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 122 of file EwkDQM.cc.

References DQMStore::IBooker::book1D(), LogTrace, pi, and DQMStore::IBooker::setCurrentFolder().

123  {
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)",
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)",
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)",
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)",
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)",
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)",
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)",
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",
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 }
MonitorElement * h_e1_phi
Definition: EwkDQM.h:95
MonitorElement * h_vertex_d0
Definition: EwkDQM.h:78
MonitorElement * h_jet2_phi
Definition: EwkDQM.h:89
MonitorElement * h_m1_phi
Definition: EwkDQM.h:102
MonitorElement * h_m_invWMass
Definition: EwkDQM.h:113
MonitorElement * h_e1_eta
Definition: EwkDQM.h:93
MonitorElement * h_vertex_numTrks
Definition: EwkDQM.h:76
MonitorElement * h_m1_pt
Definition: EwkDQM.h:98
edm::InputTag thePFJetCollectionLabel_
Definition: EwkDQM.h:61
MonitorElement * h_mumu_invMass
Definition: EwkDQM.h:114
MonitorElement * h_jet_eta
Definition: EwkDQM.h:83
MonitorElement * h_jet_phi
Definition: EwkDQM.h:84
const Double_t pi
MonitorElement * h_e2_eta
Definition: EwkDQM.h:94
MonitorElement * h_m2_phi
Definition: EwkDQM.h:103
MonitorElement * h_e_invWMass
Definition: EwkDQM.h:112
edm::InputTag theCaloMETCollectionLabel_
Definition: EwkDQM.h:62
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * h_vertex_sumTrks
Definition: EwkDQM.h:77
std::string logTraceName
Definition: EwkDQM.h:53
MonitorElement * h_e2_et
Definition: EwkDQM.h:92
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * h_m1_eta
Definition: EwkDQM.h:100
MonitorElement * h_m2_eta
Definition: EwkDQM.h:101
#define LogTrace(id)
MonitorElement * h_vertex_chi2
Definition: EwkDQM.h:75
MonitorElement * h_ee_invMass
Definition: EwkDQM.h:115
MonitorElement * h_e2_phi
Definition: EwkDQM.h:96
MonitorElement * h_met
Definition: EwkDQM.h:109
MonitorElement * h_e1_et
Definition: EwkDQM.h:91
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * h_jet_et
Definition: EwkDQM.h:81
MonitorElement * h_met_phi
Definition: EwkDQM.h:110
MonitorElement * h_jet_pt
Definition: EwkDQM.h:82
MonitorElement * h_vertex_number
Definition: EwkDQM.h:74
MonitorElement * h_m2_pt
Definition: EwkDQM.h:99
MonitorElement * h_jet_count
Definition: EwkDQM.h:80
MonitorElement * h_jet2_et
Definition: EwkDQM.h:86
MonitorElement * h_jet2_eta
Definition: EwkDQM.h:88
double EwkDQM::calcDeltaPhi ( double  phi1,
double  phi2 
)

Definition at line 627 of file EwkDQM.cc.

References hiPixelPairStep_cff::deltaPhi.

627  {
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 }
void EwkDQM::dqmBeginRun ( const edm::Run theRun,
const edm::EventSetup theSetup 
)
override

Definition at line 220 of file EwkDQM.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

220  {
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 }
bool isValidHltConfig_
Definition: EwkDQM.h:56
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
edm::InputTag theTriggerResultsCollection_
Definition: EwkDQM.h:63
std::string const & process() const
Definition: InputTag.h:40
HLTConfigProvider hltConfigProvider_
Definition: EwkDQM.h:55

Member Data Documentation

double EwkDQM::eJetMin_
private

Definition at line 71 of file EwkDQM.h.

MonitorElement* EwkDQM::h_e1_et
private

Definition at line 91 of file EwkDQM.h.

MonitorElement* EwkDQM::h_e1_eta
private

Definition at line 93 of file EwkDQM.h.

MonitorElement* EwkDQM::h_e1_phi
private

Definition at line 95 of file EwkDQM.h.

MonitorElement* EwkDQM::h_e2_et
private

Definition at line 92 of file EwkDQM.h.

MonitorElement* EwkDQM::h_e2_eta
private

Definition at line 94 of file EwkDQM.h.

MonitorElement* EwkDQM::h_e2_phi
private

Definition at line 96 of file EwkDQM.h.

MonitorElement* EwkDQM::h_e_invWMass
private

Definition at line 112 of file EwkDQM.h.

MonitorElement* EwkDQM::h_ee_invMass
private

Definition at line 115 of file EwkDQM.h.

MonitorElement* EwkDQM::h_jet2_et
private

Definition at line 86 of file EwkDQM.h.

MonitorElement* EwkDQM::h_jet2_eta
private

Definition at line 88 of file EwkDQM.h.

MonitorElement* EwkDQM::h_jet2_phi
private

Definition at line 89 of file EwkDQM.h.

MonitorElement* EwkDQM::h_jet_count
private

Definition at line 80 of file EwkDQM.h.

MonitorElement* EwkDQM::h_jet_et
private

Definition at line 81 of file EwkDQM.h.

MonitorElement* EwkDQM::h_jet_eta
private

Definition at line 83 of file EwkDQM.h.

MonitorElement* EwkDQM::h_jet_phi
private

Definition at line 84 of file EwkDQM.h.

MonitorElement* EwkDQM::h_jet_pt
private

Definition at line 82 of file EwkDQM.h.

MonitorElement* EwkDQM::h_m1_eta
private

Definition at line 100 of file EwkDQM.h.

MonitorElement* EwkDQM::h_m1_phi
private

Definition at line 102 of file EwkDQM.h.

MonitorElement* EwkDQM::h_m1_pt
private

Definition at line 98 of file EwkDQM.h.

MonitorElement* EwkDQM::h_m2_eta
private

Definition at line 101 of file EwkDQM.h.

MonitorElement* EwkDQM::h_m2_phi
private

Definition at line 103 of file EwkDQM.h.

MonitorElement* EwkDQM::h_m2_pt
private

Definition at line 99 of file EwkDQM.h.

MonitorElement* EwkDQM::h_m_invWMass
private

Definition at line 113 of file EwkDQM.h.

MonitorElement* EwkDQM::h_met
private

Definition at line 109 of file EwkDQM.h.

MonitorElement* EwkDQM::h_met_phi
private

Definition at line 110 of file EwkDQM.h.

MonitorElement* EwkDQM::h_mumu_invMass
private

Definition at line 114 of file EwkDQM.h.

MonitorElement* EwkDQM::h_vertex_chi2
private

Definition at line 75 of file EwkDQM.h.

MonitorElement* EwkDQM::h_vertex_d0
private

Definition at line 78 of file EwkDQM.h.

MonitorElement* EwkDQM::h_vertex_number
private

Definition at line 74 of file EwkDQM.h.

MonitorElement* EwkDQM::h_vertex_numTrks
private

Definition at line 76 of file EwkDQM.h.

MonitorElement* EwkDQM::h_vertex_sumTrks
private

Definition at line 77 of file EwkDQM.h.

HLTConfigProvider EwkDQM::hltConfigProvider_
private

Definition at line 55 of file EwkDQM.h.

bool EwkDQM::isValidHltConfig_
private

Definition at line 56 of file EwkDQM.h.

std::string EwkDQM::logTraceName
private

Definition at line 53 of file EwkDQM.h.

edm::InputTag EwkDQM::theCaloMETCollectionLabel_
private

Definition at line 62 of file EwkDQM.h.

edm::EDGetTokenT<edm::View<reco::MET> > EwkDQM::theCaloMETCollectionToken_
private

Definition at line 68 of file EwkDQM.h.

std::vector<std::string> EwkDQM::theElecTriggerPathToPass_
private

Definition at line 59 of file EwkDQM.h.

edm::EDGetTokenT<reco::GsfElectronCollection> EwkDQM::theElectronCollectionLabel_
private

Definition at line 66 of file EwkDQM.h.

edm::EDGetTokenT<reco::MuonCollection> EwkDQM::theMuonCollectionLabel_
private

Definition at line 65 of file EwkDQM.h.

std::vector<std::string> EwkDQM::theMuonTriggerPathToPass_
private

Definition at line 60 of file EwkDQM.h.

edm::InputTag EwkDQM::thePFJetCollectionLabel_
private

Definition at line 61 of file EwkDQM.h.

edm::EDGetTokenT<edm::View<reco::Jet> > EwkDQM::thePFJetCollectionToken_
private

Definition at line 67 of file EwkDQM.h.

edm::InputTag EwkDQM::theTriggerResultsCollection_
private

Definition at line 63 of file EwkDQM.h.

edm::EDGetTokenT<edm::TriggerResults> EwkDQM::theTriggerResultsToken_
private

Definition at line 64 of file EwkDQM.h.

edm::EDGetTokenT<reco::VertexCollection> EwkDQM::theVertexToken_
private

Definition at line 69 of file EwkDQM.h.