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