CMS 3D CMS Logo

Protected Member Functions | Private Attributes

ElectronValidator Class Reference

#include <ElectronValidator.h>

Inheritance diagram for ElectronValidator:
edm::EDAnalyzer ElectronMcFakeValidator ElectronMcSignalValidator

List of all members.

Protected Member Functions

MonitorElementbookH1 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events")
MonitorElementbookH1andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="", bool print=false)
MonitorElementbookH1withSumw2 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events")
MonitorElementbookH2 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="")
MonitorElementbookH2andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="", bool print=false)
MonitorElementbookH2withSumw2 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="")
MonitorElementbookP1 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="")
 ElectronValidator (const edm::ParameterSet &conf)
void prepareStore ()
MonitorElementprofileX (const std::string &name, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
MonitorElementprofileY (const std::string &name, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
void saveStore (const std::string &filename)
void setStoreFolder (const std::string &path)
virtual ~ElectronValidator ()

Private Attributes

DQMStorestore_

Detailed Description

Definition at line 12 of file ElectronValidator.h.


Constructor & Destructor Documentation

ElectronValidator::ElectronValidator ( const edm::ParameterSet conf) [explicit, protected]

Definition at line 17 of file ElectronValidator.cc.

 {}
ElectronValidator::~ElectronValidator ( ) [protected, virtual]

Definition at line 20 of file ElectronValidator.cc.

 {}

Member Function Documentation

MonitorElement * ElectronValidator::bookH1 ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
const std::string &  titleX = "",
const std::string &  titleY = "Events" 
) [protected]

Definition at line 37 of file ElectronValidator.cc.

References MonitorElement::getTH1F().

Referenced by ElectronMcFakeValidator::beginJob(), and ElectronMcSignalValidator::beginJob().

 {
  MonitorElement * me = store_->book1D(name,title,nchX,lowX,highX) ;
  if (titleX!="") { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
  if (titleY!="") { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
  return me ;
 }
MonitorElement * ElectronValidator::bookH1andDivide ( const std::string &  name,
MonitorElement num,
MonitorElement denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "",
bool  print = false 
) [protected]

Definition at line 97 of file ElectronValidator.cc.

References MonitorElement::getTH1(), and MonitorElement::getTH1F().

Referenced by ElectronMcFakeValidator::endJob(), and ElectronMcSignalValidator::endJob().

 {
  TH1F * h_temp = (TH1F *)num->getTH1F()->Clone(name.c_str()) ;
  h_temp->Reset() ;
  h_temp->Divide(num->getTH1(),denom->getTH1(),1,1,"b") ;
  h_temp->GetXaxis()->SetTitle(titleX.c_str()) ;
  h_temp->GetYaxis()->SetTitle(titleY.c_str()) ;
  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
  if (print) { h_temp->Print() ; }
  MonitorElement * me = store_->book1D(name,h_temp) ;
  delete h_temp ;
  return me ;
 }
MonitorElement * ElectronValidator::bookH1withSumw2 ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
const std::string &  titleX = "",
const std::string &  titleY = "Events" 
) [protected]

Definition at line 48 of file ElectronValidator.cc.

References MonitorElement::getTH1F().

Referenced by ElectronMcFakeValidator::beginJob(), ElectronMcSignalValidator::beginJob(), ElectronMcFakeValidator::endJob(), and ElectronMcSignalValidator::endJob().

 {
  MonitorElement * me = store_->book1D(name,title,nchX,lowX,highX) ;
  me->getTH1F()->Sumw2() ;
  if (titleX!="") { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
  if (titleY!="") { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
  return me ;
 }
MonitorElement * ElectronValidator::bookH2 ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "" 
) [protected]

Definition at line 60 of file ElectronValidator.cc.

References MonitorElement::getTH2F().

Referenced by ElectronMcFakeValidator::beginJob(), and ElectronMcSignalValidator::beginJob().

 {
  MonitorElement * me = store_->book2D(name,title,nchX,lowX,highX,nchY,lowY,highY) ;
  if (titleX!="") { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
  if (titleY!="") { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
  return me ;
 }
MonitorElement * ElectronValidator::bookH2andDivide ( const std::string &  name,
MonitorElement num,
MonitorElement denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "",
bool  print = false 
) [protected]

Definition at line 114 of file ElectronValidator.cc.

References MonitorElement::getTH1(), and MonitorElement::getTH2F().

Referenced by ElectronMcSignalValidator::endJob().

 {
  TH2F * h_temp = (TH2F *)num->getTH2F()->Clone(name.c_str()) ;
  h_temp->Reset() ;
  h_temp->Divide(num->getTH1(),denom->getTH1(),1,1,"b") ;
  h_temp->GetXaxis()->SetTitle(titleX.c_str()) ;
  h_temp->GetYaxis()->SetTitle(titleY.c_str()) ;
  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
  if (print) { h_temp->Print() ; }
  MonitorElement * me = store_->book2D(name,h_temp) ;
  delete h_temp ;
  return me ;
 }
MonitorElement * ElectronValidator::bookH2withSumw2 ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
int  nchY,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "" 
) [protected]

Definition at line 72 of file ElectronValidator.cc.

References MonitorElement::getTH2F().

Referenced by ElectronMcSignalValidator::beginJob().

 {
  MonitorElement * me = store_->book2D(name,title,nchX,lowX,highX,nchY,lowY,highY) ;
  me->getTH2F()->Sumw2() ;
  if (titleX!="") { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
  if (titleY!="") { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
  return me ;
 }
MonitorElement * ElectronValidator::bookP1 ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
double  lowY,
double  highY,
const std::string &  titleX = "",
const std::string &  titleY = "" 
) [protected]

Definition at line 85 of file ElectronValidator.cc.

References MonitorElement::getTProfile().

Referenced by ElectronMcFakeValidator::beginJob(), and ElectronMcSignalValidator::beginJob().

 {
  MonitorElement * me = store_->bookProfile(name,title,nchX,lowX,highX,lowY,highY) ;
  if (titleX!="") { me->getTProfile()->GetXaxis()->SetTitle(titleX.c_str()) ; }
  if (titleY!="") { me->getTProfile()->GetYaxis()->SetTitle(titleY.c_str()) ; }
  return me ;
 }
void ElectronValidator::prepareStore ( ) [protected]

Definition at line 23 of file ElectronValidator.cc.

References cmsCodeRules::cppFunctionSkipper::operator, and store_.

Referenced by ElectronMcFakeValidator::beginJob(), and ElectronMcSignalValidator::beginJob().

 {
  store_ = edm::Service<DQMStore>().operator->() ;
  if (!store_)
   { edm::LogError("ElectronValidator::prepareStore")<<"No DQMStore found !" ; }
 }
MonitorElement * ElectronValidator::profileX ( const std::string &  name,
MonitorElement me2d,
const std::string &  title = "",
const std::string &  titleX = "",
const std::string &  titleY = "",
Double_t  minimum = -1111,
Double_t  maximum = -1111 
) [protected]

Definition at line 131 of file ElectronValidator.cc.

References MonitorElement::getTH2F().

Referenced by ElectronMcFakeValidator::endJob(), and ElectronMcSignalValidator::endJob().

 {
  TProfile * p1_temp = me2d->getTH2F()->ProfileX() ;
  if (title!="") { p1_temp->SetTitle(title.c_str()) ; }
  if (titleX!="") { p1_temp->GetXaxis()->SetTitle(titleX.c_str()) ; }
  if (titleY!="") { p1_temp->GetYaxis()->SetTitle(titleY.c_str()) ; }
  if (minimum!=-1111) { p1_temp->SetMinimum(minimum) ; }
  if (maximum!=-1111) { p1_temp->SetMaximum(maximum) ; }
  MonitorElement * me = store_->bookProfile(name,p1_temp) ;
  delete p1_temp ;
  return me ;
 }
MonitorElement * ElectronValidator::profileY ( const std::string &  name,
MonitorElement me2d,
const std::string &  title = "",
const std::string &  titleX = "",
const std::string &  titleY = "",
Double_t  minimum = -1111,
Double_t  maximum = -1111 
) [protected]

Definition at line 147 of file ElectronValidator.cc.

References MonitorElement::getTH2F().

Referenced by ElectronMcSignalValidator::endJob().

 {
  TProfile * p1_temp = me2d->getTH2F()->ProfileY() ;
  if (title!="") { p1_temp->SetTitle(title.c_str()) ; }
  if (titleX!="") { p1_temp->GetXaxis()->SetTitle(titleX.c_str()) ; }
  if (titleY!="") { p1_temp->GetYaxis()->SetTitle(titleY.c_str()) ; }
  if (minimum!=-1111) { p1_temp->SetMinimum(minimum) ; }
  if (maximum!=-1111) { p1_temp->SetMaximum(maximum) ; }
  MonitorElement * me = store_->bookProfile(name,p1_temp) ;
  delete p1_temp ;
  return me ;
 }
void ElectronValidator::saveStore ( const std::string &  filename) [protected]
void ElectronValidator::setStoreFolder ( const std::string &  path) [protected]

Member Data Documentation

Definition at line 74 of file ElectronValidator.h.

Referenced by prepareStore(), saveStore(), and setStoreFolder().