1 |
fpschill |
1.1 |
|
2 |
|
|
#include "PluginManager/ModuleDef.h"
|
3 |
|
|
#include "FWCore/Framework/interface/MakerMacros.h"
|
4 |
|
|
|
5 |
|
|
//-----------------------------------------------------------------------------
|
6 |
|
|
|
7 |
|
|
#include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentProducer.h"
|
8 |
|
|
|
9 |
|
|
//-----------------------------------------------------------------------------
|
10 |
|
|
|
11 |
fronga |
1.3 |
#include "PhysicsTools/UtilAlgos/interface/ObjectSelector.h"
|
12 |
fpschill |
1.2 |
#include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentTrackSelector.h"
|
13 |
fpschill |
1.1 |
#include "PhysicsTools/RecoAlgos/interface/TrackSelector.h"
|
14 |
|
|
|
15 |
|
|
struct TrackConfigSelector {
|
16 |
|
|
|
17 |
fpschill |
1.2 |
typedef std::vector<const reco::Track*> container;
|
18 |
|
|
typedef container::const_iterator const_iterator;
|
19 |
|
|
typedef reco::TrackCollection collection;
|
20 |
|
|
|
21 |
|
|
TrackConfigSelector( const edm::ParameterSet & cfg ) :
|
22 |
fpschill |
1.1 |
theSelector(cfg) {}
|
23 |
|
|
|
24 |
fpschill |
1.2 |
const_iterator begin() const { return selected_.begin(); }
|
25 |
|
|
const_iterator end() const { return selected_.end(); }
|
26 |
|
|
bool empty() const { return selected_.empty(); }
|
27 |
|
|
|
28 |
|
|
void select( const reco::TrackCollection & c, const edm::Event & evt) {
|
29 |
|
|
all_.clear();
|
30 |
|
|
selected_.clear();
|
31 |
|
|
for( reco::TrackCollection::const_iterator i=c.begin();i!=c.end();++i){
|
32 |
|
|
all_.push_back(& * i );
|
33 |
|
|
}
|
34 |
|
|
selected_=theSelector.select(all_,evt);
|
35 |
fpschill |
1.1 |
}
|
36 |
|
|
|
37 |
fpschill |
1.2 |
private:
|
38 |
|
|
container all_,selected_;
|
39 |
fpschill |
1.1 |
AlignmentTrackSelector theSelector;
|
40 |
|
|
};
|
41 |
|
|
|
42 |
fpschill |
1.2 |
typedef ObjectSelector<TrackConfigSelector> AlignmentTrackSelectorModule;
|
43 |
fpschill |
1.1 |
|
44 |
|
|
//-----------------------------------------------------------------------------
|
45 |
|
|
|
46 |
|
|
DEFINE_SEAL_MODULE();
|
47 |
fronga |
1.3 |
DEFINE_ANOTHER_FWK_LOOPER( AlignmentProducer );
|
48 |
fpschill |
1.1 |
DEFINE_ANOTHER_FWK_MODULE( AlignmentTrackSelectorModule );
|