00001 // 00002 // Package: RecoTracker/RoadSearchTrackCandidateMaker 00003 // Class: RoadSearchTrackCandidateMaker 00004 // 00005 // Description: Calls RoadSeachTrackCandidateMakerAlgorithm 00006 // to convert cleaned clouds into 00007 // TrackCandidates using the 00008 // TrajectoryBuilder framework 00009 // 00010 // Original Author: Oliver Gutsche, gutsche@fnal.gov 00011 // Created: Wed Mar 15 13:00:00 UTC 2006 00012 // 00013 // $Author: gutsche $ 00014 // $Date: 2007/07/08 20:32:40 $ 00015 // $Revision: 1.5 $ 00016 // 00017 00018 #include <memory> 00019 #include <string> 00020 00021 #include "RecoTracker/RoadSearchTrackCandidateMaker/interface/RoadSearchTrackCandidateMaker.h" 00022 00023 #include "DataFormats/RoadSearchCloud/interface/RoadSearchCloudCollection.h" 00024 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h" 00025 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" 00026 00027 #include "DataFormats/Common/interface/Handle.h" 00028 #include "FWCore/Framework/interface/ESHandle.h" 00029 #include "FWCore/Framework/interface/EventSetup.h" 00030 00031 RoadSearchTrackCandidateMaker::RoadSearchTrackCandidateMaker(edm::ParameterSet const& conf) : 00032 roadSearchTrackCandidateMakerAlgorithm_(conf) , 00033 conf_(conf) 00034 { 00035 produces<TrackCandidateCollection>(); 00036 00037 cloudProducer_ = conf_.getParameter<edm::InputTag>("CloudProducer"); 00038 00039 } 00040 00041 00042 // Virtual destructor needed. 00043 RoadSearchTrackCandidateMaker::~RoadSearchTrackCandidateMaker() { } 00044 00045 // Functions that gets called by framework every event 00046 void RoadSearchTrackCandidateMaker::produce(edm::Event& e, const edm::EventSetup& es) 00047 { 00048 // Step A: Get Inputs 00049 00050 00051 // retrieve producer name of raw CloudCollection 00052 edm::Handle<RoadSearchCloudCollection> cloudHandle; 00053 e.getByLabel(cloudProducer_, cloudHandle); 00054 const RoadSearchCloudCollection *clouds = cloudHandle.product(); 00055 00056 // Step B: create empty output collection 00057 std::auto_ptr<TrackCandidateCollection> output(new TrackCandidateCollection); 00058 00059 // Step C: Invoke the cloud cleaning algorithm 00060 roadSearchTrackCandidateMakerAlgorithm_.run(clouds,e,es,*output); 00061 00062 // Step D: write output to file 00063 e.put(output); 00064 00065 }