Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 # PYTHON configuration file for class: JetIdExample
0002 # Description:  Example showing how to conveniently select collection
0003 # of jets in the event which pass the jet id criteria ("loose",
0004 # "medium", "tight",..etc) using a simple one-line plugin.
0005 #
0006 # Author: Kalanand Mishra
0007 # Date:  18 - January - 2011
0008 
0009 import FWCore.ParameterSet.Config as cms
0010 
0011 ##  ____        _                       __  __  ____ 
0012 ## |  _ \  __ _| |_ __ _    ___  _ __  |  \/  |/ ___|
0013 ## | | | |/ _` | __/ _` |  / _ \| '__| | |\/| | |    
0014 ## | |_| | (_| | || (_| | | (_) | |    | |  | | |___ 
0015 ## |____/ \__,_|\__\__,_|  \___/|_|    |_|  |_|\____|
0016                                                   
0017 isMC = True
0018 
0019 
0020 ##   ____             __ _                       _     _           
0021 ##  / ___|___  _ __  / _(_) __ _ _   _ _ __ __ _| |__ | | ___  ___ 
0022 ## | |   / _ \| '_ \| |_| |/ _` | | | | '__/ _` | '_ \| |/ _ \/ __|
0023 ## | |__| (_) | | | |  _| | (_| | |_| | | | (_| | |_) | |  __/\__ \
0024 ##  \____\___/|_| |_|_| |_|\__, |\__,_|_|  \__,_|_.__/|_|\___||___/
0025 ##                         |___/                                   
0026 
0027 NJetsToKeep = 2
0028 GLOBAL_TAG = 'GR_R_38X_V15::All'
0029 inputFile = 'file:/uscms_data/d2/kalanand/dijet-Run2010A-JetMET-Nov4ReReco-9667events.root'
0030 
0031 if isMC:
0032     GLOBAL_TAG = 'START38_V14::All'
0033     inputFile ='/store/mc/Fall10/QCD_Pt_80to120_TuneZ2_7TeV_pythia6/GEN-SIM-RECO/START38_V12-v1/0000/FEF4D100-4CCB-DF11-94CB-00E08178C12F.root'
0034 
0035 
0036 ##   _            _           _           
0037 ## (_)_ __   ___| |_   _  __| | ___  ___ 
0038 ## | | '_ \ / __| | | | |/ _` |/ _ \/ __|
0039 ## | | | | | (__| | |_| | (_| |  __/\__ \
0040 ## |_|_| |_|\___|_|\__,_|\__,_|\___||___/
0041                                       
0042    
0043 process = cms.Process("Ana")
0044 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0045 process.load("Configuration.StandardSequences.Geometry_cff")
0046 process.GlobalTag.globaltag = GLOBAL_TAG
0047 
0048 #############   Format MessageLogger #################
0049 process.load("FWCore.MessageService.MessageLogger_cfi")
0050 process.MessageLogger.cerr.FwkReport.reportEvery = 10
0051 
0052 
0053 ##  ____             _ ____                           
0054 ## |  _ \ ___   ___ | / ___|  ___  _   _ _ __ ___ ___ 
0055 ## | |_) / _ \ / _ \| \___ \ / _ \| | | | '__/ __/ _ \
0056 ## |  __/ (_) | (_) | |___) | (_) | |_| | | | (_|  __/
0057 ## |_|   \___/ \___/|_|____/ \___/ \__,_|_|  \___\___|
0058                                                    
0059 
0060 #############   Set the number of events #############
0061 process.maxEvents = cms.untracked.PSet(
0062     input = cms.untracked.int32(100)
0063 )
0064 #############   Define the source file ###############
0065 process.source = cms.Source("PoolSource",
0066     fileNames = cms.untracked.vstring(inputFile)
0067 )
0068 process.source.inputCommands = cms.untracked.vstring("keep *","drop *_MEtoEDMConverter_*_*")
0069 
0070 
0071 ##      _      _     ___    _ 
0072 ##     | | ___| |_  |_ _|__| |
0073 ##  _  | |/ _ \ __|  | |/ _` |
0074 ## | |_| |  __/ |_   | | (_| |
0075 ##  \___/ \___|\__| |___\__,_|
0076                            
0077 
0078 #############   JetID: Calo Jets  ###########################
0079 process.load("RecoJets.JetProducers.ak5JetID_cfi")
0080 process.CaloJetsLooseId = cms.EDProducer("CaloJetIdSelector",
0081     src     = cms.InputTag( "ak5CaloJets" ),                                     
0082     idLevel = cms.string("LOOSE"),                            
0083     jetIDMap = cms.untracked.InputTag("ak5JetID")
0084 )
0085 
0086 process.CaloJetsTightId = cms.EDProducer("CaloJetIdSelector",
0087     src     = cms.InputTag( "ak5CaloJets" ),                                             
0088     idLevel = cms.string("TIGHT"),                            
0089     jetIDMap = cms.untracked.InputTag("ak5JetID")
0090 )
0091 #############   JetID: PF Jets    ###########################
0092 process.PFJetsLooseId = cms.EDProducer("PFJetIdSelector",
0093     src     = cms.InputTag( "ak5PFJets" ),                                     
0094     idLevel = cms.string("LOOSE")
0095 )
0096 
0097 process.PFJetsTightId = cms.EDProducer("PFJetIdSelector",
0098     src     = cms.InputTag( "ak5PFJets" ),                                             
0099     idLevel = cms.string("TIGHT")
0100 )
0101 
0102 
0103 ##  ____  _       _       
0104 ## |  _ \| | ___ | |_ ___ 
0105 ## | |_) | |/ _ \| __/ __|
0106 ## |  __/| | (_) | |_\__ \
0107 ## |_|   |_|\___/ \__|___/
0108 
0109 #######################################################
0110 #############   Analysis: Calo Jets  ##################
0111 process.caloJetAnalysisLooseId = cms.EDAnalyzer("CaloJetPlotsExample",
0112     JetAlgorithm  = cms.string('CaloJetsLooseId'),
0113     HistoFileName = cms.string('CaloJetPlotsExample_LooseId.root'),
0114     NJets         = cms.int32(NJetsToKeep)
0115 )
0116 process.caloJetAnalysisTightId = process.caloJetAnalysisLooseId.clone()
0117 process.caloJetAnalysisTightId.JetAlgorithm = cms.string('CaloJetsTightId')
0118 process.caloJetAnalysisTightId.HistoFileName = cms.string('CaloJetPlotsExample_TightId.root')
0119 
0120 #############    Analysis: PF Jets  ###################
0121 process.pfJetAnalysisLooseId = cms.EDAnalyzer("PFJetPlotsExample",
0122     JetAlgorithm  = cms.string('PFJetsLooseId'),
0123     HistoFileName = cms.string('PFJetPlotsExample_LooseId.root'),
0124     NJets         = cms.int32(NJetsToKeep)
0125 )
0126 process.pfJetAnalysisTightId = process.pfJetAnalysisLooseId.clone()
0127 process.pfJetAnalysisTightId.JetAlgorithm = cms.string('PFJetsTightId')
0128 process.pfJetAnalysisTightId.HistoFileName = cms.string('PFJetPlotsExample_TightId.root')
0129 
0130 
0131 
0132 ##  ____       _   _     
0133 ## |  _ \ __ _| |_| |__  
0134 ## | |_) / _` | __| '_ \ 
0135 ## |  __/ (_| | |_| | | |
0136 ## |_|   \__,_|\__|_| |_|
0137 
0138 ## #############   Path       ###########################
0139 process.p = cms.Path( process.ak5JetID +
0140                       process.CaloJetsLooseId +
0141                       process.CaloJetsTightId +
0142                       process.PFJetsLooseId +
0143                       process.PFJetsTightId +
0144                       process.caloJetAnalysisLooseId +
0145                       process.caloJetAnalysisTightId +                      
0146                       process.pfJetAnalysisLooseId +
0147                       process.pfJetAnalysisTightId 
0148                       )