File indexing completed on 2025-02-05 23:50:57
0001
0002 #include "FWCore/Framework/interface/ConsumesCollector.h"
0003 #include "FWCore/Framework/interface/MakerMacros.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0005 #include "CommonTools/UtilAlgos/interface/ObjectSelector.h"
0006
0007
0008 #include "Alignment/CommonAlignmentProducer/interface/AlignmentCSCTrackSelector.h"
0009 #include "Alignment/CommonAlignmentProducer/interface/AlignmentGlobalTrackSelector.h"
0010 #include "Alignment/CommonAlignmentProducer/interface/AlignmentTwoBodyDecayTrackSelector.h"
0011
0012
0013
0014
0015
0016 #include "CommonTools/RecoAlgos/interface/TrackSelector.h"
0017
0018 struct CSCTrackConfigSelector {
0019 typedef std::vector<const reco::Track *> container;
0020 typedef container::const_iterator const_iterator;
0021 typedef reco::TrackCollection collection;
0022
0023 CSCTrackConfigSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC) : theBaseSelector(cfg) {}
0024
0025 const_iterator begin() const { return theSelectedTracks.begin(); }
0026 const_iterator end() const { return theSelectedTracks.end(); }
0027 size_t size() const { return theSelectedTracks.size(); }
0028
0029 void select(const edm::Handle<reco::TrackCollection> &c, const edm::Event &evt, const edm::EventSetup & ) {
0030 container all;
0031 for (reco::TrackCollection::const_iterator i = c.product()->begin(); i != c.product()->end(); ++i) {
0032 all.push_back(&*i);
0033 }
0034 theSelectedTracks = theBaseSelector.select(all, evt);
0035 }
0036
0037 static void fillPSetDescription(edm::ParameterSetDescription &desc) {
0038 AlignmentCSCTrackSelector::fillPSetDescription(desc);
0039 }
0040
0041 private:
0042 container theSelectedTracks;
0043
0044 AlignmentCSCTrackSelector theBaseSelector;
0045 };
0046
0047 typedef ObjectSelector<CSCTrackConfigSelector> AlignmentCSCTrackSelectorModule;
0048
0049 DEFINE_FWK_MODULE(AlignmentCSCTrackSelectorModule);