25 #include "boost/shared_ptr.hpp" 27 #include "Alignment/Geners/interface/CompressedIO.hh" 28 #include "Alignment/Geners/interface/StringArchive.hh" 29 #include "Alignment/Geners/interface/Reference.hh" 49 FFTJetLookupTableSequence::iterator it = seq.find(category);
51 it = seq.insert(std::make_pair(
53 it->second.insert(std::make_pair(name, fptr));
56 static std::shared_ptr<FFTJetLookupTableSequence>
59 const std::vector<edm::ParameterSet>& tableDefs,
60 const bool isArchiveCompressed,
const bool verbose)
63 CPP11_auto_ptr<gs::StringArchive> ar;
65 std::istringstream is(tablePars.
str());
66 if (isArchiveCompressed)
67 ar = gs::read_compressed_item<gs::StringArchive>(is);
69 ar = gs::read_item<gs::StringArchive>(is);
72 auto ptr = std::make_shared<FFTJetLookupTableSequence>();
75 std::set<unsigned long long> loadedSet;
77 const unsigned nTables = tableDefs.size();
78 for (
unsigned itab=0; itab<nTables; ++itab)
85 gs::Reference<npstat::StorableMultivariateFunctor> ref(
86 *ar, nameSearch, categorySearch);
87 const unsigned long nItems = ref.size();
88 for (
unsigned long item=0; item<nItems; ++item)
90 const unsigned long long id = ref.id(item);
91 if (loadedSet.insert(
id).second)
93 CPP11_auto_ptr<npstat::StorableMultivariateFunctor>
p(ref.get(item));
95 CPP11_shared_ptr<const gs::CatalogEntry>
e = ar->catalogEntry(
id);
98 std::cout <<
"In buildLookupTables: loaded table with name \"" 99 << e->name() <<
"\" and category \"" 100 << e->category() <<
'"' << std::endl;
111 template<
typename CT>
115 typedef std::shared_ptr<FFTJetLookupTableSequence>
ReturnType;
122 ReturnType
produce(
const MyRecord&);
141 template<
typename CT>
146 verbose(psIn.getUntrackedParameter<
bool>(
"verbose")),
155 template<
typename CT>
169 const ParentRecord& rec = iRecord.template getRecord<ParentRecord>();
void doWhenChanged(const ParentRecord &)
T getParameter(std::string const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
FFTJetLookupTableESProducer< fftluttypes::LUT3 > FFTLUT3TableESProducer
const std::string & str() const
FFTJetLookupTableESProducer< fftluttypes::LUT12 > FFTLUT12TableESProducer
FFTJetLookupTableESProducer< fftluttypes::LUT15 > FFTLUT15TableESProducer
FFTJetLookupTableESProducer< fftluttypes::LUT9 > FFTLUT9TableESProducer
FFTJetLookupTableESProducer< fftluttypes::LUT2 > FFTLUT2TableESProducer
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
std::shared_ptr< FFTJetLookupTableSequence > ReturnType
FFTJetLookupTableESProducer< fftluttypes::EtaFlatteningFactors > FFTEtaFlatteningFactorsTableESProducer
boost::shared_ptr< npstat::StorableMultivariateFunctor > StorableFunctorPtr
std::vector< edm::ParameterSet > tables
FFTJetLookupTableESProducer< fftluttypes::LUT4 > FFTLUT4TableESProducer
void get(HolderT &iHolder) const
FFTJetLookupTableESProducer< fftluttypes::LUT10 > FFTLUT10TableESProducer
ReturnType produce(const MyRecord &)
FFTJetLookupTableESProducer< fftluttypes::LUT1 > FFTLUT1TableESProducer
FFTJetLookupTableESProducer< fftluttypes::LUT14 > FFTLUT14TableESProducer
FFTJetLookupTableESProducer< fftluttypes::LUT13 > FFTLUT13TableESProducer
FFTJetLookupTableESProducer< fftluttypes::LUT5 > FFTLUT5TableESProducer
FFTJetLookupTableESProducer< fftluttypes::LUT6 > FFTLUT6TableESProducer
FFTJetLookupTableESProducer< fftluttypes::PileupRhoEtaDependence > FFTPileupRhoEtaDependenceTableESProducer
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
FFTJetCorrectorParametersRcd< CT > ParentRecord
static void insertLUTItem(FFTJetLookupTableSequence &seq, StorableFunctorPtr fptr, const std::string &name, const std::string &category)
FFTJetLookupTableESProducer< fftluttypes::LUT8 > FFTLUT8TableESProducer
FFTJetLookupTableESProducer< fftluttypes::PileupRhoCalibration > FFTPileupRhoCalibrationTableESProducer
FFTJetLookupTableRcd< CT > MyRecord
FFTJetLookupTableESProducer< fftluttypes::LUT7 > FFTLUT7TableESProducer
~FFTJetLookupTableESProducer() override
FFTJetLookupTableESProducer< fftluttypes::LUT0 > FFTLUT0TableESProducer
static std::shared_ptr< FFTJetLookupTableSequence > buildLookupTables(const FFTJetCorrectorParameters &tablePars, const std::vector< edm::ParameterSet > &tableDefs, const bool isArchiveCompressed, const bool verbose)
FFTJetLookupTableESProducer(const edm::ParameterSet &)
FFTJetLookupTableESProducer< fftluttypes::LUT11 > FFTLUT11TableESProducer