CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoTracker/SpecialSeedGenerators/src/CRackSeedGenerator.cc

Go to the documentation of this file.
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 "DataFormats/Common/interface/Handle.h"
00014 #include "FWCore/Framework/interface/ESHandle.h"
00015 #include "FWCore/Framework/interface/EventSetup.h"
00016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00017 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00018 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00019 #include "FWCore/Utilities/interface/InputTag.h"
00020 
00021 using namespace std;
00022 CRackSeedGenerator::CRackSeedGenerator(edm::ParameterSet const& conf) : 
00023   conf_(conf) ,cosmic_seed(conf)
00024  {
00025   edm::LogInfo ("CRackSeedGenerator")<<"Enter the CRackSeedGenerator";
00026   produces<TrajectorySeedCollection>();
00027 }
00028 
00029 
00030 // Virtual destructor needed.
00031 CRackSeedGenerator::~CRackSeedGenerator() { }  
00032 
00033 // Functions that gets called by framework every event
00034 void CRackSeedGenerator::produce(edm::Event& ev, const edm::EventSetup& es)
00035 {
00036   // get Inputs
00037   edm::InputTag matchedrecHitsTag = conf_.getParameter<edm::InputTag>("matchedRecHits");
00038   edm::InputTag rphirecHitsTag = conf_.getParameter<edm::InputTag>("rphirecHits");
00039   edm::InputTag stereorecHitsTag = conf_.getParameter<edm::InputTag>("stereorecHits");
00040 
00041   edm::Handle<SiStripRecHit2DCollection> rphirecHits;
00042   ev.getByLabel( rphirecHitsTag, rphirecHits );
00043   edm::Handle<SiStripRecHit2DCollection> stereorecHits;
00044   ev.getByLabel( stereorecHitsTag ,stereorecHits );
00045   edm::Handle<SiStripMatchedRecHit2DCollection> matchedrecHits;          
00046   ev.getByLabel( matchedrecHitsTag ,matchedrecHits );
00047  
00048 
00049   std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection);
00050   //
00051  
00052   cosmic_seed.init(*stereorecHits,*rphirecHits,*matchedrecHits, es);
00053  
00054   // invoke the seed finding algorithm
00055   cosmic_seed.run(*output,es);
00056 
00057   // write output to file
00058   LogDebug("CRackSeedGenerator")<<" number of seeds = "<< output->size();
00059 
00060 
00061   ev.put(output);
00062 }