CMS 3D CMS Logo

HcalNoiseRatesClient.cc
Go to the documentation of this file.
3 
8 
10 
12  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
13  debug_ = false;
14  verbose_ = false;
15  dirName_ = iConfig.getParameter<std::string>("DQMDirName");
16 }
17 
19 
21 
23 
25  igetter.setCurrentFolder(dirName_);
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., CaloTowersD/CaloTowersTask, HcalRecHitsD/HcalRecHitTask,
34  // HcalNoiseRatesD/NoiseRatesTask.
35  std::vector<std::string> fullPathHLTFolders = igetter.getSubdirs();
36  for (unsigned int i = 0; i < fullPathHLTFolders.size(); i++) {
37  if (verbose_)
38  std::cout << "\nfullPath: " << fullPathHLTFolders[i] << std::endl;
39  igetter.setCurrentFolder(fullPathHLTFolders[i]);
40 
41  std::vector<std::string> fullSubPathHLTFolders = igetter.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(), "HcalNoiseRatesD/NoiseRatesTask") == 0) {
47  hcalMEs = igetter.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 HcalNoiseRatesD/NoiseRatesTask directory
58 // hcalMEs are within that directory
59 int HcalNoiseRatesClient::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
edm::Run
Definition: Run.h:45
HcalNoiseRatesClient::beginJob
void beginJob(void) override
Definition: HcalNoiseRatesClient.cc:20
gather_cfg.cout
cout
Definition: gather_cfg.py:144
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
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
HcalNoiseRatesClient.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CaloTowersParam_cfi.useAllHistos
useAllHistos
Definition: CaloTowersParam_cfi.py:8
HcalNoiseRatesClient::NoiseRatesEndjob
int NoiseRatesEndjob(const std::vector< MonitorElement * > &hcalMEs)
Definition: HcalNoiseRatesClient.cc:59
HcalNoiseRatesClient::verbose_
bool verbose_
Definition: HcalNoiseRatesClient.h:40
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HcalNoiseRatesClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: HcalNoiseRatesClient.cc:24
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
HcalNoiseRatesClient::beginRun
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
Definition: HcalNoiseRatesClient.cc:22
Run.h
HcalNoiseRatesClient::outputFile_
std::string outputFile_
Definition: HcalNoiseRatesClient.h:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
HcalNoiseRatesClient
Definition: HcalNoiseRatesClient.h:34
HcalNoiseRatesClient::dirName_
std::string dirName_
Definition: HcalNoiseRatesClient.h:43
edm::EventSetup
Definition: EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
writedatasetfile.run
run
Definition: writedatasetfile.py:27
HcalNoiseRatesClient::~HcalNoiseRatesClient
~HcalNoiseRatesClient() override
Definition: HcalNoiseRatesClient.cc:18
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HcalNoiseRatesClient::HcalNoiseRatesClient
HcalNoiseRatesClient(const edm::ParameterSet &)
Definition: HcalNoiseRatesClient.cc:11
HcalNoiseRatesClient::debug_
bool debug_
Definition: HcalNoiseRatesClient.h:41