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 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string dirName_
NoiseRatesClient(const edm::ParameterSet &)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:361
void Fill(long long x)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:192
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
TString getName(TString structure, int layer, TString geometry)
Definition: DMRtrends.cc:167
std::string outputFile_
~NoiseRatesClient() override
virtual void runClient_(DQMStore::IBooker &, DQMStore::IGetter &)
std::vector< std::string > getSubdirs()
Definition: DQMStore.cc:325
int NoiseRatesEndjob(const std::vector< MonitorElement * > &hcalMEs)
ib
Definition: cuy.py:662