File indexing completed on 2024-04-06 11:56:13
0001
0002 #include "FWCore/Framework/interface/ConsumesCollector.h"
0003 #include "FWCore/Framework/interface/MakerMacros.h"
0004 #include "CommonTools/UtilAlgos/interface/ObjectSelector.h"
0005 #include "Alignment/CommonAlignmentProducer/interface/AlignmentCSCOverlapSelector.h"
0006
0007
0008
0009
0010
0011 #include "CommonTools/RecoAlgos/interface/TrackSelector.h"
0012
0013 struct CSCOverlapConfigSelector {
0014 typedef std::vector<const reco::Track *> container;
0015 typedef container::const_iterator const_iterator;
0016 typedef reco::TrackCollection collection;
0017
0018 CSCOverlapConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC) : theSelector(cfg) {}
0019
0020 const_iterator begin() const { return selected_.begin(); }
0021 const_iterator end() const { return selected_.end(); }
0022 size_t size() const { return selected_.size(); }
0023
0024 void select(const edm::Handle<reco::TrackCollection> &c, const edm::Event &evt, const edm::EventSetup & ) {
0025 all_.clear();
0026 selected_.clear();
0027 for (collection::const_iterator i = c.product()->begin(), iE = c.product()->end(); i != iE; ++i) {
0028 all_.push_back(&*i);
0029 }
0030 selected_ = theSelector.select(all_, evt);
0031 }
0032
0033 private:
0034 container all_, selected_;
0035 AlignmentCSCOverlapSelector theSelector;
0036 };
0037
0038 typedef ObjectSelector<CSCOverlapConfigSelector> AlignmentCSCOverlapSelectorModule;
0039
0040 DEFINE_FWK_MODULE(AlignmentCSCOverlapSelectorModule);