CMS 3D CMS Logo

HarvestingAnalyzer Class Reference

Class to perform operations on MEs after EDMtoMEConverter. More...

#include <DQMServices/Examples/interface/HarvestingAnalyzer.h>

Inheritance diagram for HarvestingAnalyzer:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob (const edm::EventSetup &)
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
virtual void endJob ()
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 HarvestingAnalyzer (const edm::ParameterSet &)
virtual ~HarvestingAnalyzer ()

Private Attributes

DQMStoredbe
std::string fName
int verbosity


Detailed Description

Class to perform operations on MEs after EDMtoMEConverter.

Date
2008/04/17 21:20:12
Revision
1.1
Author:
M. Strang SUNY-Buffalo

Definition at line 36 of file HarvestingAnalyzer.h.


Constructor & Destructor Documentation

HarvestingAnalyzer::HarvestingAnalyzer ( const edm::ParameterSet iPSet  )  [explicit]

Definition at line 3 of file HarvestingAnalyzer.cc.

References fName, edm::ParameterSet::getUntrackedParameter(), and verbosity.

00004 {
00005   std::string MsgLoggerCat = "HarvestingAnalyzer_HarvestingAnalyzer";
00006 
00007   fName = iPSet.getUntrackedParameter<std::string>("Name");
00008   verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
00009  
00010   if (verbosity >= 0) {
00011     edm::LogInfo(MsgLoggerCat) 
00012       << "\n===============================\n"
00013       << "Initialized as EDAnalyzer with parameter values:\n"
00014       << "    Name          = " << fName << "\n"
00015       << "    Verbosity     = " << verbosity << "\n"
00016       << "===============================\n";
00017   }
00018 }

HarvestingAnalyzer::~HarvestingAnalyzer (  )  [virtual]

Definition at line 20 of file HarvestingAnalyzer.cc.

00020 {}


Member Function Documentation

void HarvestingAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 84 of file HarvestingAnalyzer.cc.

00086 {
00087   return;
00088 }

void HarvestingAnalyzer::beginJob ( const edm::EventSetup iSetup  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 22 of file HarvestingAnalyzer.cc.

00023 {
00024   return;
00025 }

void HarvestingAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file HarvestingAnalyzer.cc.

00074 {
00075   return;
00076 }

void HarvestingAnalyzer::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 27 of file HarvestingAnalyzer.cc.

References DQMStore::book1D(), GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), DQMStore::get(), MonitorElement::getTH1F(), me, and DQMStore::setCurrentFolder().

00028 {
00029 
00030   dbe = 0;
00031   dbe = edm::Service<DQMStore>().operator->();
00032 
00033   if (dbe) {
00034 
00035     // monitoring element numerator and denominator histogram
00036     MonitorElement *meN = 
00037       dbe->get("ConverterTest/TH1F/Random1DN");
00038     MonitorElement *meD = 
00039       dbe->get("ConverterTest/TH1F/Random1DD"); 
00040 
00041     if (meN && meD) {
00042 
00043       // get the numerator and denominator histogram            
00044       TH1F *numerator = meN->getTH1F();
00045       numerator->Sumw2();
00046       TH1F *denominator = meD->getTH1F();
00047       denominator->Sumw2();
00048 
00049       // set the current directory
00050       dbe->setCurrentFolder("ConverterTest/TH1F");
00051 
00052       // booked the new histogram to contain the results
00053       MonitorElement *me = 
00054         dbe->book1D("Divide","Divide calculation",
00055                     numerator->GetNbinsX(),
00056                     numerator->GetXaxis()->GetXmin(),
00057                     numerator->GetXaxis()->GetXmax());
00058 
00059       // Calculate the efficiency
00060       me->getTH1F()->Divide(numerator, denominator, 1., 1., "B");
00061 
00062     } else {
00063       std::cout << "Monitor elements don't exist" << std::endl;
00064     }
00065   } else {
00066     std::cout << "Don't have a valid DQM back end" << std::endl;
00067   }
00068 
00069   return;
00070 }

void HarvestingAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file HarvestingAnalyzer.cc.

00080 {
00081   return;
00082 }


Member Data Documentation

DQMStore* HarvestingAnalyzer::dbe [private]

Definition at line 53 of file HarvestingAnalyzer.h.

Referenced by endJob().

std::string HarvestingAnalyzer::fName [private]

Definition at line 51 of file HarvestingAnalyzer.h.

Referenced by HarvestingAnalyzer().

int HarvestingAnalyzer::verbosity [private]

Definition at line 52 of file HarvestingAnalyzer.h.

Referenced by HarvestingAnalyzer().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:28 2009 for CMSSW by  doxygen 1.5.4