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 raise RuntimeError(
"jetID '%s' not supported" % name)
85 '''PF Jet ID (loose operation point) [method provided for convenience only]'''
86 return self.
jetID(
"POG_PFID_Loose")
88 def puMva(self, label="pileupJetId:fullDiscriminant
"):
89 return self.userFloat(label)
91 def puJetId(self, label="pileupJetId:fullDiscriminant
"):
92 '''Full mva PU jet id'''
94 puMva = self.
puMva(label)
98 for etamin, etamax, cut
in wp:
99 if not(eta>=etamin
and eta<etamax):
115 corr = newP4.Pt() / (self.pt() * self.
rawFactor())
120 if hasattr(self,
'CorrFactor_L1'):
121 return self.CorrFactor_L1
123 raise RuntimeError(
"The jet was recalibrated, but without calculateSeparateCorrections. L1 is not available")
124 jecLevels = self.physObj.availableJECLevels()
125 for level
in jecLevels:
127 return self.physObj.jecFactor(level)/self.physObj.jecFactor(
'Uncorrected')
131 ret = self.bDiscriminator(name)
132 if ret == -1000
and name.startswith(
"pf"):
133 ret = self.bDiscriminator(name[2].lower()+name[3:])
138 (disc,val) = _btagWPs[name]
139 return self.
btag(disc) > val
145 self.
_leadingTrack =
max( self.daughterPtrVector() , key =
lambda x : x.pt()
if x.charge()!=0
else 0. )
146 if self._leadingTrack.charge()==0:
157 if not hasattr(self,
"qgl_value") :
158 if hasattr(self,
"qgl_rho") :
168 if not hasattr(self,
"qgl_rho")
or getattr(self,
"hasQGVvars",
False) :
184 for ii
in range(0, jet.numberOfDaughters()) :
186 part = jet.daughter(ii)
188 if part.charge() == 0 :
190 if part.pt() < 1.:
continue
194 if part.trackHighPurity()==
False:
continue
195 if part.fromPV()<=1:
continue
200 deta = part.eta() - jet.eta()
201 dphi =
deltaPhi(part.phi(), jet.phi())
203 weight = partPt*partPt
206 sum_deta += deta*weight
207 sum_dphi += dphi*weight
208 sum_deta2 += deta*deta*weight
209 sum_detadphi += deta*dphi*weight
210 sum_dphi2 += dphi*dphi*weight
220 jet.ptd = math.sqrt(sum_weight)/sum_pt
221 ave_deta = sum_deta/sum_weight
222 ave_dphi = sum_dphi/sum_weight
223 ave_deta2 = sum_deta2/sum_weight
224 ave_dphi2 = sum_dphi2/sum_weight
225 a = ave_deta2 - ave_deta*ave_deta
226 b = ave_dphi2 - ave_dphi*ave_dphi
227 c = -(sum_detadphi/sum_weight - ave_deta*ave_dphi)
230 delta = math.sqrt(math.fabs((a-b)*(a-b)+4.*c*c))
232 if a+b-delta > 0: jet.axis2 = -math.log(math.sqrt(0.5*(a+b-delta)))
233 else: jet.axis2 = -1.
Abs< T >::type abs(const T &t)