Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 # As of 1 Feb 2017:
0002 # This configuration is already broken. Probably it
0003 # was broken when a tagAlgo option was removed from
0004 # RecoJets/JetProducers/plugins/CATopJetProducer.cc.
0005 # For this reason, it was not converted to use Tasks.
0006 # If that problem is ever fixed, it will also need to
0007 # be migrated to use Tasks.
0008 
0009 ## import skeleton process
0010 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0011 ## switch to uncheduled mode
0012 process.options.allowUnscheduled = cms.untracked.bool(True)
0013 #process.Tracer = cms.Service('Tracer')
0014 
0015 process.load('PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff')
0016 process.load('PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff')
0017 process.load("RecoJets.Configuration.RecoGenJets_cff")
0018 process.load("RecoJets.Configuration.GenJetParticles_cff")
0019 
0020 #process.ca8GenJetsNoNu = process.ca6GenJetsNoNu.clone( rParam = 0.8 )
0021 
0022 from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
0023 from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
0024 
0025 addJetCollection(
0026     process,
0027     labelName = 'AK4PFCHS',
0028     jetSource = cms.InputTag('ak4PFJetsCHS'),
0029     algo = 'ak4',
0030     rParam = 0.4,
0031     jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None')
0032     )
0033 
0034 addJetCollection(
0035     process,
0036     labelName = 'CA8PFCHS',
0037     jetSource = cms.InputTag('ca8PFJetsCHS'),
0038     algo = 'ca8',
0039     rParam = 0.8,
0040     jetCorrections = ('AK8PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None')
0041     )
0042 
0043 addJetCollection(
0044     process,
0045     labelName = 'AK8PFCHS',
0046     jetSource = cms.InputTag('ak8PFJetsCHS'),
0047     algo = 'ak8',
0048     rParam = 0.8,
0049     jetCorrections = ('AK8PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None')
0050     )
0051 
0052 switchJetCollection(
0053     process,
0054     jetSource = cms.InputTag('ak4PFJets'),
0055     rParam = 0.4,
0056     jetCorrections = ('AK4PF', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'Type-1'),
0057     )
0058 
0059 #process.patJetGenJetMatchCA8PFCHS.matched = cms.InputTag("ca8GenJetsNoNu")
0060 
0061 patJetsAK4 = process.patJetsAK4PFCHS
0062 patJetsCA8 = process.patJetsCA8PFCHS
0063 patJetsAK8 = process.patJetsAK8PFCHS
0064 
0065 process.out.outputCommands += ['keep *_ak4PFJetsCHS_*_*',
0066                                'keep *_patJetsAK4PFCHS_*_*',
0067                                'keep *_ca8PFJetsCHS_*_*',
0068                                'keep *_patJetsCA8PFCHS_*_*',
0069                                'keep *_ak8PFJetsCHS_*_*',
0070                                'keep *_patJetsAK8PFCHS_*_*']
0071 
0072 ####################################################################################################
0073 #THE JET TOOLBOX
0074 
0075 #load the various tools
0076 
0077 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0078 #pileupJetID
0079 
0080 process.load('RecoJets.JetProducers.PileupJetID_cfi')
0081 patJetsAK4.userData.userFloats.src += ['pileupJetIdEvaluator:fullDiscriminant']
0082 patJetsAK4.userData.userInts.src += ['pileupJetIdEvaluator:cutbasedId','pileupJetIdEvaluator:fullId']
0083 process.out.outputCommands += ['keep *_pileupJetIdEvaluator_*_*']
0084 
0085 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0086 #QGTagger
0087 
0088 process.load('RecoJets.JetProducers.QGTagger_cfi')
0089 patJetsAK4.userData.userFloats.src += ['QGTagger:qgLikelihood']
0090 process.out.outputCommands += ['keep *_QGTagger_*_*']
0091 
0092 #HF shower shape variables
0093 process.load('RecoJets.JetProducers.hfJetShowerShape_cfi')
0094 process.hfJetShowerShape.jets = cms.InputTag("ak4PFJetsCHS")
0095 process.hfJetShowerShape.vertices = cms.InputTag("offlinePrimaryVertices")
0096 
0097 patJetsAK4.userData.userFloats.src += ['hfJetShowerShape:sigmaEtaEta','hfJetShowerShape:sigmaPhiPhi']
0098 patJetsAK4.userData.userInts.src += ['hfJetShowerShape:centralEtaStripSize','hfJetShowerShape:adjacentEtaStripsSize']
0099 process.out.outputCommands += ['keep *_hfJetShowerShape_*_*']
0100 
0101 
0102 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0103 #Njettiness
0104 
0105 process.load('RecoJets.JetProducers.nJettinessAdder_cfi')
0106 
0107 process.NjettinessCA8 = process.Njettiness.clone()
0108 process.NjettinessCA8.src = cms.InputTag("ca8PFJetsCHS")
0109 process.NjettinessCA8.cone = cms.double(0.8)
0110 
0111 patJetsCA8.userData.userFloats.src += ['NjettinessCA8:tau1','NjettinessCA8:tau2','NjettinessCA8:tau3']
0112 process.out.outputCommands += ['keep *_NjettinessCA8_*_*']
0113 
0114 process.NjettinessAK8 = process.NjettinessCA8.clone()
0115 process.NjettinessAK8.src = cms.InputTag("ak8PFJetsCHS")
0116 
0117 patJetsAK8.userData.userFloats.src += ['NjettinessAK8:tau1','NjettinessAK8:tau2','NjettinessAK8:tau3']
0118 process.out.outputCommands += ['keep *_NjettinessAK8_*_*']
0119 
0120 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0121 #ECF
0122 
0123 process.load('RecoJets.JetProducers.ECF_cfi')
0124 
0125 process.ECFCA8 = process.ECF.clone()
0126 process.ECFCA8.src = cms.InputTag("ca8PFJetsCHS")
0127 process.ECFCA8.cone = cms.double(0.8)
0128 
0129 patJetsCA8.userData.userFloats.src += ['ECFCA8:ecf1','ECFCA8:ecf2','ECFCA8:ecf3']
0130 process.out.outputCommands += ['keep *_ECFCA8_*_*']
0131 
0132 process.ECFAK8 = process.ECFCA8.clone()
0133 process.ECFAK8.src = cms.InputTag("ak8PFJetsCHS")
0134 
0135 patJetsAK8.userData.userFloats.src += ['ECFAK8:ecf1','ECFAK8:ecf2','ECFAK8:ecf3']
0136 process.out.outputCommands += ['keep *_ECFAK8_*_*']
0137 
0138 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0139 #QJetsAdder
0140 
0141 process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
0142                                                    QJetsAdderCA8 = cms.PSet(initialSeed = cms.untracked.uint32(7)),
0143                                                    QJetsAdderAK8 = cms.PSet(initialSeed = cms.untracked.uint32(31)))
0144 
0145 process.load('RecoJets.JetProducers.qjetsadder_cfi')
0146 
0147 process.QJetsAdderCA8 = process.QJetsAdder.clone()
0148 process.QJetsAdderCA8.src = cms.InputTag("ca8PFJetsCHS")
0149 process.QJetsAdderCA8.jetRad = cms.double(0.8)
0150 process.QJetsAdderCA8.jetAlgo = cms.string('CA')
0151 
0152 patJetsCA8.userData.userFloats.src += ['QJetsAdderCA8:QjetsVolatility']
0153 process.out.outputCommands += ['keep *_QJetsAdderCA8_*_*']
0154 
0155 process.QJetsAdderAK8 = process.QJetsAdderCA8.clone()
0156 process.QJetsAdderAK8.src = cms.InputTag("ak8PFJetsCHS")
0157 process.QJetsAdderAK8.jetAlgo = cms.string('AK')
0158 
0159 patJetsAK8.userData.userFloats.src += ['QJetsAdderAK8:QjetsVolatility']
0160 process.out.outputCommands += ['keep *_QJetsAdderAK8_*_*']
0161                                    
0162 #- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0163 #Grooming valueMaps
0164 
0165 process.load('RecoJets.Configuration.RecoPFJets_cff')
0166 
0167 patJetsCA8.userData.userFloats.src += ['ca8PFJetsCHSPrunedMass','ca8PFJetsCHSSoftDropMass','ca8PFJetsCHSTrimmedMass','ca8PFJetsCHSFilteredMass']
0168 process.out.outputCommands += ['keep *_ca8PFJetsCHSPrunedMass_*_*',
0169                                'keep *_ca8PFJetsCHSSoftDropMass_*_*',
0170                                'keep *_ca8PFJetsCHSTrimmedMass_*_*',
0171                                'keep *_ca8PFJetsCHSFilteredMass_*_*']
0172 
0173 patJetsAK8.userData.userFloats.src += ['ak8PFJetsCHSPrunedMass','ak8PFJetsCHSSoftDropMass','ak8PFJetsCHSTrimmedMass','ak8PFJetsCHSFilteredMass']
0174 process.out.outputCommands += ['keep *_ak8PFJetsCHSPrunedMass_*_*',
0175                                'keep *_ak8PFJetsCHSSoftDropMass_*_*',
0176                                'keep *_ak8PFJetsCHSTrimmedMass_*_*',
0177                                'keep *_ak8PFJetsCHSFilteredMass_*_*']
0178 
0179 process.cmsTopTagPFJetsCHSMassCA8 = process.ca8PFJetsCHSPrunedMass.clone()
0180 process.cmsTopTagPFJetsCHSMassCA8.src = cms.InputTag("ca8PFJetsCHS")
0181 process.cmsTopTagPFJetsCHSMassCA8.matched = cms.InputTag("cmsTopTagPFJetsCHS")
0182 
0183 patJetsCA8.userData.userFloats.src += ['cmsTopTagPFJetsCHSMassCA8']
0184 process.out.outputCommands += ['keep *_cmsTopTagPFJetsCHSMassCA8_*_*']
0185 
0186 process.cmsTopTagPFJetsCHSMassAK8 = process.cmsTopTagPFJetsCHSMassCA8.clone()
0187 process.cmsTopTagPFJetsCHSMassAK8.src = cms.InputTag("ak8PFJetsCHS")
0188 process.cmsTopTagPFJetsCHSMassAK8.matched = cms.InputTag("cmsTopTagPFJetsCHS")
0189 
0190 patJetsAK8.userData.userFloats.src += ['cmsTopTagPFJetsCHSMassAK8']
0191 process.out.outputCommands += ['keep *_cmsTopTagPFJetsCHSMassAK8_*_*']
0192 
0193 ####################################################################################################
0194 
0195 ## ------------------------------------------------------
0196 #  In addition you usually want to change the following
0197 #  parameters:
0198 ## ------------------------------------------------------
0199 #
0200 #   process.GlobalTag.globaltag =  ...    ##  (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions)
0201 #from Configuration.AlCa.GlobalTag import GlobalTag
0202 #process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')
0203 #                                         ##
0204 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM
0205 process.source.fileNames = filesRelValProdTTbarAODSIM
0206 #                                         ##
0207 process.maxEvents.input = 5
0208 #                                         ##
0209 #   process.out.outputCommands = [ ... ]  ##  (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py)
0210 #                                         ##
0211 process.out.fileName = 'testJetTools.root'
0212 #                                         ##
0213 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)