CMS 3D CMS Logo

customiseL1CustomReco.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 ## from CondCore.DBCommon.CondDBSetup_cfi import *
4 from CondCore.CondDB.CondDB_cfi import *
6 from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry
8 
9 def L1NtupleCustomReco(process):
10 
11 
12 #### Custom Jet reco ####
13 
14  # load JEC from SQLite file
15  process.load("CondCore.CondDB.CondDB_cfi")
16 
17  # re-apply JEC for AK4 CHS PF jets
18  process.load('JetMETCorrections.Configuration.JetCorrectors_cff')
19 
20 #### Custom Met Filter reco
21 
22  # load hbhe noise filter result producer
23  process.load('CommonTools/RecoAlgos/HBHENoiseFilterResultProducer_cfi')
24 
25  # Type-1 pf MET correction
26  process.load("JetMETCorrections.Type1MET.correctionTermsPfMetType1Type2_cff")
27  process.load("JetMETCorrections.Type1MET.correctedMet_cff")
28 
29 
30 #### Custom E/Gamma reco ####
31 
32  # turn on VID producer, indicate data format to be
33  # DataFormat.AOD or DataFormat.MiniAOD, as appropriate
34  dataFormat = DataFormat.AOD
35  switchOnVIDElectronIdProducer(process, dataFormat)
36  process.load("RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cfi")
37  process.egmGsfElectronIDSequence = cms.Sequence(process.egmGsfElectronIDs)
38  # define which IDs we want to produce
39  idmod = 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Spring15_25ns_V1_cff'
40  setupAllVIDIdsInModule(process,idmod,setupVIDElectronSelection)
41 
42 
43 
44 
45  process.l1CustomReco = cms.Path(
46  process.ak4PFCHSL1FastL2L3ResidualCorrectorChain
47  +process.HBHENoiseFilterResultProducer
48  +process.correctionTermsPfMetType1Type2
49  +process.pfMetT1
50  +process.egmGsfElectronIDSequence
51  )
52 
53  process.schedule.append(process.l1CustomReco)
54 
55  return process
56 
57 
58 def getJECFromSQLite(process):
59 
60  process.load("CondCore.CondDB.CondDB_cfi")
61 
62  process.jec = cms.ESSource(
63  "PoolDBESSource",
64  DBParameters = cms.PSet(
65  messageLevel = cms.untracked.int32(0)
66  ),
67  timetype = cms.string('runnumber'),
68  toGet = cms.VPSet(
69  cms.PSet(
70  record = cms.string('JetCorrectionsRecord'),
71  # for data
72  tag = cms.string('JetCorrectorParametersCollection_Summer15_25nsV6_DATA_AK4PFchs'),
73  # for MC
74  #tag = cms.string('JetCorrectorParametersCollection_Fall15_25nsV2_MC_AK4PFchs'),
75  label = cms.untracked.string('AK4PFCHS')
76  ),
77  ),
78  connect = cms.string('sqlite:Summer15_25nsV6_DATA.db')
79  # uncomment above tag lines and this comment to use MC JEC
80  # connect = cms.string('sqlite:Fall15_25nsV2_MC.db')
81  )
82 
83  process.es_prefer_jec = cms.ESPrefer('PoolDBESSource','jec')
84 
85  return process
def switchOnVIDElectronIdProducer(process, dataFormat, task=None)
Electrons.
Definition: vid_id_tools.py:66
def setupAllVIDIdsInModule(process, id_module_name, setupFunction, patProducer=None, addUserData=True, task=None)
Definition: vid_id_tools.py:49
def getJECFromSQLite(process)
Custom Jet reco ####.