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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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_, AlCaHLTBitMon_QueryRunRegistry::string, and ~DQMFileReader().

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

Referenced by DQMFileReader().

Member Function Documentation

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

Definition at line 67 of file DQMFileReader.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 20 of file DQMFileReader.cc.

References DQMStore::bookString(), getEcalConditions_orcoffint2r_cff::catalog, DQMStore::cd(), gather_cfg::cout, dbe_, alignCSCRings::ff, corrVsCorr::filename, edm::InputFileCatalog::fileNames(), filenames_, recoMuon::in, DQMStore::load(), DQMStore::open(), referenceFileName_, DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and DQMStore::StripRunDirs.

21 {
22 
23  if (referenceFileName_ != "")
24  {
25  const std::string override = "";
26  std::vector<std::string> in ; in.push_back(referenceFileName_);
27  edm::InputFileCatalog catalog(in,override,true);
28 
29  std::string ff=catalog.fileNames()[0];
30  std::cout << "DQMFileReader: reading reference file '" << ff << "'\n";
31 
32  // now open file, quietly continuing if it does not exist
33  if (dbe_->open(ff, true, "", "Reference", DQMStore::StripRunDirs, false))
34  {
35  dbe_->cd(); dbe_->setCurrentFolder("Info/ProvInfo");
36  dbe_->bookString("referenceFileName",ff);
37  std::cout << "DQMFileReader: reference file '" << ff << "' successfully read in \n";
38  }
39  else
40  {
41  dbe_->cd(); dbe_->setCurrentFolder("Info/ProvInfo");
42  dbe_->bookString("referenceFileName","non-existent:"+ff);
43  std::cout << "DQMFileReader: reference file '" << ff << "' does not exist \n";
44  }
45  dbe_->cd();
46  return;
47  }
48 
49  dbe_->bookString("referenceFileName","no reference file specified");
50  dbe_->cd();
51 
52  // read in files, stripping off Run Summary and Run <number> folders
53 
54  for (auto const & filename : filenames_)
55  {
56  std::cout << "DQMFileReader::beginJob: loading" << filename << std::endl;
57  if (dbe_)
58  dbe_->load(filename);
59  }
60 }
DQMStore * dbe_
Definition: DQMFileReader.h:34
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:803
std::vector< std::string > filenames_
Definition: DQMFileReader.h:37
bool load(const std::string &filename, OpenRunDirs stripdirs=StripRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2951
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:522
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:2936
std::string referenceFileName_
Definition: DQMFileReader.h:38
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:545
void DQMFileReader::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 63 of file DQMFileReader.cc.

64 {}

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