CMS 3D CMS Logo

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 () override
 
- 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
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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(), Utilities::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 ( )
override

Definition at line 17 of file DQMFileReader.cc.

18 {}

Member Function Documentation

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

Definition at line 68 of file DQMFileReader.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file DQMFileReader.cc.

References DQMStore::bookString(), getEcalConditions_orcoffint2r_cff::catalog, DQMStore::cd(), gather_cfg::cout, dbe_, alignCSCRings::ff, edm::InputFileCatalog::fileNames(), filenames_, mps_fire::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 }
DQMStore * dbe_
Definition: DQMFileReader.h:34
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:718
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:1001
std::vector< std::string > filenames_
Definition: DQMFileReader.h:37
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:3040
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:3025
std::string referenceFileName_
Definition: DQMFileReader.h:38
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:741
void DQMFileReader::endJob ( void  )
overrideprivatevirtual

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().