|
|
|
def | _getattrGenerator (process, postfix) |
|
def | _loadPFBRECO (process) |
|
def | setupPFElectronIso (process, electronCollection, newpostfix='PFIso', postfix='', runPF2PAT=False) |
|
def | setupPFIso (process, leptonCollection, particleName, newpostfix='PFIso', postfix='', runPF2PAT=False) |
|
def | setupPFIsoPhoton (process, photonCollection, particleName, newpostfix='PFIso') |
|
def | setupPFMuonIso (process, muonCollection, postfix='PFIso') |
|
def | setupPFPhotonIso (process, photonCollection, postfix='PFIso') |
|
◆ _getattrGenerator()
def pfIsolation._getattrGenerator |
( |
|
process, |
|
|
|
postfix |
|
) |
| |
|
private |
A function generator to simplify the getattr syntax
Definition at line 6 of file pfIsolation.py.
7 '''A function generator to simplify the getattr syntax'''
9 return getattr(process, name+postfix)
Referenced by setupPFIso(), and setupPFIsoPhoton().
◆ _loadPFBRECO()
def pfIsolation._loadPFBRECO |
( |
|
process | ) |
|
|
private |
The particle-flow based reconstruction sequence should be loaded once in the process.
Not optimal, should load it only if it is not detected (hasattr)
Definition at line 15 of file pfIsolation.py.
16 '''The particle-flow based reconstruction sequence should be loaded once in the process.
17 Not optimal, should load it only if it is not detected (hasattr)'''
18 global _PFBRECO_loaded
19 if _PFBRECO_loaded
is False:
20 _PFBRECO_loaded =
True
21 process.load(
"CommonTools.ParticleFlow.PFBRECO_cff")
Referenced by setupPFIso(), and setupPFIsoPhoton().
◆ setupPFElectronIso()
def pfIsolation.setupPFElectronIso |
( |
|
process, |
|
|
|
electronCollection, |
|
|
|
newpostfix = 'PFIso' , |
|
|
|
postfix = '' , |
|
|
|
runPF2PAT = False |
|
) |
| |
Set up particle-based isolation for the electrons in electronCollection.
Calls setupPFIso.
Definition at line 121 of file pfIsolation.py.
121 def setupPFElectronIso(process, electronCollection, newpostfix='PFIso', postfix='', runPF2PAT = False ):
122 '''Set up particle-based isolation for the electrons in electronCollection.
129 return setupPFIso( process, electronCollection,
'Electron', newpostfix, postfix, runPF2PAT)
References setupPFIso().
◆ setupPFIso()
def pfIsolation.setupPFIso |
( |
|
process, |
|
|
|
leptonCollection, |
|
|
|
particleName, |
|
|
|
newpostfix = 'PFIso' , |
|
|
|
postfix = '' , |
|
|
|
runPF2PAT = False |
|
) |
| |
Generic function to setup particle-based isolation for a given lepton collection.
Returns the isolation sequence.
You are responsible for adding it to your path.
leptonCollection could e.g. be "gsfElectrons" or "muons"
particleName must be either "Electron" or "Muon".
newpostfix can be specified to define several particle-flow isolation sequences
Definition at line 24 of file pfIsolation.py.
24 def setupPFIso(process, leptonCollection, particleName, newpostfix='PFIso', postfix='', runPF2PAT = False):
25 '''Generic function to setup particle-based isolation for a given lepton collection.
26 Returns the isolation sequence.
27 You are responsible for adding it to your path.
29 leptonCollection could e.g. be "gsfElectrons" or "muons"
30 particleName must be either "Electron" or "Muon".
31 newpostfix can be specified to define several particle-flow isolation sequences
34 if particleName==
'Electron':
36 elif particleName==
'Muon':
39 raise ValueError(
'particleName should be equal to "Electron" or "Muon"')
41 if runPF2PAT !=
True :
45 fullpostfix = postfix+newpostfix
49 leptonSeq = cms.Sequence(
50 ga(
'pf{lepton}IsolationSequence'.
format(lepton=particleName))
52 setattr( process,
'std{lepton}Sequence{postfix}'.
format(lepton=particleName,
53 postfix=postfix), leptonSeq)
55 leptonSource = leptonCollection
57 ga(
'std{lepton}Sequence'.
format(lepton=particleName)),
60 ganew(
"{lepshort}PFIsoDepositCharged".
format(lepshort=lepshort) ).src = leptonSource
61 ganew(
"{lepshort}PFIsoDepositChargedAll".
format(lepshort=lepshort)).src = leptonSource
62 ganew(
"{lepshort}PFIsoDepositNeutral".
format(lepshort=lepshort)).src = leptonSource
63 ganew(
"{lepshort}PFIsoDepositGamma".
format(lepshort=lepshort)).src = leptonSource
64 ganew(
"{lepshort}PFIsoDepositPU".
format(lepshort=lepshort)).src = leptonSource
66 return ganew(
'std{lepton}Sequence'.
format(lepton=particleName))
References _getattrGenerator(), _loadPFBRECO(), and helpers.cloneProcessingSnippet().
Referenced by setupPFElectronIso(), and setupPFMuonIso().
◆ setupPFIsoPhoton()
def pfIsolation.setupPFIsoPhoton |
( |
|
process, |
|
|
|
photonCollection, |
|
|
|
particleName, |
|
|
|
newpostfix = 'PFIso' |
|
) |
| |
Generic function to setup particle-based isolation for a given lepton collection.
Returns the isolation sequence.
You are responsible for adding it to your path.
leptonCollection could e.g. be "gsfElectrons" or "muons"
particleName must be either "Electron" or "Muon".
newpostfix can be specified to define several particle-flow isolation sequences
Definition at line 68 of file pfIsolation.py.
68 def setupPFIsoPhoton(process, photonCollection, particleName, newpostfix='PFIso'):
69 '''Generic function to setup particle-based isolation for a given lepton collection.
70 Returns the isolation sequence.
71 You are responsible for adding it to your path.
73 leptonCollection could e.g. be "gsfElectrons" or "muons"
74 particleName must be either "Electron" or "Muon".
75 newpostfix can be specified to define several particle-flow isolation sequences
78 if particleName==
'Photon':
81 raise ValueError(
'particleName should be equal to "Photon"')
87 fullpostfix = postfix+newpostfix
92 photonSeq = cms.Sequence(
93 ga(
'pf{photon}IsolationSequence'.
format(photon=particleName))
95 setattr( process,
'std{photon}Sequence{postfix}'.
format(photon=particleName,
96 postfix=postfix), photonSeq)
98 photonSource = photonCollection
100 ga(
'std{photon}Sequence'.
format(photon=particleName)),
103 ganew(
"{phoshort}PFIsoDepositCharged".
format(phoshort=phoshort) ).src = photonSource
104 ganew(
"{phoshort}PFIsoDepositChargedAll".
format(phoshort=phoshort)).src = photonSource
105 ganew(
"{phoshort}PFIsoDepositNeutral".
format(phoshort=phoshort)).src = photonSource
106 ganew(
"{phoshort}PFIsoDepositGamma".
format(phoshort=phoshort)).src = photonSource
107 ganew(
"{phoshort}PFIsoDepositPU".
format(phoshort=phoshort)).src = photonSource
109 return ganew(
'std{photon}Sequence'.
format(photon=particleName))
References _getattrGenerator(), _loadPFBRECO(), and helpers.cloneProcessingSnippet().
Referenced by setupPFPhotonIso().
◆ setupPFMuonIso()
def pfIsolation.setupPFMuonIso |
( |
|
process, |
|
|
|
muonCollection, |
|
|
|
postfix = 'PFIso' |
|
) |
| |
Set up particle-based isolation for the muons in muonCollection.
Calls setupPFIso.
Definition at line 112 of file pfIsolation.py.
113 '''Set up particle-based isolation for the muons in muonCollection.
117 return setupPFIso( process, muonCollection,
'Muon', postfix)
References setupPFIso().
◆ setupPFPhotonIso()
def pfIsolation.setupPFPhotonIso |
( |
|
process, |
|
|
|
photonCollection, |
|
|
|
postfix = 'PFIso' |
|
) |
| |
Set up particle-based isolation for the electrons in electronCollection.
Calls setupPFIsoPhoton.
Definition at line 132 of file pfIsolation.py.
133 '''Set up particle-based isolation for the electrons in electronCollection.
135 Calls setupPFIsoPhoton.
References setupPFIsoPhoton().
def setupPFMuonIso(process, muonCollection, postfix='PFIso')
def _loadPFBRECO(process)
def _getattrGenerator(process, postfix)
def setupPFIso(process, leptonCollection, particleName, newpostfix='PFIso', postfix='', runPF2PAT=False)
def setupPFIsoPhoton(process, photonCollection, particleName, newpostfix='PFIso')
def setupPFPhotonIso(process, photonCollection, postfix='PFIso')
def cloneProcessingSnippet(process, sequence, postfix, removePostfix="", noClones=[], addToTask=False, verbose=False)
def setupPFElectronIso(process, electronCollection, newpostfix='PFIso', postfix='', runPF2PAT=False)