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::selector_
StringCutObjectSelector< reco::PFCandidate > selector_
Definition:
GenericPFCandidateSelectorDefinition.h:40
PFCandidate.h
pf2pat
Definition:
ElectronIDPFCandidateSelectorDefinition.h:22
edm::Handle
Definition:
AssociativeIterator.h:50
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
pf2pat::PFCandidateSelectorDefinition::selected_
container selected_
Definition:
PFCandidateSelectorDefinition.h:33
PFCandidateSelectorDefinition.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
edm::EventSetup
Definition:
EventSetup.h:58
pf2pat::GenericPFCandidateSelectorDefinition::GenericPFCandidateSelectorDefinition
GenericPFCandidateSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
GenericPFCandidateSelectorDefinition.h:23
edm::Ptr< PFCandidate >
looper.cfg
cfg
Definition:
looper.py:297
pf2pat::GenericPFCandidateSelectorDefinition
Selects PFCandidates basing on cuts provided with string cut parser.
Definition:
GenericPFCandidateSelectorDefinition.h:22
std
Definition:
JetResolutionObject.h:76
StringCutObjectSelector.h
StringCutObjectSelector< reco::PFCandidate >
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition:
PFCandidate.h:41
ConsumesCollector.h
pf2pat::PFCandidateSelectorDefinition
Definition:
PFCandidateSelectorDefinition.h:10
ParameterSet.h
edm::Event
Definition:
Event.h:73
crabWrapper.key
key
Definition:
crabWrapper.py:19
pf2pat::GenericPFCandidateSelectorDefinition::select
void select(const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s)
Definition:
GenericPFCandidateSelectorDefinition.h:26
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
PFCandidateFwd.h
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16