CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/RecoMuon/TrackerSeedGenerator/plugins/TSGSmart.cc

Go to the documentation of this file.
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 #include "RecoTracker/TkSeedGenerator/interface/SeedCreatorFactory.h"
00008 
00009 
00010 TSGSmart::TSGSmart(const edm::ParameterSet &pset)
00011   : theConfig(pset), thePairGenerator(0), theTripletGenerator(0), theMixedGenerator(0)
00012 {
00013 
00014   theEtaBound = theConfig.getParameter<double>("EtaBound");
00015 
00016   // FIXME??
00017   edm::ParameterSet creatorPSet;
00018   creatorPSet.addParameter<std::string>("propagator","PropagatorWithMaterial");
00019 
00020   edm::ParameterSet PairPSet = theConfig.getParameter<edm::ParameterSet>("PixelPairGeneratorSet"); 
00021   edm::ParameterSet pairhitsfactoryPSet =
00022     PairPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
00023   std::string pairhitsfactoryName = pairhitsfactoryPSet.getParameter<std::string>("ComponentName");
00024   OrderedHitsGenerator*  pairhitsGenerator =
00025     OrderedHitsGeneratorFactory::get()->create( pairhitsfactoryName, pairhitsfactoryPSet);
00026 
00027 
00028   thePairGenerator = new SeedGeneratorFromRegionHits( pairhitsGenerator, 0, 
00029                                                  SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet)
00030                                                  );
00031 
00032   edm::ParameterSet TripletPSet = theConfig.getParameter<edm::ParameterSet>("PixelTripletGeneratorSet"); 
00033   edm::ParameterSet triplethitsfactoryPSet =
00034     TripletPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
00035   std::string triplethitsfactoryName = triplethitsfactoryPSet.getParameter<std::string>("ComponentName");
00036   OrderedHitsGenerator*  triplethitsGenerator =
00037     OrderedHitsGeneratorFactory::get()->create( triplethitsfactoryName, triplethitsfactoryPSet);
00038   theTripletGenerator = new SeedGeneratorFromRegionHits( triplethitsGenerator, 0, 
00039                                                  SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet)
00040                                                  );
00041 
00042   edm::ParameterSet MixedPSet = theConfig.getParameter<edm::ParameterSet>("MixedGeneratorSet"); 
00043   edm::ParameterSet mixedhitsfactoryPSet =
00044     MixedPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
00045   std::string mixedhitsfactoryName = mixedhitsfactoryPSet.getParameter<std::string>("ComponentName");
00046   OrderedHitsGenerator*  mixedhitsGenerator =
00047     OrderedHitsGeneratorFactory::get()->create( mixedhitsfactoryName, mixedhitsfactoryPSet);
00048   theMixedGenerator = new SeedGeneratorFromRegionHits( mixedhitsGenerator, 0, 
00049                                                  SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet)
00050                                                  );
00051   
00052  
00053 }
00054 
00055 TSGSmart::~TSGSmart()
00056 {
00057   delete thePairGenerator; 
00058   delete theTripletGenerator; 
00059   delete theMixedGenerator; 
00060 }
00061 
00062 void TSGSmart::run(TrajectorySeedCollection &seeds, 
00063       const edm::Event &ev, const edm::EventSetup &es, const TrackingRegion& region)
00064 {
00065   if( fabs(region.direction().eta()) >  theEtaBound ) {
00066     theMixedGenerator->run(seeds, region, ev, es);
00067   } else {
00068     theTripletGenerator->run(seeds, region, ev, es);
00069     if(seeds.size() < 1) thePairGenerator->run(seeds, region, ev, es);
00070   }
00071 }