CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 35 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().

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