CommonTools
ParticleFlow
interface
PdgIdPFCandidateSelectorDefinition.h
Go to the documentation of this file.
1
#ifndef CommonTools_ParticleFlow_PdgIdPFCandidateSelectorDefinition
2
#define CommonTools_ParticleFlow_PdgIdPFCandidateSelectorDefinition
3
4
#include "
FWCore/Common/interface/EventBase.h
"
5
#include "
FWCore/Framework/interface/EventSetup.h
"
6
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
7
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
8
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h
"
9
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidate.h
"
10
#include "
CommonTools/ParticleFlow/interface/PFCandidateSelectorDefinition.h
"
11
12
namespace
pf2pat
{
13
14
class
PdgIdPFCandidateSelectorDefinition
:
public
PFCandidateSelectorDefinition
{
15
public
:
16
PdgIdPFCandidateSelectorDefinition
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC)
17
:
pdgIds_
(
cfg
.getParameter<
std
::vector<
int
> >(
"pdgId"
)) {}
18
19
void
select
(
const
HandleToCollection
& hc,
const
edm::EventBase
&
e
,
const
edm::EventSetup
&
s
) {
20
selected_
.clear();
21
22
unsigned
key
= 0;
23
for
(collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++
key
) {
24
for
(
unsigned
iId = 0; iId <
pdgIds_
.size(); iId++) {
25
if
(pfc->pdgId() ==
pdgIds_
[iId]) {
26
selected_
.push_back(
reco::PFCandidate
(*pfc));
27
reco::PFCandidatePtr
ptrToMother(hc,
key
);
28
selected_
.back().setSourceCandidatePtr(ptrToMother);
29
break
;
30
}
31
}
32
}
33
}
34
35
private
:
36
std::vector<int>
pdgIds_
;
37
};
38
39
}
// namespace pf2pat
40
41
#endif
PFCandidate.h
pf2pat
Definition:
ElectronIDPFCandidateSelectorDefinition.h:22
pf2pat::PdgIdPFCandidateSelectorDefinition::PdgIdPFCandidateSelectorDefinition
PdgIdPFCandidateSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
PdgIdPFCandidateSelectorDefinition.h:16
pf2pat::PdgIdPFCandidateSelectorDefinition
Definition:
PdgIdPFCandidateSelectorDefinition.h:14
EventBase.h
edm::Handle
Definition:
AssociativeIterator.h:50
pf2pat::PdgIdPFCandidateSelectorDefinition::pdgIds_
std::vector< int > pdgIds_
Definition:
PdgIdPFCandidateSelectorDefinition.h:36
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
pf2pat::PdgIdPFCandidateSelectorDefinition::select
void select(const HandleToCollection &hc, const edm::EventBase &e, const edm::EventSetup &s)
Definition:
PdgIdPFCandidateSelectorDefinition.h:19
pf2pat::PFCandidateSelectorDefinition::selected_
container selected_
Definition:
PFCandidateSelectorDefinition.h:33
PFCandidateSelectorDefinition.h
edm::ParameterSet
Definition:
ParameterSet.h:36
createfilelist.int
int
Definition:
createfilelist.py:10
edm::EventSetup
Definition:
EventSetup.h:57
edm::Ptr< PFCandidate >
looper.cfg
cfg
Definition:
looper.py:297
std
Definition:
JetResolutionObject.h:76
edm::EventBase
Definition:
EventBase.h:46
EventSetup.h
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition:
PFCandidate.h:40
ConsumesCollector.h
pf2pat::PFCandidateSelectorDefinition
Definition:
PFCandidateSelectorDefinition.h:10
ParameterSet.h
crabWrapper.key
key
Definition:
crabWrapper.py:19
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
PFCandidateFwd.h
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16