CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/JetMETCorrections/FFTJetObjects/interface/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

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

Function Documentation

CPP11_auto_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().

{
    gs::SearchSpecifier nameSearch(ps.getParameter<std::string>("name"),
                                   ps.getParameter<bool>("nameIsRegex"));
    gs::SearchSpecifier categorySearch(ps.getParameter<std::string>("category"),
                                       ps.getParameter<bool>("categoryIsRegex"));
    gs::Reference<npstat::StorableMultivariateFunctor> ref(
        ar, nameSearch, categorySearch);

    // Require that we get a unique item for this search
    if (!ref.unique())
    {
        std::ostringstream os;
        os << "Error in loadFFTJetInterpolationTable: table with name \""
           << nameSearch.pattern() << "\" ";
        if (nameSearch.useRegex())
            os << "(regex) ";
        os << "and category \""
           << categorySearch.pattern() << "\" ";
        if (categorySearch.useRegex())
            os << "(regex) ";
        os << "is not ";
        if (ref.empty())
            os << "found";
        else
            os << "unique";
        os << " in the archive. Archive contents are:\n";
        dumpArchiveMetadata(ar, os);
        throw cms::Exception("FFTJetBadConfig", os.str());
    }

    CPP11_auto_ptr<npstat::StorableMultivariateFunctor> p = ref.get(0);
    if (verbose)
    {
        std::cout << "In loadFFTJetInterpolationTable: loaded table with metadata"
                  << std::endl;
        CPP11_shared_ptr<const gs::CatalogEntry> e = ref.indexedCatalogEntry(0);
        e->humanReadable(std::cout);
        std::cout << std::endl;
        std::cout << "Actual table class name is \""
                  << p->classId().name() << '"' << std::endl;
    }
    return p;
}