ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/HbbAnalysis/plugins/HbbTreeMaker.cc
(Generate patch)

Comparing UserCode/HbbAnalysis/plugins/HbbTreeMaker.cc (file contents):
Revision 1.39 by amagnan, Sat Jul 16 15:46:11 2011 UTC vs.
Revision 1.40 by amagnan, Sat Jul 16 19:01:58 2011 UTC

# Line 1656 | Line 1656 | void HbbTreeMaker::HbbParticles(const ed
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        }
# Line 1732 | Line 1735 | void HbbTreeMaker::HbbGenJets(const edm:
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();
# Line 1769 | Line 1775 | void HbbTreeMaker::HbbGenJets(const edm:
1775            }
1776  
1777            HbbAnalysis::GenJet lObj(lGenJet);
1778 +          lObj.nConstituants((*iter).getGenConstituents().size());
1779            aVec.push_back(lObj);
1780          }
1781      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines