Skip to content

Commit

Permalink
Merge pull request #34973 from jeongeun/physicstools12Xup
Browse files Browse the repository at this point in the history
Migrate module configuration in PhysicsTools to use default cfipython
  • Loading branch information
cmsbuild authored Aug 24, 2021
2 parents 248d57c + 7ee467a commit 00ca4ca
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import FWCore.ParameterSet.Config as cms
import PhysicsTools.PatAlgos.PATElectronProducer_cfi as _mod

patElectrons = cms.EDProducer("PATElectronProducer",
patElectrons = _mod.PATElectronProducer.clone(
# input collection
electronSource = cms.InputTag("gedGsfElectrons"),
electronSource = "gedGsfElectrons",

# use particle flow instead of std reco
useParticleFlow = cms.bool( False ),
pfElectronSource = cms.InputTag("particleFlow"),
pfCandidateMap = cms.InputTag("particleFlow:electrons"),
usePfCandidateMultiMap = cms.bool( False ),
pfElectronSource = "particleFlow",
pfCandidateMap = "particleFlow:electrons",

# collections for mva input variables
addMVAVariables = cms.bool( True ),
reducedBarrelRecHitCollection = cms.InputTag("reducedEcalRecHitsEB"),
reducedEndcapRecHitCollection = cms.InputTag("reducedEcalRecHitsEE"),
addMVAVariables = True,
reducedBarrelRecHitCollection = "reducedEcalRecHitsEB",
reducedEndcapRecHitCollection = "reducedEcalRecHitsEE",

# user data to add
userData = cms.PSet(
userData = dict(
# add custom classes here
userClasses = cms.PSet(
src = cms.VInputTag('')
Expand All @@ -34,70 +33,69 @@
src = cms.VInputTag('')
),
# add "inline" functions here
userFunctions = cms.vstring(),
userFunctionLabels = cms.vstring()
userFunctions = [],
userFunctionLabels = []
),



# embedding of AOD items
embedGsfElectronCore = cms.bool(True), ## embed in AOD externally stored gsf electron core
embedGsfTrack = cms.bool(False), ## embed in AOD externally stored gsf track
embedSuperCluster = cms.bool(True), ## embed in AOD externally stored supercluster
embedPflowSuperCluster = cms.bool(True), ## embed in AOD externally stored supercluster
embedSeedCluster = cms.bool(True), ## embed in AOD externally stored the electron's seedcluster
embedBasicClusters = cms.bool(True), ## embed in AOD externally stored the electron's basic clusters
embedPreshowerClusters = cms.bool(True), ## embed in AOD externally stored the electron's preshower clusters
embedPflowBasicClusters = cms.bool(True), ## embed in AOD externally stored the electron's pflow basic clusters
embedPflowPreshowerClusters = cms.bool(True), ## embed in AOD externally stored the electron's pflow preshower clusters
embedPFCandidate = cms.bool(True), ## embed in AOD externally stored particle flow candidate
embedTrack = cms.bool(True), ## embed in AOD externally stored track (note: gsf electrons don't have a track)
embedRecHits = cms.bool(True), ## embed in AOD externally stored the RecHits - can be called from the PATElectronProducer
embedGsfElectronCore = True, ## embed in AOD externally stored gsf electron core
embedGsfTrack = False, ## embed in AOD externally stored gsf track
embedSuperCluster = True, ## embed in AOD externally stored supercluster
embedPflowSuperCluster = True, ## embed in AOD externally stored supercluster
embedSeedCluster = True, ## embed in AOD externally stored the electron's seedcluster
embedBasicClusters = True, ## embed in AOD externally stored the electron's basic clusters
embedPreshowerClusters = True, ## embed in AOD externally stored the electron's preshower clusters
embedPflowBasicClusters = True, ## embed in AOD externally stored the electron's pflow basic clusters
embedPflowPreshowerClusters = True, ## embed in AOD externally stored the electron's pflow preshower clusters
embedPFCandidate = True, ## embed in AOD externally stored particle flow candidate
embedTrack = True, ## embed in AOD externally stored track (note: gsf electrons don't have a track)
embedRecHits = True, ## embed in AOD externally stored the RecHits - can be called from the PATElectronProducer

# embed IsoDeposits to recompute isolation
isoDeposits = cms.PSet(),

# user defined isolation variables the variables defined here will be accessible
# via pat::Electron::userIsolation(IsolationKeys key) with the key as defined in
# DataFormats/PatCandidates/interface/Isolation.h
userIsolation = cms.PSet(),
userIsolation = dict(),

# electron ID
addElectronID = cms.bool(False),
addElectronID = False,
electronIDSources = cms.PSet(),

# mc matching
addGenMatch = cms.bool(True),
embedGenMatch = cms.bool(True),
genParticleMatch = cms.InputTag("electronMatch"), ## Association between electrons and generator particles
addGenMatch = True,
embedGenMatch = True,
genParticleMatch = "electronMatch", ## Association between electrons and generator particles

# efficiencies
addEfficiencies = cms.bool(False),
efficiencies = cms.PSet(),
addEfficiencies = False,
efficiencies = dict(),

# resolution configurables
addResolutions = cms.bool(False),
resolutions = cms.PSet(),
addResolutions = False,
resolutions = dict(),

# high level selections
embedHighLevelSelection = cms.bool(True),
beamLineSrc = cms.InputTag("offlineBeamSpot"),
pvSrc = cms.InputTag("offlinePrimaryVertices"),
embedHighLevelSelection = True,
beamLineSrc = "offlineBeamSpot",
pvSrc = "offlinePrimaryVertices",

# PFClusterIso
addPFClusterIso = cms.bool(False),
ecalPFClusterIsoMap = cms.InputTag(""),
hcalPFClusterIsoMap = cms.InputTag(""),
addPuppiIsolation = cms.bool(False),
addPFClusterIso = False,
ecalPFClusterIsoMap = "",
hcalPFClusterIsoMap = "",
addPuppiIsolation = False,

# Compute and store Mini-Isolation.
# Implemention and a description of parameters can be found in:
# PhysicsTools/PatUtils/src/PFIsolation.cc
# only works in miniaod, so set to True in miniAOD_tools.py
computeMiniIso = cms.bool(False),
pfCandsForMiniIso = cms.InputTag("packedPFCandidates"),
computeMiniIso = False,
pfCandsForMiniIso = "packedPFCandidates",
# veto on candidates in deadcone only in endcap
miniIsoParamsE = cms.vdouble(0.05, 0.2, 10.0, 0.0, 0.015, 0.015, 0.08, 0.0, 0.0),
miniIsoParamsB = cms.vdouble(0.05, 0.2, 10.0, 0.0, 0.000, 0.000, 0.00, 0.0, 0.0),
miniIsoParamsE = [0.05, 0.2, 10.0, 0.0, 0.015, 0.015, 0.08, 0.0, 0.0],
miniIsoParamsB = [0.05, 0.2, 10.0, 0.0, 0.000, 0.000, 0.00, 0.0, 0.0],

)
del patElectrons.electronIDSource
62 changes: 30 additions & 32 deletions PhysicsTools/PatAlgos/python/producersLayer1/photonProducer_cfi.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import FWCore.ParameterSet.Config as cms
import PhysicsTools.PatAlgos.PATPhotonProducer_cfi as _mod

patPhotons = cms.EDProducer("PATPhotonProducer",
patPhotons = _mod.PATPhotonProducer.clone(
# input collection
photonSource = cms.InputTag("gedPhotons"),
electronSource = cms.InputTag("gedGsfElectrons"),
beamLineSrc = cms.InputTag("offlineBeamSpot"),
photonSource = "gedPhotons",
electronSource = "gedGsfElectrons",
beamLineSrc = "offlineBeamSpot",

reducedBarrelRecHitCollection = cms.InputTag("reducedEcalRecHitsEB"),
reducedEndcapRecHitCollection = cms.InputTag("reducedEcalRecHitsEE"),

# user data to add
userData = cms.PSet(
userData = dict(
# add custom classes here
userClasses = cms.PSet(
src = cms.VInputTag('')
Expand All @@ -28,49 +26,49 @@
src = cms.VInputTag('')
),
# add "inline" functions here
userFunctions = cms.vstring(),
userFunctionLabels = cms.vstring()
userFunctions = [],
userFunctionLabels = []
),


# embedding of AOD items
embedSuperCluster = cms.bool(True), ## whether to embed in AOD externally stored supercluster
embedSeedCluster = cms.bool(True), ## embed in AOD externally stored the photon's seedcluster
embedBasicClusters = cms.bool(True), ## embed in AOD externally stored the photon's basic clusters
embedPreshowerClusters = cms.bool(True), ## embed in AOD externally stored the photon's preshower clusters
embedRecHits = cms.bool(True), ## embed in AOD externally stored the RecHits - can be called from the PATPhotonProducer
saveRegressionData = cms.bool(True), ## save regression input variables
embedSuperCluster = True, ## whether to embed in AOD externally stored supercluster
embedSeedCluster = True, ## embed in AOD externally stored the photon's seedcluster
embedBasicClusters = True, ## embed in AOD externally stored the photon's basic clusters
embedPreshowerClusters = True, ## embed in AOD externally stored the photon's preshower clusters
embedRecHits = True, ## embed in AOD externally stored the RecHits - can be called from the PATPhotonProducer
saveRegressionData = True, ## save regression input variables

# embed IsoDeposits to recompute isolation
isoDeposits = cms.PSet(),

# user defined isolation variables the variables defined here will be accessible
# via pat::Photon::userIsolation(IsolationKeys key) with the key as defined in
# DataFormats/PatCandidates/interface/Isolation.h
userIsolation = cms.PSet(
#PFClusterEcalIso = cms.InputTag('electronEcalPFClusterIsolationProducer'),
#PFClusterHcalIso = cms.InputTag('electronHcalPFClusterIsolationProducer'),
userIsolation = dict(
#PFClusterEcalIso = 'electronEcalPFClusterIsolationProducer',
#PFClusterHcalIso = 'electronHcalPFClusterIsolationProducer',
),

# photon ID
addPhotonID = cms.bool(False),
addPhotonID = False,
photonIDSources = cms.PSet(),
# mc matching
addGenMatch = cms.bool(True),
embedGenMatch = cms.bool(True),
genParticleMatch = cms.InputTag("photonMatch"), ## particles source to be used for the matching
addGenMatch = True,
embedGenMatch = True,
genParticleMatch = "photonMatch", ## particles source to be used for the matching

# efficiencies
addEfficiencies = cms.bool(False),
efficiencies = cms.PSet(),
addEfficiencies = False,
efficiencies = dict(),

# resolutions
addResolutions = cms.bool(False),
resolutions = cms.PSet(),
addResolutions = False,
resolutions = dict(),

# PFClusterIso
addPFClusterIso = cms.bool(False),
ecalPFClusterIsoMap = cms.InputTag(""),
hcalPFClusterIsoMap = cms.InputTag(""),
addPuppiIsolation = cms.bool(False)
addPFClusterIso = False,
ecalPFClusterIsoMap = "",
hcalPFClusterIsoMap = "",
addPuppiIsolation = False
)
del patPhotons.photonIDSource

0 comments on commit 00ca4ca

Please sign in to comment.