CMS 3D CMS Logo

Classes | Typedefs | Functions
FFTJetLookupTableESProducer.cc File Reference
#include <sstream>
#include <utility>
#include <memory>
#include "boost/shared_ptr.hpp"
#include "Alignment/Geners/interface/CompressedIO.hh"
#include "Alignment/Geners/interface/StringArchive.hh"
#include "Alignment/Geners/interface/Reference.hh"
#include "FWCore/Framework/interface/ModuleFactory.h"
#include "FWCore/Framework/interface/ESProducer.h"
#include "FWCore/Framework/interface/ESProductHost.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Utilities/interface/ReusableObjectHolder.h"
#include "CondFormats/JetMETObjects/interface/FFTJetCorrectorParameters.h"
#include "CondFormats/JetMETObjects/interface/FFTJetLUTTypes.h"
#include "JetMETCorrections/FFTJetObjects/interface/FFTJetLookupTableRcd.h"
#include "JetMETCorrections/FFTJetObjects/interface/FFTJetLookupTableSequence.h"

Go to the source code of this file.

Classes

class  FFTJetLookupTableESProducer< CT >
 

Typedefs

typedef FFTJetLookupTableESProducer< fftluttypes::EtaFlatteningFactorsFFTEtaFlatteningFactorsTableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT0FFTLUT0TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT10FFTLUT10TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT11FFTLUT11TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT12FFTLUT12TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT13FFTLUT13TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT14FFTLUT14TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT15FFTLUT15TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT1FFTLUT1TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT2FFTLUT2TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT3FFTLUT3TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT4FFTLUT4TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT5FFTLUT5TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT6FFTLUT6TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT7FFTLUT7TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT8FFTLUT8TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::LUT9FFTLUT9TableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::PileupRhoCalibrationFFTPileupRhoCalibrationTableESProducer
 
typedef FFTJetLookupTableESProducer< fftluttypes::PileupRhoEtaDependenceFFTPileupRhoEtaDependenceTableESProducer
 
typedef boost::shared_ptr< npstat::StorableMultivariateFunctorStorableFunctorPtr
 

Functions

static void buildLookupTables (const FFTJetCorrectorParameters &tablePars, const std::vector< edm::ParameterSet > &tableDefs, const bool isArchiveCompressed, const bool verbose, FFTJetLookupTableSequence *ptr)
 
static void insertLUTItem (FFTJetLookupTableSequence &seq, StorableFunctorPtr fptr, const std::string &name, const std::string &category)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::DescriptionFillerForESProducers< FFTEtaFlatteningFactorsTableESProducer > > s_filler__LINE__ ("FFTEtaFlatteningFactorsTableESProducer")
 
static const edm::eventsetup::ModulePluginFactory::PMaker< edm::eventsetup::ModuleMaker< FFTEtaFlatteningFactorsTableESProducer > > s_maker__LINE__ ("FFTEtaFlatteningFactorsTableESProducer")
 

Typedef Documentation

Definition at line 174 of file FFTJetLookupTableESProducer.cc.

Definition at line 177 of file FFTJetLookupTableESProducer.cc.

Definition at line 187 of file FFTJetLookupTableESProducer.cc.

Definition at line 188 of file FFTJetLookupTableESProducer.cc.

Definition at line 189 of file FFTJetLookupTableESProducer.cc.

Definition at line 190 of file FFTJetLookupTableESProducer.cc.

Definition at line 191 of file FFTJetLookupTableESProducer.cc.

Definition at line 192 of file FFTJetLookupTableESProducer.cc.

Definition at line 178 of file FFTJetLookupTableESProducer.cc.

Definition at line 179 of file FFTJetLookupTableESProducer.cc.

Definition at line 180 of file FFTJetLookupTableESProducer.cc.

Definition at line 181 of file FFTJetLookupTableESProducer.cc.

Definition at line 182 of file FFTJetLookupTableESProducer.cc.

Definition at line 183 of file FFTJetLookupTableESProducer.cc.

Definition at line 184 of file FFTJetLookupTableESProducer.cc.

