Alignment
CommonAlignmentProducer
plugins
AlignmentTrackSelectorModule.cc
Go to the documentation of this file.
1
2
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
3
#include "
FWCore/Framework/interface/MakerMacros.h
"
4
#include "
CommonTools/UtilAlgos/interface/ObjectSelectorStream.h
"
5
6
//the selectores used to select the tracks
7
#include "
Alignment/CommonAlignmentProducer/interface/AlignmentTrackSelector.h
"
8
#include "
Alignment/CommonAlignmentProducer/interface/AlignmentGlobalTrackSelector.h
"
9
#include "
Alignment/CommonAlignmentProducer/interface/AlignmentTwoBodyDecayTrackSelector.h
"
10
11
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
12
13
// the following include is necessary to clone all track branches
14
// including recoTrackExtras and TrackingRecHitsOwned (in future also "owned clusters"?).
15
// if you remove it the code will compile, but the cloned
16
// tracks have only the recoTracks branch!
17
#include "
CommonTools/RecoAlgos/interface/TrackSelector.h
"
18
19
struct
TrackConfigSelector
{
20
typedef
std::vector<const reco::Track*>
container
;
21
typedef
container::const_iterator
const_iterator
;
22
typedef
reco::TrackCollection
collection
;
23
24
TrackConfigSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC)
25
:
theBaseSelector
(
cfg
, iC),
26
theGlobalSelector
(
cfg
.getParameter<
edm
::
ParameterSet
>(
"GlobalSelector"
), iC),
27
theTwoBodyDecaySelector
(
cfg
.getParameter<
edm
::
ParameterSet
>(
"TwoBodyDecaySelector"
), iC) {
28
//TODO Wrap the BaseSelector into its own PSet
29
theBaseSwitch
=
theBaseSelector
.
useThisFilter
();
30
31
theGlobalSwitch
=
theGlobalSelector
.
useThisFilter
();
32
33
theTwoBodyDecaySwitch
=
theTwoBodyDecaySelector
.
useThisFilter
();
34
}
35
36
const_iterator
begin
()
const
{
return
theSelectedTracks
.begin(); }
37
const_iterator
end
()
const
{
return
theSelectedTracks
.end(); }
38
size_t
size
()
const
{
return
theSelectedTracks
.size(); }
39
40
void
select
(
const
edm::Handle<reco::TrackCollection>
&
c
,
const
edm::Event
& evt,
const
edm::EventSetup
& eSetup) {
41
theSelectedTracks
.clear();
42
for
(reco::TrackCollection::const_iterator
i
=
c
.product()->begin();
i
!=
c
.product()->end(); ++
i
) {
43
theSelectedTracks
.push_back(&*
i
);
44
}
45
// might add EvetSetup to the select(...) method of the Selectors
46
if
(
theBaseSwitch
)
47
theSelectedTracks
=
theBaseSelector
.
select
(
theSelectedTracks
, evt, eSetup);
48
if
(
theGlobalSwitch
)
49
theSelectedTracks
=
theGlobalSelector
.
select
(
theSelectedTracks
, evt, eSetup);
50
if
(
theTwoBodyDecaySwitch
)
51
theSelectedTracks
=
theTwoBodyDecaySelector
.
select
(
theSelectedTracks
, evt, eSetup);
52
}
53
54
private
:
55
container
theSelectedTracks
;
56
57
bool
theBaseSwitch
,
theGlobalSwitch
,
theTwoBodyDecaySwitch
;
58
AlignmentTrackSelector
theBaseSelector
;
59
AlignmentGlobalTrackSelector
theGlobalSelector
;
60
AlignmentTwoBodyDecayTrackSelector
theTwoBodyDecaySelector
;
61
};
62
63
typedef
ObjectSelectorStream<TrackConfigSelector>
AlignmentTrackSelectorModule
;
64
65
DEFINE_FWK_MODULE
(
AlignmentTrackSelectorModule
);
TrackConfigSelector::const_iterator
container::const_iterator const_iterator
Definition:
AlignmentTrackSelectorModule.cc:21
AlignmentTwoBodyDecayTrackSelector.h
mps_fire.i
i
Definition:
mps_fire.py:428
ObjectSelectorStream.h
TrackConfigSelector::begin
const_iterator begin() const
Definition:
AlignmentTrackSelectorModule.cc:36
TrackSelector.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
AlignmentGlobalTrackSelector
Definition:
AlignmentGlobalTrackSelector.h:22
TrackConfigSelector::theGlobalSelector
AlignmentGlobalTrackSelector theGlobalSelector
Definition:
AlignmentTrackSelectorModule.cc:59
TrackConfigSelector
Definition:
AlignmentTrackSelectorModule.cc:19
AlignmentTwoBodyDecayTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &iEvent, const edm::EventSetup &iSetup)
select tracks
Definition:
AlignmentTwoBoyDecayTrackSelector.cc:78
TrackConfigSelector::theBaseSwitch
bool theBaseSwitch
Definition:
AlignmentTrackSelectorModule.cc:57
TrackConfigSelector::size
size_t size() const
Definition:
AlignmentTrackSelectorModule.cc:38
edm::Handle< reco::TrackCollection >
AlignmentTwoBodyDecayTrackSelector
Definition:
AlignmentTwoBodyDecayTrackSelector.h:20
AlignmentTrackSelector
Definition:
AlignmentTrackSelector.h:23
MakerMacros.h
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
TrackConfigSelector::theSelectedTracks
container theSelectedTracks
Definition:
AlignmentTrackSelectorModule.cc:55
TrackConfigSelector::theTwoBodyDecaySelector
AlignmentTwoBodyDecayTrackSelector theTwoBodyDecaySelector
Definition:
AlignmentTrackSelectorModule.cc:60
AlignmentGlobalTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentGlobalTrackSelector.cc:68
AlignmentTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentTrackSelector.cc:263
TrackConfigSelector::theGlobalSwitch
bool theGlobalSwitch
Definition:
AlignmentTrackSelectorModule.cc:57
edm::ParameterSet
Definition:
ParameterSet.h:47
ParameterSet
Definition:
Functions.h:16
ObjectSelectorStream
AlignmentTrackSelector.h
edm::EventSetup
Definition:
EventSetup.h:57
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
TrackConfigSelector::select
void select(const edm::Handle< reco::TrackCollection > &c, const edm::Event &evt, const edm::EventSetup &eSetup)
Definition:
AlignmentTrackSelectorModule.cc:40
looper.cfg
cfg
Definition:
looper.py:297
AlignmentTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &evt, const edm::EventSetup &eSetup) const
select tracks
Definition:
AlignmentTrackSelector.cc:229
TrackConfigSelector::container
std::vector< const reco::Track * > container
Definition:
AlignmentTrackSelectorModule.cc:20
TrackConfigSelector::end
const_iterator end() const
Definition:
AlignmentTrackSelectorModule.cc:37
AlignmentGlobalTrackSelector.h
TrackConfigSelector::theBaseSelector
AlignmentTrackSelector theBaseSelector
Definition:
AlignmentTrackSelectorModule.cc:58
AlignmentTwoBodyDecayTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentTwoBoyDecayTrackSelector.cc:72
TrackConfigSelector::TrackConfigSelector
TrackConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
AlignmentTrackSelectorModule.cc:24
ConsumesCollector.h
AlignmentGlobalTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &iEvent, const edm::EventSetup &eSetup)
select tracks
Definition:
AlignmentGlobalTrackSelector.cc:73
TrackConfigSelector::theTwoBodyDecaySwitch
bool theTwoBodyDecaySwitch
Definition:
AlignmentTrackSelectorModule.cc:57
edm::Event
Definition:
Event.h:73
TrackConfigSelector::collection
reco::TrackCollection collection
Definition:
AlignmentTrackSelectorModule.cc:22
AlignmentTrackSelectorModule
ObjectSelectorStream< TrackConfigSelector > AlignmentTrackSelectorModule
Definition:
AlignmentTrackSelectorModule.cc:63
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition:
TrackFwd.h:14
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
Generated for CMSSW Reference Manual by
1.8.16