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 Attributes
TauDQMSimpleFileSaver Class Reference

#include <DQMSimpleFileSaver.h>

Inheritance diagram for TauDQMSimpleFileSaver:
edm::EDAnalyzer

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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

int cfgError_
 
std::string outputFileName_
 

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

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

Date:
2012/04/20 13:26:21
Revision:
1.2
Author
Christian Veelken, UC Davis

Definition at line 22 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(), and outputFileName_.

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

Implements edm::EDAnalyzer.

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, 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="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

int TauDQMSimpleFileSaver::cfgError_
private

Definition at line 32 of file DQMSimpleFileSaver.h.

Referenced by endJob(), and TauDQMSimpleFileSaver().

std::string TauDQMSimpleFileSaver::outputFileName_
private

Definition at line 31 of file DQMSimpleFileSaver.h.

Referenced by endJob(), and TauDQMSimpleFileSaver().