CMS 3D CMS Logo

HcalNoiseRatesClient.cc
Go to the documentation of this file.
3 
8 
11 
13  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
14  debug_ = false;
15  verbose_ = false;
16  dirName_ = iConfig.getParameter<std::string>("DQMDirName");
17 }
18 
20 
22 
24 
26  igetter.setCurrentFolder(dirName_);
27 
28  if (verbose_)
29  std::cout << "\nrunClient" << std::endl;
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., CaloTowersD/CaloTowersTask, HcalRecHitsD/HcalRecHitTask,
35  // HcalNoiseRatesD/NoiseRatesTask.
36  std::vector<std::string> fullPathHLTFolders = igetter.getSubdirs();
37  for (unsigned int i = 0; i < fullPathHLTFolders.size(); i++) {
38  if (verbose_)
39  std::cout << "\nfullPath: " << fullPathHLTFolders[i] << std::endl;
40  igetter.setCurrentFolder(fullPathHLTFolders[i]);
41 
42  std::vector<std::string> fullSubPathHLTFolders = igetter.getSubdirs();
43  for (unsigned int j = 0; j < fullSubPathHLTFolders.size(); j++) {
44  if (verbose_)
45  std::cout << "fullSub: " << fullSubPathHLTFolders[j] << std::endl;
46 
47  if (strcmp(fullSubPathHLTFolders[j].c_str(), "HcalNoiseRatesD/NoiseRatesTask") == 0) {
48  hcalMEs = igetter.getContents(fullSubPathHLTFolders[j]);
49  if (verbose_)
50  std::cout << "hltMES size : " << hcalMEs.size() << std::endl;
51  if (!NoiseRatesEndjob(hcalMEs))
52  std::cout << "\nError in NoiseRatesEndjob!" << std::endl << std::endl;
53  }
54  }
55  }
56 }
57 
58 // called after entering the HcalNoiseRatesD/NoiseRatesTask directory
59 // hcalMEs are within that directory
60 int HcalNoiseRatesClient::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 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:361
int NoiseRatesEndjob(const std::vector< MonitorElement * > &hcalMEs)
void Fill(long long x)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:192
TString getName(TString structure, int layer, TString geometry)
Definition: DMRtrends.cc:167
HcalNoiseRatesClient(const edm::ParameterSet &)
void beginJob(void) override
std::vector< std::string > getSubdirs()
Definition: DQMStore.cc:325
Definition: Run.h:45