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.
5 
8 
9 #include <iostream>
10 #include <string.h>
11 #include <iomanip>
12 #include<fstream>
13 #include <math.h>
14 
15 
17  public:
20 
21  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) {};
22  void endRun(edm::Run const&, edm::EventSetup const&);
23  void endJob();
24 
25  private:
26 
30 
31 };
32 
33 
35 {
36  subDir_ = pset.getUntrackedParameter<std::string>("subDir");
37  saveToFile_=pset.getParameter<bool>("saveToFile");
38  outputRootFileName_=pset.getParameter<std::string>("outputFile");
39 }
40 
42 {
43 }
44 
46 {
47 
48  DQMStore* dqm;
49  dqm = 0;
50  dqm = edm::Service<DQMStore>().operator->();
51 
52  if ( ! dqm ) {
53  edm::LogInfo("DQMHcalIsoTrackPostProcessor") << "Cannot create DQMStore instance\n";
54  return;
55  }
56 
57  std::cout<<"endjob"<<std::endl;
58  if(dqm->dirExists(subDir_)) dqm->cd(subDir_);
59  else {
60  edm::LogWarning("DQMHcalIsoTrackPostProcessor") << "cannot find directory: " << subDir_ << " , skipping";
61  return;
62  }
63 
64  MonitorElement* hPurityEta=dqm->book1D("hPurityEta","Purity of sample vs eta",16,-2,2);
65  MonitorElement* hPurityPhi=dqm->book1D("hPurityPhi","Purity of sample vs phi",16,-3.2,3.2);
66 
67  MonitorElement* hSumOffEta=dqm->book1D("hSumOffEta","hSumOffEta",16,-2,2);
68  MonitorElement* hSumOffPhi=dqm->book1D("hSumOffPhi","hSumOffPhi",16,-3.2,3.2);
69 
70  MonitorElement* hSumL3Eta=dqm->book1D("hSumL3Eta","hSumL3Eta",16,-2,2);
71  MonitorElement* hSumL3Phi=dqm->book1D("hSumL3Phi","hSumL3Phi",16,-3.2,3.2);
72 
73  hSumOffEta->getTH1F()->Add(dqm->get(dqm->pwd() + "/hOffEtaFP")->getTH1F(),1);
74  hSumOffPhi->getTH1F()->Add(dqm->get(dqm->pwd() + "/hOffPhiFP")->getTH1F(),1);
75 
76  hSumL3Eta->getTH1F()->Add(dqm->get(dqm->pwd() + "/hl3eta")->getTH1F(),1);
77  hSumL3Phi->getTH1F()->Add(dqm->get(dqm->pwd() + "/hl3phi")->getTH1F(),1);
78 
79 
80  hSumOffEta->getTH1F()->TH1F::Sumw2();
81  hSumOffPhi->getTH1F()->TH1F::Sumw2();
82  hSumL3Eta->getTH1F()->TH1F::Sumw2();
83  hSumL3Phi->getTH1F()->TH1F::Sumw2();
84 
85  hPurityEta->getTH1F()->Divide(hSumOffEta->getTH1F(),hSumL3Eta->getTH1F(),1,1);
86  hPurityPhi->getTH1F()->Divide(hSumOffPhi->getTH1F(),hSumL3Phi->getTH1F(),1,1);
87 
89 }
90 
92 
93 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:411
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
DQMHcalIsoTrackPostProcessor(const edm::ParameterSet &pset)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
void endRun(edm::Run const &, edm::EventSetup const &)
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:498
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:121
Definition: Run.h:36
const std::string & pwd(void) const
Definition: DQMStore.cc:406