Alignment
CommonAlignmentProducer
plugins
AlignmentMuonSelectorModule.cc
Go to the documentation of this file.
1
15
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
16
#include "
FWCore/Framework/interface/MakerMacros.h
"
17
#include "
CommonTools/UtilAlgos/interface/ObjectSelectorStream.h
"
18
#include "
Alignment/CommonAlignmentProducer/interface/AlignmentMuonSelector.h
"
19
#include "
DataFormats/MuonReco/interface/MuonFwd.h
"
20
21
// the following include is necessary to clone all track branches
22
// including recoTrackExtras and TrackingRecHitsOwned.
23
// if you remove it the code will compile, but the cloned
24
// tracks have only the recoMuons branch!
25
26
struct
MuonConfigSelector
{
27
typedef
std::vector<const reco::Muon *>
container
;
28
typedef
container::const_iterator
const_iterator
;
29
typedef
reco::MuonCollection
collection
;
30
31
MuonConfigSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&&iC) :
theSelector
(
cfg
) {}
32
33
const_iterator
begin
()
const
{
return
selected_
.begin(); }
34
const_iterator
end
()
const
{
return
selected_
.end(); }
35
size_t
size
()
const
{
return
selected_
.size(); }
36
37
void
select
(
const
edm::Handle<reco::MuonCollection>
&
c
,
const
edm::Event
&evt,
const
edm::EventSetup
&
/* dummy*/
) {
38
all_
.clear();
39
selected_
.clear();
40
for
(collection::const_iterator
i
=
c
.product()->begin(), iE =
c
.product()->end();
i
!= iE; ++
i
) {
41
all_
.push_back(&*
i
);
42
}
43
selected_
=
theSelector
.
select
(
all_
, evt);
// might add dummy
44
}
45
46
private
:
47
container
all_
,
selected_
;
48
AlignmentMuonSelector
theSelector
;
49
};
50
51
typedef
ObjectSelectorStream<MuonConfigSelector>
AlignmentMuonSelectorModule
;
52
53
DEFINE_FWK_MODULE
(
AlignmentMuonSelectorModule
);
AlignmentMuonSelector.h
mps_fire.i
i
Definition:
mps_fire.py:428
ObjectSelectorStream.h
MuonConfigSelector::theSelector
AlignmentMuonSelector theSelector
Definition:
AlignmentMuonSelectorModule.cc:48
MuonConfigSelector::container
std::vector< const reco::Muon * > container
Definition:
AlignmentMuonSelectorModule.cc:27
MuonConfigSelector::const_iterator
container::const_iterator const_iterator
Definition:
AlignmentMuonSelectorModule.cc:28
MuonConfigSelector::MuonConfigSelector
MuonConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
AlignmentMuonSelectorModule.cc:31
MuonConfigSelector::selected_
container selected_
Definition:
AlignmentMuonSelectorModule.cc:47
edm::Handle< reco::MuonCollection >
AlignmentMuonSelector
Definition:
AlignmentMuonSelector.h:26
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
MuonFwd.h
reco::MuonCollection
std::vector< Muon > MuonCollection
collection of Muon objects
Definition:
MuonFwd.h:9
AlignmentMuonSelectorModule
ObjectSelectorStream< MuonConfigSelector > AlignmentMuonSelectorModule
Definition:
AlignmentMuonSelectorModule.cc:51
AlignmentMuonSelectorModule
edm::ParameterSet
Definition:
ParameterSet.h:47
MuonConfigSelector::select
void select(const edm::Handle< reco::MuonCollection > &c, const edm::Event &evt, const edm::EventSetup &)
Definition:
AlignmentMuonSelectorModule.cc:37
MuonConfigSelector::size
size_t size() const
Definition:
AlignmentMuonSelectorModule.cc:35
ObjectSelectorStream
edm::EventSetup
Definition:
EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
MuonConfigSelector::all_
container all_
Definition:
AlignmentMuonSelectorModule.cc:47
looper.cfg
cfg
Definition:
looper.py:297
MuonConfigSelector::collection
reco::MuonCollection collection
Definition:
AlignmentMuonSelectorModule.cc:29
ConsumesCollector.h
MuonConfigSelector::end
const_iterator end() const
Definition:
AlignmentMuonSelectorModule.cc:34
edm::Event
Definition:
Event.h:73
MuonConfigSelector
Definition:
AlignmentMuonSelectorModule.cc:26
MuonConfigSelector::begin
const_iterator begin() const
Definition:
AlignmentMuonSelectorModule.cc:33
AlignmentMuonSelector::select
Muons select(const Muons &muons, const edm::Event &evt) const
select muons
Definition:
AlignmentMuonSelector.cc:62
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
Generated for CMSSW Reference Manual by
1.8.16