CMS 3D CMS Logo

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