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 edm::EDConsumerBase

Public Member Functions

 DQMFileReader (const edm::ParameterSet &)
 
 ~DQMFileReader ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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_, referenceFileName_, and AlCaHLTBitMon_QueryRunRegistry::string.

6 {
7 
8  pset_ = ps;
9 
11 
12  filenames_.clear();
13  filenames_=pset_.getUntrackedParameter<std::vector<std::string > >("FileNames");
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(), AlCaHLTBitMon_QueryRunRegistry::string, 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:644
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:920
std::vector< std::string > filenames_
Definition: DQMFileReader.h:37
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2910
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:2895
tuple cout
Definition: gather_cfg.py:121
std::string referenceFileName_
Definition: DQMFileReader.h:38
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
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().