CMS 3D CMS Logo

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::StorableMultivariateFunctorloadFFTJetInterpolationTable (const edm::ParameterSet &ps, gs::StringArchive &ar, bool verbose)
 

Function Documentation

◆ loadFFTJetInterpolationTable()

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(), MillePedeFileConverter_cfg::e, Exception, edm::ParameterSet::getParameter(), AlCaHLTBitMon_ParallelJobs::p, AlCaHLTBitMon_QueryRunRegistry::string, and verbose.

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool verbose
static void dumpArchiveMetadata(gs::StringArchive &ar, std::ostream &os)