src
CommonTools
ParticleFlow
interface
MuonIDPFCandidateSelectorDefinition.h
Go to the documentation of this file.
1
#ifndef CommonTools_ParticleFlow_MuonIDPFCandidateSelectorDefinition
2
#define CommonTools_ParticleFlow_MuonIDPFCandidateSelectorDefinition
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 "
DataFormats/Common/interface/ValueMap.h
"
18
#include "
DataFormats/PatCandidates/interface/Muon.h
"
19
#include "
CommonTools/Utils/interface/StringCutObjectSelector.h
"
20
#include "
CommonTools/ParticleFlow/interface/PFCandidateSelectorDefinition.h
"
21
22
namespace
pf2pat
{
23
24
struct
MuonIDPFCandidateSelectorDefinition
:
public
PFCandidateSelectorDefinition
{
25
MuonIDPFCandidateSelectorDefinition
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC)
26
:
muonCut_
(
cfg
.getParameter<
std
::
string
>(
"cut"
)) {}
27
28
void
select
(
const
HandleToCollection
& hc,
const
edm::Event
&
e
,
const
edm::EventSetup
&
s
) {
29
selected_
.clear();
30
31
unsigned
key
= 0;
32
for
(collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++
key
) {
33
reco::MuonRef
muR = pfc->muonRef();
34
35
// skip ones without a ref to a reco::Muon: they won't be matched anyway
36
if
(muR.
isNull
())
37
continue
;
38
39
// convert into a pat::Muon, so that the 'muonID' method is available
40
pat::Muon
patMu(*muR);
41
42
// apply muon id
43
if
(
muonCut_
(patMu)) {
44
selected_
.push_back(
reco::PFCandidate
(*pfc));
45
reco::PFCandidatePtr
ptrToMother(hc,
key
);
46
selected_
.back().setSourceCandidatePtr(ptrToMother);
47
}
48
}
49
}
50
51
private
:
52
StringCutObjectSelector<pat::Muon>
muonCut_
;
53
};
54
}
// namespace pf2pat
55
56
#endif
edm::Ref< MuonCollection >
Event.h
StringCutObjectSelector< pat::Muon >
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
edm::Handle
Definition:
AssociativeIterator.h:50
pf2pat::MuonIDPFCandidateSelectorDefinition::muonCut_
StringCutObjectSelector< pat::Muon > muonCut_
Definition:
MuonIDPFCandidateSelectorDefinition.h:52
std
Definition:
JetResolutionObject.h:76
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
ValueMap.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ParameterSet.h
pf2pat::MuonIDPFCandidateSelectorDefinition::MuonIDPFCandidateSelectorDefinition
MuonIDPFCandidateSelectorDefinition(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
MuonIDPFCandidateSelectorDefinition.h:25
StringCutObjectSelector.h
PFCandidateSelectorDefinition.h
submitPVResolutionJobs.key
key
prepare the HTCondor submission files and eventually submit them
Definition:
submitPVResolutionJobs.py:222
edm::EventSetup
Definition:
EventSetup.h:56
edm::Ptr< PFCandidate >
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition:
Ref.h:229
looper.cfg
cfg
Definition:
looper.py:296
pf2pat::MuonIDPFCandidateSelectorDefinition::select
void select(const HandleToCollection &hc, const edm::Event &e, const edm::EventSetup &s)
Definition:
MuonIDPFCandidateSelectorDefinition.h:28
pf2pat
Definition:
ElectronIDPFCandidateSelectorDefinition.h:22
pf2pat::PFCandidateSelectorDefinition::selected_
container selected_
Definition:
PFCandidateSelectorDefinition.h:33
Muon.h
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition:
PFCandidate.h:41
pf2pat::PFCandidateSelectorDefinition
Definition:
PFCandidateSelectorDefinition.h:10
edm::ParameterSet
Definition:
ParameterSet.h:48
edm::Event
Definition:
Event.h:73
PFCandidate.h
PFCandidateFwd.h
ConsumesCollector.h
pat::Muon
Analysis-level muon class.
Definition:
Muon.h:51
pf2pat::MuonIDPFCandidateSelectorDefinition
Selects PFCandidates basing on cuts provided with string cut parser.
Definition:
MuonIDPFCandidateSelectorDefinition.h:24
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
Generated for CMSSW Reference Manual by
1.8.14