Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:17

0001 ## import skeleton process
0002 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0003 #process.Tracer = cms.Service('Tracer')
0004 
0005 from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection
0006 
0007 updateJetCollection(
0008     process,
0009     labelName = 'AK8PFCHS',
0010     jetSource = cms.InputTag('slimmedJetsAK8'),
0011     algo = 'ak8',
0012     rParam = 0.8,
0013     jetCorrections = ('AK8PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None')
0014     )
0015 
0016 updateJetCollection(
0017     process,
0018     labelName = 'AK4PFCHS',
0019     jetSource = cms.InputTag('slimmedJets'),
0020     algo = 'ak4',
0021     rParam = 0.4,
0022     jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'),
0023     )
0024 
0025 patJetsAK4 = process.updatedPatJetsAK4PFCHS
0026 patJetsAK8 = process.updatedPatJetsAK8PFCHS
0027 
0028 process.out.outputCommands += ['keep *_updatedPatJetsAK4PFCHS_*_*',
0029                                'keep *_updatedPatJetsAK8PFCHS_*_*']
0030 
0031 ####################################################################################################
0032 #THE JET TOOLBOX
0033 
0034 #load the various tools
0035 
0036 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0037 #pileupJetID
0038 
0039 process.load('RecoJets.JetProducers.PileupJetID_cfi')
0040 patAlgosToolsTask.add(process.pileUpJetIDTask)
0041 process.pileupJetIdCalculator.jets=cms.InputTag("slimmedJets")
0042 process.pileupJetIdCalculator.inputIsCorrected=True
0043 process.pileupJetIdCalculator.applyJec=True
0044 process.pileupJetIdCalculator.vertexes=cms.InputTag("offlineSlimmedPrimaryVertices")
0045 process.pileupJetIdEvaluator.jets=process.pileupJetIdCalculator.jets
0046 process.pileupJetIdEvaluator.inputIsCorrected=process.pileupJetIdCalculator.inputIsCorrected
0047 process.pileupJetIdEvaluator.applyJec=process.pileupJetIdCalculator.applyJec
0048 process.pileupJetIdEvaluator.vertexes=process.pileupJetIdCalculator.vertexes
0049 patJetsAK4.userData.userFloats.src += ['pileupJetIdEvaluator:fullDiscriminant']
0050 patJetsAK4.userData.userInts.src += ['pileupJetIdEvaluator:cutbasedId','pileupJetIdEvaluator:fullId']
0051 process.out.outputCommands += ['keep *_pileupJetIdEvaluator_*_*']
0052 
0053 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0054 #QGTagger
0055 
0056 process.load('RecoJets.JetProducers.QGTagger_cfi')
0057 patAlgosToolsTask.add(process.QGTagger)
0058 process.QGTagger.srcJets=cms.InputTag("slimmedJets")
0059 process.QGTagger.srcVertexCollection=cms.InputTag("offlineSlimmedPrimaryVertices")
0060 patJetsAK4.userData.userFloats.src += ['QGTagger:qgLikelihood']
0061 process.out.outputCommands += ['keep *_QGTagger_*_*']
0062 
0063 
0064 #HF shower shape variables
0065 process.load('RecoJets.JetProducers.hfJetShowerShape_cfi')
0066 patAlgosToolsTask.add(process.hfJetShowerShape)
0067 process.hfJetShowerShape.jets=cms.InputTag("slimmedJets")
0068 process.hfJetShowerShape.vertices=cms.InputTag("offlineSlimmedPrimaryVertices")
0069 patJetsAK4.userData.userFloats.src += ['hfJetShowerShape:sigmaEtaEta','hfJetShowerShape:sigmaPhiPhi']
0070 patJetsAK4.userData.userInts.src += ['hfJetShowerShape:centralEtaStripSize','hfJetShowerShape:adjacentEtaStripsSize']
0071 process.out.outputCommands += ['keep *_hfJetShowerShape_*_*']
0072 
0073 
0074 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0075 #Njettiness
0076 
0077 process.load('RecoJets.JetProducers.nJettinessAdder_cfi')
0078 patAlgosToolsTask.add(process.Njettiness)
0079 process.NjettinessAK8 = process.Njettiness.clone()
0080 patAlgosToolsTask.add(process.NjettinessAK8)
0081 process.NjettinessAK8.src = cms.InputTag("slimmedJetsAK8")
0082 
0083 patJetsAK8.userData.userFloats.src += ['NjettinessAK8:tau1','NjettinessAK8:tau2','NjettinessAK8:tau3']
0084 process.out.outputCommands += ['keep *_NjettinessAK8_*_*']
0085 
0086 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0087 #ECF
0088 
0089 process.load('RecoJets.JetProducers.ECF_cff')
0090 patAlgosToolsTask.add(process.ecf)
0091 process.ecfAK8 = process.ecf.clone()
0092 patAlgosToolsTask.add(process.ecfAK8)
0093 #process.ecfAK8.cone = cms.double(0.8)
0094 process.ecfAK8.src = cms.InputTag("slimmedJetsAK8")
0095 
0096 patJetsAK8.userData.userFloats.src += ['ecfAK8:ecf1','ecfAK8:ecf2','ecfAK8:ecf3']
0097 process.out.outputCommands += ['keep *_ecfAK8_*_*']
0098 
0099 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0100 #QJetsAdder
0101 
0102 process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
0103                                                    QJetsAdderAK8 = cms.PSet(initialSeed = cms.untracked.uint32(31)))
0104 
0105 process.load('RecoJets.JetProducers.qjetsadder_cfi')
0106 patAlgosToolsTask.add(process.QJetsAdder)
0107 process.QJetsAdderAK8 = process.QJetsAdder.clone()
0108 patAlgosToolsTask.add(process.QJetsAdderAK8)
0109 process.QJetsAdderAK8.src = cms.InputTag("slimmedJetsAK8")
0110 process.QJetsAdderAK8.jetRad = cms.double(0.8)
0111 process.QJetsAdderAK8.jetAlgo = cms.string('AK')
0112 
0113 patJetsAK8.userData.userFloats.src += ['QJetsAdderAK8:QjetsVolatility']
0114 process.out.outputCommands += ['keep *_QJetsAdderAK8_*_*']
0115                                    
0116 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0117 #Grooming valueMaps
0118 
0119 from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsCHSPruned, ak8PFJetsCHSSoftDrop, ak8PFJetsCHSTrimmed, ak8PFJetsCHSFiltered
0120 process.ak8PFJetsCHSPruned = ak8PFJetsCHSPruned.clone()
0121 patAlgosToolsTask.add(process.ak8PFJetsCHSPruned)
0122 process.ak8PFJetsCHSSoftDrop = ak8PFJetsCHSSoftDrop.clone()
0123 patAlgosToolsTask.add(process.ak8PFJetsCHSSoftDrop)
0124 process.ak8PFJetsCHSTrimmed = ak8PFJetsCHSTrimmed.clone()
0125 patAlgosToolsTask.add(process.ak8PFJetsCHSTrimmed)
0126 process.ak8PFJetsCHSFiltered = ak8PFJetsCHSFiltered.clone()
0127 patAlgosToolsTask.add(process.ak8PFJetsCHSFiltered)
0128 process.ak8PFJetsCHSPruned.src = cms.InputTag("packedPFCandidates")
0129 process.ak8PFJetsCHSSoftDrop.src = cms.InputTag("packedPFCandidates")
0130 process.ak8PFJetsCHSTrimmed.src = cms.InputTag("packedPFCandidates")
0131 process.ak8PFJetsCHSFiltered.src = cms.InputTag("packedPFCandidates")
0132 from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsCHSPrunedMass, ak8PFJetsCHSSoftDropMass, ak8PFJetsCHSTrimmedMass, ak8PFJetsCHSFilteredMass
0133 process.ak8PFJetsCHSPrunedMass = ak8PFJetsCHSPrunedMass.clone()
0134 patAlgosToolsTask.add(process.ak8PFJetsCHSPrunedMass)
0135 process.ak8PFJetsCHSSoftDropMass = ak8PFJetsCHSSoftDropMass.clone()
0136 patAlgosToolsTask.add(process.ak8PFJetsCHSSoftDropMass)
0137 process.ak8PFJetsCHSTrimmedMass = ak8PFJetsCHSTrimmedMass.clone()
0138 patAlgosToolsTask.add(process.ak8PFJetsCHSTrimmedMass)
0139 process.ak8PFJetsCHSFilteredMass = ak8PFJetsCHSFilteredMass.clone()
0140 patAlgosToolsTask.add(process.ak8PFJetsCHSFilteredMass)
0141 process.ak8PFJetsCHSPrunedMass.src = cms.InputTag("slimmedJetsAK8")
0142 process.ak8PFJetsCHSSoftDropMass.src = cms.InputTag("slimmedJetsAK8")
0143 process.ak8PFJetsCHSTrimmedMass.src = cms.InputTag("slimmedJetsAK8")
0144 process.ak8PFJetsCHSFilteredMass.src = cms.InputTag("slimmedJetsAK8")
0145 
0146 patJetsAK8.userData.userFloats.src += ['ak8PFJetsCHSPrunedMass','ak8PFJetsCHSSoftDropMass','ak8PFJetsCHSTrimmedMass','ak8PFJetsCHSFilteredMass']
0147 process.out.outputCommands += ['keep *_ak8PFJetsCHSPrunedMass_*_*',
0148                                'keep *_ak8PFJetsCHSSoftDropMass_*_*',
0149                                'keep *_ak8PFJetsCHSTrimmedMass_*_*',
0150                                'keep *_ak8PFJetsCHSFilteredMass_*_*']
0151 
0152 from RecoJets.JetProducers.caTopTaggers_cff import cmsTopTagPFJetsCHS
0153 process.cmsTopTagPFJetsCHS = cmsTopTagPFJetsCHS.clone()
0154 patAlgosToolsTask.add(process.cmsTopTagPFJetsCHS)
0155 process.cmsTopTagPFJetsCHS.src = cms.InputTag("packedPFCandidates")
0156 process.cmsTopTagPFJetsCHSMassAK8 = process.ak8PFJetsCHSPrunedMass.clone()
0157 patAlgosToolsTask.add(process.cmsTopTagPFJetsCHSMassAK8)
0158 process.cmsTopTagPFJetsCHSMassAK8.src = cms.InputTag("slimmedJetsAK8")
0159 process.cmsTopTagPFJetsCHSMassAK8.matched = cms.InputTag("cmsTopTagPFJetsCHS")
0160 
0161 patJetsAK8.userData.userFloats.src += ['cmsTopTagPFJetsCHSMassAK8']
0162 process.out.outputCommands += ['keep *_cmsTopTagPFJetsCHSMassAK8_*_*']
0163 
0164 ####################################################################################################
0165 
0166 ## ------------------------------------------------------
0167 #  In addition you usually want to change the following
0168 #  parameters:
0169 ## ------------------------------------------------------
0170 #
0171 #   process.GlobalTag.globaltag =  ...    ##  (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions)
0172 #from Configuration.AlCa.GlobalTag import GlobalTag
0173 #process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')
0174 #                                         ##
0175 import PhysicsTools.PatAlgos.patInputFiles_cff
0176 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM
0177 process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM
0178 #                                         ##
0179 process.maxEvents.input = 5
0180 #                                         ##
0181 #   process.out.outputCommands = [ ... ]  ##  (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py)
0182 #                                         ##
0183 process.out.fileName = 'testJetTools.root'
0184 #                                         ##
0185 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)
0186