6 """ add userIsolation to patMuon
8 _label=
'addMuonUserIsolation'
9 _defaultParameters=dicttypes.SortedKeysDict()
12 ConfigToolBase.__init__(self)
13 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'])
20 def __call__(self,process,isolationTypes=None) :
21 if isolationTypes
is None:
23 self.setParameter(
'isolationTypes',isolationTypes)
27 isolationTypes=self.
_parameters[
'isolationTypes'].value
32 for obj
in range(len(isolationTypes)):
33 if ( isolationTypes[obj] ==
'Tracker' or isolationTypes[obj] ==
'All'):
34 print "adding predefined userIsolation to pat::Muon for Tracker"
35 print " -> to access this information call pat::Muon::userIsolation(pat::TrackIso) in your analysis code <-"
36 isolationKey=isolationKey+1
38 if ( isolationTypes[obj] ==
'Ecal' or isolationTypes[obj] ==
'All'):
39 print "adding predefined userIsolation to pat::Muon for Ecal"
40 print " -> to access this information call pat::Muon::userIsolation(pat::EcalIso ) in your analysis code <-"
41 isolationKey=isolationKey+10
43 if ( isolationTypes[obj] ==
'Hcal' or isolationTypes[obj] ==
'All'):
44 print "adding predefined userIsolation to pat::Muon for Hcal"
45 print " -> to access this information call pat::Muon::userIsolation(pat::HcalIso ) in your analysis code <-"
46 isolationKey=isolationKey+100
49 if ( isolationKey == 1 ):
51 process.patMuons.isoDeposits = cms.PSet(
52 tracker = cms.InputTag(
"muIsoDepositTk"),
54 process.patMuons.userIsolation = cms.PSet(
56 src = cms.InputTag(
"muIsoDepositTk"),
57 deltaR = cms.double(0.3)
60 if ( isolationKey == 10 ):
62 process.patMuons.isoDeposits = cms.PSet(
63 ecal = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"ecal"),
65 process.patMuons.userIsolation = cms.PSet(
67 src = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"ecal"),
68 deltaR = cms.double(0.3)
71 if ( isolationKey == 100 ):
73 process.patMuons.isoDeposits = cms.PSet(
74 hcal = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"hcal"),
76 process.patMuons.userIsolation = cms.PSet(
78 src = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"hcal"),
79 deltaR = cms.double(0.3)
82 if ( isolationKey == 11 ):
84 process.patMuons.isoDeposits = cms.PSet(
85 tracker = cms.InputTag(
"muIsoDepositTk"),
86 ecal = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"ecal"),
88 process.patMuons.userIsolation = cms.PSet(
90 src = cms.InputTag(
"muIsoDepositTk"),
91 deltaR = cms.double(0.3)
94 src = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"ecal"),
95 deltaR = cms.double(0.3)
98 if ( isolationKey == 101 ):
100 process.patMuons.isoDeposits = cms.PSet(
101 tracker = cms.InputTag(
"muIsoDepositTk"),
102 hcal = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"hcal"),
104 process.patMuons.userIsolation = cms.PSet(
106 src = cms.InputTag(
"muIsoDepositTk"),
107 deltaR = cms.double(0.3)
110 src = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"hcal"),
111 deltaR = cms.double(0.3)
114 if ( isolationKey == 110 ):
116 process.patMuons.isoDeposits = cms.PSet(
117 ecal = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"ecal"),
118 hcal = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"hcal"),
120 process.patMuons.userIsolation = cms.PSet(
122 src = cms.InputTag(
"gamIsoFromDepsEcalFromHits"),
125 src = cms.InputTag(
"gamIsoFromDepsHcalFromTowers"),
128 if ( isolationKey == 111 ):
130 process.patMuons.isoDeposits = cms.PSet(
131 tracker = cms.InputTag(
"muIsoDepositTk"),
132 ecal = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"ecal"),
133 hcal = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"hcal"),
135 process.patMuons.userIsolation = cms.PSet(
137 src = cms.InputTag(
"muIsoDepositTk"),
138 deltaR = cms.double(0.3)
141 src = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"ecal"),
142 deltaR = cms.double(0.3)
145 src = cms.InputTag(
"muIsoDepositCalByAssociatorTowers",
"hcal"),
146 deltaR = cms.double(0.3)