CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMFileReader.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6 {
7 
8  pset_ = ps;
9 
11 
12  filenames_.clear();
13  filenames_=pset_.getUntrackedParameter<std::vector<std::string > >("FileNames");
15 }
16 
18 {}
19 
20 void
22 {
23 
24  if (referenceFileName_ != "")
25  {
26  const std::string override = "";
27  std::vector<std::string> in ; in.push_back(referenceFileName_);
28  edm::InputFileCatalog catalog(in,override,true);
29 
30  std::string ff=catalog.fileNames()[0];
31  std::cout << "DQMFileReader: reading reference file '" << ff << "'\n";
32 
33  // now open file, quietly continuing if it does not exist
34  if (dbe_->open(ff, true, "", "Reference", DQMStore::StripRunDirs, false))
35  {
36  dbe_->cd(); dbe_->setCurrentFolder("Info/ProvInfo");
37  dbe_->bookString("referenceFileName",ff);
38  std::cout << "DQMFileReader: reference file '" << ff << "' successfully read in \n";
39  }
40  else
41  {
42  dbe_->cd(); dbe_->setCurrentFolder("Info/ProvInfo");
43  dbe_->bookString("referenceFileName","non-existent:"+ff);
44  std::cout << "DQMFileReader: reference file '" << ff << "' does not exist \n";
45  }
46  dbe_->cd();
47  return;
48  }
49 
50  dbe_->bookString("referenceFileName","no reference file specified");
51  dbe_->cd();
52 
53  // read in files, stripping off Run Summary and Run <number> folders
54 
55  for (unsigned int i=0; i<filenames_.size(); i++)
56  {
57  std::cout << "DQMFileReader::beginJob: loading" << filenames_[i] << std::endl;
58  if (dbe_)
59  dbe_->load(filenames_[i]);
60  }
61 }
62 
63 void
65 {}
66 
67 void
69 {}
70 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
DQMFileReader(const edm::ParameterSet &)
Definition: DQMFileReader.cc:5
DQMStore * dbe_
Definition: DQMFileReader.h:34
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:700
edm::ParameterSet pset_
Definition: DQMFileReader.h:35
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:230
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:983
std::vector< std::string > filenames_
Definition: DQMFileReader.h:37
virtual void endJob()
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:3004
std::vector< std::string > const & fileNames() const
virtual void beginJob()
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2989
tuple cout
Definition: gather_cfg.py:145
std::string referenceFileName_
Definition: DQMFileReader.h:38
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:723