test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
fftjetlookuptableesproducer_cfi.py
Go to the documentation of this file.
2 
4  """
5  A class which contains the info about a valid combination
6  of ES record types and ES producer type for FFTJet lookup tables
7  """
8  def __init__(self, basename):
9  self.basename = basename
10  self.dbTag = "FFT" + basename + "TableDBTag"
11  self.dbRecord = "FFT" + basename + "ParametersRcd"
12  self.LUTRecord = "FFT" + basename + "TableRcd"
13  self.esProducer = "FFT" + basename + "TableESProducer"
14 
15 # The following dictionary contains valid combinations of ES record
16 # types and ES producer type for FFTJet (pileup) lookup tables.
17 #
18 # The dictionary keys used here correspond to the types defined in
19 # CondFormats/JetMETObjects/interface/FFTJetLUTTypes.h
20 #
21 # The database ES record types are listed in
22 # CondFormats/DataRecord/interface/FFTJetCorrectorParametersRcdTypes.h
23 #
24 # The jet correction sequence types (which depend on the corresponding
25 # database ES record types) are listed in
26 # JetMETCorrections/FFTJetObjects/interface/FFTJetLookupTableRcdTypes.h
27 #
28 # The ES producer types are defined in
29 # JetMCorrections/FFTJetModules/plugins/FFTJetLookupTableESProducer.cc
30 #
31 fftjet_lut_types = {
32  "EtaFlatteningFactors" : ValidFFTJetLUT("EtaFlatteningFactors"),
33  "PileupRhoCalibration" : ValidFFTJetLUT("PileupRhoCalibration"),
34  "PileupRhoEtaDependence" : ValidFFTJetLUT("PileupRhoEtaDependence"),
35  "LUT0" : ValidFFTJetLUT("LUT0"),
36  "LUT1" : ValidFFTJetLUT("LUT1"),
37  "LUT2" : ValidFFTJetLUT("LUT2"),
38  "LUT3" : ValidFFTJetLUT("LUT3"),
39  "LUT4" : ValidFFTJetLUT("LUT4"),
40  "LUT5" : ValidFFTJetLUT("LUT5"),
41  "LUT6" : ValidFFTJetLUT("LUT6"),
42  "LUT7" : ValidFFTJetLUT("LUT7"),
43  "LUT8" : ValidFFTJetLUT("LUT8"),
44  "LUT9" : ValidFFTJetLUT("LUT9"),
45  "LUT10" : ValidFFTJetLUT("LUT10"),
46  "LUT11" : ValidFFTJetLUT("LUT11"),
47  "LUT12" : ValidFFTJetLUT("LUT12"),
48  "LUT13" : ValidFFTJetLUT("LUT13"),
49  "LUT14" : ValidFFTJetLUT("LUT14"),
50  "LUT15" : ValidFFTJetLUT("LUT15")
51 }
52 
53 #
54 # Procedure for configuring the L2-L3 FFTJet ES producer. This
55 # producer turns the database record into a set of lookup table types.
56 # The "sequenceTag" argument should be set to one of the keys in the
57 # "fftjet_lut_types" dictionary.
58 #
60  #
61  # The ES producer name comes from the C++ plugin registration code
62  esProducer = fftjet_lut_types[sequenceTag].esProducer
63  config = cms.ESProducer(
64  esProducer,
65  tables = cms.VPSet(
66  cms.PSet(
67  name = cms.string('.*'),
68  nameIsRegex = cms.bool(True),
69  category = cms.string('.*'),
70  categoryIsRegex = cms.bool(True)
71  )
72  ),
73  isArchiveCompressed = cms.bool(False),
74  verbose = cms.untracked.bool(False)
75  )
76  return (config, esProducer)
77 
78 #
79 # Procedure for configuring the ES source which fetches
80 # the database record. "process.CondDBCommon" should be
81 # already defined before calling this procedure.
82 #
83 def configure_fftjetlut_pooldbessource(process, sequenceTag):
84  config = cms.ESSource(
85  "PoolDBESSource",
86  process.CondDBCommon,
87  toGet = cms.VPSet(cms.PSet(
88  record = cms.string(fftjet_lut_types[sequenceTag].dbRecord),
89  tag = cms.string(fftjet_lut_types[sequenceTag].dbTag),
90  ))
91  )
92  sourceName = "FFT" + sequenceTag + "DBESSource"
93  setattr(process, sourceName, config)
94  return