#include <JetMETCorrections/FFTJetModules/plugins/FFTJetCorrectorDBReader.cc>
Public Member Functions | |
FFTJetCorrectorDBReader (const edm::ParameterSet &) | |
virtual | ~FFTJetCorrectorDBReader () |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
FFTJetCorrectorDBReader (const FFTJetCorrectorDBReader &) | |
FFTJetCorrectorDBReader () | |
FFTJetCorrectorDBReader & | operator= (const FFTJetCorrectorDBReader &) |
Private Attributes | |
bool | isArchiveCompressed |
std::string | outputFile |
bool | printAsString |
bool | readArchive |
std::string | record |
Description: writes a blob from a file into a database
Implementation: [Notes on implementation]
Definition at line 46 of file FFTJetCorrectorDBReader.cc.
FFTJetCorrectorDBReader::FFTJetCorrectorDBReader | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 66 of file FFTJetCorrectorDBReader.cc.
: init_param(std::string, record), init_param(std::string, outputFile), init_param(bool, printAsString), init_param(bool, readArchive), init_param(bool, isArchiveCompressed) { }
virtual FFTJetCorrectorDBReader::~FFTJetCorrectorDBReader | ( | ) | [inline, virtual] |
Definition at line 50 of file FFTJetCorrectorDBReader.cc.
{}
FFTJetCorrectorDBReader::FFTJetCorrectorDBReader | ( | ) | [private] |
FFTJetCorrectorDBReader::FFTJetCorrectorDBReader | ( | const FFTJetCorrectorDBReader & | ) | [private] |
void FFTJetCorrectorDBReader::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 75 of file FFTJetCorrectorDBReader.cc.
References prof2calltree::count, gather_cfg::cout, alignCSCRings::e, instance, isArchiveCompressed, outputFile, printAsString, readArchive, and record.
{ edm::ESHandle<FFTJetCorrectorParameters> JetCorParams; StaticFFTJetCorrectorParametersLoader::instance().load( iSetup, record, JetCorParams); if (printAsString || readArchive) std::cout << "++++ FFTJetCorrectorDBReader: info for record \"" << record << '"' << std::endl; if (printAsString) std::cout << "++++ String rep: \"" << JetCorParams->str() << '"' << std::endl; else if (readArchive) { CPP11_auto_ptr<gs::StringArchive> par; { std::istringstream is(JetCorParams->str()); if (isArchiveCompressed) par = gs::read_compressed_item<gs::StringArchive>(is); else par = gs::read_item<gs::StringArchive>(is); } const unsigned long long idSmall = par->smallestId(); if (!idSmall) std::cout << "++++ No valid records in the archive" << std::endl; else { std::cout << "++++ Archive metadata begins" << std::endl; const unsigned long long idLarge = par->largestId(); unsigned long long count = 0; for (unsigned long long id = idSmall; id <= idLarge; ++id) if (par->itemExists(id)) { CPP11_shared_ptr<const gs::CatalogEntry> e = par->catalogEntry(id); std::cout << '\n'; e->humanReadable(std::cout); ++count; } std::cout << "\n++++ Archive metadata ends, " << count << " items total" << std::endl; } } if (!outputFile.empty()) { std::ofstream of(outputFile.c_str(), std::ios_base::binary); if (!of.is_open()) throw cms::Exception("InvalidArgument") << "Failed to open file \"" << outputFile << '"' << std::endl; if (!JetCorParams->empty()) { of.write(JetCorParams->getBuffer(), JetCorParams->length()); if (of.fail()) throw cms::Exception("SystemError") << "Output stream failure while writing file \"" << outputFile << '"' << std::endl; } } }
FFTJetCorrectorDBReader& FFTJetCorrectorDBReader::operator= | ( | const FFTJetCorrectorDBReader & | ) | [private] |
bool FFTJetCorrectorDBReader::isArchiveCompressed [private] |
Definition at line 63 of file FFTJetCorrectorDBReader.cc.
Referenced by analyze().
std::string FFTJetCorrectorDBReader::outputFile [private] |
Definition at line 60 of file FFTJetCorrectorDBReader.cc.
Referenced by analyze().
bool FFTJetCorrectorDBReader::printAsString [private] |
Definition at line 61 of file FFTJetCorrectorDBReader.cc.
Referenced by analyze().
bool FFTJetCorrectorDBReader::readArchive [private] |
Definition at line 62 of file FFTJetCorrectorDBReader.cc.
Referenced by analyze().
std::string FFTJetCorrectorDBReader::record [private] |
Definition at line 59 of file FFTJetCorrectorDBReader.cc.
Referenced by analyze().