CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Protected Member Functions | Private Attributes
ElectronValidator Class Reference

#include <ElectronValidator.h>

Inheritance diagram for ElectronValidator:
edm::EDAnalyzer ElectronMcFakeValidator ElectronMcSignalValidator

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 ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

DQMStorestore_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 12 of file ElectronValidator.h.

Constructor & Destructor Documentation

ElectronValidator::ElectronValidator ( const edm::ParameterSet conf)
explicitprotected

Definition at line 17 of file ElectronValidator.cc.

18  {}
ElectronValidator::~ElectronValidator ( )
protectedvirtual

Definition at line 20 of file ElectronValidator.cc.

21  {}

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

40  {
41  MonitorElement * me = store_->book1D(name,title,nchX,lowX,highX) ;
42  if (titleX!="") { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
43  if (titleY!="") { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
44  return me ;
45  }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
TH1F * getTH1F(void) const
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().

100  {
101  TH1F * h_temp = (TH1F *)num->getTH1F()->Clone(name.c_str()) ;
102  h_temp->Reset() ;
103  h_temp->Divide(num->getTH1(),denom->getTH1(),1,1,"b") ;
104  h_temp->GetXaxis()->SetTitle(titleX.c_str()) ;
105  h_temp->GetYaxis()->SetTitle(titleY.c_str()) ;
106  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
107  if (print) { h_temp->Print() ; }
108  MonitorElement * me = store_->book1D(name,h_temp) ;
109  delete h_temp ;
110  return me ;
111  }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:8
TH1 * getTH1(void) const
TH1F * getTH1F(void) const
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(), ElectronMcSignalValidator::endJob(), and ElectronMcFakeValidator::endJob().

51  {
52  MonitorElement * me = store_->book1D(name,title,nchX,lowX,highX) ;
53  me->getTH1F()->Sumw2() ;
54  if (titleX!="") { me->getTH1F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
55  if (titleY!="") { me->getTH1F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
56  return me ;
57  }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
TH1F * getTH1F(void) const
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().

64  {
65  MonitorElement * me = store_->book2D(name,title,nchX,lowX,highX,nchY,lowY,highY) ;
66  if (titleX!="") { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
67  if (titleY!="") { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
68  return me ;
69  }
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
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().

117  {
118  TH2F * h_temp = (TH2F *)num->getTH2F()->Clone(name.c_str()) ;
119  h_temp->Reset() ;
120  h_temp->Divide(num->getTH1(),denom->getTH1(),1,1,"b") ;
121  h_temp->GetXaxis()->SetTitle(titleX.c_str()) ;
122  h_temp->GetYaxis()->SetTitle(titleY.c_str()) ;
123  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
124  if (print) { h_temp->Print() ; }
125  MonitorElement * me = store_->book2D(name,h_temp) ;
126  delete h_temp ;
127  return me ;
128  }
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:8
TH1 * getTH1(void) const
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
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().

76  {
77  MonitorElement * me = store_->book2D(name,title,nchX,lowX,highX,nchY,lowY,highY) ;
78  me->getTH2F()->Sumw2() ;
79  if (titleX!="") { me->getTH2F()->GetXaxis()->SetTitle(titleX.c_str()) ; }
80  if (titleY!="") { me->getTH2F()->GetYaxis()->SetTitle(titleY.c_str()) ; }
81  return me ;
82  }
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:642
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().

89  {
90  MonitorElement * me = store_->bookProfile(name,title,nchX,lowX,highX,lowY,highY) ;
91  if (titleX!="") { me->getTProfile()->GetXaxis()->SetTitle(titleX.c_str()) ; }
92  if (titleY!="") { me->getTProfile()->GetYaxis()->SetTitle(titleY.c_str()) ; }
93  return me ;
94  }
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:828
TProfile * getTProfile(void) const
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().

24  {
26  if (!store_)
27  { edm::LogError("ElectronValidator::prepareStore")<<"No DQMStore found !" ; }
28  }
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().

134  {
135  if (me2d->getTH2F()->GetSumw2N()==0) me2d->getTH2F()->Sumw2() ; // workaround for http://savannah.cern.ch/bugs/?77751
136  TProfile * p1_temp = me2d->getTH2F()->ProfileX() ;
137  if (title!="") { p1_temp->SetTitle(title.c_str()) ; }
138  if (titleX!="") { p1_temp->GetXaxis()->SetTitle(titleX.c_str()) ; }
139  if (titleY!="") { p1_temp->GetYaxis()->SetTitle(titleY.c_str()) ; }
140  if (minimum!=-1111) { p1_temp->SetMinimum(minimum) ; }
141  if (maximum!=-1111) { p1_temp->SetMaximum(maximum) ; }
142  MonitorElement * me = store_->bookProfile(name,p1_temp) ;
143  delete p1_temp ;
144  return me ;
145  }
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:828
TH2F * getTH2F(void) const
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 148 of file ElectronValidator.cc.

References MonitorElement::getTH2F().

Referenced by ElectronMcSignalValidator::endJob().

151  {
152  if (me2d->getTH2F()->GetSumw2N()==0) me2d->getTH2F()->Sumw2() ; // workaround for http://savannah.cern.ch/bugs/?77751
153  TProfile * p1_temp = me2d->getTH2F()->ProfileY() ;
154  if (title!="") { p1_temp->SetTitle(title.c_str()) ; }
155  if (titleX!="") { p1_temp->GetXaxis()->SetTitle(titleX.c_str()) ; }
156  if (titleY!="") { p1_temp->GetYaxis()->SetTitle(titleY.c_str()) ; }
157  if (minimum!=-1111) { p1_temp->SetMinimum(minimum) ; }
158  if (maximum!=-1111) { p1_temp->SetMaximum(maximum) ; }
159  MonitorElement * me = store_->bookProfile(name,p1_temp) ;
160  delete p1_temp ;
161  return me ;
162  }
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:828
TH2F * getTH2F(void) const
void ElectronValidator::saveStore ( const std::string &  filename)
protected

Definition at line 33 of file ElectronValidator.cc.

References DQMStore::save(), and store_.

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

34  { store_->save(filename) ; }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
tuple filename
Definition: lut2db_cfg.py:20
void ElectronValidator::setStoreFolder ( const std::string &  path)
protected

Member Data Documentation

DQMStore* ElectronValidator::store_
private

Definition at line 74 of file ElectronValidator.h.

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