File indexing completed on 2024-04-06 12:20:55
0001 #include "L1TMuonEndCapTrackProducer.h"
0002
0003 L1TMuonEndCapTrackProducer::L1TMuonEndCapTrackProducer(const edm::ParameterSet& iConfig)
0004 : track_finder_(new TrackFinder(iConfig, consumesCollector())), uGMT_converter_(new MicroGMTConverter()) {
0005
0006 produces<EMTFHitCollection>("");
0007 produces<EMTFTrackCollection>("");
0008 produces<l1t::RegionalMuonCandBxCollection>("EMTF");
0009 }
0010
0011 void L1TMuonEndCapTrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
0012
0013 auto out_hits_tmp = std::make_unique<EMTFHitCollection>();
0014 auto out_hits = std::make_unique<EMTFHitCollection>();
0015 auto out_tracks = std::make_unique<EMTFTrackCollection>();
0016 auto out_cands = std::make_unique<l1t::RegionalMuonCandBxCollection>();
0017
0018
0019 track_finder_->process(iEvent, iSetup, *out_hits_tmp, *out_tracks);
0020
0021
0022
0023 emtf::sector_array<bool> good_sectors;
0024 good_sectors.fill(false);
0025
0026 for (const auto& h : *out_hits_tmp) {
0027 if (h.Is_CSC()) {
0028 good_sectors.at(h.Sector_idx()) = true;
0029 }
0030 }
0031
0032 for (const auto& h : *out_hits_tmp) {
0033 if (good_sectors.at(h.Sector_idx())) {
0034 out_hits->push_back(h);
0035 }
0036 }
0037
0038
0039 uGMT_converter_->convert_all(iEvent, *out_tracks, *out_cands);
0040
0041
0042 iEvent.put(std::move(out_hits), "");
0043 iEvent.put(std::move(out_tracks), "");
0044 iEvent.put(std::move(out_cands), "EMTF");
0045 }
0046
0047
0048 void L1TMuonEndCapTrackProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0049
0050
0051 edm::ParameterSetDescription desc;
0052 desc.setUnknown();
0053 descriptions.addDefault(desc);
0054 }
0055
0056
0057 DEFINE_FWK_MODULE(L1TMuonEndCapTrackProducer);