21 "TCHEL": (
"pfTrackCountingHighEffBJetTags", 1.7),
22 "TCHEM": (
"pfTrackCountingHighEffBJetTags", 3.3),
23 "TCHPT": (
"pfTrackCountingHighPurBJetTags", 3.41),
24 "JPL": (
"pfJetProbabilityBJetTags", 0.275),
25 "JPM": (
"pfJetProbabilityBJetTags", 0.545),
26 "JPT": (
"pfJetProbabilityBJetTags", 0.790),
27 "CSVL": (
"combinedSecondaryVertexBJetTags", 0.244),
28 "CSVM": (
"combinedSecondaryVertexBJetTags", 0.679),
29 "CSVT": (
"combinedSecondaryVertexBJetTags", 0.898),
31 "CSVv2IVFL": (
"pfCombinedInclusiveSecondaryVertexV2BJetTags", 0.605),
32 "CSVv2IVFM": (
"pfCombinedInclusiveSecondaryVertexV2BJetTags", 0.890),
33 "CSVv2IVFT": (
"pfCombinedInclusiveSecondaryVertexV2BJetTags", 0.990),
34 "CMVAL": (
"pfCombinedMVABJetTags", 0.630),
35 "CMVAM": (
"pfCombinedMVABJetTags", 0.732),
36 "CMVAT": (
"pfCombinedMVABJetTags", 0.813),
42 super(Jet, self).
__init__(*args, **kwargs)
52 if not self.isPFJet():
53 raise RuntimeError,
"jetID implemented only for PF Jets"
54 eta =
abs(self.eta());
56 chf = self.chargedHadronEnergy()/energy;
57 nhf = self.neutralHadronEnergy()/energy;
58 phf = self.neutralEmEnergy()/energy;
59 muf = self.muonEnergy()/energy;
60 elf = self.chargedEmEnergy()/energy;
61 chm = self.chargedHadronMultiplicity();
62 npr = self.chargedMultiplicity() + self.neutralMultiplicity();
63 npn = self.neutralMultiplicity();
66 if name ==
"POG_PFID":
68 if self.
jetID(
"PAG_monoID_Tight")
and self.
jetID(
"POG_PFID_Tight") :
return 5;
69 if self.
jetID(
"PAG_monoID_Loose")
and self.
jetID(
"POG_PFID_Tight") :
return 4;
70 if self.
jetID(
"POG_PFID_Tight") :
return 3;
72 elif self.
jetID(
"POG_PFID_Loose") :
return 1;
76 if name ==
"POG_PFID_Loose":
return ((eta<3.0
and ((npr>1
and phf<0.99
and nhf<0.99)
and (eta>2.4
or (elf<0.99
and chf>0
and chm>0))))
or (eta>3.0
and (phf<0.90
and npn>10)));
77 if name ==
"POG_PFID_Medium":
return (npr>1
and phf<0.95
and nhf<0.95
and muf < 0.8)
and (eta>2.4
or (elf<0.99
and chf>0
and chm>0));
78 if name ==
"POG_PFID_Tight":
return ((eta<3.0
and ((npr>1
and phf<0.90
and nhf<0.90)
and (eta>2.4
or (elf<0.99
and chf>0
and chm>0))))
or (eta>3.0
and (phf<0.90
and npn>10)));
79 if name ==
"VBFHBB_PFID_Loose":
return (npr>1
and phf<0.99
and nhf<0.99);
80 if name ==
"VBFHBB_PFID_Medium":
return (npr>1
and phf<0.99
and nhf<0.99)
and ((eta<=2.4
and nhf<0.9
and phf<0.9
and elf<0.99
and muf<0.99
and chf>0
and chm>0)
or eta>2.4);
81 if name ==
"VBFHBB_PFID_Tight":
return (npr>1
and phf<0.99
and nhf<0.99)
and ((eta<=2.4
and nhf<0.9
and phf<0.9
and elf<0.70
and muf<0.70
and chf>0
and chm>0)
or eta>2.4);
82 if name ==
"PAG_monoID_Loose":
return (eta<3.0
and chf>0.05
and nhf<0.7
and phf<0.8);
83 if name ==
"PAG_monoID_Tight":
return (eta<3.0
and chf>0.2
and nhf<0.7
and phf<0.7);
85 raise RuntimeError,
"jetID '%s' not supported" % name
88 '''PF Jet ID (loose operation point) [method provided for convenience only]'''
89 return self.
jetID(
"POG_PFID_Loose")
91 def puMva(self, label="pileupJetId:fullDiscriminant
"):
92 return self.userFloat(label)
94 def puJetId(self, label="pileupJetId:fullDiscriminant
"):
95 '''Full mva PU jet id'''
97 puMva = self.
puMva(label)
101 for etamin, etamax, cut
in wp:
102 if not(eta>=etamin
and eta<etamax):
118 corr = newP4.Pt() / (self.pt() * self.
rawFactor())
123 if hasattr(self,
'CorrFactor_L1'):
124 return self.CorrFactor_L1
126 raise RuntimeError,
"The jet was recalibrated, but without calculateSeparateCorrections. L1 is not available"
127 jecLevels = self.physObj.availableJECLevels()
128 for level
in jecLevels:
130 return self.physObj.jecFactor(level)/self.physObj.jecFactor(
'Uncorrected')
134 ret = self.bDiscriminator(name)
135 if ret == -1000
and name.startswith(
"pf"):
136 ret = self.bDiscriminator(name[2].lower()+name[3:])
141 (disc,val) = _btagWPs[name]
142 return self.
btag(disc) > val
148 self.
_leadingTrack =
max( self.daughterPtrVector() , key =
lambda x : x.pt()
if x.charge()!=0
else 0. )
149 if self._leadingTrack.charge()==0:
160 if not hasattr(self,
"qgl_value") :
161 if hasattr(self,
"qgl_rho") :
171 if not hasattr(self,
"qgl_rho")
or getattr(self,
"hasQGVvars",
False) :
187 for ii
in range(0, jet.numberOfDaughters()) :
189 part = jet.daughter(ii)
191 if part.charge() == 0 :
193 if part.pt() < 1.:
continue
197 if part.trackHighPurity()==
False:
continue
198 if part.fromPV()<=1:
continue
203 deta = part.eta() - jet.eta()
204 dphi =
deltaPhi(part.phi(), jet.phi())
206 weight = partPt*partPt
209 sum_deta += deta*weight
210 sum_dphi += dphi*weight
211 sum_deta2 += deta*deta*weight
212 sum_detadphi += deta*dphi*weight
213 sum_dphi2 += dphi*dphi*weight
223 jet.ptd = math.sqrt(sum_weight)/sum_pt
224 ave_deta = sum_deta/sum_weight
225 ave_dphi = sum_dphi/sum_weight
226 ave_deta2 = sum_deta2/sum_weight
227 ave_dphi2 = sum_dphi2/sum_weight
228 a = ave_deta2 - ave_deta*ave_deta
229 b = ave_dphi2 - ave_dphi*ave_dphi
230 c = -(sum_detadphi/sum_weight - ave_deta*ave_dphi)
233 delta = math.sqrt(math.fabs((a-b)*(a-b)+4.*c*c))
235 if a+b-delta > 0: jet.axis2 = -math.log(math.sqrt(0.5*(a+b-delta)))
236 else: jet.axis2 = -1.
Abs< T >::type abs(const T &t)