00001 #include "RecoMuon/TrackerSeedGenerator/plugins/TSGSmart.h" 00002 00003 #include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h" 00004 #include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGeneratorFactory.h" 00005 #include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGenerator.h" 00006 #include "RecoTracker/TkSeedGenerator/interface/SeedGeneratorFromRegionHits.h" 00007 00008 00009 TSGSmart::TSGSmart(const edm::ParameterSet &pset) 00010 : theConfig(pset), thePairGenerator(0), theTripletGenerator(0), theMixedGenerator(0) 00011 { 00012 00013 theEtaBound = theConfig.getParameter<double>("EtaBound"); 00014 00015 edm::ParameterSet PairPSet = theConfig.getParameter<edm::ParameterSet>("PixelPairGeneratorSet"); 00016 edm::ParameterSet pairhitsfactoryPSet = 00017 PairPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet"); 00018 std::string pairhitsfactoryName = pairhitsfactoryPSet.getParameter<std::string>("ComponentName"); 00019 OrderedHitsGenerator* pairhitsGenerator = 00020 OrderedHitsGeneratorFactory::get()->create( pairhitsfactoryName, pairhitsfactoryPSet); 00021 thePairGenerator = new SeedGeneratorFromRegionHits( pairhitsGenerator, PairPSet); 00022 00023 edm::ParameterSet TripletPSet = theConfig.getParameter<edm::ParameterSet>("PixelTripletGeneratorSet"); 00024 edm::ParameterSet triplethitsfactoryPSet = 00025 TripletPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet"); 00026 std::string triplethitsfactoryName = triplethitsfactoryPSet.getParameter<std::string>("ComponentName"); 00027 OrderedHitsGenerator* triplethitsGenerator = 00028 OrderedHitsGeneratorFactory::get()->create( triplethitsfactoryName, triplethitsfactoryPSet); 00029 theTripletGenerator = new SeedGeneratorFromRegionHits( triplethitsGenerator, TripletPSet); 00030 00031 edm::ParameterSet MixedPSet = theConfig.getParameter<edm::ParameterSet>("MixedGeneratorSet"); 00032 edm::ParameterSet mixedhitsfactoryPSet = 00033 MixedPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet"); 00034 std::string mixedhitsfactoryName = mixedhitsfactoryPSet.getParameter<std::string>("ComponentName"); 00035 OrderedHitsGenerator* mixedhitsGenerator = 00036 OrderedHitsGeneratorFactory::get()->create( mixedhitsfactoryName, mixedhitsfactoryPSet); 00037 theMixedGenerator = new SeedGeneratorFromRegionHits( mixedhitsGenerator, MixedPSet); 00038 00039 00040 } 00041 00042 TSGSmart::~TSGSmart() 00043 { 00044 delete thePairGenerator; 00045 delete theTripletGenerator; 00046 delete theMixedGenerator; 00047 } 00048 00049 void TSGSmart::run(TrajectorySeedCollection &seeds, 00050 const edm::Event &ev, const edm::EventSetup &es, const TrackingRegion& region) 00051 { 00052 if( fabs(region.direction().eta()) > theEtaBound ) { 00053 theMixedGenerator->run(seeds, region, ev, es); 00054 } else { 00055 theTripletGenerator->run(seeds, region, ev, es); 00056 if(seeds.size() < 1) thePairGenerator->run(seeds, region, ev, es); 00057 } 00058 }