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
ScoutingAnalyzerBase Class Reference

#include <ScoutingAnalyzerBase.h>

Inheritance diagram for ScoutingAnalyzerBase:
edm::EDAnalyzer AlphaTVarAnalyzer DiJetVarAnalyzer RazorVarAnalyzer ScoutingTestAnalyzer

Protected Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob ()
 
MonitorElementbookH1 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1BinArray (const std::string &name, const std::string &title, int nchX, float *xbinsize, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2BinArray (const std::string &name, const std::string &title, int nchX, float *xbinsize, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
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="", Option_t *option="COLZ")
 
MonitorElementbookH2andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
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="", Option_t *option="COLZ")
 
virtual void bookMEs ()
 
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="", Option_t *option="E1 P")
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
std::string newName (const std::string &name)
 
MonitorElementprofileX (MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
 ScoutingAnalyzerBase (const edm::ParameterSet &conf)
 
virtual ~ScoutingAnalyzerBase ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

std::string m_MEsPath
 
std::string m_modulePath
 
DQMStorem_store
 
unsigned m_verbosityLevel
 

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)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 21 of file ScoutingAnalyzerBase.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file ScoutingAnalyzerBase.cc.

References edm::ParameterSet::getUntrackedParameter(), m_MEsPath, m_modulePath, and m_verbosityLevel.

12  {
13  m_MEsPath = conf.getUntrackedParameter<std::string>("rootPath","DataScouting") ;
14  m_modulePath = conf.getUntrackedParameter<std::string>("modulePath","DataScouting") ;
15  m_verbosityLevel = conf.getUntrackedParameter<unsigned int>("verbosityLevel", 0) ;
16  if (m_modulePath.size() != 0)
17  m_MEsPath+="/"+m_modulePath;
18  }
T getUntrackedParameter(std::string const &, T const &) const
ScoutingAnalyzerBase::~ScoutingAnalyzerBase ( )
protectedvirtual

Definition at line 22 of file ScoutingAnalyzerBase.cc.

22 {}

Member Function Documentation

virtual void ScoutingAnalyzerBase::analyze ( const edm::Event e,
const edm::EventSetup c 
)
inlineprotectedvirtual

Implements edm::EDAnalyzer.

Reimplemented in DiJetVarAnalyzer, ScoutingTestAnalyzer, AlphaTVarAnalyzer, and RazorVarAnalyzer.

Definition at line 34 of file ScoutingAnalyzerBase.h.

34 {}
void ScoutingAnalyzerBase::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 26 of file ScoutingAnalyzerBase.cc.

References bookMEs(), m_MEsPath, m_store, m_verbosityLevel, cppFunctionSkipper::operator, DQMStore::setCurrentFolder(), and DQMStore::setVerbose().

26  {
28  if (!m_store)
29  { edm::LogError("ScoutingAnalyzerBase::prepareStore")<<"No DQMStore found !" ; }
32  bookMEs() ;
33  }
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * ScoutingAnalyzerBase::bookH1 ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 45 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getTH1().

49  {
50  MonitorElement * me = m_store->book1DD(newName(name),title,nchX,lowX,highX) ;
51  if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; }
52  if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; }
53  if (TString(option)!="") { me->getTH1()->SetOption(option) ; }
54  return me ;
55  }
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:749
std::string newName(const std::string &name)
TH1 * getTH1(void) const
MonitorElement * ScoutingAnalyzerBase::bookH1andDivide ( const std::string &  name,
MonitorElement num,
MonitorElement denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "" 
)
protected

Definition at line 162 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getTH1().

