CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTHiggsHarvesting.cc
Go to the documentation of this file.
2 
4 {
5 
6  analysisName = iPSet.getUntrackedParameter<std::string>("analysisName");
7 
8 
9 }
10 
12 
14 {
15  return;
16 }
17 
19 {
20 
21 
22  //define type of sources :
23  std::vector<std::string> sources(2);
24  sources[0] = "gen";
25  sources[1] = "rec";
26  for(size_t i = 0; i < sources.size(); i++) {
27  // monitoring element numerator and denominator histogram
28  MonitorElement *meN =
29  iGetter.get("HLT/Higgs/"+analysisName+"/SummaryPaths_"+analysisName+"_"+sources[i]+"_passingHLT");
30  MonitorElement *meD =
31  iGetter.get("HLT/Higgs/"+analysisName+"/SummaryPaths_"+analysisName+"_"+sources[i]);
32 
33  if (meN && meD) {
34  // get the numerator and denominator histogram
35  TH1F *numerator = meN->getTH1F();
36  TH1F *denominator = meD->getTH1F();
37 
38  // set the current directory
39  iBooker.setCurrentFolder("HLT/Higgs/"+analysisName);
40 
41  // booked the new histogram to contain the results
42  TString nameEffHisto = "efficiencySummary_"+sources[i];
43  TH1F *efficiencySummary = (TH1F*) numerator->Clone(nameEffHisto);
44  std::string histoTitle = "efficiency of paths used in " + analysisName;
45  efficiencySummary->SetTitle(histoTitle.c_str());
46  MonitorElement *me = iBooker.book1D(nameEffHisto, efficiencySummary );
47 
48  // Calculate the efficiency
49  me->getTH1F()->Divide(numerator, denominator, 1., 1., "B");
50 
51  } else {
52  std::cout << "Monitor elements don't exist" << std::endl;
53  }
54  }
55 
56  return;
57 }
58 
60  const edm::EventSetup& iSetup)
61 {
62  return;
63 }
64 
66  const edm::EventSetup& iSetup)
67 {
68  return;
69 }
70 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual ~HiggsHarvesting()
list numerator
Definition: cuy.py:483
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:291
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
list denominator
Definition: cuy.py:484
std::string analysisName
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:112
HiggsHarvesting(const edm::ParameterSet &)
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
TH1F * getTH1F(void) const
virtual void beginJob()
tuple cout
Definition: gather_cfg.py:121
virtual void endRun(const edm::Run &, const edm::EventSetup &)
Definition: Run.h:41