Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch default PAT jet input to 'AK5PFJetsCHS' and some related minor fi... #1543

Merged
merged 3 commits into from Nov 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,11 +2,11 @@

patJetPartons = cms.EDProducer("PartonSelector",
withLeptons = cms.bool(False),
src = cms.InputTag("genParticles")
src = cms.InputTag("genParticles")
)

patJetPartonAssociation = cms.EDProducer("JetPartonMatcher",
jets = cms.InputTag("ak5CaloJets"),
jets = cms.InputTag("ak5PFJetsCHS"),
partons = cms.InputTag("patJetPartons"),
coneSizeToAssociate = cms.double(0.3),
)
Expand Down
4 changes: 2 additions & 2 deletions PhysicsTools/PatAlgos/python/mcMatchLayer0/jetMatch_cfi.py
Expand Up @@ -4,7 +4,7 @@
# Example for a configuration of the MC match
#
patJetPartonMatch = cms.EDProducer("MCMatcher", # cut on deltaR, deltaPt/Pt; pick best by deltaR
src = cms.InputTag("ak5CaloJets"), # RECO objects to match
src = cms.InputTag("ak5PFJetsCHS"), # RECO objects to match
matched = cms.InputTag("genParticles"), # mc-truth particle collection
mcPdgId = cms.vint32(1, 2, 3, 4, 5, 21), # one or more PDG ID (quarks except top; gluons)
mcStatus = cms.vint32(3), # PYTHIA status code (3 = hard scattering)
Expand All @@ -16,7 +16,7 @@
)

