Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:59

0001 # PYTHON configuration file.
0002 # Description:  Example of applying default (L2+L3) jet corrections.
0003 # Author: K. Kousouris
0004 # Date:  02 - September - 2009
0005 # Date:  22 - November - 2009: Kalanand Mishra: Modified for 3.3.X (re-Reco) corrections
0006 # Date:  14 - January - 2011: Kalanand Mishra: Modified for 3.8.X 
0007 
0008 import FWCore.ParameterSet.Config as cms
0009 
0010 ##  ____        _                       __  __  ____ 
0011 ## |  _ \  __ _| |_ __ _    ___  _ __  |  \/  |/ ___|
0012 ## | | | |/ _` | __/ _` |  / _ \| '__| | |\/| | |    
0013 ## | |_| | (_| | || (_| | | (_) | |    | |  | | |___ 
0014 ## |____/ \__,_|\__\__,_|  \___/|_|    |_|  |_|\____|
0015             
0016 isMC = True
0017 
0018 
0019 ##   ____             __ _                       _     _           
0020 ##  / ___|___  _ __  / _(_) __ _ _   _ _ __ __ _| |__ | | ___  ___ 
0021 ## | |   / _ \| '_ \| |_| |/ _` | | | | '__/ _` | '_ \| |/ _ \/ __|
0022 ## | |__| (_) | | | |  _| | (_| | |_| | | | (_| | |_) | |  __/\__ \
0023 ##  \____\___/|_| |_|_| |_|\__, |\__,_|_|  \__,_|_.__/|_|\___||___/
0024 ##                         |___/                                   
0025 
0026 NJetsToKeep = 2
0027 GLOBAL_TAG = 'GR_R_38X_V15::All'
0028 inputFile = 'file:/uscms_data/d2/kalanand/dijet-Run2010A-JetMET-Nov4ReReco-9667events.root'
0029 if isMC:
0030     GLOBAL_TAG = 'START38_V14::All'
0031     inputFile ='/store/mc/Fall10/QCD_Pt_80to120_TuneZ2_7TeV_pythia6/GEN-SIM-RECO/START38_V12-v1/0000/FEF4D100-4CCB-DF11-94CB-00E08178C12F.root'
0032 
0033 
0034 ##   _            _           _           
0035 ## (_)_ __   ___| |_   _  __| | ___  ___ 
0036 ## | | '_ \ / __| | | | |/ _` |/ _ \/ __|
0037 ## | | | | | (__| | |_| | (_| |  __/\__ \
0038 ## |_|_| |_|\___|_|\__,_|\__,_|\___||___/
0039 
0040                                         
0041 process = cms.Process("Ana")
0042 process.load('Configuration.StandardSequences.Services_cff')
0043 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0044 process.GlobalTag.globaltag = GLOBAL_TAG
0045 process.load("FWCore.MessageService.MessageLogger_cfi")
0046 
0047 
0048 ##  ____             _ ____                           
0049 ## |  _ \ ___   ___ | / ___|  ___  _   _ _ __ ___ ___ 
0050 ## | |_) / _ \ / _ \| \___ \ / _ \| | | | '__/ __/ _ \
0051 ## |  __/ (_) | (_) | |___) | (_) | |_| | | | (_|  __/
0052 ## |_|   \___/ \___/|_|____/ \___/ \__,_|_|  \___\___|
0053                                                    
0054 
0055 #############   Set the number of events #############
0056 process.maxEvents = cms.untracked.PSet(
0057     input = cms.untracked.int32(100)
0058 )
0059 #############   Define the source file ###############
0060 process.source = cms.Source("PoolSource",
0061     fileNames = cms.untracked.vstring(inputFile)
0062 )
0063 process.source.inputCommands = cms.untracked.vstring("keep *","drop *_MEtoEDMConverter_*_*")
0064 
0065 
0066 
0067 ##      _ _____ ____ 
0068 ##     | | ____/ ___|
0069 ##  _  | |  _|| |    
0070 ## | |_| | |__| |___ 
0071 ##  \___/|_____\____|
0072                   
0073 
0074 #############   Include the jet corrections ##########
0075 process.load("JetMETCorrections.Configuration.DefaultJEC_cff")
0076 ak5CaloJetsCor = cms.InputTag("ak5CaloJetsL2L3")
0077 ak5PFJetsCor = cms.InputTag("ak5PFJetsL2L3")
0078 ak4JPTJetsCor = cms.InputTag("ak4JPTJetsL2L3")
0079 if not isMC:
0080     ak5CaloJetsCor = cms.InputTag("ak5CaloJetsL2L3Residual")
0081     ak5PFJetsCor = cms.InputTag("ak5PFJetsL2L3Residual")
0082     ak4JPTJetsCor = cms.InputTag("ak4JPTJetsL2L3Residual")
0083 
0084 
0085 ##  ____       _           _   _             
0086 ## / ___|  ___| | ___  ___| |_(_) ___  _ __  
0087 ## \___ \ / _ \ |/ _ \/ __| __| |/ _ \| '_ \ 
0088 ##  ___) |  __/ |  __/ (__| |_| | (_) | | | |
0089 ## |____/ \___|_|\___|\___|\__|_|\___/|_| |_|
0090                                           
0091 
0092 #############   Apply selection cuts ##
0093 process.ak5CaloJetsSel = cms.EDFilter("CaloJetSelector",  
0094     src = ak5CaloJetsCor,
0095     cut = cms.string('pt > 20.0 && eta<3.0 && eta>-3.0')
0096 )
0097 process.ak5PFJetsSel = cms.EDFilter("PFJetSelector",  
0098     src = ak5PFJetsCor,
0099     cut = cms.string('pt > 20.0 && eta<3.0 && eta>-3.0')
0100 )
0101 
0102 process.ak4JPTJetsSel = cms.EDFilter("JPTJetSelector",  
0103     src = ak4JPTJetsCor,
0104     cut = cms.string('pt > 20.0 && eta<3.0 && eta>-3.0')
0105 )
0106 
0107 ##  ____  _       _       
0108 ## |  _ \| | ___ | |_ ___ 
0109 ## | |_) | |/ _ \| __/ __|
0110 ## |  __/| | (_) | |_\__ \
0111 ## |_|   |_|\___/ \__|___/
0112 
0113 ####################################################### 
0114 #############   User analyzer (corrected calo jets) ##
0115 process.correctedAK5Calo = cms.EDAnalyzer("CaloJetPlotsExample",
0116     JetAlgorithm  = cms.string("ak5CaloJetsSel"),
0117     HistoFileName = cms.string('CorJetHisto_AK5Calo.root'),
0118     NJets         = cms.int32(NJetsToKeep)
0119     )
0120 #############   User analyzer (corrected pf jets) ##
0121 process.correctedAK5PF = cms.EDAnalyzer("PFJetPlotsExample",
0122     JetAlgorithm  = cms.string("ak5PFJetsSel"),
0123     HistoFileName = cms.string('CorJetHisto_AK5PF.root'),
0124     NJets         = cms.int32(NJetsToKeep)
0125     )
0126 #############   User analyzer (corrected jpt jets) #####
0127 process.correctedAK5JPT = cms.EDAnalyzer("JPTJetPlotsExample",
0128     JetAlgorithm    = cms.string("ak4JPTJetsSel"),
0129     HistoFileName   = cms.string('CorJetHisto_AK5JPT.root'),
0130     NJets           = cms.int32(NJetsToKeep)
0131     )
0132 
0133 
0134 
0135 ##  ____       _   _     
0136 ## |  _ \ __ _| |_| |__  
0137 ## | |_) / _` | __| '_ \ 
0138 ## |  __/ (_| | |_| | | |
0139 ## |_|   \__,_|\__|_| |_|
0140 
0141 
0142 #############   Path       ###########################
0143 process.p = cms.Path( process.ak5CaloJetsL2L3 +
0144                       process.ak5CaloJetsL2L3Residual + 
0145                       process.ak5CaloJetsSel +
0146                       process.correctedAK5Calo +                      
0147                       process.ak5PFJetsL2L3 +
0148                       process.ak5PFJetsL2L3Residual +
0149                       process.ak5PFJetsSel +
0150                       process.correctedAK5PF  +                      
0151                       process.ak4JPTJetsL2L3 +
0152                       process.ak4JPTJetsL2L3Residual +                      
0153                       process.ak4JPTJetsSel +
0154                       process.correctedAK5JPT
0155                       )
0156 #############   Format MessageLogger #################
0157 process.MessageLogger.cerr.FwkReport.reportEvery = 10
0158