CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Typedefs | Functions
FFTJetLookupTableESProducer.cc File Reference
#include <sstream>
#include <utility>
#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/ESTransientHandle.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::EtaFlatteningFactors
FFTEtaFlatteningFactorsTableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT0
FFTLUT0TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT10
FFTLUT10TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT11
FFTLUT11TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT12
FFTLUT12TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT13
FFTLUT13TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT14
FFTLUT14TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT15
FFTLUT15TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT1
FFTLUT1TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT2
FFTLUT2TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT3
FFTLUT3TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT4
FFTLUT4TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT5
FFTLUT5TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT6
FFTLUT6TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT7
FFTLUT7TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT8
FFTLUT8TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::LUT9
FFTLUT9TableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::PileupRhoCalibration
FFTPileupRhoCalibrationTableESProducer
 
typedef
FFTJetLookupTableESProducer
< fftluttypes::PileupRhoEtaDependence
FFTPileupRhoEtaDependenceTableESProducer
 
typedef boost::shared_ptr
< npstat::StorableMultivariateFunctor
StorableFunctorPtr
 

Functions

static boost::shared_ptr
< FFTJetLookupTableSequence
buildLookupTables (const FFTJetCorrectorParameters &tablePars, const std::vector< edm::ParameterSet > &tableDefs, const bool isArchiveCompressed, const bool verbose)
 
 DEFINE_FWK_EVENTSETUP_MODULE (FFTEtaFlatteningFactorsTableESProducer)
 
static void insertLUTItem (FFTJetLookupTableSequence &seq, StorableFunctorPtr fptr, const std::string &name, const std::string &category)
 

Typedef Documentation

Definition at line 182 of file FFTJetLookupTableESProducer.cc.

Definition at line 185 of file FFTJetLookupTableESProducer.cc.

Definition at line 195 of file FFTJetLookupTableESProducer.cc.

Definition at line 196 of file FFTJetLookupTableESProducer.cc.

Definition at line 197 of file FFTJetLookupTableESProducer.cc.

Definition at line 198 of file FFTJetLookupTableESProducer.cc.

Definition at line 199 of file FFTJetLookupTableESProducer.cc.

Definition at line 200 of file FFTJetLookupTableESProducer.cc.

Definition at line 186 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 193 of file FFTJetLookupTableESProducer.cc.

Definition at line 194 of file FFTJetLookupTableESProducer.cc.

Definition at line 183 of file FFTJetLookupTableESProducer.cc.

Definition at line 184 of file FFTJetLookupTableESProducer.cc.

Definition at line 41 of file FFTJetLookupTableESProducer.cc.

Function Documentation

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

Definition at line 56 of file FFTJetLookupTableESProducer.cc.

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

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

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

Definition at line 43 of file FFTJetLookupTableESProducer.cc.

Referenced by buildLookupTables().

47 {
48  FFTJetLookupTableSequence::iterator it = seq.find(category);
49  if (it == seq.end())
50  it = seq.insert(std::make_pair(
52  it->second.insert(std::make_pair(name, fptr));
53 }