File indexing completed on 2024-04-06 12:19:28
0001 #include "CSCTFCandidateProducer.h"
0002
0003 #include <vector>
0004 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h"
0005 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
0006
0007 #include "DataFormats/Common/interface/Handle.h"
0008 #include "FWCore/Framework/interface/Event.h"
0009
0010 CSCTFCandidateProducer::CSCTFCandidateProducer(const edm::ParameterSet& pset)
0011 : input_module{consumes<L1CSCTrackCollection>(pset.getUntrackedParameter<edm::InputTag>("CSCTrackProducer"))},
0012 putToken_{produces<std::vector<L1MuRegionalCand> >("CSC")},
0013 my_builder{pset.getParameter<edm::ParameterSet>("MuonSorter")} {}
0014
0015 void CSCTFCandidateProducer::produce(edm::StreamID, edm::Event& e, const edm::EventSetup& c) const {
0016 edm::Handle<L1CSCTrackCollection> tracks;
0017 std::vector<L1MuRegionalCand> cand_product;
0018
0019 e.getByToken(input_module, tracks);
0020
0021 my_builder.buildCandidates(tracks.product(), &cand_product);
0022
0023 e.emplace(putToken_, std::move(cand_product));
0024 }