1656 |
|
lMC.phi = p.phi(); |
1657 |
|
lMC.pdgId = p.pdgId(); |
1658 |
|
lMC.status = p.status(); |
1659 |
< |
if (p.status()==3 || (p.status()==2 && (abs(p.pdgId())==4 || abs(p.pdgId())==5)) || (p.status()==1 && p.pt()>5)){ |
1659 |
> |
if (p.status()==3 || |
1660 |
> |
(p.status()==2 && (abs(p.pdgId())==4 || abs(p.pdgId())==5)) || |
1661 |
> |
(p.status()==1 && ( (p.pt()>5 && abs(p.pdgId()) > 16) || abs(p.pdgId()) <= 16) ) |
1662 |
> |
){ |
1663 |
|
HbbAnalysis::GenParticle lObj(lMC); |
1664 |
|
aVec.push_back(lObj); |
1665 |
|
} |
1735 |
|
lGenJet.phi = (*iter).phi(); |
1736 |
|
lGenJet.charge = (*iter).charge(); |
1737 |
|
|
1738 |
+ |
//only status 1 saved !!!! |
1739 |
|
//get flavour from list of constituants. |
1740 |
< |
std::vector <const reco::GenParticle*> lConst = (*iter).getGenConstituents(); |
1741 |
< |
unsigned int nb=0, nc=0; |
1742 |
< |
for (unsigned int iMC(0); iMC<lConst.size(); ++iMC){ |
1743 |
< |
const reco::GenParticle* lPart = lConst[iMC]; |
1744 |
< |
if (abs(lPart->pdgId()) == 5){ |
1745 |
< |
++nb; |
1746 |
< |
break; |
1747 |
< |
} |
1748 |
< |
if (abs(lPart->pdgId()) == 4) ++nc; |
1749 |
< |
} |
1750 |
< |
if (nb > 0) lGenJet.pdgId = 5; |
1751 |
< |
else if (nc > 0) lGenJet.pdgId = 4; |
1752 |
< |
else lGenJet.pdgId = 3; |
1740 |
> |
//std::vector <const reco::GenParticle*> lConst = (*iter).getGenConstituents(); |
1741 |
> |
//unsigned int nb=0, nc=0; |
1742 |
> |
// for (unsigned int iMC(0); iMC<lConst.size(); ++iMC){ |
1743 |
> |
// const reco::GenParticle* lPart = lConst[iMC]; |
1744 |
> |
// //std::cout << lPart->pdgId() << " " << fabs(lPart->pdgId()) << " " << abs(lPart->pdgId()) << std::endl; |
1745 |
> |
// if (fabs(lPart->pdgId()) == 5){ |
1746 |
> |
// ++nb; |
1747 |
> |
// break; |
1748 |
> |
// } |
1749 |
> |
// if (fabs(lPart->pdgId()) == 4) ++nc; |
1750 |
> |
// } |
1751 |
> |
// if (nb > 0) lGenJet.pdgId = 5; |
1752 |
> |
// else if (nc > 0) lGenJet.pdgId = 4; |
1753 |
> |
// else lGenJet.pdgId = 3; |
1754 |
> |
lGenJet.pdgId = (*iter).pdgId(); |
1755 |
|
lGenJet.status = (*iter).status(); |
1756 |
|
lGenJet.mass = (*iter).mass(); |
1757 |
|
lGenJet.vx = (*iter).vx(); |
1775 |
|
} |
1776 |
|
|
1777 |
|
HbbAnalysis::GenJet lObj(lGenJet); |
1778 |
+ |
lObj.nConstituants((*iter).getGenConstituents().size()); |
1779 |
|
aVec.push_back(lObj); |
1780 |
|
} |
1781 |
|
} |