patJetGenJetMatch = cms.EDProducer("GenJetMatcher", # cut on deltaR, deltaPt/Pt; pick best by deltaR
src = cms.InputTag("ak5CaloJets"), # RECO jets (any View<Jet> is ok)
src = cms.InputTag("ak5PFJetsCHS"), # RECO jets (any View<Jet> is ok)
matched = cms.InputTag("ak5GenJets"), # GEN jets (must be GenJetCollection)
mcPdgId = cms.vint32(), # n/a
mcStatus = cms.vint32(), # n/a
Expand Down
23 changes: 15 additions & 8 deletions PhysicsTools/PatAlgos/python/patInputFiles_cff.py
@@ -1,35 +1,42 @@
import FWCore.ParameterSet.Config as cms
from PhysicsTools.PatAlgos.tools.cmsswVersionTools import pickRelValInputFiles

# /RelValProdTTbar/CMSSW_7_0_0_pre8-START70_V1-v1/AODSIM
filesRelValProdTTbarAODSIM = cms.untracked.vstring(
pickRelValInputFiles( cmsswVersion = 'CMSSW_6_2_0_pre8'
pickRelValInputFiles( cmsswVersion = 'CMSSW_7_0_0_pre7'
, relVal = 'RelValProdTTbar'
, globalTag = 'PRE_ST62_V8'
, dataTier = 'AODSIM'
, maxVersions = 1
, maxVersions = 2
, numberOfFiles = 1
)
)

# /RelValProdTTbar/CMSSW_7_0_0_pre8-START70_V1-v1/GEN-SIM-RECO
filesRelValProdTTbarGENSIMRECO = cms.untracked.vstring(
pickRelValInputFiles( cmsswVersion = 'CMSSW_6_2_0_pre5' # event content in 620pre8 broken
pickRelValInputFiles( cmsswVersion = 'CMSSW_7_0_0_pre7'
, relVal = 'RelValProdTTbar'
, globalTag = 'PRE_ST61_V1'
, globalTag = 'PRE_ST62_V8'
, dataTier = 'GEN-SIM-RECO'
, maxVersions = 1
, maxVersions = 2
, numberOfFiles = 1
)
)

# /RelValTTbar/CMSSW_7_0_0_pre8-PU_START70_V1-v1/GEN-SIM-RECO
filesRelValTTbarPileUpGENSIMRECO = cms.untracked.vstring(
pickRelValInputFiles( cmsswVersion = 'CMSSW_6_2_0_pre5' # event content in 620pre8 broken
pickRelValInputFiles( cmsswVersion = 'CMSSW_7_0_0_pre7'
, relVal = 'RelValTTbar'
, globalTag = 'PU_PRE_ST61_V1'
, globalTag = 'PU_PRE_ST62_V8'
, dataTier = 'GEN-SIM-RECO'
, maxVersions = 1
, numberOfFiles = 1
)
)

# /SingleMu/CMSSW_6_2_0_pre8-PRE_62_V8_RelVal_mu2012D-v1/RECO
filesSingleMuRECO = cms.untracked.vstring(
pickRelValInputFiles( cmsswVersion = 'CMSSW_6_2_0_pre8'
pickRelValInputFiles( cmsswVersion = 'CMSSW_6_2_0_pre8' # no 70X data RelVals at CERN
, relVal = 'SingleMu'
, dataTier = 'RECO'
, globalTag = 'PRE_62_V8_RelVal_mu2012D'
Expand Down
Expand Up @@ -2,7 +2,7 @@

patJets = cms.EDProducer("PATJetProducer",
# input
jetSource = cms.InputTag("ak5CaloJets"),
jetSource = cms.InputTag("ak5PFJetsCHS"),
# add user data
userData = cms.PSet(
# add custom classes here
Expand Down Expand Up @@ -51,7 +51,7 @@
tagInfoSources = cms.VInputTag(),
# track association
addAssociatedTracks = cms.bool(True),
trackAssociationSource = cms.InputTag("ak5JetTracksAssociatorAtVertex"),
trackAssociationSource = cms.InputTag("ak5JetTracksAssociatorAtVertexPF"),
# jet charge
addJetCharge = cms.bool(True),
jetChargeSource = cms.InputTag("patJetCharge"),
Expand Down
@@ -1,8 +1,8 @@
import FWCore.ParameterSet.Config as cms

patMETs = cms.EDProducer("PATMETProducer",
# input
metSource = cms.InputTag("caloType1CorrectedMet"),
# input
metSource = cms.InputTag("pfType1CorrectedMetCHS"),

# add user data
userData = cms.PSet(
Expand All @@ -28,7 +28,7 @@
),

# muon correction
addMuonCorrections = cms.bool(True),
addMuonCorrections = cms.bool(False),
muonSource = cms.InputTag("muons"),

# mc matching configurables
Expand Down
16 changes: 8 additions & 8 deletions PhysicsTools/PatAlgos/python/recoLayer0/jetCorrFactors_cfi.py
Expand Up @@ -5,14 +5,14 @@
## the use of emf in the JEC is not yet implemented
emf = cms.bool(False),
## input collection of jets
src = cms.InputTag("ak5CaloJets"),
src = cms.InputTag("ak5PFJetsCHS"),
## payload postfix for testing
payload = cms.string('AK5Calo'),
payload = cms.string('AK5PFchs'),
## correction levels
levels = cms.vstring(
## tags for the individual jet corrections; when
## not available the string should be set to 'none'
'L1Offset', 'L2Relative', 'L3Absolute',#'L5Flavor', 'L7Parton'
## not available the string should be set to 'none'
'L1FastJet', 'L2Relative', 'L3Absolute',#'L5Flavor', 'L7Parton'
),
## define the type of L5Flavor corrections for here. These can
## be of type 'J' for dijet derived, or of type 'T' for ttbar
Expand All @@ -22,8 +22,8 @@
## corrections by a dedicated L1JPTOffset correction level. This dedi-
## cated correction level has an ordinary L1Offset or L1FastJet corrector
## as input, which needs to be specified via this additional parameter
extraJPTOffset = cms.string("L1Offset"),
## in case that L1Offset or L1FastJet corrections are part
extraJPTOffset = cms.string("L1FastJet"),
## in case that L1Offset or L1FastJet corrections are part
## of the parameter levels add the optional parameter
## primaryVertices here to specify the primary vertex
## collection, which was used to determine the L1Offset
Expand All @@ -37,6 +37,6 @@
## here to specify the energy density parameter for
## the corresponding jet collection (this variable is
## typically taken from kt6PFJets).
useRho = cms.bool(False),
rho = cms.InputTag('kt6PFJets', 'rho'),
useRho = cms.bool(True),
rho = cms.InputTag('kt6PFJets', 'rho'),
)
Expand Up @@ -2,7 +2,7 @@

## Compute JET Charge
patJetCharge = cms.EDProducer("JetChargeProducer",
src = cms.InputTag("ak5JetTracksAssociatorAtVertex"), ## a reco::JetTracksAssociation::Container
src = cms.InputTag("ak5JetTracksAssociatorAtVertexPF"), ## a reco::JetTracksAssociation::Container
# -- JetCharge parameters --
var = cms.string('Pt'),
exp = cms.double(1.0)
Expand Down
4 changes: 4 additions & 0 deletions PhysicsTools/PatAlgos/python/recoLayer0/metCorrections_cff.py
Expand Up @@ -5,5 +5,9 @@
from JetMETCorrections.Type1MET.caloMETCorrections_cff import *
#from JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff import *

pfJetMETcorrCHS = pfJetMETcorr.clone( src = cms.InputTag( "ak5PFJetsCHS" ) )
pfType1CorrectedMetCHS = pfType1CorrectedMet.clone( srcType1Corrections = cms.VInputTag( cms.InputTag( "pfJetMETcorrCHS", "type1" ) ) )
pfType1p2CorrectedMetCHS = pfType1p2CorrectedMet.clone( srcType1Corrections = cms.VInputTag( cms.InputTag( "pfJetMETcorrCHS", "type1" ) ) )

## for scheduled mode
patMETCorrections = cms.Sequence(produceCaloMETCorrections+producePFMETCorrections)
18 changes: 10 additions & 8 deletions PhysicsTools/PatAlgos/python/tools/jetTools.py
Expand Up @@ -340,6 +340,7 @@ def toolCode(self, process):
if not error :
_newPatJetCorrFactors.useNPV=True
_newPatJetCorrFactors.primaryVertices='offlinePrimaryVertices'
_newPatJetCorrFactors.useRho=False
## we set this to True now as a L1 correction type should appear only once
## otherwise levels is miss configured
error=True
Expand All @@ -352,7 +353,7 @@ def toolCode(self, process):
raise TypeError, "In addJetCollection: L1FastJet corrections are only supported for PF and Calo jets."
## configure module
_newPatJetCorrFactors.useRho=True
_newPatJetCorrFactors.rho=cms.InputTag('kt6'+_type+'Jets', 'rho')
_newPatJetCorrFactors.rho=cms.InputTag('kt6PFJets', 'rho')
## we set this to True now as a L1 correction type should appear only once
## otherwise levels is miss configured
error=True
Expand All @@ -375,7 +376,7 @@ def toolCode(self, process):
from JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff import ak5PFL3Absolute
from JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff import ak5PFResidual

setattr(process, jetCorrections[0]+'L1FastJet', ak5PFL1Fastjet.clone(algorithm=jetCorrections[0], srcRho=cms.InputTag('kt6'+_type+'Jets','rho')))
setattr(process, jetCorrections[0]+'L1FastJet', ak5PFL1Fastjet.clone(algorithm=jetCorrections[0], srcRho=cms.InputTag('kt6PFJets','rho')))
setattr(process, jetCorrections[0]+'L1Offset', ak5PFL1Offset.clone(algorithm=jetCorrections[0]))
setattr(process, jetCorrections[0]+'L2Relative', ak5PFL2Relative.clone(algorithm=jetCorrections[0]))
setattr(process, jetCorrections[0]+'L3Absolute', ak5PFL3Absolute.clone(algorithm=jetCorrections[0]))
Expand All @@ -392,9 +393,9 @@ def toolCode(self, process):
from JetMETCorrections.Type1MET.caloMETCorrections_cff import caloJetMETcorr
from JetMETCorrections.Type1MET.caloMETCorrections_cff import caloType1CorrectedMet
from JetMETCorrections.Type1MET.caloMETCorrections_cff import caloType1p2CorrectedMet
setattr(process,jetCorrections[0]+'JetMETcorr'+postfix, caloJetMETcorr.clone(src=jetSource,srcMET = "corMetGlobalMuons",jetCorrections = cms.string(jetCorrections[0]+'CombinedCorrector'+postfix)))
setattr(process,jetCorrections[0]+'Type1CorMet'+postfix, caloType1CorrectedMet.clone(src = "corMetGlobalMuons"+postfix,srcType1Corrections = cms.VInputTag(cms.InputTag(jetCorrections[0]+'JetMETcorr'+postfix, 'type1'))))
setattr(process,jetCorrections[0]+'Type1p2CorMet'+postfix,caloType1p2CorrectedMet.clone(src = "corMetGlobalMuons"+postfix,srcType1Corrections = cms.VInputTag(cms.InputTag(jetCorrections[0]+'JetMETcorr'+postfix, 'type1')),srcUnclEnergySums = cms.VInputTag(cms.InputTag(jetCorrections[0]+'JetMETcorr'+postfix, 'type2'),cms.InputTag(jetCorrections[0]+'JetMETcorr'+postfix, 'offset'),cms.InputTag('muonCaloMETcorr'+postfix))))
setattr(process,jetCorrections[0]+'JetMETcorr'+postfix, caloJetMETcorr.clone(src=jetSource,srcMET = "corMetGlobalMuons",jetCorrections = cms.string(jetCorrections[0]+'CombinedCorrector')))
setattr(process,jetCorrections[0]+'Type1CorMet'+postfix, caloType1CorrectedMet.clone(src = "corMetGlobalMuons",srcType1Corrections = cms.VInputTag(cms.InputTag(jetCorrections[0]+'JetMETcorr'+postfix, 'type1'))))
setattr(process,jetCorrections[0]+'Type1p2CorMet'+postfix,caloType1p2CorrectedMet.clone(src = "corMetGlobalMuons",srcType1Corrections = cms.VInputTag(cms.InputTag(jetCorrections[0]+'JetMETcorr'+postfix, 'type1')),srcUnclEnergySums = cms.VInputTag(cms.InputTag(jetCorrections[0]+'JetMETcorr'+postfix, 'type2'),cms.InputTag(jetCorrections[0]+'JetMETcorr'+postfix, 'offset'),cms.InputTag('muonCaloMETcorr'))))

elif _type == 'PF':
from JetMETCorrections.Type1MET.pfMETCorrections_cff import pfCandsNotInJet
Expand All @@ -411,15 +412,16 @@ def toolCode(self, process):
## common configuration for Calo and PF
if ('L1FastJet' in jetCorrections[1] or 'L1Fastjet' in jetCorrections[1]):
getattr(process,jetCorrections[0]+'JetMETcorr'+postfix).offsetCorrLabel = cms.string(jetCorrections[0]+'L1FastJet')
elif ('L1Offset' in jetCorrections[1]):
getattr(process,jetCorrections[0]+'JetMETcorr'+postfix).offsetCorrLabel = cms.string(jetCorrections[0]+'L1Offset')
#FIXME: What is wrong here?
#elif ('L1Offset' in jetCorrections[1]):
#getattr(process,jetCorrections[0]+'JetMETcorr'+postfix).offsetCorrLabel = cms.string(jetCorrections[0]+'L1Offset')
else:
getattr(process,jetCorrections[0]+'JetMETcorr'+postfix).offsetCorrLabel = cms.string('')

from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs
if jetCorrections[2].lower() == 'type-1':
setattr(process, 'patMETs'+_labelName+postfix, patMETs.clone(metSource = cms.InputTag(jetCorrections[0]+'Type1CorMet'+postfix), addMuonCorrections = False))
elif jetCorrections[2].lower() == 'type-1':
elif jetCorrections[2].lower() == 'type-2':
setattr(process, 'patMETs'+_labelName+postfix, patMETs.clone(metSource = cms.InputTag(jetCorrections[0]+'Type1p2CorMet'+postfix), addMuonCorrections = False))
else:
## switch jetCorrFactors off
Expand Down