96 |
|
,jet->vx() |
97 |
|
,jet->vy() |
98 |
|
,jet->vz() |
99 |
< |
,abs(jet->pdgId()) |
99 |
> |
,jet->pdgId() |
100 |
|
,jet->charge() |
101 |
|
); |
102 |
|
|
234 |
|
// Matched genParticle |
235 |
|
if (useMC_) |
236 |
|
{ |
237 |
< |
if ( patJet->genParton() != NULL ) |
238 |
< |
{ |
239 |
< |
localJet.setMomentumMCParton(TLorentzVector(patJet->genParton()->px(),patJet->genParton()->py(),patJet->genParton()->pz(),patJet->genParton()->energy())); |
240 |
< |
localJet.setVertexMCParton(TVector3(patJet->genParton()->vx(),patJet->genParton()->vy(),patJet->genParton()->vz() ) ); |
241 |
< |
localJet.setPdgIdMCParton(patJet->genParton()->pdgId()); |
237 |
> |
// MC truth associator index |
238 |
> |
if ((patJet->genParticleRef()).isNonnull()) { |
239 |
> |
localJet.setGenParticleIndex((patJet->genParticleRef()).index()); |
240 |
> |
} else { |
241 |
> |
localJet.setGenParticleIndex(-1); |
242 |
|
} |
243 |
|
|
244 |
+ |
// Matched generated jet |
245 |
+ |
// FIXME - Keep genJet index or UID instead |
246 |
+ |
// genJet stocked in MCParticles branch |
247 |
+ |
/* |
248 |
|
if ( patJet->genJet() != NULL ) |
249 |
|
{ |
250 |
|
localJet.setMomentumMCJet(TLorentzVector(patJet->genJet()->px(),patJet->genJet()->py(),patJet->genJet()->pz(),patJet->genJet()->energy())); |
251 |
|
localJet.setVertexMCJet(TVector3(patJet->genJet()->vx(),patJet->genJet()->vy(),patJet->genJet()->vz() )); |
252 |
|
localJet.setPdgIdMCJet(patJet->genJet()->pdgId()); |
253 |
|
} |
254 |
+ |
*/ |
255 |
+ |
|
256 |
+ |
// check if jet comes from a top |
257 |
+ |
bool IsTopJet = false; |
258 |
+ |
if(patJet->genParton()) |
259 |
+ |
{ |
260 |
+ |
const reco::Candidate* gen = patJet->genParton(); |
261 |
+ |
while(gen->mother()) |
262 |
+ |
{ |
263 |
+ |
if(abs((gen->mother())->pdgId()) == 6) |
264 |
+ |
{ |
265 |
+ |
IsTopJet = true; |
266 |
+ |
break; |
267 |
+ |
} |
268 |
+ |
else |
269 |
+ |
{ |
270 |
+ |
gen = (gen->mother() ); |
271 |
+ |
} |
272 |
+ |
} |
273 |
+ |
} |
274 |
+ |
localJet.setIsTopJet(IsTopJet); |
275 |
|
} |
276 |
|
} |
277 |
|
|