CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/RecoTracker/ConversionSeedGenerators/plugins/PhotonConversionTrajectorySeedProducerFromQuadruplets.cc

Go to the documentation of this file.
00001 #include "FWCore/Framework/interface/EDProducer.h"
00002 #include "FWCore/Utilities/interface/InputTag.h"
00003 #include "FWCore/Utilities/interface/Exception.h"
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 
00006 #include "FWCore/Framework/interface/Event.h"
00007 #include "DataFormats/Common/interface/Handle.h"
00008 #include "FWCore/Framework/interface/EventSetup.h"
00009 #include "FWCore/Framework/interface/ESHandle.h"
00010 
00011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00012 #include "RecoTracker/ConversionSeedGenerators/interface/PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo.h"
00013 
00014 
00015 class PhotonConversionTrajectorySeedProducerFromQuadruplets : public edm::EDProducer {
00016 public:
00017   PhotonConversionTrajectorySeedProducerFromQuadruplets(const edm::ParameterSet& );
00018   ~PhotonConversionTrajectorySeedProducerFromQuadruplets(){}
00019   void beginRun(edm::Run &run, const edm::EventSetup& es);
00020   void endRun(edm::Run &run, const edm::EventSetup& es);
00021   void produce(edm::Event& , const edm::EventSetup& );
00022 
00023 private:
00024   edm::ParameterSet _conf;
00025   std::string _newSeedCandidates;
00026   PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo *_theFinder;
00027 };
00028 
00029 
00030 PhotonConversionTrajectorySeedProducerFromQuadruplets::
00031 PhotonConversionTrajectorySeedProducerFromQuadruplets(const edm::ParameterSet& conf)
00032   : _conf(conf),
00033     _newSeedCandidates(conf.getParameter<std::string>( "newSeedCandidates"))
00034 {
00035   _theFinder = new PhotonConversionTrajectorySeedProducerFromQuadrupletsAlgo(conf);
00036   produces<TrajectorySeedCollection>(_newSeedCandidates);
00037 
00038 }
00039 
00040 
00041 void PhotonConversionTrajectorySeedProducerFromQuadruplets::
00042 endRun(edm::Run &run, const edm::EventSetup& es) {
00043   _theFinder->clear();
00044 }
00045 
00046 void PhotonConversionTrajectorySeedProducerFromQuadruplets::
00047 beginRun(edm::Run &run, const edm::EventSetup& es)
00048 {
00049   _theFinder->init();
00050 }
00051 
00052 
00053 void PhotonConversionTrajectorySeedProducerFromQuadruplets::produce(edm::Event& ev, const edm::EventSetup& es)
00054 {
00055   std::auto_ptr<TrajectorySeedCollection> result( new TrajectorySeedCollection() );  
00056   try{
00057     _theFinder->analyze(ev,es);
00058     if(_theFinder->getTrajectorySeedCollection()->size())
00059       result->insert(result->end(),
00060                      _theFinder->getTrajectorySeedCollection()->begin(),
00061                      _theFinder->getTrajectorySeedCollection()->end());
00062   }catch(cms::Exception& er){
00063     edm::LogError("SeedingConversion") << " Problem in the Single Leg Conversion Seed Producer " <<er.what()<<std::endl;
00064   }catch(std::exception& er){
00065     edm::LogError("SeedingConversion") << " Problem in the Single Leg Conversion Seed Producer " << er.what()<<std::endl;
00066   }
00067 
00068   
00069   edm::LogInfo("debugTrajSeedFromQuadruplets") << " TrajectorySeedCollection size " << result->size();
00070   ev.put(result, _newSeedCandidates);  
00071 }
00072 
00073 #include "FWCore/Framework/interface/MakerMacros.h"
00074 DEFINE_FWK_MODULE(PhotonConversionTrajectorySeedProducerFromQuadruplets);