CMS 3D CMS Logo

NoiseRatesClient.cc
Go to the documentation of this file.
3 
8 
10 
11 NoiseRatesClient::NoiseRatesClient(const edm::ParameterSet &iConfig) : conf_(iConfig) {
12  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
13 
14  debug_ = false;
15  verbose_ = false;
16 
17  dirName_ = iConfig.getParameter<std::string>("DQMDirName");
18 }
19 
21 
23 
26 
27  if (verbose_)
28  std::cout << "\nrunClient" << std::endl;
29 
30  std::vector<MonitorElement *> hcalMEs;
31 
32  // Since out folders are fixed to three, we can just go over these three
33  // folders i.e., CaloTowersV/CaloTowersTask, HcalRecHitsV/HcalRecHitTask,
34  // NoiseRatesV/NoiseRatesTask.
35  std::vector<std::string> fullPathHLTFolders = ig.getSubdirs();
36  for (unsigned int i = 0; i < fullPathHLTFolders.size(); i++) {
37  if (verbose_)
38  std::cout << "\nfullPath: " << fullPathHLTFolders[i] << std::endl;
39  ig.setCurrentFolder(fullPathHLTFolders[i]);
40 
41  std::vector<std::string> fullSubPathHLTFolders = ig.getSubdirs();
42  for (unsigned int j = 0; j < fullSubPathHLTFolders.size(); j++) {
43  if (verbose_)
44  std::cout << "fullSub: " << fullSubPathHLTFolders[j] << std::endl;
45 
46  if (strcmp(fullSubPathHLTFolders[j].c_str(), "NoiseRatesV/NoiseRatesTask") == 0) {
47  hcalMEs = ig.getContents(fullSubPathHLTFolders[j]);
48  if (verbose_)
49  std::cout << "hltMES size : " << hcalMEs.size() << std::endl;
50  if (!NoiseRatesEndjob(hcalMEs))
51  std::cout << "\nError in NoiseRatesEndjob!" << std::endl << std::endl;
52  }
53  }
54  }
55 }
56 
57 // called after entering the NoiseRatesV/NoiseRatesTask directory
58 // hcalMEs are within that directory
59 int NoiseRatesClient::NoiseRatesEndjob(const std::vector<MonitorElement *> &hcalMEs) {
60  int useAllHistos = 0;
61  MonitorElement *hLumiBlockCount = nullptr;
62  for (unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
63  if (strcmp(hcalMEs[ih]->getName().c_str(), "hLumiBlockCount") == 0) {
64  hLumiBlockCount = hcalMEs[ih];
65  useAllHistos = 1;
66  }
67  }
68  if (useAllHistos != 0 && useAllHistos != 1)
69  return 0;
70 
71  // FIXME: dummy lumiCountMap.size since hLumiBlockCount is disabled
72  // in a general case.
73  int lumiCountMapsize = -1; // dummy
74  if (useAllHistos)
75  hLumiBlockCount->Fill(0.0, lumiCountMapsize);
76 
77  return 1;
78 }
79 
mps_fire.i
i
Definition: mps_fire.py:355
dqm::implementation::IGetter::getContents
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
NoiseRatesClient::runClient_
virtual void runClient_(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: NoiseRatesClient.cc:24
NoiseRatesClient::verbose_
bool verbose_
Definition: NoiseRatesClient.h:38
gather_cfg.cout
cout
Definition: gather_cfg.py:144
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
NoiseRatesClient::NoiseRatesEndjob
int NoiseRatesEndjob(const std::vector< MonitorElement * > &hcalMEs)
Definition: NoiseRatesClient.cc:59
DQMStore.h
dqm::implementation::IGetter::getSubdirs
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:678
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
NoiseRatesClient::~NoiseRatesClient
~NoiseRatesClient() override
Definition: NoiseRatesClient.cc:20
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
NoiseRatesClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: NoiseRatesClient.cc:22
CaloTowersParam_cfi.useAllHistos
useAllHistos
Definition: CaloTowersParam_cfi.py:8
NoiseRatesClient.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
getName
TString getName(TString structure, int layer, TString geometry)
Definition: DMRtrends.cc:235
Run.h
NoiseRatesClient::dirName_
std::string dirName_
Definition: NoiseRatesClient.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
cuy.ib
ib
Definition: cuy.py:662
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
NoiseRatesClient::debug_
bool debug_
Definition: NoiseRatesClient.h:39
dqm::implementation::IGetter
Definition: DQMStore.h:484
NoiseRatesClient::NoiseRatesClient
NoiseRatesClient(const edm::ParameterSet &)
Definition: NoiseRatesClient.cc:11
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
NoiseRatesClient
Definition: NoiseRatesClient.h:32
NoiseRatesClient::outputFile_
std::string outputFile_
Definition: NoiseRatesClient.h:34