Definition at line 185 of file FFTJetLookupTableESProducer.cc.

Definition at line 186 of file FFTJetLookupTableESProducer.cc.

Definition at line 175 of file FFTJetLookupTableESProducer.cc.

Definition at line 176 of file FFTJetLookupTableESProducer.cc.

Definition at line 44 of file FFTJetLookupTableESProducer.cc.

Function Documentation

static void buildLookupTables ( const FFTJetCorrectorParameters tablePars,
const std::vector< edm::ParameterSet > &  tableDefs,
const bool  isArchiveCompressed,
const bool  verbose,
FFTJetLookupTableSequence ptr 
)
static

Definition at line 59 of file FFTJetLookupTableESProducer.cc.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, edm::ParameterSet::getParameter(), insertLUTItem(), AlCaHLTBitMon_ParallelJobs::p, FFTJetCorrectorParameters::str(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FFTJetLookupTableESProducer< CT >::produce().

64 {
65  // Load the archive stored in the FFTJetCorrectorParameters object
66  CPP11_auto_ptr<gs::StringArchive> ar;
67  {
68  std::istringstream is(tablePars.str());
69  if (isArchiveCompressed)
70  ar = gs::read_compressed_item<gs::StringArchive>(is);
71  else
72  ar = gs::read_item<gs::StringArchive>(is);
73  }
74 
75  ptr->clear();
76 
77  // Avoid loading the same item more than once
78  std::set<unsigned long long> loadedSet;
79 
80  const unsigned nTables = tableDefs.size();
81  for (unsigned itab=0; itab<nTables; ++itab)
82  {
83  const edm::ParameterSet& ps(tableDefs[itab]);
84  gs::SearchSpecifier nameSearch(ps.getParameter<std::string>("name"),
85  ps.getParameter<bool>("nameIsRegex"));
86  gs::SearchSpecifier categorySearch(ps.getParameter<std::string>("category"),
87  ps.getParameter<bool>("categoryIsRegex"));
88  gs::Reference<npstat::StorableMultivariateFunctor> ref(
89  *ar, nameSearch, categorySearch);
90  const unsigned long nItems = ref.size();
91  for (unsigned long item=0; item<nItems; ++item)
92  {
93  const unsigned long long id = ref.id(item);
94  if (loadedSet.insert(id).second)
95  {
96  CPP11_auto_ptr<npstat::StorableMultivariateFunctor> p(ref.get(item));
97  StorableFunctorPtr fptr(p.release());
98  CPP11_shared_ptr<const gs::CatalogEntry> e = ar->catalogEntry(id);
99  insertLUTItem(*ptr, fptr, e->name(), e->category());
100  if (verbose)
101  std::cout << "In buildLookupTables: loaded table with name \""
102  << e->name() << "\" and category \""
103  << e->category() << '"' << std::endl;
104  }
105  }
106  }
107 }
const std::string & str() const
boost::shared_ptr< npstat::StorableMultivariateFunctor > StorableFunctorPtr
static void insertLUTItem(FFTJetLookupTableSequence &seq, StorableFunctorPtr fptr, const std::string &name, const std::string &category)
static void insertLUTItem ( FFTJetLookupTableSequence seq,
StorableFunctorPtr  fptr,
const std::string &  name,
const std::string &  category 
)
static

Definition at line 46 of file FFTJetLookupTableESProducer.cc.

Referenced by buildLookupTables().

50 {
51  FFTJetLookupTableSequence::iterator it = seq.find(category);
52  if (it == seq.end())
53  it = seq.insert(std::make_pair(
55  it->second.insert(std::make_pair(name, fptr));
56 }
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::DescriptionFillerForESProducers< FFTLUT15TableESProducer > > s_filler__LINE__ ( "FFTEtaFlatteningFactorsTableESProducer"  )
static
static const edm::eventsetup::ModulePluginFactory::PMaker< edm::eventsetup::ModuleMaker< FFTLUT15TableESProducer > > s_maker__LINE__ ( "FFTEtaFlatteningFactorsTableESProducer"  )
static