CMS 3D CMS Logo

HcalNoiseRatesClient.cc
Go to the documentation of this file.
3 
7 
9 
11  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
12  debug_ = false;
13  verbose_ = false;
14  dirName_ = iConfig.getParameter<std::string>("DQMDirName");
15 }
16 
18 
20 
22 
24  igetter.setCurrentFolder(dirName_);
25 
26  if (verbose_)
27  std::cout << "\nrunClient" << std::endl;
28 
29  std::vector<MonitorElement *> hcalMEs;
30 
31  // Since out folders are fixed to three, we can just go over these three
32  // folders i.e., CaloTowersD/CaloTowersTask, HcalRecHitsD/HcalRecHitTask,
33  // HcalNoiseRatesD/NoiseRatesTask.
34  std::vector<std::string> fullPathHLTFolders = igetter.getSubdirs();
35  for (unsigned int i = 0; i < fullPathHLTFolders.size(); i++) {
36  if (verbose_)
37  std::cout << "\nfullPath: " << fullPathHLTFolders[i] << std::endl;
38  igetter.setCurrentFolder(fullPathHLTFolders[i]);
39 
40  std::vector<std::string> fullSubPathHLTFolders = igetter.getSubdirs();
41  for (unsigned int j = 0; j < fullSubPathHLTFolders.size(); j++) {
42  if (verbose_)
43  std::cout << "fullSub: " << fullSubPathHLTFolders[j] << std::endl;
44 
45  if (strcmp(fullSubPathHLTFolders[j].c_str(), "HcalNoiseRatesD/NoiseRatesTask") == 0) {
46  hcalMEs = igetter.getContents(fullSubPathHLTFolders[j]);
47  if (verbose_)
48  std::cout << "hltMES size : " << hcalMEs.size() << std::endl;
49  if (!NoiseRatesEndjob(hcalMEs))
50  std::cout << "\nError in NoiseRatesEndjob!" << std::endl << std::endl;
51  }
52  }
53  }
54 }
55 
56 // called after entering the HcalNoiseRatesD/NoiseRatesTask directory
57 // hcalMEs are within that directory
58 int HcalNoiseRatesClient::NoiseRatesEndjob(const std::vector<MonitorElement *> &hcalMEs) {
59  int useAllHistos = 0;
60  MonitorElement *hLumiBlockCount = nullptr;
61  for (unsigned int ih = 0; ih < hcalMEs.size(); ih++) {
62  if (strcmp(hcalMEs[ih]->getName().c_str(), "hLumiBlockCount") == 0) {
63  hLumiBlockCount = hcalMEs[ih];
64  useAllHistos = 1;
65  }
66  }
67  if (useAllHistos != 0 && useAllHistos != 1)
68  return 0;
69 
70  // FIXME: dummy lumiCountMap.size since hLumiBlockCount is disabled
71  // in a general case.
72  int lumiCountMapsize = -1; // dummy
73  if (useAllHistos)
74  hLumiBlockCount->Fill(0.0, lumiCountMapsize);
75 
76  return 1;
77 }
78 
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
T getUntrackedParameter(std::string const &, T const &) const
void Fill(long long x)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
int NoiseRatesEndjob(const std::vector< MonitorElement *> &hcalMEs)
TString getName(TString structure, int layer, TString geometry)
Definition: DMRtrends.cc:236
HcalNoiseRatesClient(const edm::ParameterSet &)
void beginJob(void) override
Definition: Run.h:45
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:707