src
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
Pythia8PartonSelector::Pythia8PartonSelector
() {}
12
13
Pythia8PartonSelector::~Pythia8PartonSelector
() {}
14
15
void
Pythia8PartonSelector::run
(
const
edm::Handle<reco::GenParticleCollection>
&
particles
,
16
std::unique_ptr<reco::GenParticleRefVector>&
partons
) {
17
// loop over particles and select partons
18
for
(reco::GenParticleCollection::const_iterator
it
=
particles
->begin();
it
!=
particles
->end(); ++
it
) {
19
int
status
=
it
->status();
20
if
(
status
== 1)
21
continue
;
// skip stable particles
22
if
(
status
== 2)
23
continue
;
// skip decayed Standard Model hadrons and leptons
24
if
(!
CandMCTagUtils::isParton
(*
it
))
25
continue
;
// skip particle if not a parton
26
27
// check if the parton has other partons as daughters
28
int
nparton_daughters = 0;
29
for
(
unsigned
i
= 0;
i
<
it
->numberOfDaughters(); ++
i
) {
30
if
(
CandMCTagUtils::isParton
(*(
it
->daughter(
i
))))
31
++nparton_daughters;
32
}
33
34
if
(nparton_daughters == 0)
35
partons
->push_back(
reco::GenParticleRef
(
particles
,
it
-
particles
->begin()));
36
}
37
38
return
;
39
}
mps_fire.i
i
Definition:
mps_fire.py:429
ecalTrigSettings_cff.particles
particles
Definition:
ecalTrigSettings_cff.py:11
edm::Ref< GenParticleCollection >
edm::Handle< reco::GenParticleCollection >
CandMCTag.h
dqmAnalyzer_cff.partons
partons
Definition:
dqmAnalyzer_cff.py:25
mps_update.status
status
Definition:
mps_update.py:68
Pythia8PartonSelector::~Pythia8PartonSelector
~Pythia8PartonSelector() override
Definition:
Pythia8PartonSelector.cc:13
CandMCTagUtils::isParton
bool isParton(const reco::Candidate &c)
Definition:
CandMCTag.cc:46
Pythia8PartonSelector::run
void run(const edm::Handle< reco::GenParticleCollection > &particles, std::unique_ptr< reco::GenParticleRefVector > &partons) override
Definition:
Pythia8PartonSelector.cc:15
ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it
auto & it
Definition:
splitVertices.h:45
Pythia8PartonSelector.h
Pythia8PartonSelector::Pythia8PartonSelector
Pythia8PartonSelector()
Definition:
Pythia8PartonSelector.cc:11
Generated for CMSSW Reference Manual by
1.8.14