CMS 3D CMS Logo

Functions
customizeDeltaBetaWeights_cfi Namespace Reference

Functions

def customize (process)
 
def customizeElectronsOnly (process)
 
def customizeMuonsOnly (process)
 
def customizePhotonsOnly (process)
 

Detailed Description

Customization functions for cmsDriver to get neutral weighted isolation

Function Documentation

def customizeDeltaBetaWeights_cfi.customize (   process)
run neutral particle weighting sequence and use it for isolation of electrons, muons and photons

   syntax: --customise RecoParticleFlow/Configuration/customizeDeltaBetaWeights_cfi.customize
   It will add 2 new sequences to the RECO sequence that will produce pfWeightedPhotons and 
   pfWeightedNeutralHadrons. They are produced from pfAllPhotons and pfAllNeutralHadrons by rescaling
   pt of each particle by a weight that reflects the probability that it is from pileup. The formula is
   w = sumNPU/(sumNPU+sumPU). The sums are running over all charged particles from the PV (NPU) or from the PU.
   The function used in the sum is ln(pt(i)/deltaR(i,j)) where i is neutral particle that is being weighted and j
   is the charged particle (either PU or NPU) that is used to access 'pileupility' of a particle.

   Neutral isolation of electrons, muons and photons is calculated using the weighed collection.

Definition at line 7 of file customizeDeltaBetaWeights_cfi.py.

References tools_cfi.isoDepositReplace().

7 def customize(process):
8  '''run neutral particle weighting sequence and use it for isolation of electrons, muons and photons
9 
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.
17 
18  Neutral isolation of electrons, muons and photons is calculated using the weighed collection.
19  '''
20 
21  if hasattr(process,'pfParticleSelectionSequence'):
22  process.load("CommonTools.ParticleFlow.deltaBetaWeights_cff")
23  process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
24 
25  if hasattr(process,'elPFIsoDepositNeutral'):
26  process.elPFIsoDepositNeutral=isoDepositReplace('pfElectronTranslator:pf','pfWeightedNeutralHadrons')
27 
28  if hasattr(process,'elPFIsoDepositGamma'):
29  process.elPFIsoDepositGamma=isoDepositReplace('pfElectronTranslator:pf','pfWeightedPhotons')
30 
31  if hasattr(process,'gedElPFIsoDepositNeutral'):
32  process.gedElPFIsoDepositNeutral=isoDepositReplace('gedGsfElectronsTmp','pfWeightedNeutralHadrons')
33 
34  if hasattr(process,'gedElPFIsoDepositGamma'):
35  process.gedElPFIsoDepositGamma=isoDepositReplace('gedGsfElectronsTmp','pfWeightedPhotons')
36 
37  if hasattr(process,'muPFIsoDepositNeutral'):
38  process.muPFIsoDepositNeutral=isoDepositReplace('muons1stStep','pfWeightedNeutralHadrons')
39 
40  if hasattr(process,'muPFIsoDepositGamma'):
41  process.muPFIsoDepositGamma=isoDepositReplace('muons1stStep','pfWeightedPhotons')
42 
43  if hasattr(process,'phPFIsoDepositNeutral'):
44  process.phPFIsoDepositNeutral=isoDepositReplace('pfSelectedPhotons','pfWeightedNeutralHadrons')
45 
46  if hasattr(process,'phPFIsoDepositGamma'):
47  process.phPFIsoDepositGamma.ExtractorPSet.inputCandView = cms.InputTag("pfWeightedPhotons")
48 
49  return process
50 
51 
def isoDepositReplace(toBeIsolated, isolating)
Definition: tools_cfi.py:6
def customizeDeltaBetaWeights_cfi.customizeElectronsOnly (   process)
run neutral particle weighting sequence and use it for isolation of electrons only.

syntax: --customise RecoParticleFlow/Configuration/customizeDeltaBetaWeights_cfi.customizeElectronsOnly
Same as customize, only that the weighted collections are used only for electron neutral isolation, 
while muons and photons are left untouched.

Definition at line 52 of file customizeDeltaBetaWeights_cfi.py.

