Main Page
Namespaces
Classes
Package Documentation
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
21
typedef
std::vector<const reco::Track*>
container
;
22
typedef
container::const_iterator
const_iterator
;
23
typedef
reco::TrackCollection
collection
;
24
25
TrackConfigSelector
(
const
edm::ParameterSet
&
cfg
,
edm::ConsumesCollector
&& iC ) :
26
theBaseSelector
(cfg, iC),
27
theGlobalSelector
(cfg.getParameter<
edm
::
ParameterSet
>(
"GlobalSelector"
), iC),
28
theTwoBodyDecaySelector
(cfg.getParameter<
edm
::
ParameterSet
>(
"TwoBodyDecaySelector"
), iC)
29
{
30
//TODO Wrap the BaseSelector into its own PSet
31
theBaseSwitch
=
theBaseSelector
.
useThisFilter
();
32
33
theGlobalSwitch
=
theGlobalSelector
.
useThisFilter
();
34
35
theTwoBodyDecaySwitch
=
theTwoBodyDecaySelector
.
useThisFilter
();
36
}
37
38
const_iterator
begin
()
const
{
return
theSelectedTracks
.begin(); }
39
const_iterator
end
()
const
{
return
theSelectedTracks
.end(); }
40
size_t
size
()
const
{
return
theSelectedTracks
.size(); }
41
42
void
select
(
const
edm::Handle<reco::TrackCollection>
&
c
,
const
edm::Event
& evt,
43
const
edm::EventSetup
& eSetup)
44
{
45
theSelectedTracks
.clear();
46
for
( reco::TrackCollection::const_iterator
i
=c.
product
()->begin();
i
!=c.
product
()->end();++
i
){
47
theSelectedTracks
.push_back(& *
i
);
48
}
49
// might add EvetSetup to the select(...) method of the Selectors
50
if
(
theBaseSwitch
)
51
theSelectedTracks
=
theBaseSelector
.
select
(
theSelectedTracks
,evt,eSetup);
52
if
(
theGlobalSwitch
)
53
theSelectedTracks
=
theGlobalSelector
.
select
(
theSelectedTracks
,evt,eSetup);
54
if
(
theTwoBodyDecaySwitch
)
55
theSelectedTracks
=
theTwoBodyDecaySelector
.
select
(
theSelectedTracks
,evt,eSetup);
56
}
57
58
private
:
59
container
theSelectedTracks
;
60
61
bool
theBaseSwitch
,
theGlobalSwitch
,
theTwoBodyDecaySwitch
;
62
AlignmentTrackSelector
theBaseSelector
;
63
AlignmentGlobalTrackSelector
theGlobalSelector
;
64
AlignmentTwoBodyDecayTrackSelector
theTwoBodyDecaySelector
;
65
66
};
67
68
typedef
ObjectSelectorStream<TrackConfigSelector>
AlignmentTrackSelectorModule
;
69
70
DEFINE_FWK_MODULE
(
AlignmentTrackSelectorModule
);
TrackConfigSelector::size
size_t size() const
Definition:
AlignmentTrackSelectorModule.cc:40
mps_fire.i
i
Definition:
mps_fire.py:269
TrackConfigSelector::begin
const_iterator begin() const
Definition:
AlignmentTrackSelectorModule.cc:38
TrackConfigSelector::end
const_iterator end() const
Definition:
AlignmentTrackSelectorModule.cc:39
AlignmentTrackSelectorModule
ObjectSelectorStream< TrackConfigSelector > AlignmentTrackSelectorModule
Definition:
AlignmentTrackSelectorModule.cc:68
ParameterSet
Definition:
Functions.h:16
ObjectSelectorStream
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
ObjectSelectorStream.h
MakerMacros.h
EnergyCorrector.c
c
Definition:
EnergyCorrector.py:43
edm::Handle< reco::TrackCollection >
AlignmentTrackSelector.h
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition:
TrackFwd.h:14
AlignmentGlobalTrackSelector.h
TrackFwd.h
TrackConfigSelector::theTwoBodyDecaySelector
AlignmentTwoBodyDecayTrackSelector theTwoBodyDecaySelector
Definition:
AlignmentTrackSelectorModule.cc:64
TrackConfigSelector::theBaseSwitch
bool theBaseSwitch
Definition:
AlignmentTrackSelectorModule.cc:61
AlignmentGlobalTrackSelector
Definition:
AlignmentGlobalTrackSelector.h:17
TrackConfigSelector::const_iterator
container::const_iterator const_iterator
Definition:
AlignmentTrackSelectorModule.cc:22
AlignmentGlobalTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &iEvent, const edm::EventSetup &eSetup)
select tracks
Definition:
AlignmentGlobalTrackSelector.cc:85
AlignmentTwoBodyDecayTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentTwoBoyDecayTrackSelector.cc:75
TrackConfigSelector::theGlobalSelector
AlignmentGlobalTrackSelector theGlobalSelector
Definition:
AlignmentTrackSelectorModule.cc:63
AlignmentTwoBodyDecayTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &iEvent, const edm::EventSetup &iSetup)
select tracks
Definition:
AlignmentTwoBoyDecayTrackSelector.cc:83
TrackConfigSelector::theSelectedTracks
container theSelectedTracks
Definition:
AlignmentTrackSelectorModule.cc:59
TrackConfigSelector::collection
reco::TrackCollection collection
Definition:
AlignmentTrackSelectorModule.cc:23
edm::EventSetup
Definition:
EventSetup.h:48
AlignmentTwoBodyDecayTrackSelector.h
TrackConfigSelector::theGlobalSwitch
bool theGlobalSwitch
Definition:
AlignmentTrackSelectorModule.cc:61
looper.cfg
cfg
Definition:
looper.py:293
TrackConfigSelector::TrackConfigSelector
TrackConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition:
AlignmentTrackSelectorModule.cc:25
edm::Handle::product
T const * product() const
Definition:
Handle.h:81
TrackConfigSelector::select
void select(const edm::Handle< reco::TrackCollection > &c, const edm::Event &evt, const edm::EventSetup &eSetup)
Definition:
AlignmentTrackSelectorModule.cc:42
TrackConfigSelector
Definition:
AlignmentTrackSelectorModule.cc:19
AlignmentTwoBodyDecayTrackSelector
Definition:
AlignmentTwoBodyDecayTrackSelector.h:17
TrackConfigSelector::theBaseSelector
AlignmentTrackSelector theBaseSelector
Definition:
AlignmentTrackSelectorModule.cc:62
AlignmentTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &evt, const edm::EventSetup &eSetup) const
select tracks
Definition:
AlignmentTrackSelector.cc:239
TrackSelector.h
edm
HLT enums.
Definition:
AlignableModifier.h:17
AlignmentTrackSelector
Definition:
AlignmentTrackSelector.h:23
edm::ParameterSet
Definition:
ParameterSet.h:36
TrackConfigSelector::theTwoBodyDecaySwitch
bool theTwoBodyDecaySwitch
Definition:
AlignmentTrackSelectorModule.cc:61
edm::Event
Definition:
Event.h:69
ConsumesCollector.h
AlignmentGlobalTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentGlobalTrackSelector.cc:78
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
AlignmentTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentTrackSelector.cc:272
TrackConfigSelector::container
std::vector< const reco::Track * > container
Definition:
AlignmentTrackSelectorModule.cc:21
Generated for CMSSW Reference Manual by
1.8.11