165  {
166  std::string name2 = newName(name) ;
167  TH1D * h_temp = dynamic_cast<TH1D*>( num->getTH1()->Clone(name2.c_str()) );
168  h_temp->Reset() ;
169  h_temp->Divide(num->getTH1(),denom->getTH1(),1,1,"b") ;
170  h_temp->GetXaxis()->SetTitle(titleX.c_str()) ;
171  h_temp->GetYaxis()->SetTitle(titleY.c_str()) ;
172  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
173  if (m_verbosityLevel>0) { h_temp->Print() ; }
174  MonitorElement * me = m_store->book1DD(name2,h_temp) ;
175  delete h_temp ;
176  return me ;
177  }
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:749
std::string newName(const std::string &name)
TH1 * getTH1(void) const
MonitorElement * ScoutingAnalyzerBase::bookH1BinArray ( const std::string &  name,
const std::string &  title,
int  nchX,
float *  xbinsize,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 78 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getTH1().

82  {
83  MonitorElement * me = m_store->book1D(newName(name),title,nchX,xbinsize) ;
84  //book1DD not implemented in DQMServices/Core/src/DQMStore.cc
85  if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; }
86  if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; }
87  if (TString(option)!="") { me->getTH1()->SetOption(option) ; }
88  return me ;
89  }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::string newName(const std::string &name)
TH1 * getTH1(void) const
MonitorElement * ScoutingAnalyzerBase::bookH1withSumw2 ( const std::string &  name,
const std::string &  title,
int  nchX,
double  lowX,
double  highX,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 60 of file ScoutingAnalyzerBase.cc.

References gather_cfg::cout, and MonitorElement::getTH1().

Referenced by AlphaTVarAnalyzer::bookMEs(), ScoutingTestAnalyzer::bookMEs(), and DiJetVarAnalyzer::bookMEs().

64  {
65 
66  std::cout << newName(name) << std::endl;
67  MonitorElement * me = m_store->book1DD(newName(name),title,nchX,lowX,highX) ;
68  me->getTH1()->Sumw2() ;
69  if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; }
70  if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; }
71  if (TString(option)!="") { me->getTH1()->SetOption(option) ; }
72  return me ;
73  }
MonitorElement * book1DD(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1S histogram.
Definition: DQMStore.cc:749
std::string newName(const std::string &name)
TH1 * getTH1(void) const
tuple cout
Definition: gather_cfg.py:121
MonitorElement * ScoutingAnalyzerBase::bookH1withSumw2BinArray ( const std::string &  name,
const std::string &  title,
int  nchX,
float *  xbinsize,
const std::string &  titleX = "",
const std::string &  titleY = "Events",
Option_t *  option = "E1 P" 
)
protected

Definition at line 94 of file ScoutingAnalyzerBase.cc.

References gather_cfg::cout, and MonitorElement::getTH1().

Referenced by DiJetVarAnalyzer::bookMEs().

98  {
99 
100  std::cout << newName(name) << std::endl;
101  MonitorElement * me = m_store->book1D(newName(name),title,nchX,xbinsize) ;
102  //book1DD not implemented in DQMServices/Core/src/DQMStore.cc
103  me->getTH1()->Sumw2() ;
104  if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; }
105  if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; }
106  if (TString(option)!="") { me->getTH1()->SetOption(option) ; }
107  return me ;
108  }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::string newName(const std::string &name)
TH1 * getTH1(void) const
tuple cout
Definition: gather_cfg.py:121
MonitorElement * ScoutingAnalyzerBase::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 = "",
Option_t *  option = "COLZ" 
)
protected

Definition at line 113 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getTH1().

118  {
119  MonitorElement * me = m_store->book2DD(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ;
120  if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; }
121  if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; }
122  if (TString(option)!="") { me->getTH1()->SetOption(option) ; }
123  return me ;
124  }
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
Definition: DQMStore.cc:889
std::string newName(const std::string &name)
TH1 * getTH1(void) const
MonitorElement * ScoutingAnalyzerBase::bookH2andDivide ( const std::string &  name,
MonitorElement num,
MonitorElement denom,
const std::string &  titleX,
const std::string &  titleY,
const std::string &  title = "" 
)
protected

Definition at line 182 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getTH1().

185  {
186  std::string name2 = newName(name) ;
187  TH2D * h_temp = dynamic_cast<TH2D*>( num->getTH1()->Clone(name2.c_str()) );
188  h_temp->Reset() ;
189  h_temp->Divide(num->getTH1(),denom->getTH1(),1,1,"b") ;
190  h_temp->GetXaxis()->SetTitle(titleX.c_str()) ;
191  h_temp->GetYaxis()->SetTitle(titleY.c_str()) ;
192  if (title!="") { h_temp->SetTitle(title.c_str()) ; }
193  if (m_verbosityLevel>0) { h_temp->Print() ; }
194  MonitorElement * me = m_store->book2DD(name2,h_temp) ;
195  delete h_temp ;
196  return me ;
197  }
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
Definition: DQMStore.cc:889
std::string newName(const std::string &name)
TH1 * getTH1(void) const
MonitorElement * ScoutingAnalyzerBase::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 = "",
Option_t *  option = "COLZ" 
)
protected

Definition at line 129 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getTH1().

Referenced by AlphaTVarAnalyzer::bookMEs(), RazorVarAnalyzer::bookMEs(), ScoutingTestAnalyzer::bookMEs(), and DiJetVarAnalyzer::bookMEs().

134  {
135  MonitorElement * me = m_store->book2DD(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ;
136  me->getTH1()->Sumw2() ;
137  if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; }
138  if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; }
139  if (TString(option)!="") { me->getTH1()->SetOption(option) ; }
140  return me ;
141  }
MonitorElement * book2DD(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D double histogram.
Definition: DQMStore.cc:889
std::string newName(const std::string &name)
TH1 * getTH1(void) const
virtual void ScoutingAnalyzerBase::bookMEs ( )
inlineprotectedvirtual

Reimplemented in DiJetVarAnalyzer, ScoutingTestAnalyzer, AlphaTVarAnalyzer, and RazorVarAnalyzer.

Definition at line 36 of file ScoutingAnalyzerBase.h.

Referenced by beginJob().

36 {}
MonitorElement * ScoutingAnalyzerBase::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 = "",
Option_t *  option = "E1 P" 
)
protected

