Main Page
Namespaces
Classes
Package Documentation
PhysicsTools
JetMCAlgos
src
SherpaPartonSelector.cc
Go to the documentation of this file.
1
6
#include "
PhysicsTools/JetMCAlgos/interface/SherpaPartonSelector.h
"
7
#include "
PhysicsTools/JetMCUtils/interface/CandMCTag.h
"
8
9
10
SherpaPartonSelector::SherpaPartonSelector
()
11
{
12
}
13
14
SherpaPartonSelector::~SherpaPartonSelector
()
15
{
16
}
17
18
void
19
SherpaPartonSelector::run
(
const
edm::Handle<reco::GenParticleCollection>
&
particles
,
20
std::unique_ptr<reco::GenParticleRefVector> &
partons
)
21
{
22
// loop over particles and select partons
23
for
(reco::GenParticleCollection::const_iterator it = particles->begin(); it != particles->end(); ++it)
24
{
25
if
( it->status()!=11 )
continue
;
// only accept status==11 particles
26
if
( !
CandMCTagUtils::isParton
( *it ) )
continue
;
// skip particle if not a parton
27
28
partons->push_back(
reco::GenParticleRef
( particles, it - particles->begin() ) );
29
}
30
31
return
;
32
}
edm::Ref< GenParticleCollection >
edm::Handle< reco::GenParticleCollection >
CandMCTag.h
HadronAndPartonSelector_cfi.particles
particles
Definition:
HadronAndPartonSelector_cfi.py:6
SherpaPartonSelector.h
CandMCTagUtils::isParton
bool isParton(const reco::Candidate &c)
Definition:
CandMCTag.cc:48
SherpaPartonSelector::~SherpaPartonSelector
~SherpaPartonSelector() override
Definition:
SherpaPartonSelector.cc:14
SherpaPartonSelector::run
void run(const edm::Handle< reco::GenParticleCollection > &particles, std::unique_ptr< reco::GenParticleRefVector > &partons) override
Definition:
SherpaPartonSelector.cc:19
AK4CaloJetsMCFlavour_cff.partons
partons
Definition:
AK4CaloJetsMCFlavour_cff.py:7
SherpaPartonSelector::SherpaPartonSelector
SherpaPartonSelector()
Definition:
SherpaPartonSelector.cc:10
Generated for CMSSW Reference Manual by
1.8.11