Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
Alignment
CommonAlignmentProducer
plugins
AlignmentTrackSelectorModule.cc
Go to the documentation of this file.
1
2
#include "
FWCore/Framework/interface/MakerMacros.h
"
3
#include "
CommonTools/UtilAlgos/interface/ObjectSelector.h
"
4
5
//the selectores used to select the tracks
6
#include "
Alignment/CommonAlignmentProducer/interface/AlignmentTrackSelector.h
"
7
#include "
Alignment/CommonAlignmentProducer/interface/AlignmentGlobalTrackSelector.h
"
8
#include "
Alignment/CommonAlignmentProducer/interface/AlignmentTwoBodyDecayTrackSelector.h
"
9
10
#include "
DataFormats/TrackReco/interface/TrackFwd.h
"
11
12
// the following include is necessary to clone all track branches
13
// including recoTrackExtras and TrackingRecHitsOwned (in future also "owned clusters"?).
14
// if you remove it the code will compile, but the cloned
15
// tracks have only the recoTracks branch!
16
#include "
CommonTools/RecoAlgos/interface/TrackSelector.h
"
17
18
struct
TrackConfigSelector
{
19
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 ) :
25
theBaseSelector
(cfg),
26
theGlobalSelector
(cfg.getParameter<edm::
ParameterSet
>(
"GlobalSelector"
)),
27
theTwoBodyDecaySelector
(cfg.getParameter<edm::
ParameterSet
>(
"TwoBodyDecaySelector"
))
28
{
29
//TODO Wrap the BaseSelector into its own PSet
30
theBaseSwitch
=
theBaseSelector
.
useThisFilter
();
31
32
theGlobalSwitch
=
theGlobalSelector
.
useThisFilter
();
33
34
theTwoBodyDecaySwitch
=
theTwoBodyDecaySelector
.
useThisFilter
();
35
}
36
37
const_iterator
begin
()
const
{
return
theSelectedTracks
.begin(); }
38
const_iterator
end
()
const
{
return
theSelectedTracks
.end(); }
39
size_t
size
()
const
{
return
theSelectedTracks
.size(); }
40
41
void
select
(
const
edm::Handle<reco::TrackCollection>
&
c
,
const
edm::Event
& evt,
42
const
edm::EventSetup
&
/*dummy*/
)
43
{
44
theSelectedTracks
.clear();
45
for
( reco::TrackCollection::const_iterator
i
=c.
product
()->begin();
i
!=c.
product
()->end();++
i
){
46
theSelectedTracks
.push_back(& *
i
);
47
}
48
// might add EvetSetup to the select(...) method of the Selectors
49
if
(
theBaseSwitch
)
50
theSelectedTracks
=
theBaseSelector
.
select
(
theSelectedTracks
,evt);
51
if
(
theGlobalSwitch
)
52
theSelectedTracks
=
theGlobalSelector
.
select
(
theSelectedTracks
,evt);
53
if
(
theTwoBodyDecaySwitch
)
54
theSelectedTracks
=
theTwoBodyDecaySelector
.
select
(
theSelectedTracks
,evt);
55
}
56
57
private
:
58
container
theSelectedTracks
;
59
60
bool
theBaseSwitch
,
theGlobalSwitch
,
theTwoBodyDecaySwitch
;
61
AlignmentTrackSelector
theBaseSelector
;
62
AlignmentGlobalTrackSelector
theGlobalSelector
;
63
AlignmentTwoBodyDecayTrackSelector
theTwoBodyDecaySelector
;
64
65
};
66
67
typedef
ObjectSelector<TrackConfigSelector>
AlignmentTrackSelectorModule
;
68
69
DEFINE_FWK_MODULE
(
AlignmentTrackSelectorModule
);
ObjectSelector
Definition:
ObjectSelector.h:38
i
int i
Definition:
DBlmapReader.cc:9
TrackConfigSelector::size
size_t size() const
Definition:
AlignmentTrackSelectorModule.cc:39
TrackConfigSelector::begin
const_iterator begin() const
Definition:
AlignmentTrackSelectorModule.cc:37
TrackConfigSelector::end
const_iterator end() const
Definition:
AlignmentTrackSelectorModule.cc:38
ParameterSet
Definition:
Functions.h:16
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
MakerMacros.h
AlignmentTrackSelector.h
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition:
TrackFwd.h:10
AlignmentTwoBodyDecayTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &iEvent)
select tracks
Definition:
AlignmentTwoBoyDecayTrackSelector.cc:80
AlignmentGlobalTrackSelector.h
TrackFwd.h
TrackConfigSelector::theTwoBodyDecaySelector
AlignmentTwoBodyDecayTrackSelector theTwoBodyDecaySelector
Definition:
AlignmentTrackSelectorModule.cc:63
edm::Handle< reco::TrackCollection >
TrackConfigSelector::theBaseSwitch
bool theBaseSwitch
Definition:
AlignmentTrackSelectorModule.cc:60
AlignmentGlobalTrackSelector
Definition:
AlignmentGlobalTrackSelector.h:14
TrackConfigSelector::const_iterator
container::const_iterator const_iterator
Definition:
AlignmentTrackSelectorModule.cc:21
ObjectSelector.h
AlignmentTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &evt) const
select tracks
Definition:
AlignmentTrackSelector.cc:186
AlignmentTwoBodyDecayTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentTwoBoyDecayTrackSelector.cc:72
TrackConfigSelector::theGlobalSelector
AlignmentGlobalTrackSelector theGlobalSelector
Definition:
AlignmentTrackSelectorModule.cc:62
TrackConfigSelector::theSelectedTracks
container theSelectedTracks
Definition:
AlignmentTrackSelectorModule.cc:58
TrackConfigSelector::collection
reco::TrackCollection collection
Definition:
AlignmentTrackSelectorModule.cc:22
edm::EventSetup
Definition:
EventSetup.h:44
AlignmentTwoBodyDecayTrackSelector.h
TrackConfigSelector::theGlobalSwitch
bool theGlobalSwitch
Definition:
AlignmentTrackSelectorModule.cc:60
AlignmentTrackSelectorModule
ObjectSelector< TrackConfigSelector > AlignmentTrackSelectorModule
Definition:
AlignmentTrackSelectorModule.cc:67
TrackConfigSelector
Definition:
AlignmentTrackSelectorModule.cc:18
trackerHits.c
tuple c
Definition:
trackerHits.py:26
AlignmentTwoBodyDecayTrackSelector
Definition:
AlignmentTwoBodyDecayTrackSelector.h:14
edm::Handle::product
T const * product() const
Definition:
Handle.h:74
TrackConfigSelector::theBaseSelector
AlignmentTrackSelector theBaseSelector
Definition:
AlignmentTrackSelectorModule.cc:61
TrackSelector.h
AlignmentTrackSelector
Definition:
AlignmentTrackSelector.h:17
edm::ParameterSet
Definition:
ParameterSet.h:31
AlignmentGlobalTrackSelector::select
Tracks select(const Tracks &tracks, const edm::Event &iEvent)
select tracks
Definition:
AlignmentGlobalTrackSelector.cc:87
TrackConfigSelector::theTwoBodyDecaySwitch
bool theTwoBodyDecaySwitch
Definition:
AlignmentTrackSelectorModule.cc:60
edm::Event
Definition:
Event.h:49
TrackConfigSelector::select
void select(const edm::Handle< reco::TrackCollection > &c, const edm::Event &evt, const edm::EventSetup &)
Definition:
AlignmentTrackSelectorModule.cc:41
TrackConfigSelector::TrackConfigSelector
TrackConfigSelector(const edm::ParameterSet &cfg)
Definition:
AlignmentTrackSelectorModule.cc:24
AlignmentGlobalTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentGlobalTrackSelector.cc:80
AlignmentTrackSelector::useThisFilter
bool useThisFilter()
returns if any of the Filters is used.
Definition:
AlignmentTrackSelector.cc:219
TrackConfigSelector::container
std::vector< const reco::Track * > container
Definition:
AlignmentTrackSelectorModule.cc:20
Generated for CMSSW Reference Manual by
1.8.5