Main Page
Namespaces
Classes
Package Documentation
PhysicsTools
JetMCAlgos
src
Pythia8PartonSelector.cc
Go to the documentation of this file.
1
8
#include "
PhysicsTools/JetMCAlgos/interface/Pythia8PartonSelector.h
"
9
#include "
PhysicsTools/JetMCUtils/interface/CandMCTag.h
"
10
11
12
Pythia8PartonSelector::Pythia8PartonSelector
()
13
{
14
}
15
16
Pythia8PartonSelector::~Pythia8PartonSelector
()
17
{
18
}
19
20
void
21
Pythia8PartonSelector::run
(
const
edm::Handle<reco::GenParticleCollection>
&
particles
,
22
std::unique_ptr<reco::GenParticleRefVector> &
partons
)
23
{
24
// loop over particles and select partons
25
for
(reco::GenParticleCollection::const_iterator it = particles->begin(); it != particles->end(); ++it)
26
{
27
int
status
= it->status();
28
if
( status==1 )
continue
;
// skip stable particles
29
if
( status==2 )
continue
;
// skip decayed Standard Model hadrons and leptons
30
if
( !
CandMCTagUtils::isParton
( *it ) )
continue
;
// skip particle if not a parton
31
32
// check if the parton has other partons as daughters
33
int
nparton_daughters = 0;
34
for
(
unsigned
i
=0;
i
<it->numberOfDaughters(); ++
i
)
35
{
36
if
(
CandMCTagUtils::isParton
( *(it->daughter(
i
)) ) )
37
++nparton_daughters;
38
}
39
40
if
( nparton_daughters==0 )
41
partons->push_back(
reco::GenParticleRef
( particles, it - particles->begin() ) );
42
}
43
44
return
;
45
}
Pythia8PartonSelector::run
void run(const edm::Handle< reco::GenParticleCollection > &particles, std::unique_ptr< reco::GenParticleRefVector > &partons)
Definition:
Pythia8PartonSelector.cc:21
mps_fire.i
i
Definition:
mps_fire.py:156
edm::Ref< GenParticleCollection >
edm::Handle< reco::GenParticleCollection >
CandMCTag.h
mps_update.status
status
Definition:
mps_update.py:57
HadronAndPartonSelector_cfi.particles
particles
Definition:
HadronAndPartonSelector_cfi.py:6
Pythia8PartonSelector::~Pythia8PartonSelector
virtual ~Pythia8PartonSelector()
Definition:
Pythia8PartonSelector.cc:16
CandMCTagUtils::isParton
bool isParton(const reco::Candidate &c)
Definition:
CandMCTag.cc:48
AK4CaloJetsMCFlavour_cff.partons
partons
Definition:
AK4CaloJetsMCFlavour_cff.py:7
Pythia8PartonSelector.h
Pythia8PartonSelector::Pythia8PartonSelector
Pythia8PartonSelector()
Definition:
Pythia8PartonSelector.cc:12
Generated for CMSSW Reference Manual by
1.8.11