10 '''Initializing rho to None. The user is responsible for setting it to the right value
11 to get the rho-corrected isolation.'''
12 super(Photon, self).
__init__(*args, **kwargs)
20 return self.physObj.hadTowOverEm()
23 return self.physObj.r9()
26 return self.physObj.sigmaIetaIeta()
29 return self.physObj.full5x5_r9()
32 return self.physObj.full5x5_sigmaIetaIeta()
35 isoCharged = self.ftprAbsIsoCharged03
if hasattr(self,
'ftprAbsIsoCharged03')
else self.physObj.chargedHadronIso()
36 if corr
is None or corr ==
"":
return isoCharged
37 elif corr ==
"rhoArea":
return max(isoCharged-self.
rho*self.EffectiveArea03[0],0)
38 else:
raise RuntimeError,
"Photon isolation correction '%s' not yet implemented in Photon.py" % corr
41 isoNHad = self.ftprAbsIsoNHad03
if hasattr(self,
'ftprAbsIsoNHad03')
else self.physObj.neutralHadronIso()
42 if corr
is None or corr ==
"":
return isoNHad
43 elif corr ==
"rhoArea":
return max(isoNHad-self.
rho*self.EffectiveArea03[1],0)
44 else:
raise RuntimeError,
"Photon isolation correction '%s' not yet implemented in Photon.py" % corr
47 isoPho = self.ftprAbsIsoPho03
if hasattr(self,
'ftprAbsIsoPho03')
else self.physObj.photonIso()
48 if corr
is None or corr ==
"":
return isoPho
49 elif corr ==
"rhoArea":
return max(isoPho-self.
rho*self.EffectiveArea03[2],0)
50 else:
raise RuntimeError,
"Photon isolation correction '%s' not yet implemented in Photon.py" % corr
56 if name ==
"PhotonCutBasedIDLoose_CSA14":
57 if abs(self.physObj.eta())<1.479 :
63 elif name ==
"PhotonCutBasedIDLoose_PHYS14":
64 if abs(self.physObj.eta())<1.479 :
71 print "WARNING! Unkown photon ID! Will return true!"
75 if abs(self.physObj.eta())<1.479 :
81 if self.
hOVERe() > hovereThresh : keepThisPhoton =
False
89 "POG_PHYS14_25ns_Loose": {
"conversionVeto": [
True,
True],
"H/E":[0.028,0.093],
"sigmaIEtaIEta":[0.0107,0.0272],
90 "chaHadIso":[2.67,1.79],
"neuHadIso":[[7.23,0.0028,0.5408],[8.89,0.01725]],
"phoIso":[[2.11,0.0014],[3.09,0.0091]]},
93 "POG_PHYS14_25ns_Loose_old": {
"conversionVeto": [
True,
True],
"H/E":[0.048,0.069],
"sigmaIEtaIEta":[0.0106,0.0266],
94 "chaHadIso":[2.56,3.12],
"neuHadIso":[[3.74,0.0025,0.],[17.11,0.0118,0.]],
"phoIso":[[2.68,0.001],[2.70,0.0059]]},
96 "POG_PHYS14_25ns_Medium": {
"conversionVeto": [
True,
True],
"H/E":[0.012,0.023],
"sigmaIEtaIEta":[0.0100,0.0267],
97 "chaHadIso":[1.79,1.09],
"neuHadIso":[[0.16,0.0028,0.5408],[4.31,0.0172]],
"phoIso":[[1.90,0.0014],[1.90,0.0091]]},
99 "POG_PHYS14_25ns_Tight": {
"conversionVeto": [
True,
True],
"H/E":[0.010,0.015],
"sigmaIEtaIEta":[0.0100,0.0265],
100 "chaHadIso":[1.66,1.04],
"neuHadIso":[[0.14,0.0028,0.5408],[3.89,0.0172]],
"phoIso":[[1.40,0.0014],[1.40,0.0091]]},
103 "POG_SPRING15_50ns_Loose": {
"conversionVeto": [
True,
True],
"H/E":[0.05,0.05],
"sigmaIEtaIEta":[0.0103,0.0277],
104 "chaHadIso":[2.44,1.84],
"neuHadIso":[[2.57,0.0044,0.5809],[4.00, 0.0040,0.9402]],
"phoIso":[[1.92,0.0043],[2.15,0.0041]]},
106 "POG_SPRING15_50ns_Medium": {
"conversionVeto": [
True,
True],
"H/E":[0.05,0.05],
"sigmaIEtaIEta":[0.0100,0.0267],
107 "chaHadIso":[1.31,1.25],
"neuHadIso":[[0.60,0.0044,0.5809],[1.65, 0.0040,0.9402]],
"phoIso":[[1.33,0.0043],[1.02,0.0041]]},
109 "POG_SPRING15_50ns_Tight": {
"conversionVeto": [
True,
True],
"H/E":[0.05,0.05],
"sigmaIEtaIEta":[0.0100,0.0267],
110 "chaHadIso":[0.91,0.65],
"neuHadIso":[[0.33,0.0044,0.5809],[0.93, 0.0040,0.9402]],
"phoIso":[[0.61,0.0043],[0.54,0.0041]]},
113 "POG_CSA14_25ns_Loose": {
"conversionVeto": [
True,
True],
"H/E":[0.553,0.062],
"sigmaIEtaIEta":[0.0099,0.0284],
114 "chaHadIso":[2.49,1.04],
"neuHadIso":[[15.43,0.007],[19.71,0.0129]],
"phoIso":[[9.42,0.0033],[11.88,0.0108]]},
116 "POG_CSA14_25ns_Medium": {
"conversionVeto": [
True,
True],
"H/E":[0.058,0.020],
"sigmaIEtaIEta":[0.0099,0.0268],
117 "chaHadIso":[1.91,0.82],
"neuHadIso":[[4.66,0.007],[14.65,0.0129]],
"phoIso":[[4.29,0.0033],[4.06,0.0108]]},
119 "POG_CSA14_25ns_Tight": {
"conversionVeto": [
True,
True],
"H/E":[0.019,0.016],
"sigmaIEtaIEta":[0.0099,0.0263],
120 "chaHadIso":[1.61,0.69],
"neuHadIso":[[3.98,0.007],[4.52,0.0129]],
"phoIso":[[3.01,0.0033],[3.61,0.0108]]},
125 baseWP = re.split(
'_',name)
126 if "looseSieie" in baseWP[-1]:
128 WPs[
"_".
join(baseWP)][
"sigmaIEtaIEta"] = [0.015,0.035]
130 return WPs[
"_".
join(baseWP)]
135 if abs(self.physObj.eta())<1.479 :
142 return slope*self.pt()+offset
145 return offset +
exp(slope_exp*self.pt()+offset_exp)
153 if self.
CutBasedIDWP(name)[
"conversionVeto"][idForBarrel]:
154 if (conversionSafe_eleVeto==
False and self.physObj.hasPixelSeed())
or (conversionSafe_eleVeto==
True and self.physObj.passElectronVeto()==
False):
171 passPhotonIso =
False
173 if "POG_PHYS14_25ns" in name
and idForBarrel == 0:
175 passPhotonIso =
False
176 elif "POG_SPRING15_50ns" in name:
178 passPhotonIso =
False
181 passPhotonIso =
False
184 passPhotonIso =
False
190 setattr(ROOT.pat.Photon,
"recoPhotonIso", ROOT.reco.Photon.photonIso)
191 setattr(ROOT.pat.Photon,
"recoNeutralHadronIso", ROOT.reco.Photon.neutralHadronIso)
192 setattr(ROOT.pat.Photon,
"recoChargedHadronIso", ROOT.reco.Photon.chargedHadronIso)
Abs< T >::type abs(const T &t)
static std::string join(char **cmd)
def full5x5_sigmaIetaIeta