CMS 3D CMS Logo

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