CMS 3D CMS Logo

Public Member Functions | Private Attributes

HarvestingAnalyzer Class Reference

#include <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 ()
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:
2009/12/14 22:22:22
Revision:
1.2
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.

{
  std::string MsgLoggerCat = "HarvestingAnalyzer_HarvestingAnalyzer";

  fName = iPSet.getUntrackedParameter<std::string>("Name");
  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
 
  if (verbosity >= 0) {
    edm::LogInfo(MsgLoggerCat) 
      << "\n===============================\n"
      << "Initialized as EDAnalyzer with parameter values:\n"
      << "    Name          = " << fName << "\n"
      << "    Verbosity     = " << verbosity << "\n"
      << "===============================\n";
  }
}
HarvestingAnalyzer::~HarvestingAnalyzer ( ) [virtual]

Definition at line 20 of file HarvestingAnalyzer.cc.

{}

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.

{
  return;
}
void HarvestingAnalyzer::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 22 of file HarvestingAnalyzer.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file HarvestingAnalyzer.cc.

{
  return;
}
void HarvestingAnalyzer::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 27 of file HarvestingAnalyzer.cc.

References DQMStore::book1D(), gather_cfg::cout, dbe, RecoTauValidation_cfi::denominator, DQMStore::get(), MonitorElement::getTH1F(), cmsCodeRules::cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

{

  dbe = 0;
  dbe = edm::Service<DQMStore>().operator->();

  if (dbe) {

    // monitoring element numerator and denominator histogram
    MonitorElement *meN = 
      dbe->get("ConverterTest/TH1F/Random1DN");
    MonitorElement *meD = 
      dbe->get("ConverterTest/TH1F/Random1DD"); 

    if (meN && meD) {

      // get the numerator and denominator histogram            
      TH1F *numerator = meN->getTH1F();
      numerator->Sumw2();
      TH1F *denominator = meD->getTH1F();
      denominator->Sumw2();

      // set the current directory
      dbe->setCurrentFolder("ConverterTest/TH1F");

      // booked the new histogram to contain the results
      MonitorElement *me = 
        dbe->book1D("Divide","Divide calculation",
                    numerator->GetNbinsX(),
                    numerator->GetXaxis()->GetXmin(),
                    numerator->GetXaxis()->GetXmax());

      // Calculate the efficiency
      me->getTH1F()->Divide(numerator, denominator, 1., 1., "B");

    } else {
      std::cout << "Monitor elements don't exist" << std::endl;
    }
  } else {
    std::cout << "Don't have a valid DQM back end" << std::endl;
  }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file HarvestingAnalyzer.cc.

{
  return;
}

Member Data Documentation

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().

Definition at line 52 of file HarvestingAnalyzer.h.

Referenced by HarvestingAnalyzer().