CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoTracker/TkSeedingLayers/src/HitExtractorPIX.cc

Go to the documentation of this file.
00001 #include "HitExtractorPIX.h"
00002 #include "Geometry/TrackerGeometryBuilder/interface/TrackerLayerIdAccessor.h"
00003 #include "TrackingTools/DetLayers/interface/DetLayer.h"
00004 
00005 #include "DataFormats/Common/interface/Handle.h"
00006 #include "FWCore/Framework/interface/Event.h"
00007 
00008 #include "FWCore/Framework/interface/EventSetup.h"
00009 #include "FWCore/Framework/interface/ESHandle.h"
00010 
00011 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
00012 
00013 using namespace ctfseeding;
00014 using namespace std;
00015 
00016 HitExtractorPIX::HitExtractorPIX(
00017     SeedingLayer::Side & side, int idLayer, const std::string & hitProducer)
00018   : theSide(side), theIdLayer(idLayer), theHitProducer(hitProducer)
00019 { }
00020 
00021 HitExtractor::Hits HitExtractorPIX::hits(const SeedingLayer & sl,const edm::Event& ev, const edm::EventSetup& es) const
00022 {
00023   TrackerLayerIdAccessor accessor;
00024   HitExtractor::Hits result;
00025   edm::Handle<SiPixelRecHitCollection> pixelHits;
00026   ev.getByLabel( theHitProducer, pixelHits);
00027   if (theSide==SeedingLayer::Barrel) {
00028     range2SeedingHits( *pixelHits, result, accessor.pixelBarrelLayer(theIdLayer), sl, es );
00029   } else {
00030     range2SeedingHits( *pixelHits, result, accessor.pixelForwardDisk(theSide,theIdLayer), sl, es );
00031   }
00032   return result;
00033 }