Definition at line 146 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getTProfile().

151  {
152  MonitorElement * me = m_store->bookProfile(newName(name),title,nchX,lowX,highX,lowY,highY," ") ;
153  if (titleX!="") { me->getTProfile()->GetXaxis()->SetTitle(titleX.c_str()) ; }
154  if (titleY!="") { me->getTProfile()->GetYaxis()->SetTitle(titleY.c_str()) ; }
155  if (TString(option)!="") { me->getTProfile()->SetOption(option) ; }
156  return me ;
157  }
std::string newName(const std::string &name)
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:1031
TProfile * getTProfile(void) const
virtual void ScoutingAnalyzerBase::endJob ( void  )
inlineprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 33 of file ScoutingAnalyzerBase.h.

33 {};
virtual void ScoutingAnalyzerBase::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
inlineprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 32 of file ScoutingAnalyzerBase.h.

32 {}
virtual void ScoutingAnalyzerBase::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Reimplemented in DiJetVarAnalyzer, ScoutingTestAnalyzer, AlphaTVarAnalyzer, and RazorVarAnalyzer.

Definition at line 31 of file ScoutingAnalyzerBase.h.

31 {};
std::string ScoutingAnalyzerBase::newName ( const std::string &  name)
inlineprotected

Definition at line 37 of file ScoutingAnalyzerBase.cc.

References mergeVDriftHistosByStation::name.

37  {
38  // let's keep it in case we need massage
39  return name;
40 }
MonitorElement * ScoutingAnalyzerBase::profileX ( 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 202 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getName(), and MonitorElement::getTH2D().

Referenced by ScoutingTestAnalyzer::endRun().

205  {
206  std::string name2 = me2d->getName()+"_pfx" ;
207  TProfile * p1_temp = me2d->getTH2D()->ProfileX() ;
208  if (title!="") { p1_temp->SetTitle(title.c_str()) ; }
209  if (titleX!="") { p1_temp->GetXaxis()->SetTitle(titleX.c_str()) ; }
210  if (titleY!="") { p1_temp->GetYaxis()->SetTitle(titleY.c_str()) ; }
211  if (minimum!=-1111) { p1_temp->SetMinimum(minimum) ; }
212  if (maximum!=-1111) { p1_temp->SetMaximum(maximum) ; }
213  MonitorElement * me = m_store->bookProfile(name2,p1_temp) ;
214  delete p1_temp ;
215  return me ;
216  }
const std::string & getName(void) const
get name of ME
TH2D * getTH2D(void) const
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:1031
MonitorElement * ScoutingAnalyzerBase::profileY ( 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 221 of file ScoutingAnalyzerBase.cc.

References MonitorElement::getName(), and MonitorElement::getTH2D().

Referenced by ScoutingTestAnalyzer::endRun().

224  {
225  std::string name2 = me2d->getName()+"_pfy" ;
226  TProfile * p1_temp = me2d->getTH2D()->ProfileY() ;
227  if (title!="") { p1_temp->SetTitle(title.c_str()) ; }
228  if (titleX!="") { p1_temp->GetXaxis()->SetTitle(titleX.c_str()) ; }
229  if (titleY!="") { p1_temp->GetYaxis()->SetTitle(titleY.c_str()) ; }
230  if (minimum!=-1111) { p1_temp->SetMinimum(minimum) ; }
231  if (maximum!=-1111) { p1_temp->SetMaximum(maximum) ; }
232  MonitorElement * me = m_store->bookProfile(name2,p1_temp) ;
233  delete p1_temp ;
234  return me ;
235  }
const std::string & getName(void) const
get name of ME
TH2D * getTH2D(void) const
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:1031

Member Data Documentation

std::string ScoutingAnalyzerBase::m_MEsPath
private

Definition at line 109 of file ScoutingAnalyzerBase.h.

Referenced by beginJob(), and ScoutingAnalyzerBase().

std::string ScoutingAnalyzerBase::m_modulePath
private

Definition at line 108 of file ScoutingAnalyzerBase.h.

Referenced by ScoutingAnalyzerBase().

DQMStore* ScoutingAnalyzerBase::m_store
private

Definition at line 111 of file ScoutingAnalyzerBase.h.

Referenced by beginJob().

unsigned ScoutingAnalyzerBase::m_verbosityLevel
private

Definition at line 110 of file ScoutingAnalyzerBase.h.

Referenced by beginJob(), and ScoutingAnalyzerBase().