5 """ add userIsolation to patPhoton
7 _label=
'addPhotonUserIsolation'
8 _defaultParameters=dicttypes.SortedKeysDict()
11 ConfigToolBase.__init__(self)
12 self.addParameter(self.
_defaultParameters,
'isolationTypes',[
'All'],
'List of predefined userIsolation types to be added; possible values are [\'Tracker\',\'Ecal\',\'Hcal\'] or just [\'All\']', allowedValues=[
'Tracker',
'Ecal',
'Hcal',
'All'])
19 def __call__(self,process,isolationTypes=None) :
20 if isolationTypes
is None:
22 self.setParameter(
'isolationTypes',isolationTypes)
26 isolationTypes=self.
_parameters[
'isolationTypes'].value
31 gamIsoDepositEcalFromHits.ExtractorPSet.barrelEcalHits = cms.InputTag(
"reducedEcalRecHitsEB")
32 gamIsoDepositEcalFromHits.ExtractorPSet.endcapEcalHits = cms.InputTag(
"reducedEcalRecHitsEE")
37 for obj
in range(len(isolationTypes)):
38 if ( isolationTypes[obj] ==
'Tracker' or isolationTypes[obj] ==
'All'):
39 print "adding predefined userIsolation to pat::Photon for Tracker"
40 print " -> to access this information call pat::Photon::userIsolation(pat::TrackIso) in your analysis code <-"
41 isolationKey=isolationKey+1
43 process.patPhotonTrackIsolation
44 process.patDefaultSequence.replace( process.patPhotons, process.patPhotonTrackIsolation*process.patPhotons )
46 if ( isolationTypes[obj] ==
'Ecal' or isolationTypes[obj] ==
'All'):
47 print "adding predefined userIsolation to pat::Photon for Ecal"
48 print " -> to access this information call pat::Photon::userIsolation(pat::EcalIso ) in your analysis code <-"
49 isolationKey=isolationKey+10
51 process.patPhotonEcalIsolation
52 process.patDefaultSequence.replace( process.patPhotons, process.patPhotonEcalIsolation*process.patPhotons )
54 if ( isolationTypes[obj] ==
'Hcal' or isolationTypes[obj] ==
'All'):
55 print "adding predefined userIsolation to pat::Photon for Hcal"
56 print " -> to access this information call pat::Photon::userIsolation(pat::HcalIso ) in your analysis code <-"
57 isolationKey=isolationKey+100
59 process.patPhotonHcalIsolation = patPhotonHcalIsolation
60 process.patDefaultSequence.replace( process.patPhotons, process.patPhotonHcalIsolation*process.patPhotons )
63 if ( isolationKey == 1 ):
65 process.patPhotons.isoDeposits = cms.PSet(
66 tracker = cms.InputTag(
"gamIsoDepositTk"),
68 process.patPhotons.userIsolation = cms.PSet(
70 src = cms.InputTag(
"gamIsoFromDepsTk"),
73 if ( isolationKey == 10 ):
75 process.patPhotons.isoDeposits = cms.PSet(
76 ecal = cms.InputTag(
"gamIsoDepositEcalFromHits"),
78 process.patPhotons.userIsolation = cms.PSet(
80 src = cms.InputTag(
"gamIsoFromDepsEcalFromHits"),
83 if ( isolationKey == 100 ):
85 process.patPhotons.isoDeposits = cms.PSet(
86 hcal = cms.InputTag(
"gamIsoDepositHcalFromTowers"),
88 process.patPhotons.userIsolation = cms.PSet(
90 src = cms.InputTag(
"gamIsoFromDepsHcalFromTowers"),
93 if ( isolationKey == 11 ):
95 process.patPhotons.isoDeposits = cms.PSet(
96 tracker = cms.InputTag(
"gamIsoDepositTk"),
97 ecal = cms.InputTag(
"gamIsoDepositEcalFromHits"),
99 process.patPhotons.userIsolation = cms.PSet(
101 src = cms.InputTag(
"gamIsoFromDepsTk"),
104 src = cms.InputTag(
"gamIsoFromDepsEcalFromHits"),
107 if ( isolationKey == 101 ):
109 process.patPhotons.isoDeposits = cms.PSet(
110 tracker = cms.InputTag(
"gamIsoDepositTk"),
111 hcal = cms.InputTag(
"gamIsoDepositHcalFromTowers"),
113 process.patPhotons.userIsolation = cms.PSet(
115 src = cms.InputTag(
"gamIsoFromDepsTk"),
118 src = cms.InputTag(
"gamIsoFromDepsHcalFromTowers"),
121 if ( isolationKey == 110 ):
123 process.patPhotons.isoDeposits = cms.PSet(
124 ecal = cms.InputTag(
"gamIsoDepositEcalFromHits"),
125 hcal = cms.InputTag(
"gamIsoDepositHcalFromTowers"),
127 process.patPhotons.userIsolation = cms.PSet(
129 src = cms.InputTag(
"gamIsoFromDepsEcalFromHits"),
132 src = cms.InputTag(
"gamIsoFromDepsHcalFromTowers"),
135 if ( isolationKey == 111 ):
137 process.patPhotons.isoDeposits = cms.PSet(
138 tracker = cms.InputTag(
"gamIsoDepositTk"),
139 ecal = cms.InputTag(
"gamIsoDepositEcalFromHits"),
140 hcal = cms.InputTag(
"gamIsoDepositHcalFromTowers"),
142 process.patPhotons.userIsolation = cms.PSet(
144 src = cms.InputTag(
"gamIsoFromDepsTk"),
147 src = cms.InputTag(
"gamIsoFromDepsEcalFromHits"),
150 src = cms.InputTag(
"gamIsoFromDepsHcalFromTowers"),