References tools_cfi.isoDepositReplace().

53  '''run neutral particle weighting sequence and use it for isolation of electrons only.
54 
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.
58  '''
59 
60  if hasattr(process,'pfParticleSelectionSequence'):
61  process.load("CommonTools.ParticleFlow.deltaBetaWeights_cff")
62  process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
63 
64  if hasattr(process,'elPFIsoDepositNeutral'):
65  process.elPFIsoDepositNeutral=isoDepositReplace('pfElectronTranslator:pf','pfWeightedNeutralHadrons')
66 
67  if hasattr(process,'elPFIsoDepositGamma'):
68  process.elPFIsoDepositGamma=isoDepositReplace('pfElectronTranslator:pf','pfWeightedPhotons')
69 
70  if hasattr(process,'gedElPFIsoDepositNeutral'):
71  process.gedElPFIsoDepositNeutral=isoDepositReplace('gedGsfElectronsTmp','pfWeightedNeutralHadrons')
72 
73  if hasattr(process,'gedElPFIsoDepositGamma'):
74  process.gedElPFIsoDepositGamma=isoDepositReplace('gedGsfElectronsTmp','pfWeightedPhotons')
75 
76  return process
77 
78 
def isoDepositReplace(toBeIsolated, isolating)
Definition: tools_cfi.py:6
def customizeDeltaBetaWeights_cfi.customizeMuonsOnly (   process)
run neutral particle weighting sequence and use it for isolation of muonss only.

syntax: --customise RecoParticleFlow/Configuration/customizeDeltaBetaWeights_cfi.customizeMuonsOnly
Same as customize, only that the weighted collections are used only for muon neutral isolation,
while electronss and photons are left untouched.

Definition at line 79 of file customizeDeltaBetaWeights_cfi.py.

References tools_cfi.isoDepositReplace().

79 def customizeMuonsOnly(process):
80  '''run neutral particle weighting sequence and use it for isolation of muonss only.
81 
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.
85  '''
86 
87  if hasattr(process,'pfParticleSelectionSequence'):
88  process.load("CommonTools.ParticleFlow.deltaBetaWeights_cff")
89  process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
90 
91  if hasattr(process,'muPFIsoDepositNeutral'):
92  process.muPFIsoDepositNeutral=isoDepositReplace('muons1stStep','pfWeightedNeutralHadrons')
93 
94  if hasattr(process,'muPFIsoDepositGamma'):
95  process.muPFIsoDepositGamma=isoDepositReplace('muons1stStep','pfWeightedPhotons')
96 
97  return process
98 
99 
def isoDepositReplace(toBeIsolated, isolating)
Definition: tools_cfi.py:6
def customizeDeltaBetaWeights_cfi.customizePhotonsOnly (   process)
run neutral particle weighting sequence and use it for isolation of muons only.

syntax: --customise RecoParticleFlow/Configuration/customizeDeltaBetaWeights_cfi.customizePhotonsOnly
Same as customize, only that the weighted collections are used only for photon neutral isolation,
while electronss and muons are left untouched.

Definition at line 100 of file customizeDeltaBetaWeights_cfi.py.

References tools_cfi.isoDepositReplace().

100 def customizePhotonsOnly(process):
101  '''run neutral particle weighting sequence and use it for isolation of muons only.
102 
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.
106  '''
107 
108  if hasattr(process,'pfParticleSelectionSequence'):
109  process.load("CommonTools.ParticleFlow.deltaBetaWeights_cff")
110  process.pfParticleSelectionSequence += process.pfDeltaBetaWeightingSequence
111 
112  if hasattr(process,'phPFIsoDepositNeutral'):
113  process.phPFIsoDepositNeutral=isoDepositReplace('pfSelectedPhotons','pfWeightedNeutralHadrons')
114 
115  if hasattr(process,'phPFIsoDepositGamma'):
116  process.phPFIsoDepositGamma.ExtractorPSet.inputCandView = cms.InputTag("pfWeightedPhotons")
117 
118 
119  return process
120 
def isoDepositReplace(toBeIsolated, isolating)
Definition: tools_cfi.py:6