CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TauDQMSimpleFileSaver Class Reference

#include <DQMSimpleFileSaver.h>

Inheritance diagram for TauDQMSimpleFileSaver:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void endJob ()
 
 TauDQMSimpleFileSaver (const edm::ParameterSet &)
 
virtual ~TauDQMSimpleFileSaver ()
 
- 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 Attributes

int cfgError_
 
std::string outputFileName_
 

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

Class to write all monitor elements registered in DQMStore into ROOT file (without any naming restrictions imposed by "regular" DQMFileSaver)

Author
Christian Veelken, UC Davis

Definition at line 20 of file DQMSimpleFileSaver.h.

Constructor & Destructor Documentation

TauDQMSimpleFileSaver::TauDQMSimpleFileSaver ( const edm::ParameterSet cfg)
explicit

Definition at line 15 of file DQMSimpleFileSaver.cc.

References cfgError_, edm::ParameterSet::getParameter(), outputFileName_, and AlCaHLTBitMon_QueryRunRegistry::string.

16 {
17  //std::cout << "<TauDQMSimpleFileSaver::TauDQMSimpleFileSaver>:" << std::endl;
18 
19  cfgError_ = 0;
20 
21  outputFileName_ = cfg.getParameter<std::string>("outputFileName");
22  if ( outputFileName_ == "" ) {
23  edm::LogError("TauDQMSimpleFileSaver") << " No outputFileName specified --> histograms will NOT be saved !!";
24  cfgError_ = 1;
25  } else if ( outputFileName_.find(".root") == std::string::npos ) {
26  edm::LogError("TauDQMSimpleFileSaver") << " Invalid outputFileName = " << outputFileName_ << " --> histograms will NOT be saved !!";
27  cfgError_ = 1;
28  }
29 }
T getParameter(std::string const &) const
TauDQMSimpleFileSaver::~TauDQMSimpleFileSaver ( )
virtual

Definition at line 31 of file DQMSimpleFileSaver.cc.

32 {
33 // nothing to be done yet...
34 }

Member Function Documentation

void TauDQMSimpleFileSaver::analyze ( const edm::Event ,
const edm::EventSetup  
)
virtual

Definition at line 36 of file DQMSimpleFileSaver.cc.

37 {
38 // nothing to be done yet...
39 }
void TauDQMSimpleFileSaver::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file DQMSimpleFileSaver.cc.

References cfgError_, gather_cfg::cout, DEFINE_FWK_MODULE, outputFileName_, and DQMStore::save().

42 {
43  std::cout << "<TauDQMSimpleFileSaver::endJob>:" << std::endl;
44 
45 //--- check that configuration parameters contain no errors
46  if ( cfgError_ ) {
47  edm::LogError ("endJob") << " Error in Configuration ParameterSet --> histograms will NOT be saved !!";
48  return;
49  }
50 
51 //--- check that DQMStore service is available
52  if ( !edm::Service<DQMStore>().isAvailable() ) {
53  edm::LogError ("endJob") << " Failed to access dqmStore --> histograms will NOT be saved !!";
54  return;
55  }
56 
57  DQMStore& dqmStore = (*edm::Service<DQMStore>());
58  dqmStore.save(outputFileName_);
59 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2668

Member Data Documentation

int TauDQMSimpleFileSaver::cfgError_
private

Definition at line 30 of file DQMSimpleFileSaver.h.

Referenced by endJob(), and TauDQMSimpleFileSaver().

std::string TauDQMSimpleFileSaver::outputFileName_
private

Definition at line 29 of file DQMSimpleFileSaver.h.

Referenced by endJob(), and TauDQMSimpleFileSaver().