Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:34

0001 
0002 /**
0003  * This is a Pythia6-specific parton selector that selects all status==2 partons. An explanation of the particle status codes
0004  * returned by Pythia6 can be found in Section 5.4 of Pythia6 manual (http://arxiv.org/abs/hep-ph/0603175)
0005  */
0006 
0007 #include "PhysicsTools/JetMCAlgos/interface/Pythia6PartonSelector.h"
0008 #include "PhysicsTools/JetMCUtils/interface/CandMCTag.h"
0009 
0010 Pythia6PartonSelector::Pythia6PartonSelector() {}
0011 
0012 Pythia6PartonSelector::~Pythia6PartonSelector() {}
0013 
0014 void Pythia6PartonSelector::run(const edm::Handle<reco::GenParticleCollection>& particles,
0015                                 std::unique_ptr<reco::GenParticleRefVector>& partons) {
0016   // loop over particles and select partons
0017   for (reco::GenParticleCollection::const_iterator it = particles->begin(); it != particles->end(); ++it) {
0018     if (it->status() != 2)
0019       continue;  // only accept status==2 particles
0020     if (!CandMCTagUtils::isParton(*it))
0021       continue;  // skip particle if not a parton
0022 
0023     partons->push_back(reco::GenParticleRef(particles, it - particles->begin()));
0024   }
0025 
0026   return;
0027 }