Go to the documentation of this file.00001 #include "Validation/RecoMET/interface/METFileSaver.h"
00002
00003
00004
00005
00006
00007
00008 #include "FWCore/PluginManager/interface/ModuleDef.h"
00009 #include "FWCore/Framework/interface/MakerMacros.h"
00010
00011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00012 #include "FWCore/ServiceRegistry/interface/Service.h"
00013
00014 #include "FWCore/Framework/interface/Event.h"
00015 #include "DataFormats/Common/interface/Handle.h"
00016
00017 #include "FWCore/Framework/interface/ESHandle.h"
00018
00019 #include <vector>
00020 #include <utility>
00021 #include <ostream>
00022 #include <fstream>
00023 #include <iostream>
00024 #include <algorithm>
00025 #include <cmath>
00026 #include <memory>
00027 #include "DQMServices/Core/interface/DQMStore.h"
00028
00029 METFileSaver::METFileSaver(const edm::ParameterSet& iConfig)
00030 {
00031 outputFile_ = iConfig.getUntrackedParameter<std::string>("OutputFile");
00032 if (outputFile_.size() > 0)
00033 edm::LogInfo("OutputInfo") << " MET Task histograms will be saved to '" << outputFile_.c_str() << "'";
00034 else edm::LogInfo("OutputInfo") << " MET Task histograms will NOT be saved";
00035
00036 }
00037
00038 void METFileSaver::beginJob()
00039 {
00040
00041 dbe_ = edm::Service<DQMStore>().operator->();
00042
00043 }
00044
00045 void METFileSaver::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00046 {
00047 }
00048
00049 void METFileSaver::endJob()
00050 {
00051
00052 if (outputFile_.size() > 0 && dbe_)
00053 dbe_->save(outputFile_);
00054 }