ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/CMSSW/Alignment/CommonAlignmentAlgorithm/src/SealModule.cc
Revision: 1.3
Committed: Fri Aug 4 16:15:14 2006 UTC (18 years, 9 months ago) by fronga
Content type: text/plain
Branch: MAIN
CVS Tags: CMSSW_1_0_0_pre1, V00-01-00
Changes since 1.2: +2 -2 lines
Log Message:
First version with EDLooper interface, and running in latest release.

File Contents

# User Rev Content
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 );