CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMHcalIsoTrackPostProcessor.cc
Go to the documentation of this file.
8 
11 
12 #include <iostream>
13 #include <string.h>
14 #include <iomanip>
15 #include<fstream>
16 #include <math.h>
17 
18 
20  public:
23 
24 // void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override {};
25  virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; //performed in the endJob
26 
27  private:
28 
32 
33 };
34 
35 
37 {
38  subDir_ = pset.getUntrackedParameter<std::string>("subDir");
39  saveToFile_=pset.getParameter<bool>("saveToFile");
40  outputRootFileName_=pset.getParameter<std::string>("outputFile");
41 }
42 
43 
45 {
46 
47  if(igetter.dirExists(subDir_)) igetter.cd(subDir_);
48  else {
49  edm::LogWarning("DQMHcalIsoTrackPostProcessor") << "cannot find directory: " << subDir_ << " , skipping";
50  return;
51  }
52 
53  MonitorElement* hPurityEta=ibooker.book1D("hPurityEta","Purity of sample vs eta",16,-2,2);
54  MonitorElement* hPurityPhi=ibooker.book1D("hPurityPhi","Purity of sample vs phi",16,-3.2,3.2);
55 
56  MonitorElement* hSumOffEta=ibooker.book1D("hSumOffEta","hSumOffEta",16,-2,2);
57  MonitorElement* hSumOffPhi=ibooker.book1D("hSumOffPhi","hSumOffPhi",16,-3.2,3.2);
58 
59  MonitorElement* hSumL3Eta=ibooker.book1D("hSumL3Eta","hSumL3Eta",16,-2,2);
60  MonitorElement* hSumL3Phi=ibooker.book1D("hSumL3Phi","hSumL3Phi",16,-3.2,3.2);
61 
62  hSumOffEta->getTH1F()->Add(igetter.get(ibooker.pwd() + "/hOffEtaFP")->getTH1F(),1);
63  hSumOffPhi->getTH1F()->Add(igetter.get(ibooker.pwd() + "/hOffPhiFP")->getTH1F(),1);
64 
65  hSumL3Eta->getTH1F()->Add(igetter.get(ibooker.pwd() + "/hl3eta")->getTH1F(),1);
66  hSumL3Phi->getTH1F()->Add(igetter.get(ibooker.pwd() + "/hl3phi")->getTH1F(),1);
67 
68 
69  hSumOffEta->getTH1F()->TH1F::Sumw2();
70  hSumOffPhi->getTH1F()->TH1F::Sumw2();
71  hSumL3Eta->getTH1F()->TH1F::Sumw2();
72  hSumL3Phi->getTH1F()->TH1F::Sumw2();
73 
74  hPurityEta->getTH1F()->Divide(hSumOffEta->getTH1F(),hSumL3Eta->getTH1F(),1,1);
75  hPurityPhi->getTH1F()->Divide(hSumOffPhi->getTH1F(),hSumL3Phi->getTH1F(),1,1);
76 
77 // if (saveToFile_) igetter.save(outputRootFileName_);
78 }
79 
81 
82 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void cd(void)
Definition: DQMStore.cc:318
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:298
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
const std::string & pwd(void)
Definition: DQMStore.cc:282
DQMHcalIsoTrackPostProcessor(const edm::ParameterSet &pset)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
bool dirExists(const std::string &path)
Definition: DQMStore.cc:314
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
TH1F * getTH1F(void) const