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
}
Pythia8PartonSelector::Pythia8PartonSelector
Pythia8PartonSelector()
Definition:
Pythia8PartonSelector.cc:11
mps_fire.i
i
Definition:
mps_fire.py:428
Pythia8PartonSelector.h
mps_update.status
status
Definition:
mps_update.py:68
CandMCTag.h
CandMCTagUtils::isParton
bool isParton(const reco::Candidate &c)
Definition:
CandMCTag.cc:46
edm::Handle< reco::GenParticleCollection >
ecalTrigSettings_cff.particles
particles
Definition:
ecalTrigSettings_cff.py:11
edm::Ref< GenParticleCollection >
dqmAnalyzer_cff.partons
partons
Definition:
dqmAnalyzer_cff.py:28
Pythia8PartonSelector::~Pythia8PartonSelector
~Pythia8PartonSelector() override
Definition:
Pythia8PartonSelector.cc:13
Pythia8PartonSelector::run
void run(const edm::Handle< reco::GenParticleCollection > &particles, std::unique_ptr< reco::GenParticleRefVector > &partons) override
Definition:
Pythia8PartonSelector.cc:15
Generated for CMSSW Reference Manual by
1.8.16