CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
NoiseRatesClient.cc
Go to the documentation of this file.
3 
8 
10 
12 {
13 
14  outputFile_ = iConfig.getUntrackedParameter<std::string>("outputFile", "myfile.root");
15 
16  debug_ = false;
17  verbose_ = false;
18 
19  dirName_=iConfig.getParameter<std::string>("DQMDirName");
20 
21 }
22 
23 
25 {
26 
27 }
28 
29 
30 
32 {
33  runClient_(ib,ig);
34 }
35 
37 {
39 
40  if (verbose_) std::cout << "\nrunClient" << std::endl;
41 
42  std::vector<MonitorElement*> hcalMEs;
43 
44  // Since out folders are fixed to three, we can just go over these three folders
45  // i.e., CaloTowersV/CaloTowersTask, HcalRecHitsV/HcalRecHitTask, NoiseRatesV/NoiseRatesTask.
46  std::vector<std::string> fullPathHLTFolders = ig.getSubdirs();
47  for(unsigned int i=0;i<fullPathHLTFolders.size();i++) {
48 
49  if (verbose_) std::cout <<"\nfullPath: "<< fullPathHLTFolders[i] << std::endl;
50  ig.setCurrentFolder(fullPathHLTFolders[i]);
51 
52  std::vector<std::string> fullSubPathHLTFolders = ig.getSubdirs();
53  for(unsigned int j=0;j<fullSubPathHLTFolders.size();j++) {
54 
55  if (verbose_) std::cout <<"fullSub: "<<fullSubPathHLTFolders[j] << std::endl;
56 
57  if( strcmp(fullSubPathHLTFolders[j].c_str(), "NoiseRatesV/NoiseRatesTask") ==0 ){
58  hcalMEs = ig.getContents(fullSubPathHLTFolders[j]);
59  if (verbose_) std::cout <<"hltMES size : "<<hcalMEs.size()<<std::endl;
60  if( !NoiseRatesEndjob(hcalMEs) ) std::cout<<"\nError in NoiseRatesEndjob!"<<std::endl<<std::endl;
61  }
62 
63  }
64 
65  }
66 
67 }
68 
69 // called after entering the NoiseRatesV/NoiseRatesTask directory
70 // hcalMEs are within that directory
71 int NoiseRatesClient::NoiseRatesEndjob(const std::vector<MonitorElement*> &hcalMEs){
72 
73  int useAllHistos = 0;
74  MonitorElement* hLumiBlockCount =0;
75  for(unsigned int ih=0; ih<hcalMEs.size(); ih++){
76  if( strcmp(hcalMEs[ih]->getName().c_str(), "hLumiBlockCount") ==0 ){
77  hLumiBlockCount = hcalMEs[ih];
78  useAllHistos =1;
79  }
80  }
81  if( useAllHistos !=0 && useAllHistos !=1 ) return 0;
82 
83 // FIXME: dummy lumiCountMap.size since hLumiBlockCount is disabled
84 // in a general case.
85  int lumiCountMapsize = -1; // dummy
86  if (useAllHistos) hLumiBlockCount->Fill(0.0, lumiCountMapsize);
87 
88  return 1;
89 
90 }
91 
std::vector< MonitorElement * > getContents(Args &&...args)
Definition: DQMStore.h:197
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
int ib
Definition: cuy.py:660
std::string dirName_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
NoiseRatesClient(const edm::ParameterSet &)
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
virtual void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
std::string outputFile_
virtual void runClient_(DQMStore::IBooker &, DQMStore::IGetter &)
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:306
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:330
int NoiseRatesEndjob(const std::vector< MonitorElement * > &hcalMEs)
tuple cout
Definition: gather_cfg.py:121
virtual ~NoiseRatesClient()