CMS 3D CMS Logo

AlignmentCSCBeamHaloSelectorModule.cc
Go to the documentation of this file.
1 
6 
7 // the following include is necessary to clone all track branches
8 // including recoTrackExtras and TrackingRecHitsOwned.
9 // if you remove it the code will compile, but the cloned
10 // tracks have only the recoTracks branch!
12 
14  typedef std::vector<const reco::Track *> container;
15  typedef container::const_iterator const_iterator;
17 
21 
22  const_iterator begin() const { return selected_.begin(); }
23  const_iterator end() const { return selected_.end(); }
24  size_t size() const { return selected_.size(); }
25 
26  void select(const edm::Handle<reco::TrackCollection> &c, const edm::Event &evt, const edm::EventSetup & /*dummy*/) {
27  all_.clear();
28  selected_.clear();
29  for (collection::const_iterator i = c.product()->begin(), iE = c.product()->end(); i != iE; ++i) {
30  all_.push_back(&*i);
31  }
32  selected_ = theSelector.select(all_, evt); // might add dummy...
33  }
34 
35 private:
38 };
39 
41 
CSCBeamHaloConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Tracks select(const Tracks &tracks, const edm::Event &iEvent) const
select tracks
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ObjectSelector< CSCBeamHaloConfigSelector > AlignmentCSCBeamHaloSelectorModule
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
AlignmentCSCBeamHaloSelector theSelector
CSCBeamHaloConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
void select(const edm::Handle< reco::TrackCollection > &c, const edm::Event &evt, const edm::EventSetup &)
std::vector< const reco::Track * > container