CommonTools
ParticleFlow
interface
GenericPFCandidateSelectorDefinition.h
Go to the documentation of this file.
1
#ifndef CommonTools_ParticleFlow_GenericPFCandidateSelectorDefinition
2
#define CommonTools_ParticleFlow_GenericPFCandidateSelectorDefinition
3
12
#include "
FWCore/Framework/interface/Event.h
"
13
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
14
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
15
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h
"
16
#include "
DataFormats/ParticleFlowCandidate/interface/PFCandidate.h
"
17
#include "
CommonTools/ParticleFlow/interface/PFCandidateSelectorDefinition.h
"
18
#include "
CommonTools/Utils/interface/StringCutObjectSelector.h
"
19
20
namespace
pf2pat
{
21
22
struct
GenericPFCandidateSelectorDefinition
:
public
PFCandidateSelectorDefinition
{
23
GenericPFCandidateSelectorDefinition
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC)
24
:
selector_
(
cfg
.getParameter<
std
::
string
>(
"cut"
)) {}
25
26
void
select
(
const
HandleToCollection
& hc,
const
edm::Event
&
e
,
const
edm::EventSetup
&
s
) {
27
selected_
.clear();
28
29
unsigned
key
= 0;
30
for
(collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++
key
) {
31
if
(
selector_
(*pfc)) {
32
selected_
.push_back(
reco::PFCandidate
(*pfc));
33
reco::PFCandidatePtr
ptrToMother(hc,
key
);
34
selected_
.back().setSourceCandidatePtr(ptrToMother);
35
}
36
}
37
}
38
39
private
:
40
StringCutObjectSelector<reco::PFCandidate>
selector_
;
41
};
42
}
// namespace pf2pat
43
44
#endif
pf2pat::GenericPFCandidateSelectorDefinition::select
void select(const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s)
Definition:
GenericPFCandidateSelectorDefinition.h:26
Event.h
StringCutObjectSelector< reco::PFCandidate >
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
edm::Handle
Definition:
AssociativeIterator.h:50
std
Definition:
JetResolutionObject.h:76
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
crabWrapper.key
key
Definition:
crabWrapper.py:19
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ParameterSet.h
StringCutObjectSelector.h
PFCandidateSelectorDefinition.h
edm::EventSetup
Definition:
EventSetup.h:56
edm::Ptr< PFCandidate >
pf2pat::GenericPFCandidateSelectorDefinition
Selects PFCandidates basing on cuts provided with string cut parser.
Definition:
GenericPFCandidateSelectorDefinition.h:22
looper.cfg
cfg
Definition:
looper.py:296
pf2pat::GenericPFCandidateSelectorDefinition::GenericPFCandidateSelectorDefinition
GenericPFCandidateSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
GenericPFCandidateSelectorDefinition.h:23
pf2pat
Definition:
ElectronIDPFCandidateSelectorDefinition.h:22
pf2pat::PFCandidateSelectorDefinition::selected_
container selected_
Definition:
PFCandidateSelectorDefinition.h:33
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition:
PFCandidate.h:41
pf2pat::PFCandidateSelectorDefinition
Definition:
PFCandidateSelectorDefinition.h:10
edm::ParameterSet
Definition:
ParameterSet.h:47
edm::Event
Definition:
Event.h:73
PFCandidate.h
PFCandidateFwd.h
ConsumesCollector.h
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
pf2pat::GenericPFCandidateSelectorDefinition::selector_
StringCutObjectSelector< reco::PFCandidate > selector_
Definition:
GenericPFCandidateSelectorDefinition.h:40
Generated for CMSSW Reference Manual by
1.8.14