CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DQMFileReader Class Reference

#include <DQMFileReader.h>

Inheritance diagram for DQMFileReader:
edm::EDAnalyzer

Public Member Functions

 DQMFileReader (const edm::ParameterSet &)
 
 ~DQMFileReader ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

DQMStoredbe_
 
std::vector< std::string > filenames_
 
edm::ParameterSet pset_
 
std::string referenceFileName_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 23 of file DQMFileReader.h.

Constructor & Destructor Documentation

DQMFileReader::DQMFileReader ( const edm::ParameterSet ps)
explicit

Definition at line 5 of file DQMFileReader.cc.

References dbe_, filenames_, edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, pset_, and referenceFileName_.

6 {
7 
8  pset_ = ps;
9 
11 
12  filenames_.clear();
13  filenames_=pset_.getUntrackedParameter<std::vector<std::string > >("FileNames");
14  referenceFileName_=pset_.getUntrackedParameter<std::string>("referenceFileName","");
15 }
T getUntrackedParameter(std::string const &, T const &) const
DQMStore * dbe_
Definition: DQMFileReader.h:34
edm::ParameterSet pset_
Definition: DQMFileReader.h:35
std::vector< std::string > filenames_
Definition: DQMFileReader.h:37
std::string referenceFileName_
Definition: DQMFileReader.h:38
DQMFileReader::~DQMFileReader ( )

Definition at line 17 of file DQMFileReader.cc.

18 {}

Member Function Documentation

void DQMFileReader::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 68 of file DQMFileReader.cc.

69 {}
void DQMFileReader::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file DQMFileReader.cc.

References DQMStore::bookString(), validate_alignment_devdb10_cfg::catalog, DQMStore::cd(), gather_cfg::cout, dbe_, alignCSCRings::ff, edm::InputFileCatalog::fileNames(), filenames_, i, recoMuon::in, DQMStore::load(), DQMStore::open(), referenceFileName_, DQMStore::setCurrentFolder(), and DQMStore::StripRunDirs.

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 }
int i
Definition: DBlmapReader.cc:9
DQMStore * dbe_
Definition: DQMFileReader.h:34
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:683
std::vector< std::string > filenames_
Definition: DQMFileReader.h:37
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2447
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:2432
tuple cout
Definition: gather_cfg.py:121
std::string referenceFileName_
Definition: DQMFileReader.h:38
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void DQMFileReader::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file DQMFileReader.cc.

65 {}

Member Data Documentation

DQMStore* DQMFileReader::dbe_
private

Definition at line 34 of file DQMFileReader.h.

Referenced by beginJob(), and DQMFileReader().

std::vector<std::string > DQMFileReader::filenames_
private

Definition at line 37 of file DQMFileReader.h.

Referenced by beginJob(), and DQMFileReader().

edm::ParameterSet DQMFileReader::pset_
private

Definition at line 35 of file DQMFileReader.h.

Referenced by DQMFileReader().

std::string DQMFileReader::referenceFileName_
private

Definition at line 38 of file DQMFileReader.h.

Referenced by beginJob(), and DQMFileReader().