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
0006
0007 #include "Alignment/CommonAlignmentProducer/interface/AlignmentCSCTrackSelector.h"
0008 #include "Alignment/CommonAlignmentProducer/interface/AlignmentGlobalTrackSelector.h"
0009 #include "Alignment/CommonAlignmentProducer/interface/AlignmentTwoBodyDecayTrackSelector.h"
0010
0011
0012
0013
0014
0015 #include "CommonTools/RecoAlgos/interface/TrackSelector.h"
0016
0017 struct CSCTrackConfigSelector {
0018 typedef std::vector<const reco::Track *> container;
0019 typedef container::const_iterator const_iterator;
0020 typedef reco::TrackCollection collection;
0021
0022 CSCTrackConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC) : theBaseSelector(cfg) {}
0023
0024 const_iterator begin() const { return theSelectedTracks.begin(); }
0025 const_iterator end() const { return theSelectedTracks.end(); }
0026 size_t size() const { return theSelectedTracks.size(); }
0027
0028 void select(const edm::Handle<reco::TrackCollection> &c, const edm::Event &evt, const edm::EventSetup & ) {
0029 container all;
0030 for (reco::TrackCollection::const_iterator i = c.product()->begin(); i != c.product()->end(); ++i) {
0031 all.push_back(&*i);
0032 }
0033 theSelectedTracks = theBaseSelector.select(all, evt);
0034 }
0035
0036 private:
0037 container theSelectedTracks;
0038
0039 AlignmentCSCTrackSelector theBaseSelector;
0040 };
0041
0042 typedef ObjectSelector<CSCTrackConfigSelector> AlignmentCSCTrackSelectorModule;
0043
0044 DEFINE_FWK_MODULE(AlignmentCSCTrackSelectorModule);