#include <HcalNoiseRatesClient.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (void) |
virtual void | beginRun (const edm::Run &run, const edm::EventSetup &c) |
virtual void | endJob () |
virtual void | endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) |
virtual void | endRun (const edm::Run &run, const edm::EventSetup &c) |
HcalNoiseRatesClient (const edm::ParameterSet &) | |
int | NoiseRatesEndjob (const std::vector< MonitorElement * > &hcalMEs) |
virtual void | runClient_ () |
virtual | ~HcalNoiseRatesClient () |
Private Attributes | |
edm::ParameterSet | conf_ |
DQMStore * | dbe_ |
bool | debug_ |
std::string | dirName_ |
std::string | dirNameJet_ |
std::string | dirNameMET_ |
std::string | outputFile_ |
bool | verbose_ |
Definition at line 36 of file HcalNoiseRatesClient.h.
HcalNoiseRatesClient::HcalNoiseRatesClient | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 12 of file HcalNoiseRatesClient.cc.
References dbe_, debug_, dirName_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, outputFile_, and verbose_.
:conf_(iConfig) { outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root"); dbe_ = edm::Service<DQMStore>().operator->(); if (!dbe_) { edm::LogError("HcalNoiseRatesClient") << "unable to get DQMStore service, upshot is no client histograms will be made"; } if(iConfig.getUntrackedParameter<bool>("DQMStore", false)) { if(dbe_) dbe_->setVerbose(0); } debug_ = false; verbose_ = false; dirName_=iConfig.getParameter<std::string>("DQMDirName"); if(dbe_) dbe_->setCurrentFolder(dirName_); }
HcalNoiseRatesClient::~HcalNoiseRatesClient | ( | ) | [virtual] |
Definition at line 34 of file HcalNoiseRatesClient.cc.
{ }
void HcalNoiseRatesClient::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
void HcalNoiseRatesClient::beginJob | ( | void | ) | [virtual] |
void HcalNoiseRatesClient::beginRun | ( | const edm::Run & | run, |
const edm::EventSetup & | c | ||
) | [virtual] |
void HcalNoiseRatesClient::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 45 of file HcalNoiseRatesClient.cc.
References dbe_, outputFile_, and DQMStore::save().
{ if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_); }
void HcalNoiseRatesClient::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | c | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 67 of file HcalNoiseRatesClient.cc.
{
// runClient_();
}
void HcalNoiseRatesClient::endRun | ( | const edm::Run & | run, |
const edm::EventSetup & | c | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 56 of file HcalNoiseRatesClient.cc.
References runClient_().
{ runClient_(); }
int HcalNoiseRatesClient::NoiseRatesEndjob | ( | const std::vector< MonitorElement * > & | hcalMEs | ) |
Definition at line 108 of file HcalNoiseRatesClient.cc.
References MonitorElement::Fill(), and edm::getName().
Referenced by runClient_().
{ int useAllHistos = 0; MonitorElement* hLumiBlockCount =0; for(unsigned int ih=0; ih<hcalMEs.size(); ih++){ if( strcmp(hcalMEs[ih]->getName().c_str(), "hLumiBlockCount") ==0 ){ hLumiBlockCount = hcalMEs[ih]; useAllHistos =1; } } if( useAllHistos !=0 && useAllHistos !=1 ) return 0; // FIXME: dummy lumiCountMap.size since hLumiBlockCount is disabled // in a general case. int lumiCountMapsize = -1; // dummy if (useAllHistos) hLumiBlockCount->Fill(0.0, lumiCountMapsize); return 1; }
void HcalNoiseRatesClient::runClient_ | ( | ) | [virtual] |
Definition at line 72 of file HcalNoiseRatesClient.cc.
References gather_cfg::cout, dbe_, dirName_, DQMStore::getContents(), DQMStore::getSubdirs(), i, j, NoiseRatesEndjob(), DQMStore::setCurrentFolder(), and verbose_.
Referenced by endRun().
{ if(!dbe_) return; //we dont have the DQMStore so we cant do anything dbe_->setCurrentFolder(dirName_); if (verbose_) std::cout << "\nrunClient" << std::endl; std::vector<MonitorElement*> hcalMEs; // Since out folders are fixed to three, we can just go over these three folders // i.e., CaloTowersD/CaloTowersTask, HcalRecHitsD/HcalRecHitTask, HcalNoiseRatesD/NoiseRatesTask. std::vector<std::string> fullPathHLTFolders = dbe_->getSubdirs(); for(unsigned int i=0;i<fullPathHLTFolders.size();i++) { if (verbose_) std::cout <<"\nfullPath: "<< fullPathHLTFolders[i] << std::endl; dbe_->setCurrentFolder(fullPathHLTFolders[i]); std::vector<std::string> fullSubPathHLTFolders = dbe_->getSubdirs(); for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) { if (verbose_) std::cout <<"fullSub: "<<fullSubPathHLTFolders[j] << std::endl; if( strcmp(fullSubPathHLTFolders[j].c_str(), "HcalNoiseRatesD/NoiseRatesTask") ==0 ){ hcalMEs = dbe_->getContents(fullSubPathHLTFolders[j]); if (verbose_) std::cout <<"hltMES size : "<<hcalMEs.size()<<std::endl; if( !NoiseRatesEndjob(hcalMEs) ) std::cout<<"\nError in NoiseRatesEndjob!"<<std::endl<<std::endl; } } } }
edm::ParameterSet HcalNoiseRatesClient::conf_ [private] |
Definition at line 42 of file HcalNoiseRatesClient.h.
DQMStore* HcalNoiseRatesClient::dbe_ [private] |
Definition at line 39 of file HcalNoiseRatesClient.h.
Referenced by endJob(), HcalNoiseRatesClient(), and runClient_().
bool HcalNoiseRatesClient::debug_ [private] |
Definition at line 45 of file HcalNoiseRatesClient.h.
Referenced by HcalNoiseRatesClient().
std::string HcalNoiseRatesClient::dirName_ [private] |
Definition at line 47 of file HcalNoiseRatesClient.h.
Referenced by HcalNoiseRatesClient(), and runClient_().
std::string HcalNoiseRatesClient::dirNameJet_ [private] |
Definition at line 48 of file HcalNoiseRatesClient.h.
std::string HcalNoiseRatesClient::dirNameMET_ [private] |
Definition at line 49 of file HcalNoiseRatesClient.h.
std::string HcalNoiseRatesClient::outputFile_ [private] |
Definition at line 40 of file HcalNoiseRatesClient.h.
Referenced by endJob(), and HcalNoiseRatesClient().
bool HcalNoiseRatesClient::verbose_ [private] |
Definition at line 44 of file HcalNoiseRatesClient.h.
Referenced by HcalNoiseRatesClient(), and runClient_().