96 |
|
,jet->vx() |
97 |
|
,jet->vy() |
98 |
|
,jet->vz() |
99 |
< |
,abs(jet->pdgId()) |
99 |
> |
,jet->pdgId() |
100 |
|
,jet->charge() |
101 |
|
); |
102 |
|
|
156 |
|
localJet.setBtag_trackCountingHighEff(patJet->bDiscriminator("trackCountingHighEffBJetTags")); |
157 |
|
localJet.setBtag_trackCountingHighPur(patJet->bDiscriminator("trackCountingHighPurBJetTags")); |
158 |
|
localJet.setBtag_jetProbability(patJet->bDiscriminator("jetProbabilityBJetTags")); |
159 |
< |
localJet.setBCorrection(patJet->correctionFactor(pat::Jet::bCorrection)); |
160 |
< |
localJet.setCCorrection(patJet->correctionFactor(pat::Jet::cCorrection)); |
161 |
< |
localJet.setUDSCorrection(patJet->correctionFactor(pat::Jet::udsCorrection)); |
162 |
< |
localJet.setGCorrection(patJet->correctionFactor(pat::Jet::gCorrection)); |
159 |
> |
|
160 |
> |
// see DataFormats/PatCandidates/interface/JetCorrFactors.h |
161 |
> |
localJet.setBCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7b,patJet->jetCorrStep() )); |
162 |
> |
localJet.setCCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7c,patJet->jetCorrStep() )); |
163 |
> |
localJet.setUDSCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7uds,patJet->jetCorrStep() )); |
164 |
> |
localJet.setGCorrection(patJet->jetCorrFactors().correction(pat::JetCorrFactors::L7g,patJet->jetCorrStep() )); |
165 |
|
|
166 |
|
// Use associated tracks to calculate charged broadness of the jet |
167 |
|
// FIXME - Check generalTracks collection is present |
243 |
|
localJet.setGenParticleIndex(-1); |
244 |
|
} |
245 |
|
|
246 |
< |
// Matched generated parton |
247 |
< |
if ( patJet->genParton() != NULL ) |
246 |
> |
// check if jet comes from a top |
247 |
> |
bool IsTopJet = false; |
248 |
> |
if(patJet->genParton()) |
249 |
|
{ |
250 |
< |
localJet.setMomentumMCParton(TLorentzVector(patJet->genParton()->px(),patJet->genParton()->py(),patJet->genParton()->pz(),patJet->genParton()->energy())); |
251 |
< |
localJet.setVertexMCParton(TVector3(patJet->genParton()->vx(),patJet->genParton()->vy(),patJet->genParton()->vz() ) ); |
252 |
< |
localJet.setPdgIdMCParton(patJet->genParton()->pdgId()); |
250 |
> |
const reco::Candidate* gen = patJet->genParton(); |
251 |
> |
while(gen->mother()) |
252 |
> |
{ |
253 |
> |
if(abs((gen->mother())->pdgId()) == 6) |
254 |
> |
{ |
255 |
> |
IsTopJet = true; |
256 |
> |
break; |
257 |
> |
} |
258 |
> |
else |
259 |
> |
{ |
260 |
> |
gen = (gen->mother() ); |
261 |
> |
} |
262 |
> |
} |
263 |
|
} |
264 |
+ |
localJet.setIsTopJet(IsTopJet); |
265 |
|
|
266 |
|
// Matched generated jet |
267 |
|
if ( patJet->genJet() != NULL ) |
268 |
|
{ |
269 |
< |
localJet.setMomentumMCJet(TLorentzVector(patJet->genJet()->px(),patJet->genJet()->py(),patJet->genJet()->pz(),patJet->genJet()->energy())); |
256 |
< |
localJet.setVertexMCJet(TVector3(patJet->genJet()->vx(),patJet->genJet()->vy(),patJet->genJet()->vz() )); |
257 |
< |
localJet.setPdgIdMCJet(patJet->genJet()->pdgId()); |
269 |
> |
localJet.setGenJetEnergy( patJet->genJet()->energy() ); |
270 |
|
} |
271 |
+ |
|
272 |
|
} |
273 |
|
} |
274 |
|
|