![]() |
![]() |
#include <L1TGMTClient.h>
Public Member Functions | |
L1TGMTClient (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~L1TGMTClient () |
Destructor. | |
Protected Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &c) |
Fake Analyze. | |
void | beginJob (void) |
BeginJob. | |
void | beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) |
void | beginRun (const edm::Run &r, const edm::EventSetup &c) |
BeginRun. | |
void | endJob () |
Endjob. | |
void | endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) |
DQM Client Diagnostic. | |
void | endRun (const edm::Run &r, const edm::EventSetup &c) |
EndRun. | |
Private Member Functions | |
MonitorElement * | bookClone1D (std::string name, std::string title, std::string hrefName) |
MonitorElement * | bookClone1DVB (std::string name, std::string title, std::string hrefName) |
MonitorElement * | bookClone2D (std::string name, std::string title, std::string hrefName) |
TH1F * | get1DHisto (std::string meName, DQMStore *dbi) |
TH2F * | get2DHisto (std::string meName, DQMStore *dbi) |
void | initialize () |
void | makeEfficiency1D (MonitorElement *meeff, std::string heName, std::string hiName) |
void | makeEfficiency2D (MonitorElement *meeff, std::string heName, std::string hiName) |
void | makeRatio1D (MonitorElement *mer, std::string h1Name, std::string h2Name) |
void | process () |
Private Attributes | |
int | counterEvt_ |
counter | |
int | counterLS_ |
DQMStore * | dbe_ |
MonitorElement * | eff_eta_dtcsc |
prescale on number of events | |
MonitorElement * | eff_eta_rpc |
MonitorElement * | eff_etaphi_dtcsc |
MonitorElement * | eff_etaphi_rpc |
MonitorElement * | eff_phi_dtcsc |
MonitorElement * | eff_phi_rpc |
std::string | input_dir_ |
std::string | monitorName_ |
std::string | output_dir_ |
edm::ParameterSet | parameters_ |
int | prescaleEvt_ |
units of lumi sections | |
int | prescaleLS_ |
counter |
Definition at line 11 of file L1TGMTClient.h.
L1TGMTClient::L1TGMTClient | ( | const edm::ParameterSet & | ps | ) |
L1TGMTClient::~L1TGMTClient | ( | ) | [virtual] |
Destructor.
Definition at line 20 of file L1TGMTClient.cc.
{ LogInfo("TriggerDQM")<<"[TriggerDQM]: ending... "; }
void L1TGMTClient::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Fake Analyze.
Implements edm::EDAnalyzer.
Definition at line 113 of file L1TGMTClient.cc.
References align_tpl::process.
{ counterEvt_++; if (prescaleEvt_<1) return; if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return; process(); }
void L1TGMTClient::beginJob | ( | void | ) | [protected, virtual] |
BeginJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 51 of file L1TGMTClient.cc.
{ LogInfo("TriggerDQM")<<"[TriggerDQM]: Begin Job"; }
void L1TGMTClient::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | context | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 97 of file L1TGMTClient.cc.
{ // optionally reset histograms here // clientHisto->Reset(); }
void L1TGMTClient::beginRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
BeginRun.
Reimplemented from edm::EDAnalyzer.
Definition at line 58 of file L1TGMTClient.cc.
References dbe_, cmsCodeRules::cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().
{ // get backendinterface dbe_ = Service<DQMStore>().operator->(); dbe_->setCurrentFolder(output_dir_); // booking eff_eta_dtcsc = bookClone1DVB("eff_eta_dtcsc","efficiency DTCSC vs eta","eta_DTCSC_and_RPC"); eff_eta_dtcsc->setAxisTitle("eta",1); eff_eta_dtcsc->getTH1F()->Sumw2(); eff_eta_rpc = bookClone1DVB("eff_eta_rpc","efficiency RPC vs eta","eta_DTCSC_and_RPC"); eff_eta_rpc->setAxisTitle("eta",1); eff_eta_rpc->getTH1F()->Sumw2(); eff_phi_dtcsc = bookClone1D("eff_phi_dtcsc","efficiency DTCSC vs phi","phi_DTCSC_and_RPC"); eff_phi_dtcsc->setAxisTitle("phi (deg)",1); eff_phi_dtcsc->getTH1F()->Sumw2(); eff_phi_rpc = bookClone1D("eff_phi_rpc","efficiency RPC vs phi","phi_DTCSC_and_RPC"); eff_phi_rpc->setAxisTitle("phi (deg)",1); eff_phi_rpc->getTH1F()->Sumw2(); eff_etaphi_dtcsc = bookClone2D("eff_etaphi_dtcsc","efficiency DTCSC vs eta and phi","etaphi_DTCSC_and_RPC"); eff_etaphi_dtcsc->setAxisTitle("eta",1); eff_etaphi_dtcsc->setAxisTitle("phi (deg)",2); eff_etaphi_dtcsc->getTH2F()->Sumw2(); eff_etaphi_rpc = bookClone2D("eff_etaphi_rpc","efficiency RPC vs eta and phi","etaphi_DTCSC_and_RPC"); eff_etaphi_rpc->setAxisTitle("eta",1); eff_etaphi_rpc->setAxisTitle("phi (deg)",2); eff_etaphi_rpc->getTH2F()->Sumw2(); }
MonitorElement * L1TGMTClient::bookClone1D | ( | std::string | name, |
std::string | title, | ||
std::string | hrefName | ||
) | [private] |
Definition at line 205 of file L1TGMTClient.cc.
References DQMStore::book1D(), dbe_, cmsDownloadME::href, and NULL.
{ MonitorElement* me; TH1F* href = get1DHisto(input_dir_+"/"+hrefName,dbe_); if(href) { const unsigned nbx = href->GetNbinsX(); const double xmin = href->GetXaxis()->GetXmin(); const double xmax = href->GetXaxis()->GetXmax(); me = dbe_->book1D(name,title,nbx,xmin,xmax); } else { me = NULL; } return me; }
MonitorElement * L1TGMTClient::bookClone1DVB | ( | std::string | name, |
std::string | title, | ||
std::string | hrefName | ||
) | [private] |
Definition at line 221 of file L1TGMTClient.cc.
References DQMStore::book1D(), dbe_, cmsDownloadME::href, i, NULL, and fw3dlego::xbins.
{ MonitorElement* me; TH1F* href = get1DHisto(input_dir_+"/"+hrefName,dbe_); if(href) { int nbx = href->GetNbinsX(); if(nbx>99) nbx=99; float xbins[100]; for(int i=0; i<nbx; i++) { xbins[i]=href->GetBinLowEdge(i+1); } xbins[nbx]=href->GetXaxis()->GetXmax(); me = dbe_->book1D(name,title,nbx,xbins); } else { me = NULL; } return me; }
MonitorElement * L1TGMTClient::bookClone2D | ( | std::string | name, |
std::string | title, | ||
std::string | hrefName | ||
) | [private] |
Definition at line 241 of file L1TGMTClient.cc.
References DQMStore::book2D(), dbe_, cmsDownloadME::href, and NULL.
{ MonitorElement* me; TH2F* href = get2DHisto(input_dir_+"/"+hrefName,dbe_); if(href) { const unsigned nbx = href->GetNbinsX(); const double xmin = href->GetXaxis()->GetXmin(); const double xmax = href->GetXaxis()->GetXmax(); const unsigned nby = href->GetNbinsY(); const double ymin = href->GetYaxis()->GetXmin(); const double ymax = href->GetYaxis()->GetXmax(); me = dbe_->book2D(name,title,nbx,xmin,xmax,nby,ymin,ymax); } else { me = NULL; } return me; }
void L1TGMTClient::endJob | ( | void | ) | [protected, virtual] |
void L1TGMTClient::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
DQM Client Diagnostic.
Reimplemented from edm::EDAnalyzer.
Definition at line 103 of file L1TGMTClient.cc.
References align_tpl::process.
{ counterLS_++; if (prescaleLS_<1) return; if (prescaleLS_>0 && counterLS_%prescaleLS_ != 0) return; // cout << "L1TGMTClient::endLumi" << endl; process(); }
void L1TGMTClient::endRun | ( | const edm::Run & | r, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
EndRun.
Reimplemented from edm::EDAnalyzer.
Definition at line 136 of file L1TGMTClient.cc.
References align_tpl::process.
{ process(); }
TH1F* L1TGMTClient::get1DHisto | ( | std::string | meName, |
DQMStore * | dbi | ||
) | [private] |
TH2F* L1TGMTClient::get2DHisto | ( | std::string | meName, |
DQMStore * | dbi | ||
) | [private] |
void L1TGMTClient::initialize | ( | ) | [private] |
Definition at line 25 of file L1TGMTClient.cc.
References gather_cfg::cout, dbe_, and cmsCodeRules::cppFunctionSkipper::operator.
{ counterLS_=0; counterEvt_=0; // get back-end interface dbe_ = Service<DQMStore>().operator->(); // base folder for the contents of this job monitorName_ = parameters_.getUntrackedParameter<string>("monitorName",""); cout << "Monitor name = " << monitorName_ << endl; prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1); cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< endl; prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1); cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< endl; output_dir_ = parameters_.getUntrackedParameter<string>("output_dir",""); cout << "DQM output dir = " << output_dir_ << endl; input_dir_ = parameters_.getUntrackedParameter<string>("input_dir",""); cout << "DQM input dir = " << input_dir_ << endl; LogInfo( "TriggerDQM"); }
void L1TGMTClient::makeEfficiency1D | ( | MonitorElement * | meeff, |
std::string | heName, | ||
std::string | hiName | ||
) | [private] |
Definition at line 156 of file L1TGMTClient.cc.
References dbe_, and MonitorElement::getTH1F().
{ TH1F* he = get1DHisto(input_dir_+"/"+heName,dbe_); TH1F* hi = get1DHisto(input_dir_+"/"+hiName,dbe_); TH1F* heff = meeff->getTH1F(); if(heff && he && hi) { TH1F* hall = (TH1F*) he->Clone("hall"); hall->Add(hi); heff->Divide(he,hall,1.,1.,"B"); delete hall; } }
void L1TGMTClient::makeEfficiency2D | ( | MonitorElement * | meeff, |
std::string | heName, | ||
std::string | hiName | ||
) | [private] |
Definition at line 170 of file L1TGMTClient.cc.
References dbe_, and MonitorElement::getTH2F().
{ TH2F* he = get2DHisto(input_dir_+"/"+heName,dbe_); TH2F* hi = get2DHisto(input_dir_+"/"+hiName,dbe_); TH2F* heff = meeff->getTH2F(); if(heff && he && hi) { TH2F* hall = (TH2F*) he->Clone("hall"); hall->Add(hi); heff->Divide(he,hall,1.,1.,"B"); delete hall; } }
void L1TGMTClient::makeRatio1D | ( | MonitorElement * | mer, |
std::string | h1Name, | ||
std::string | h2Name | ||
) | [private] |
Definition at line 145 of file L1TGMTClient.cc.
References dbe_, and MonitorElement::getTH1F().
{ TH1F* h1 = get1DHisto(input_dir_+"/"+h1Name,dbe_); TH1F* h2 = get1DHisto(input_dir_+"/"+h2Name,dbe_); TH1F* hr = mer->getTH1F(); if(hr && h1 && h2) { hr->Divide(h1,h2,1.,1.," "); } }
void L1TGMTClient::process | ( | ) | [private] |
Definition at line 121 of file L1TGMTClient.cc.
{ // cout << "L1TGMTClient: processing..." << endl; makeEfficiency1D(eff_eta_dtcsc,"eta_DTCSC_and_RPC","eta_RPC_only"); makeEfficiency1D(eff_eta_rpc ,"eta_DTCSC_and_RPC","eta_DTCSC_only"); makeEfficiency1D(eff_phi_dtcsc,"phi_DTCSC_and_RPC","phi_RPC_only"); makeEfficiency1D(eff_phi_rpc ,"phi_DTCSC_and_RPC","phi_DTCSC_only"); makeEfficiency2D(eff_etaphi_dtcsc,"etaphi_DTCSC_and_RPC","etaphi_RPC_only"); makeEfficiency2D(eff_etaphi_rpc ,"etaphi_DTCSC_and_RPC","etaphi_DTCSC_only"); }
int L1TGMTClient::counterEvt_ [private] |
counter
Definition at line 64 of file L1TGMTClient.h.
int L1TGMTClient::counterLS_ [private] |
Definition at line 63 of file L1TGMTClient.h.
DQMStore* L1TGMTClient::dbe_ [private] |
Definition at line 59 of file L1TGMTClient.h.
MonitorElement* L1TGMTClient::eff_eta_dtcsc [private] |
prescale on number of events
Definition at line 69 of file L1TGMTClient.h.
MonitorElement* L1TGMTClient::eff_eta_rpc [private] |
Definition at line 70 of file L1TGMTClient.h.
MonitorElement* L1TGMTClient::eff_etaphi_dtcsc [private] |
Definition at line 73 of file L1TGMTClient.h.
MonitorElement* L1TGMTClient::eff_etaphi_rpc [private] |
Definition at line 74 of file L1TGMTClient.h.
MonitorElement* L1TGMTClient::eff_phi_dtcsc [private] |
Definition at line 71 of file L1TGMTClient.h.
MonitorElement* L1TGMTClient::eff_phi_rpc [private] |
Definition at line 72 of file L1TGMTClient.h.
std::string L1TGMTClient::input_dir_ [private] |
Definition at line 61 of file L1TGMTClient.h.
std::string L1TGMTClient::monitorName_ [private] |
Definition at line 60 of file L1TGMTClient.h.
std::string L1TGMTClient::output_dir_ [private] |
Definition at line 62 of file L1TGMTClient.h.
edm::ParameterSet L1TGMTClient::parameters_ [private] |
Definition at line 58 of file L1TGMTClient.h.
int L1TGMTClient::prescaleEvt_ [private] |
units of lumi sections
Definition at line 66 of file L1TGMTClient.h.
int L1TGMTClient::prescaleLS_ [private] |
counter
Definition at line 65 of file L1TGMTClient.h.