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 "CMVAL": (
"pfCombinedMVABJetTags", 0.630),
32 "CMVAM": (
"pfCombinedMVABJetTags", 0.732),
33 "CMVAT": (
"pfCombinedMVABJetTags", 0.813),
34 "CMVAv2M": (
"pfCombinedMVAV2BJetTags", 0.185),
36 "CSVv2IVFL": (
"pfCombinedInclusiveSecondaryVertexV2BJetTags", 0.460),
37 "CSVv2IVFM": (
"pfCombinedInclusiveSecondaryVertexV2BJetTags", 0.800),
38 "CSVv2IVFT": (
"pfCombinedInclusiveSecondaryVertexV2BJetTags", 0.935),
39 "CMVAv2L": (
"pfCombinedMVAV2BJetTags", -0.715),
40 "CMVAv2M": (
"pfCombinedMVAV2BJetTags", 0.185),
41 "CMVAv2T": (
"pfCombinedMVAV2BJetTags", 0.875),
47 super(Jet, self).
__init__(*args, **kwargs)
63 return self.chargedEmEnergy()/self.
rawEnergy()
66 return self.chargedHadronEnergy()/self.
rawEnergy()
69 return self.chargedMuEnergy()/self.
rawEnergy()
72 return self.electronEnergy()/self.
rawEnergy()
78 return self.neutralEmEnergy()/self.
rawEnergy()
81 return self.neutralHadronEnergy()/self.
rawEnergy()
84 return self.photonEnergy()/self.
rawEnergy()
88 return self.HFHadronEnergy()/self.
rawEnergy()
99 if not self.isPFJet():
100 raise RuntimeError(
"jetID implemented only for PF Jets")
101 eta =
abs(self.eta());
103 chf = self.chargedHadronEnergy()/energy;
104 nhf = self.neutralHadronEnergy()/energy;
105 phf = self.neutralEmEnergy()/energy;
106 muf = self.muonEnergy()/energy;
107 elf = self.chargedEmEnergy()/energy;
108 chm = self.chargedHadronMultiplicity();
109 npr = self.chargedMultiplicity() + self.neutralMultiplicity();
110 npn = self.neutralMultiplicity();
113 if name ==
"POG_PFID":
115 if self.
jetID(
"PAG_monoID_Tight")
and self.
jetID(
"POG_PFID_Tight") :
return 5;
116 if self.
jetID(
"PAG_monoID_Loose")
and self.
jetID(
"POG_PFID_Tight") :
return 4;
117 if self.
jetID(
"POG_PFID_Tight") :
return 3;
119 elif self.
jetID(
"POG_PFID_Loose") :
return 1;
123 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)));
124 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));
125 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)));
126 if name ==
"VBFHBB_PFID_Loose":
return (npr>1
and phf<0.99
and nhf<0.99);
127 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);
128 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);
129 if name ==
"PAG_monoID_Loose":
return (eta<3.0
and chf>0.05
and nhf<0.7
and phf<0.8);
130 if name ==
"PAG_monoID_Tight":
return (eta<3.0
and chf>0.2
and nhf<0.7
and phf<0.7);
132 raise RuntimeError,
"jetID '%s' not supported" % name
135 '''PF Jet ID (loose operation point) [method provided for convenience only]'''
136 return self.
jetID(
"POG_PFID_Loose")
138 def puMva(self, label="pileupJetId:fullDiscriminant
"):
139 if self.hasUserFloat(label):
140 return self.userFloat(label)
143 def puJetId(self, label="pileupJetId:fullDiscriminant
"):
144 '''Full mva PU jet id'''
146 puMva = self.
puMva(label)
148 eta =
abs(self.eta())
150 for etamin, etamax, cut
in wp:
151 if not(eta>=etamin
and eta<etamax):
167 corr = newP4.Pt() / (self.pt() * self.
rawFactor())
172 if hasattr(self,
'CorrFactor_L1'):
173 return self.CorrFactor_L1
175 raise RuntimeError(
"The jet was recalibrated, but without calculateSeparateCorrections. L1 is not available")
176 jecLevels = self.physObj.availableJECLevels()
177 for level
in jecLevels:
179 return self.physObj.jecFactor(level)/self.physObj.jecFactor(
'Uncorrected')
183 ret = self.bDiscriminator(name)
184 if ret == -1000
and name.startswith(
"pf"):
185 ret = self.bDiscriminator(name[2].lower()+name[3:])
190 (disc,val) = _btagWPs[name]
191 return self.
btag(disc) > val
197 self.
_leadingTrack =
max( self.daughterPtrVector() , key =
lambda x : x.pt()
if x.charge()!=0
else 0. )
198 if self._leadingTrack.charge()==0:
209 if not hasattr(self,
"qgl_value") :
210 if hasattr(self,
"qgl_rho") :
220 if not hasattr(self,
"qgl_rho")
or getattr(self,
"hasQGVvars",
False) :
236 for ii
in range(0, jet.numberOfDaughters()) :
238 part = jet.daughter(ii)
240 if part.charge() == 0 :
242 if part.pt() < 1.:
continue
246 if part.trackHighPurity()==
False:
continue
247 if part.fromPV()<=1:
continue
252 deta = part.eta() - jet.eta()
253 dphi =
deltaPhi(part.phi(), jet.phi())
255 weight = partPt*partPt
258 sum_deta += deta*weight
259 sum_dphi += dphi*weight
260 sum_deta2 += deta*deta*weight
261 sum_detadphi += deta*dphi*weight
262 sum_dphi2 += dphi*dphi*weight
272 jet.ptd = math.sqrt(sum_weight)/sum_pt
273 ave_deta = sum_deta/sum_weight
274 ave_dphi = sum_dphi/sum_weight
275 ave_deta2 = sum_deta2/sum_weight
276 ave_dphi2 = sum_dphi2/sum_weight
277 a = ave_deta2 - ave_deta*ave_deta
278 b = ave_dphi2 - ave_dphi*ave_dphi
279 c = -(sum_detadphi/sum_weight - ave_deta*ave_dphi)
282 delta = math.sqrt(math.fabs((a-b)*(a-b)+4.*c*c))
284 if a+b-delta > 0: jet.axis2 = -math.log(math.sqrt(0.5*(a+b-delta)))
285 else: jet.axis2 = -1.
def neutralEmEnergyFraction
def chargedEmEnergyFraction
def chargedMuEnergyFraction
Abs< T >::type abs(const T &t)
def neutralHadronEnergyFraction
def HFHadronEnergyFraction
def electronEnergyFraction
def chargedHadronEnergyFraction