test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.DBCommon.CondDBCommon_cfi")
16 
17  # re-apply JEC for AK4 CHS PF jets
18  process.load('JetMETCorrections.Configuration.JetCorrectors_cff')
19  #process.load('JetMETCorrections.Configuration.JetCorrectionProducers_cff')
20  #process.load('JetMETCorrections.Configuration.CorrectedJetProducers_cff')
21 
22  #process.ak4PFCHSJetsL1FastL2L3Residual = process.ak4PFCHSJetsL1.clone(correctors = ['ak4PFCHSL1FastL2L3ResidualCorrector'])
23 
24 #### Custom Met Filter reco
25 
26  # load hbhe noise filter result producer
27  process.load('CommonTools/RecoAlgos/HBHENoiseFilterResultProducer_cfi')
28 
29  # Type-1 pf MET correction
30  process.load("JetMETCorrections.Type1MET.correctionTermsPfMetType1Type2_cff")
31  process.load("JetMETCorrections.Type1MET.correctedMet_cff")
32 
33 
34 #### Custom E/Gamma reco ####
35 
36  # turn on VID producer, indicate data format to be
37  # DataFormat.AOD or DataFormat.MiniAOD, as appropriate
38  dataFormat = DataFormat.AOD
39  switchOnVIDElectronIdProducer(process, dataFormat)
40  process.load("RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cfi")
41  process.egmGsfElectronIDSequence = cms.Sequence(process.egmGsfElectronIDs)
42  # define which IDs we want to produce
43  idmod = 'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_Spring15_25ns_V1_cff'
44  setupAllVIDIdsInModule(process,idmod,setupVIDElectronSelection)
45 
46 
47 
48 
49  process.l1CustomReco = cms.Path(
50  process.ak4PFCHSL1FastL2L3ResidualCorrectorChain
51  +process.HBHENoiseFilterResultProducer
52  +process.correctionTermsPfMetType1Type2
53  +process.pfMetT1
54  +process.egmGsfElectronIDSequence
55  )
56 
57  process.schedule.append(process.l1CustomReco)
58 
59  return process
60 
61 
62 
63 def getJECFromSQLite(process):
64 
65  process.jec = cms.ESSource(
66  "PoolDBESSource",
67  DBParameters = cms.PSet(
68  messageLevel = cms.untracked.int32(0)
69  ),
70  timetype = cms.string('runnumber'),
71  toGet = cms.VPSet(
72  cms.PSet(
73  record = cms.string('JetCorrectionsRecord'),
74  # for data
75  tag = cms.string('JetCorrectorParametersCollection_Summer15_25nsV6_DATA_AK4PFchs'),
76  # for MC
77  #tag = cms.string('JetCorrectorParametersCollection_Fall15_25nsV2_MC_AK4PFchs'),
78  label = cms.untracked.string('AK4PFCHS')
79  ),
80  ),
81  connect = cms.string('sqlite:Summer15_25nsV6_DATA.db')
82  # uncomment above tag lines and this comment to use MC JEC
83  # connect = cms.string('sqlite:Fall15_25nsV2_MC.db')
84  )
85 
86  process.es_prefer_jec = cms.ESPrefer('PoolDBESSource','jec')
87 
88  return process
def setupAllVIDIdsInModule
Definition: vid_id_tools.py:50
def switchOnVIDElectronIdProducer
Definition: vid_id_tools.py:69