#include <JetMETCorrections/FFTJetModules/plugins/FFTJetCorrectorDBWriter.cc>
Public Member Functions | |
FFTJetCorrectorDBWriter (const edm::ParameterSet &) | |
virtual | ~FFTJetCorrectorDBWriter () |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
FFTJetCorrectorDBWriter (const FFTJetCorrectorDBWriter &) | |
FFTJetCorrectorDBWriter () | |
FFTJetCorrectorDBWriter & | operator= (const FFTJetCorrectorDBWriter &) |
Private Attributes | |
std::string | inputFile |
std::string | record |
Description: writes a blob from a file into a database
Implementation: [Notes on implementation]
Definition at line 43 of file FFTJetCorrectorDBWriter.cc.
FFTJetCorrectorDBWriter::FFTJetCorrectorDBWriter | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 60 of file FFTJetCorrectorDBWriter.cc.
: init_param(std::string, inputFile), init_param(std::string, record) { }
virtual FFTJetCorrectorDBWriter::~FFTJetCorrectorDBWriter | ( | ) | [inline, virtual] |
Definition at line 47 of file FFTJetCorrectorDBWriter.cc.
{}
FFTJetCorrectorDBWriter::FFTJetCorrectorDBWriter | ( | ) | [private] |
FFTJetCorrectorDBWriter::FFTJetCorrectorDBWriter | ( | const FFTJetCorrectorDBWriter & | ) | [private] |
void FFTJetCorrectorDBWriter::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 66 of file FFTJetCorrectorDBWriter.cc.
References Exception, LaserDQM_cfg::input, inputFile, edm::Service< T >::isAvailable(), and record.
{ std::auto_ptr<FFTJetCorrectorParameters> fcp; { std::ifstream input(inputFile.c_str(), std::ios_base::binary); if (!input.is_open()) throw cms::Exception("InvalidArgument") << "Failed to open file \"" << inputFile << '"' << std::endl; struct stat st; if (stat(inputFile.c_str(), &st)) throw cms::Exception("SystemError") << "Failed to stat file \"" << inputFile << '"' << std::endl; const std::size_t len = st.st_size; fcp = std::auto_ptr<FFTJetCorrectorParameters>( new FFTJetCorrectorParameters(len)); assert(fcp->length() == len); if (len) input.read(fcp->getBuffer(), len); if (input.fail()) throw cms::Exception("SystemError") << "Input stream failure while reading file \"" << inputFile << '"' << std::endl; } edm::Service<cond::service::PoolDBOutputService> poolDbService; if (poolDbService.isAvailable()) poolDbService->writeOne(fcp.release(), poolDbService->currentTime(), record); else throw cms::Exception("ConfigurationError") << "PoolDBOutputService is not available, " << "please configure it properly" << std::endl; }
FFTJetCorrectorDBWriter& FFTJetCorrectorDBWriter::operator= | ( | const FFTJetCorrectorDBWriter & | ) | [private] |
std::string FFTJetCorrectorDBWriter::inputFile [private] |
Definition at line 56 of file FFTJetCorrectorDBWriter.cc.
Referenced by analyze().
std::string FFTJetCorrectorDBWriter::record [private] |
Definition at line 57 of file FFTJetCorrectorDBWriter.cc.
Referenced by analyze().