#include <ScoutingAnalyzerBase.h>
Protected Member Functions | |
virtual void | analyze (const edm::Event &e, const edm::EventSetup &c) |
void | beginJob () |
MonitorElement * | 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") |
MonitorElement * | bookH1andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="") |
MonitorElement * | 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") |
MonitorElement * | 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") |
MonitorElement * | 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") |
MonitorElement * | 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") |
MonitorElement * | bookH2andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="") |
MonitorElement * | 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") |
virtual void | bookMEs () |
MonitorElement * | 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") |
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) |
MonitorElement * | profileX (MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111) |
MonitorElement * | profileY (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 () |
Private Attributes | |
std::string | m_MEsPath |
std::string | m_modulePath |
DQMStore * | m_store |
unsigned | m_verbosityLevel |
Definition at line 21 of file ScoutingAnalyzerBase.h.
ScoutingAnalyzerBase::ScoutingAnalyzerBase | ( | const edm::ParameterSet & | conf | ) | [explicit, protected] |
Definition at line 12 of file ScoutingAnalyzerBase.cc.
References edm::ParameterSet::getUntrackedParameter(), m_MEsPath, m_modulePath, m_verbosityLevel, and AlCaHLTBitMon_QueryRunRegistry::string.
{ m_MEsPath = conf.getUntrackedParameter<std::string>("rootPath","DataScouting") ; m_modulePath = conf.getUntrackedParameter<std::string>("modulePath","DataScouting") ; m_verbosityLevel = conf.getUntrackedParameter<unsigned int>("verbosityLevel", 0) ; if (m_modulePath.size() != 0) m_MEsPath+="/"+m_modulePath; }
ScoutingAnalyzerBase::~ScoutingAnalyzerBase | ( | ) | [protected, virtual] |
Definition at line 22 of file ScoutingAnalyzerBase.cc.
{}
virtual void ScoutingAnalyzerBase::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [inline, protected, virtual] |
Implements edm::EDAnalyzer.
Reimplemented in AlphaTVarAnalyzer, DiJetVarAnalyzer, RazorVarAnalyzer, and ScoutingTestAnalyzer.
Definition at line 34 of file ScoutingAnalyzerBase.h.
{}
void ScoutingAnalyzerBase::beginJob | ( | void | ) | [protected, virtual] |
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().
{ m_store = edm::Service<DQMStore>().operator->() ; if (!m_store) { edm::LogError("ScoutingAnalyzerBase::prepareStore")<<"No DQMStore found !" ; } m_store->setVerbose(m_verbosityLevel) ; m_store->setCurrentFolder(m_MEsPath) ; bookMEs() ; }
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().
{ MonitorElement * me = m_store->book1DD(newName(name),title,nchX,lowX,highX) ; if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; } if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; } if (TString(option)!="") { me->getTH1()->SetOption(option) ; } return me ; }
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(), and AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string name2 = newName(name) ; TH1D * h_temp = dynamic_cast<TH1D*>( num->getTH1()->Clone(name2.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 (m_verbosityLevel>0) { h_temp->Print() ; } MonitorElement * me = m_store->book1DD(name2,h_temp) ; delete h_temp ; return me ; }
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().
{ MonitorElement * me = m_store->book1D(newName(name),title,nchX,xbinsize) ; //book1DD not implemented in DQMServices/Core/src/DQMStore.cc if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; } if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; } if (TString(option)!="") { me->getTH1()->SetOption(option) ; } return me ; }
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().
{ std::cout << newName(name) << std::endl; MonitorElement * me = m_store->book1DD(newName(name),title,nchX,lowX,highX) ; me->getTH1()->Sumw2() ; if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; } if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; } if (TString(option)!="") { me->getTH1()->SetOption(option) ; } return me ; }
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().
{ std::cout << newName(name) << std::endl; MonitorElement * me = m_store->book1D(newName(name),title,nchX,xbinsize) ; //book1DD not implemented in DQMServices/Core/src/DQMStore.cc me->getTH1()->Sumw2() ; if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; } if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; } if (TString(option)!="") { me->getTH1()->SetOption(option) ; } return me ; }
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().
{ MonitorElement * me = m_store->book2DD(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ; if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; } if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; } if (TString(option)!="") { me->getTH1()->SetOption(option) ; } return me ; }
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(), and AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string name2 = newName(name) ; TH2D * h_temp = dynamic_cast<TH2D*>( num->getTH1()->Clone(name2.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 (m_verbosityLevel>0) { h_temp->Print() ; } MonitorElement * me = m_store->book2DD(name2,h_temp) ; delete h_temp ; return me ; }
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().
{ MonitorElement * me = m_store->book2DD(newName(name),title,nchX,lowX,highX,nchY,lowY,highY) ; me->getTH1()->Sumw2() ; if (titleX!="") { me->getTH1()->GetXaxis()->SetTitle(titleX.c_str()) ; } if (titleY!="") { me->getTH1()->GetYaxis()->SetTitle(titleY.c_str()) ; } if (TString(option)!="") { me->getTH1()->SetOption(option) ; } return me ; }
virtual void ScoutingAnalyzerBase::bookMEs | ( | ) | [inline, protected, virtual] |
Reimplemented in AlphaTVarAnalyzer, DiJetVarAnalyzer, RazorVarAnalyzer, and ScoutingTestAnalyzer.
Definition at line 36 of file ScoutingAnalyzerBase.h.
Referenced by beginJob().
{}
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().
{ MonitorElement * me = m_store->bookProfile(newName(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()) ; } if (TString(option)!="") { me->getTProfile()->SetOption(option) ; } return me ; }
virtual void ScoutingAnalyzerBase::endJob | ( | void | ) | [inline, protected, virtual] |
virtual void ScoutingAnalyzerBase::endLuminosityBlock | ( | edm::LuminosityBlock const & | , |
edm::EventSetup const & | |||
) | [inline, protected, virtual] |
virtual void ScoutingAnalyzerBase::endRun | ( | edm::Run const & | , |
edm::EventSetup const & | |||
) | [inline, protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Reimplemented in AlphaTVarAnalyzer, DiJetVarAnalyzer, RazorVarAnalyzer, and ScoutingTestAnalyzer.
Definition at line 31 of file ScoutingAnalyzerBase.h.
{};
std::string ScoutingAnalyzerBase::newName | ( | const std::string & | name | ) | [inline, protected] |
Definition at line 37 of file ScoutingAnalyzerBase.cc.
References mergeVDriftHistosByStation::name.
{ // let's keep it in case we need massage return name; }
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(), MonitorElement::getTH2D(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by ScoutingTestAnalyzer::endRun().
{ std::string name2 = me2d->getName()+"_pfx" ; TProfile * p1_temp = me2d->getTH2D()->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 = m_store->bookProfile(name2,p1_temp) ; delete p1_temp ; return me ; }
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(), MonitorElement::getTH2D(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by ScoutingTestAnalyzer::endRun().
{ std::string name2 = me2d->getName()+"_pfy" ; TProfile * p1_temp = me2d->getTH2D()->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 = m_store->bookProfile(name2,p1_temp) ; delete p1_temp ; return me ; }
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().