00001 // 00002 // Package: RecoTracker/TkSeedGenerator 00003 // Class: GlobalPixelLessSeedGenerator 00004 // 00005 00006 #include <iostream> 00007 #include <memory> 00008 #include <string> 00009 00010 #include "RecoTracker/SpecialSeedGenerators/interface/CRackSeedGenerator.h" 00011 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h" 00012 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" 00013 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00014 #include "FWCore/Utilities/interface/InputTag.h" 00015 00016 using namespace std; 00017 CRackSeedGenerator::CRackSeedGenerator(edm::ParameterSet const& conf) : 00018 conf_(conf) ,cosmic_seed(conf) 00019 { 00020 edm::LogInfo ("CRackSeedGenerator")<<"Enter the CRackSeedGenerator"; 00021 produces<TrajectorySeedCollection>(); 00022 } 00023 00024 00025 // Virtual destructor needed. 00026 CRackSeedGenerator::~CRackSeedGenerator() { } 00027 00028 // Functions that gets called by framework every event 00029 void CRackSeedGenerator::produce(edm::Event& ev, const edm::EventSetup& es) 00030 { 00031 // get Inputs 00032 edm::InputTag matchedrecHitsTag = conf_.getParameter<edm::InputTag>("matchedRecHits"); 00033 edm::InputTag rphirecHitsTag = conf_.getParameter<edm::InputTag>("rphirecHits"); 00034 edm::InputTag stereorecHitsTag = conf_.getParameter<edm::InputTag>("stereorecHits"); 00035 00036 edm::Handle<SiStripRecHit2DCollection> rphirecHits; 00037 ev.getByLabel( rphirecHitsTag, rphirecHits ); 00038 edm::Handle<SiStripRecHit2DCollection> stereorecHits; 00039 ev.getByLabel( stereorecHitsTag ,stereorecHits ); 00040 edm::Handle<SiStripMatchedRecHit2DCollection> matchedrecHits; 00041 ev.getByLabel( matchedrecHitsTag ,matchedrecHits ); 00042 00043 00044 std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection); 00045 // 00046 00047 cosmic_seed.init(*stereorecHits,*rphirecHits,*matchedrecHits, es); 00048 00049 // invoke the seed finding algorithm 00050 cosmic_seed.run(*output,es); 00051 00052 // write output to file 00053 LogDebug("CRackSeedGenerator")<<" number of seeds = "<< output->size(); 00054 00055 00056 ev.put(output); 00057 }