CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMSimpleFileSaver.cc
Go to the documentation of this file.
2 
3 // framework & common header files
7 
8 //DQM services
12 
13 #include <iostream>
14 
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 }
30 
32 {
33 // nothing to be done yet...
34 }
35 
37 {
38 // nothing to be done yet...
39 }
40 
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 }
60 
62 
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
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
TauDQMSimpleFileSaver(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
tuple cout
Definition: gather_cfg.py:121