CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DQMHcalIsoTrackPostProcessor Class Reference
Inheritance diagram for DQMHcalIsoTrackPostProcessor:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup)
 
 DQMHcalIsoTrackPostProcessor (const edm::ParameterSet &pset)
 
void endJob ()
 
void endRun (edm::Run const &, edm::EventSetup const &)
 
 ~DQMHcalIsoTrackPostProcessor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

std::string outputRootFileName_
 
bool saveToFile_
 
std::string subDir_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 16 of file DQMHcalIsoTrackPostProcessor.cc.

Constructor & Destructor Documentation

DQMHcalIsoTrackPostProcessor::DQMHcalIsoTrackPostProcessor ( const edm::ParameterSet pset)

Definition at line 34 of file DQMHcalIsoTrackPostProcessor.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputRootFileName_, saveToFile_, and subDir_.

35 {
36  subDir_ = pset.getUntrackedParameter<std::string>("subDir");
37  saveToFile_=pset.getParameter<bool>("saveToFile");
38  outputRootFileName_=pset.getParameter<std::string>("outputFile");
39 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DQMHcalIsoTrackPostProcessor::~DQMHcalIsoTrackPostProcessor ( )
inline

Definition at line 19 of file DQMHcalIsoTrackPostProcessor.cc.

19 {};

Member Function Documentation

void DQMHcalIsoTrackPostProcessor::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 21 of file DQMHcalIsoTrackPostProcessor.cc.

21 {};
void DQMHcalIsoTrackPostProcessor::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file DQMHcalIsoTrackPostProcessor.cc.

References DQMStore::book1D(), DQMStore::cd(), gather_cfg::cout, DQMStore::dirExists(), DQMStore::get(), getTH1F(), MonitorElement::getTH1F(), cppFunctionSkipper::operator, outputRootFileName_, DQMStore::pwd(), DQMStore::save(), saveToFile_, and subDir_.

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 
88  if (saveToFile_) dqm->save(outputRootFileName_);
89 }
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:121
void DQMHcalIsoTrackPostProcessor::endRun ( edm::Run const &  run,
edm::EventSetup const &  es 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file DQMHcalIsoTrackPostProcessor.cc.

42 {
43 }

Member Data Documentation

std::string DQMHcalIsoTrackPostProcessor::outputRootFileName_
private

Definition at line 29 of file DQMHcalIsoTrackPostProcessor.cc.

Referenced by DQMHcalIsoTrackPostProcessor(), and endJob().

bool DQMHcalIsoTrackPostProcessor::saveToFile_
private

Definition at line 28 of file DQMHcalIsoTrackPostProcessor.cc.

Referenced by DQMHcalIsoTrackPostProcessor(), and endJob().

std::string DQMHcalIsoTrackPostProcessor::subDir_
private

Definition at line 27 of file DQMHcalIsoTrackPostProcessor.cc.

Referenced by DQMHcalIsoTrackPostProcessor(), and endJob().