CMS 3D CMS Logo

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 
54  dqmStore.save(outputFileName_);
55 }
56 
58 
T getParameter(std::string const &) const
void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TauDQMSimpleFileSaver(const edm::ParameterSet &)
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
Definition: DQMStore.cc:2244