CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/RecoTracker/RoadSearchCloudCleaner/src/RoadSearchCloudCleaner.cc

Go to the documentation of this file.
00001 //
00002 // Package:         RecoTracker/RoadSearchCloudCleaner
00003 // Class:           RoadSearchCloudCleaner
00004 // 
00005 // Description:     Calls RoadSeachCloudCleanerAlgorithm
00006 //                  to find RoadSearchClouds.
00007 //
00008 // Original Author: Steve Wagner, stevew@pizero.colorado.edu
00009 // Created:         Sat Feb 19 22:00:00 UTC 2006
00010 //
00011 // $Author: gutsche $
00012 // $Date: 2007/03/07 22:00:09 $
00013 // $Revision: 1.2 $
00014 //
00015 
00016 #include <memory>
00017 #include <string>
00018 
00019 #include "RecoTracker/RoadSearchCloudCleaner/interface/RoadSearchCloudCleaner.h"
00020 
00021 #include "DataFormats/RoadSearchCloud/interface/RoadSearchCloudCollection.h"
00022 
00023 #include "DataFormats/Common/interface/Handle.h"
00024 #include "FWCore/Framework/interface/ESHandle.h"
00025 #include "FWCore/Framework/interface/EventSetup.h"
00026 
00027 namespace cms
00028 {
00029 
00030   RoadSearchCloudCleaner::RoadSearchCloudCleaner(edm::ParameterSet const& conf) : 
00031     roadSearchCloudCleanerAlgorithm_(conf) ,
00032     conf_(conf)
00033   {
00034     produces<RoadSearchCloudCollection>();
00035   }
00036 
00037 
00038   // Virtual destructor needed.
00039   RoadSearchCloudCleaner::~RoadSearchCloudCleaner() { }  
00040 
00041   // Functions that gets called by framework every event
00042   void RoadSearchCloudCleaner::produce(edm::Event& e, const edm::EventSetup& es)
00043   {
00044     // Step A: Get Inputs 
00045 
00046     // retrieve producer name of raw CloudCollection
00047     std::string rawcloudProducer = conf_.getParameter<std::string>("RawCloudProducer");
00048     edm::Handle<RoadSearchCloudCollection> rawclouds;
00049     e.getByLabel(rawcloudProducer, rawclouds);
00050 
00051     // Step B: create empty output collection
00052     std::auto_ptr<RoadSearchCloudCollection> output(new RoadSearchCloudCollection);
00053 
00054     // Step C: Invoke the cloud cleaning algorithm
00055     roadSearchCloudCleanerAlgorithm_.run(rawclouds.product(),es,*output);
00056 
00057     // Step D: write output to file
00058     e.put(output);
00059 
00060   }
00061 
00062 }