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 Sherpa-specific parton selector that selects all status==11 partons.
0004  */
0005 
0006 #include "PhysicsTools/JetMCAlgos/interface/SherpaPartonSelector.h"
0007 #include "PhysicsTools/JetMCUtils/interface/CandMCTag.h"
0008 
0009 SherpaPartonSelector::SherpaPartonSelector() {}
0010 
0011 SherpaPartonSelector::~SherpaPartonSelector() {}
0012 
0013 void SherpaPartonSelector::run(const edm::Handle<reco::GenParticleCollection>& particles,
0014                                std::unique_ptr<reco::GenParticleRefVector>& partons) {
0015   // loop over particles and select partons
0016   for (reco::GenParticleCollection::const_iterator it = particles->begin(); it != particles->end(); ++it) {
0017     if (it->status() != 11)
0018       continue;  // only accept status==11 particles
0019     if (!CandMCTagUtils::isParton(*it))
0020       continue;  // skip particle if not a parton
0021 
0022     partons->push_back(reco::GenParticleRef(particles, it - particles->begin()));
0023   }
0024 
0025   return;
0026 }