CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
EventMonitor Class Reference

#include <monitor.h>

Public Member Functions

void count (HypothesisType type, const char *name, double weight=1.0)
 
 EventMonitor (DQMStore::IBooker &iBooker)
 

Public Attributes

std::map< std::string, int > binMap_
 
MonitorElementcutflowHist_ [4]
 

Detailed Description

Definition at line 14 of file monitor.h.

Constructor & Destructor Documentation

EventMonitor::EventMonitor ( DQMStore::IBooker iBooker)

Definition at line 4 of file monitor.cc.

References newFWLiteAna::bin, binMap_, DQMStore::IBooker::book1D(), cutflowHist_, edm::hlt::Exception, i, cmsHarvester::index, mergeVDriftHistosByStation::name, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

5 {
6  auto addFunc = [&](std::string name) {
7  auto bin = binMap_.find(name);
8  if (bin == binMap_.end()) {
9  int index = binMap_.size();
10  binMap_[name] = index + 1;
11  } else {
12  throw cms::Exception("counterAlreadyExists") << "Name: " << name;
13  }
14  };
15 
16  addFunc("total events" );
17  addFunc("baseline" );
18  addFunc("opposite sign" );
19  addFunc("full lepton selection" );
20  addFunc("extra lepton veto" );
21  addFunc("met > 20 GeV" );
22  addFunc("mll > 12 GeV" );
23  addFunc("|mll - mZ| > 15 GeV" );
24  addFunc("minMET > 20 GeV" );
25  addFunc("minMET > 40 GeV for ee/mm" );
26  addFunc("dPhiDiLepJet < 165 dg for ee/mm" );
27  addFunc("SoftMuons==0" );
28  addFunc("top veto" );
29  addFunc("ptll > 45 GeV" );
30  addFunc("njets == 0" );
31  addFunc("max(lep1.pt(),lep2.pt())>30" );
32  addFunc("min(lep1.pt(),lep2.pt())>25" );
33  addFunc("njets == 1" );
34  addFunc("njets == 2 or 3" );
35  addFunc("abs(jet1.eta())<4.7 && abs(jet2.eta())<4.7");
36  addFunc("no central jets" );
37 
38  int maxBin = binMap_.size();
39  iBooker.setCurrentFolder("PhysicsHWW");
40  cutflowHist_[0] = iBooker.book1D("cutflow_mm", "HWW cutflow mm", maxBin, 0, maxBin);
41  cutflowHist_[1] = iBooker.book1D("cutflow_ee", "HWW cutflow ee", maxBin, 0, maxBin);
42  cutflowHist_[2] = iBooker.book1D("cutflow_em", "HWW cutflow em", maxBin, 0, maxBin);
43  cutflowHist_[3] = iBooker.book1D("cutflow_me", "HWW cutflow me", maxBin, 0, maxBin);
44 
45  for (auto it = binMap_.begin(); it != binMap_.end(); ++it) {
46  for (int i = 0; i < 4; ++i) {
47  cutflowHist_[i]->setBinContent(it->second, 0);
48  cutflowHist_[i]->setBinLabel(it->second, it->first.c_str(), 1);
49  }
50  }
51 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * cutflowHist_[4]
Definition: monitor.h:21
void setBinContent(int binx, double content)
set content of bin (1-D)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::map< std::string, int > binMap_
Definition: monitor.h:20

Member Function Documentation

void EventMonitor::count ( HypothesisType  type,
const char *  name,
double  weight = 1.0 
)

Definition at line 53 of file monitor.cc.

References newFWLiteAna::bin, binMap_, cutflowHist_, edm::hlt::Exception, MonitorElement::Fill(), and mergeVDriftHistosByStation::name.

Referenced by HWWFunctions::doCutFlow().

53  {
54  auto bin = binMap_.find(name);
55  if (bin != binMap_.end()) {
56  cutflowHist_[type]->Fill(bin->second);
57  } else {
58  throw cms::Exception("counterNotFound") << "Name: " << name;
59  }
60 }
type
Definition: HCALResponse.h:21
MonitorElement * cutflowHist_[4]
Definition: monitor.h:21
void Fill(long long x)
std::map< std::string, int > binMap_
Definition: monitor.h:20

Member Data Documentation

std::map<std::string, int> EventMonitor::binMap_

Definition at line 20 of file monitor.h.

Referenced by count(), and EventMonitor().

MonitorElement* EventMonitor::cutflowHist_[4]

Definition at line 21 of file monitor.h.

Referenced by count(), and EventMonitor().