Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:16

0001 ################################################################################
0002 #
0003 # run_kt4L2L3_cfg.py
0004 # ------------------
0005 #
0006 # This configuration demonstrates how to run the L2L3 correction producers
0007 # for kT R=0.4 CaloJets and PFJets.
0008 #
0009 # Note that you can switch between different sets of corrections
0010 # (e.g. Summer09 and Summer09_7TeV) by simply setting the below 'era'
0011 # parameter accordingly!
0012 #
0013 # The services and producers necessary to provide L2 & L3 corrections for
0014 # kT R=0.4 jets are cloned from the already existing versions for
0015 # AntiKt R=0.5. Any other available algorithms (e.g. SISCone) can be
0016 # configured accordingly.
0017 #
0018 # The job creates 'histos.root' which contains the jet pT spectra for
0019 # calorimeter and pflow jets before and after the application of the
0020 # L2 (relative) and L3 (absolute) corrections.
0021 #
0022 ################################################################################
0023 
0024 import FWCore.ParameterSet.Config as cms
0025 
0026 #!
0027 #! PROCESS
0028 #!
0029 process = cms.Process("KT4L2L3")
0030 
0031 
0032 #!
0033 #! INPUT
0034 #!
0035 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) )
0036 process.source = cms.Source(
0037     'PoolSource',
0038     fileNames = cms.untracked.vstring('/store/relval/CMSSW_7_1_0_pre1/RelValProdTTbar/GEN-SIM-RECO/START70_V5-v1/00000/14842A6B-2086-E311-B5CB-02163E00E8DA.root')
0039     )
0040 
0041 
0042 #!
0043 #! SERVICES
0044 #!
0045 process.MessageLogger = cms.Service(
0046     "MessageLogger",
0047     destinations = cms.untracked.vstring('cout'),
0048     cout         = cms.untracked.PSet(threshold = cms.untracked.string('INFO'))
0049     )
0050 process.TFileService=cms.Service("TFileService",fileName=cms.string('histos.root'))
0051 
0052 
0053 #!
0054 #! JET CORRECTION
0055 #!
0056 from JetMETCorrections.Configuration.JetCorrectionEra_cff import *
0057 JetCorrectionEra.era = 'Summer09_7TeV' # FIXME for input
0058 process.load('JetMETCorrections.Configuration.CorrectedJetProducers_cff')
0059 
0060 # correct kt4CaloJets
0061 process.kt4CaloL2Relative = process.ak5CaloL2Relative.clone(algorithm = 'KT4CALO')
0062 process.kt4CaloL3Absolute = process.ak5CaloL3Absolute.clone(algorithm = 'KT4CALO')
0063 process.kt4CaloL2L3 = process.ak5CaloL2L3.clone(
0064     correctors = ['kt4CaloL2Relative','kt4CaloL3Absolute']
0065     )
0066 process.kt4CaloJetsL2L3 = process.ak5CaloJetsL2L3.clone(
0067     src = 'kt4CaloJets', correctors = ['kt4CaloL2L3']
0068     )
0069 
0070 # correct kt4PFJets
0071 process.kt4PFL2Relative = process.ak5PFL2Relative.clone(algorithm = 'KT4PF')
0072 process.kt4PFL3Absolute = process.ak5PFL3Absolute.clone(algorithm = 'KT4PF')
0073 process.kt4PFL2L3 = process.ak5PFL2L3.clone(
0074     correctors = ['kt4PFL2Relative','kt4PFL3Absolute']
0075     )
0076 process.kt4PFJetsL2L3 = process.ak5PFJetsL2L3.clone(
0077     src = 'kt4PFJets', correctors = ['kt4PFL2L3']
0078     )
0079 
0080 
0081 #!
0082 #! MAKE SOME HISTOGRAMS
0083 #!
0084 jetPtHistogram = cms.PSet(min          = cms.untracked.double(     10),
0085                           max          = cms.untracked.double(    200),
0086                           nbins        = cms.untracked.int32 (     50),
0087                           name         = cms.untracked.string('JetPt'),
0088                           description  = cms.untracked.string(     ''),
0089                           plotquantity = cms.untracked.string(   'pt')
0090                           )
0091 
0092 process.kt4CaloHistos = cms.EDAnalyzer(
0093     'CandViewHistoAnalyzer',
0094     src = cms.InputTag('kt4CaloJets'),
0095     histograms = cms.VPSet(jetPtHistogram)
0096     )
0097 process.kt4CaloL2L3Histos = cms.EDAnalyzer(
0098     'CandViewHistoAnalyzer',
0099     src = cms.InputTag('kt4CaloJetsL2L3'),
0100     histograms = cms.VPSet(jetPtHistogram)
0101     )
0102 process.kt4PFHistos = cms.EDAnalyzer(
0103     'CandViewHistoAnalyzer',
0104     src = cms.InputTag('kt4PFJets'),
0105     histograms = cms.VPSet(jetPtHistogram)
0106     )
0107 process.kt4PFL2L3Histos = cms.EDAnalyzer(
0108     'CandViewHistoAnalyzer',
0109     src = cms.InputTag('kt4PFJetsL2L3'),
0110     histograms = cms.VPSet(jetPtHistogram)
0111     )
0112 
0113 #
0114 # RUN!
0115 #
0116 process.run = cms.Path(
0117     process.kt4CaloJetsL2L3*process.kt4CaloHistos*process.kt4CaloL2L3Histos*
0118     process.kt4PFJetsL2L3*  process.kt4PFHistos*  process.kt4PFL2L3Histos
0119     )