CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DQMSimpleFileSaver.cc
Go to the documentation of this file.
2 
3 // framework & common header files
7 
8 //DQM services
11 
12 #include <iostream>
13 
15  //std::cout << "<TauDQMSimpleFileSaver::TauDQMSimpleFileSaver>:" << std::endl;
16 
17  cfgError_ = 0;
18 
19  outputFileName_ = cfg.getParameter<std::string>("outputFileName");
20  if (outputFileName_.empty()) {
21  edm::LogError("TauDQMSimpleFileSaver") << " No outputFileName specified --> histograms will NOT be saved !!";
22  cfgError_ = 1;
23  } else if (outputFileName_.find(".root") == std::string::npos) {
24  edm::LogError("TauDQMSimpleFileSaver")
25  << " Invalid outputFileName = " << outputFileName_ << " --> histograms will NOT be saved !!";
26  cfgError_ = 1;
27  }
28 }
29 
31  // nothing to be done yet...
32 }
33 
35  // nothing to be done yet...
36 }
37 
39  std::cout << "<TauDQMSimpleFileSaver::endJob>:" << std::endl;
40 
41  //--- check that configuration parameters contain no errors
42  if (cfgError_) {
43  edm::LogError("endJob") << " Error in Configuration ParameterSet --> histograms will NOT be saved !!";
44  return;
45  }
46 
47  //--- check that DQMStore service is available
48  if (!edm::Service<DQMStore>().isAvailable()) {
49  edm::LogError("endJob") << " Failed to access dqmStore --> histograms will NOT be saved !!";
50  return;
51  }
52 
53  DQMStore& dqmStore = (*edm::Service<DQMStore>());
54  dqmStore.save(outputFileName_);
55 }
56 
58 
tuple cfg
Definition: looper.py:296
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Log< level::Error, false > LogError
void analyze(const edm::Event &, const edm::EventSetup &) override
TauDQMSimpleFileSaver(const edm::ParameterSet &)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:784
tuple cout
Definition: gather_cfg.py:144