Skip to content

Commit

Permalink
Merge pull request #39403 from mseidel42/Herwig7_partonFlavour_10_6
Browse files Browse the repository at this point in the history
Herwig7 jet partonFlavour (10_6_X)
  • Loading branch information
cmsbuild authored Nov 25, 2022
2 parents 8d796aa + e16c421 commit 6ef5341
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions PhysicsTools/JetMCAlgos/plugins/HadronAndPartonSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ HadronAndPartonSelector::produce(edm::Event& iEvent, const edm::EventSetup& iSet
partonMode_="Herwig6";
else if( moduleName.find("ThePEG")!=std::string::npos )
partonMode_="Herwig++";
else if( moduleName.find("Herwig7")!=std::string::npos )
partonMode_="Herwig++";
else if( moduleName.find("Sherpa")!=std::string::npos )
partonMode_="Sherpa";
else
Expand Down Expand Up @@ -256,18 +258,20 @@ HadronAndPartonSelector::produce(edm::Event& iEvent, const edm::EventSetup& iSet
leptons->push_back( reco::GenParticleRef( particles, it - particles->begin() ) );
}

// select partons
// select algorithmic partons
if ( partonMode_!="Undefined" ) {
partonSelector_->run(particles,partons);
for(reco::GenParticleCollection::const_iterator it = particles->begin(); it != particles->end(); ++it)
{
if(!fullChainPhysPartons_)
{
if( !(it->status()==3 || (( partonMode_=="Pythia8" ) && (it->status()==23)))) continue;
}
if( !CandMCTagUtils::isParton( *it ) ) continue; // skip particle if not a parton
physicsPartons->push_back( reco::GenParticleRef( particles, it - particles->begin() ) );
}
}

// select physics partons
for(reco::GenParticleCollection::const_iterator it = particles->begin(); it != particles->end(); ++it)
{
if(!fullChainPhysPartons_)
{
if( !(it->status()==3 || (( partonMode_=="Pythia8" ) && (it->status()==23)))) continue;
}
if( !CandMCTagUtils::isParton( *it ) ) continue; // skip particle if not a parton
physicsPartons->push_back( reco::GenParticleRef( particles, it - particles->begin() ) );
}

iEvent.put(std::move(bHadrons), "bHadrons" );
Expand Down

0 comments on commit 6ef5341

Please sign in to comment.