1 '''Customization functions for cmsDriver to get neutral weighted isolation'''
2 import FWCore.ParameterSet.Config
as cms
8 '''run neutral particle weighting sequence and use it for isolation of electrons, muons and photons
10 syntax: --customise RecoParticleFlow/Configuration/customizeDeltaBetaWeights_cfi.customize
11 It will add 2 new sequences to the RECO sequence that will produce pfWeightedPhotons and
12 pfWeightedNeutralHadrons. They are produced from pfAllPhotons and pfAllNeutralHadrons by rescaling
13 pt of each particle by a weight that reflects the probability that it is from pileup. The formula is
14 w = sumNPU/(sumNPU+sumPU). The sums are running over all charged particles from the PV (NPU) or from the PU.
15 The function used in the sum is ln(pt(i)/deltaR(i,j)) where i is neutral particle that is being weighted and j
16 is the charged particle (either PU or NPU) that is used to access 'pileupility' of a particle.
18 Neutral isolation of electrons, muons and photons is calculated using the weighed collection.
21 if hasattr(process,
'pfParticleSelectionSequence'):
22 process.load(
"CommonTools.ParticleFlow.deltaBetaWeights_cff")
23 process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
25 if hasattr(process,
'elPFIsoDepositNeutral'):
26 process.elPFIsoDepositNeutral=
isoDepositReplace(
'pfElectronTranslator:pf',
'pfWeightedNeutralHadrons')
28 if hasattr(process,
'elPFIsoDepositGamma'):
29 process.elPFIsoDepositGamma=
isoDepositReplace(
'pfElectronTranslator:pf',
'pfWeightedPhotons')
31 if hasattr(process,
'gedElPFIsoDepositNeutral'):
32 process.gedElPFIsoDepositNeutral=
isoDepositReplace(
'gedGsfElectronsTmp',
'pfWeightedNeutralHadrons')
34 if hasattr(process,
'gedElPFIsoDepositGamma'):
35 process.gedElPFIsoDepositGamma=
isoDepositReplace(
'gedGsfElectronsTmp',
'pfWeightedPhotons')
37 if hasattr(process,
'muPFIsoDepositNeutral'):
38 process.muPFIsoDepositNeutral=
isoDepositReplace(
'muons1stStep',
'pfWeightedNeutralHadrons')
40 if hasattr(process,
'muPFIsoDepositGamma'):
43 if hasattr(process,
'phPFIsoDepositNeutral'):
44 process.phPFIsoDepositNeutral=
isoDepositReplace(
'pfSelectedPhotons',
'pfWeightedNeutralHadrons')
46 if hasattr(process,
'phPFIsoDepositGamma'):
47 process.phPFIsoDepositGamma.ExtractorPSet.inputCandView = cms.InputTag(
"pfWeightedPhotons")
53 '''run neutral particle weighting sequence and use it for isolation of electrons only.
55 syntax: --customise RecoParticleFlow/Configuration/customizeDeltaBetaWeights_cfi.customizeElectronsOnly
56 Same as customize, only that the weighted collections are used only for electron neutral isolation,
57 while muons and photons are left untouched.
60 if hasattr(process,
'pfParticleSelectionSequence'):
61 process.load(
"CommonTools.ParticleFlow.deltaBetaWeights_cff")
62 process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
64 if hasattr(process,
'elPFIsoDepositNeutral'):
65 process.elPFIsoDepositNeutral=
isoDepositReplace(
'pfElectronTranslator:pf',
'pfWeightedNeutralHadrons')
67 if hasattr(process,
'elPFIsoDepositGamma'):
68 process.elPFIsoDepositGamma=
isoDepositReplace(
'pfElectronTranslator:pf',
'pfWeightedPhotons')
70 if hasattr(process,
'gedElPFIsoDepositNeutral'):
71 process.gedElPFIsoDepositNeutral=
isoDepositReplace(
'gedGsfElectronsTmp',
'pfWeightedNeutralHadrons')
73 if hasattr(process,
'gedElPFIsoDepositGamma'):
74 process.gedElPFIsoDepositGamma=
isoDepositReplace(
'gedGsfElectronsTmp',
'pfWeightedPhotons')
80 '''run neutral particle weighting sequence and use it for isolation of muonss only.
82 syntax: --customise RecoParticleFlow/Configuration/customizeDeltaBetaWeights_cfi.customizeMuonsOnly
83 Same as customize, only that the weighted collections are used only for muon neutral isolation,
84 while electronss and photons are left untouched.
87 if hasattr(process,
'pfParticleSelectionSequence'):
88 process.load(
"CommonTools.ParticleFlow.deltaBetaWeights_cff")
89 process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
91 if hasattr(process,
'muPFIsoDepositNeutral'):
92 process.muPFIsoDepositNeutral=
isoDepositReplace(
'muons1stStep',
'pfWeightedNeutralHadrons')
94 if hasattr(process,
'muPFIsoDepositGamma'):
101 '''run neutral particle weighting sequence and use it for isolation of muons only.
103 syntax: --customise RecoParticleFlow/Configuration/customizeDeltaBetaWeights_cfi.customizePhotonsOnly
104 Same as customize, only that the weighted collections are used only for photon neutral isolation,
105 while electronss and muons are left untouched.
108 if hasattr(process,
'pfParticleSelectionSequence'):
109 process.load(
"CommonTools.ParticleFlow.deltaBetaWeights_cff")
110 process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
112 if hasattr(process,
'phPFIsoDepositNeutral'):
113 process.phPFIsoDepositNeutral=
isoDepositReplace(
'pfSelectedPhotons',
'pfWeightedNeutralHadrons')
115 if hasattr(process,
'phPFIsoDepositGamma'):
116 process.phPFIsoDepositGamma.ExtractorPSet.inputCandView = cms.InputTag(
"pfWeightedPhotons")
def customizeElectronsOnly