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
DQMSimpleFileSaver Class Reference

#include <DQMSimpleFileSaver.h>

Inheritance diagram for DQMSimpleFileSaver:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 DQMSimpleFileSaver (const edm::ParameterSet &)
 
virtual void endJob ()
 
virtual ~DQMSimpleFileSaver ()
 
- 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)
 
- 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:
2008/11/18 16:41:39
Revision:
1.1
Author
Christian Veelken, UC Davis

Definition at line 22 of file DQMSimpleFileSaver.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file DQMSimpleFileSaver.cc.

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

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

Definition at line 31 of file DQMSimpleFileSaver.cc.

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

Member Function Documentation

void DQMSimpleFileSaver::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 DQMSimpleFileSaver::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 << "<DQMSimpleFileSaver::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:1898
tuple cout
Definition: gather_cfg.py:41
std::string outputFileName_

Member Data Documentation

int DQMSimpleFileSaver::cfgError_
private

Definition at line 32 of file DQMSimpleFileSaver.h.

Referenced by DQMSimpleFileSaver(), and endJob().

std::string DQMSimpleFileSaver::outputFileName_
private

Definition at line 31 of file DQMSimpleFileSaver.h.

Referenced by DQMSimpleFileSaver(), and endJob().