test
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) override {};
22  void endRun(edm::Run const&, edm::EventSetup const&) override;
23  void endJob() override;
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:954
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:644
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
DQMHcalIsoTrackPostProcessor(const edm::ParameterSet &pset)
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:1708
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
void endRun(edm::Run const &, edm::EventSetup const &) override
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:732
TH1F * getTH1F(void) const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2540
tuple cout
Definition: gather_cfg.py:121
Definition: Run.h:41
const std::string & pwd(void) const
Definition: DQMStore.cc:639