CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/L1Trigger/CSCTrackFinder/plugins/CSCTFCandidateProducer.cc

Go to the documentation of this file.
00001 #include "CSCTFCandidateProducer.h"
00002 #include "L1Trigger/CSCTrackFinder/src/CSCTFCandidateBuilder.h"
00003 
00004 #include <vector>
00005 #include "DataFormats/L1CSCTrackFinder/interface/L1CSCTrackCollection.h"
00006 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
00007 
00008 #include "DataFormats/Common/interface/Handle.h"
00009 #include "FWCore/Framework/interface/Event.h"
00010 
00011 CSCTFCandidateProducer::CSCTFCandidateProducer(const edm::ParameterSet& pset)
00012 {
00013   edm::ParameterSet mu_sorter_pset = pset.getParameter<edm::ParameterSet>("MuonSorter");
00014   my_builder = new CSCTFCandidateBuilder(mu_sorter_pset);
00015   input_module = pset.getUntrackedParameter<edm::InputTag>("CSCTrackProducer");
00016   produces<std::vector<L1MuRegionalCand> >("CSC");
00017 }
00018 
00019 CSCTFCandidateProducer::~CSCTFCandidateProducer()
00020 {
00021   delete my_builder;
00022   my_builder = NULL;
00023 }
00024 
00025 void CSCTFCandidateProducer::produce(edm::Event & e, const edm::EventSetup& c)
00026 {
00027   edm::Handle<L1CSCTrackCollection> tracks;
00028   std::auto_ptr<std::vector<L1MuRegionalCand> > cand_product(new std::vector<L1MuRegionalCand>);
00029 
00030   e.getByLabel(input_module.label(),input_module.instance(), tracks);
00031 
00032   my_builder->buildCandidates(tracks.product(), cand_product.get());
00033 
00034   e.put(cand_product,"CSC");
00035 }