CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
loadFFTJetInterpolationTable.h File Reference
#include "Alignment/Geners/interface/StringArchive.hh"
#include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
#include "JetMETCorrections/InterpolationTables/interface/StorableMultivariateFunctor.h"

Go to the source code of this file.

Functions

std::unique_ptr
< npstat::StorableMultivariateFunctor
loadFFTJetInterpolationTable (const edm::ParameterSet &ps, gs::StringArchive &ar, bool verbose)
 

Function Documentation

std::unique_ptr<npstat::StorableMultivariateFunctor> loadFFTJetInterpolationTable ( const edm::ParameterSet ps,
gs::StringArchive &  ar,
bool  verbose 
)

Definition at line 28 of file loadFFTJetInterpolationTable.cc.

References gather_cfg::cout, dumpArchiveMetadata(), alignCSCRings::e, Exception, edm::ParameterSet::getParameter(), AlCaHLTBitMon_ParallelJobs::p, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by parseFFTJetScaleCalculator().

30  {
31  gs::SearchSpecifier nameSearch(ps.getParameter<std::string>("name"), ps.getParameter<bool>("nameIsRegex"));
32  gs::SearchSpecifier categorySearch(ps.getParameter<std::string>("category"),
33  ps.getParameter<bool>("categoryIsRegex"));
34  gs::Reference<npstat::StorableMultivariateFunctor> ref(ar, nameSearch, categorySearch);
35 
36  // Require that we get a unique item for this search
37  if (!ref.unique()) {
38  std::ostringstream os;
39  os << "Error in loadFFTJetInterpolationTable: table with name \"" << nameSearch.pattern() << "\" ";
40  if (nameSearch.useRegex())
41  os << "(regex) ";
42  os << "and category \"" << categorySearch.pattern() << "\" ";
43  if (categorySearch.useRegex())
44  os << "(regex) ";
45  os << "is not ";
46  if (ref.empty())
47  os << "found";
48  else
49  os << "unique";
50  os << " in the archive. Archive contents are:\n";
51  dumpArchiveMetadata(ar, os);
52  throw cms::Exception("FFTJetBadConfig", os.str());
53  }
54 
55  CPP11_auto_ptr<npstat::StorableMultivariateFunctor> p = ref.get(0);
56  if (verbose) {
57  std::cout << "In loadFFTJetInterpolationTable: loaded table with metadata" << std::endl;
58  std::shared_ptr<const gs::CatalogEntry> e = ref.indexedCatalogEntry(0);
59  e->humanReadable(std::cout);
60  std::cout << std::endl;
61  std::cout << "Actual table class name is \"" << p->classId().name() << '"' << std::endl;
62  }
63  return p;
64 }
static constexpr int verbose
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
tuple cout
Definition: gather_cfg.py:144
static void dumpArchiveMetadata(gs::StringArchive &ar, std::ostream &os)