Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-09 23:34:00

0001 #include "RecoMuon/TrackerSeedGenerator/plugins/TSGSmart.h"
0002 
0003 #include "FWCore/Framework/interface/ConsumesCollector.h"
0004 #include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h"
0005 #include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGeneratorFactory.h"
0006 #include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGenerator.h"
0007 #include "RecoTracker/TkSeedGenerator/interface/SeedGeneratorFromRegionHits.h"
0008 #include "RecoTracker/TkSeedGenerator/interface/SeedCreatorFactory.h"
0009 
0010 TSGSmart::TSGSmart(const edm::ParameterSet &pset, edm::ConsumesCollector &iC) {
0011   theEtaBound = pset.getParameter<double>("EtaBound");
0012 
0013   // FIXME??
0014   edm::ParameterSet creatorPSet;
0015   creatorPSet.addParameter<std::string>("propagator", "PropagatorWithMaterial");
0016 
0017   edm::ParameterSet PairPSet = pset.getParameter<edm::ParameterSet>("PixelPairGeneratorSet");
0018   edm::ParameterSet pairhitsfactoryPSet = PairPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
0019   std::string pairhitsfactoryName = pairhitsfactoryPSet.getParameter<std::string>("ComponentName");
0020 
0021   thePairGenerator = std::make_unique<SeedGeneratorFromRegionHits>(
0022       OrderedHitsGeneratorFactory::get()->create(pairhitsfactoryName, pairhitsfactoryPSet, iC),
0023       nullptr,
0024       SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet, edm::ConsumesCollector(iC)));
0025 
0026   edm::ParameterSet TripletPSet = pset.getParameter<edm::ParameterSet>("PixelTripletGeneratorSet");
0027   edm::ParameterSet triplethitsfactoryPSet = TripletPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
0028   std::string triplethitsfactoryName = triplethitsfactoryPSet.getParameter<std::string>("ComponentName");
0029 
0030   theTripletGenerator = std::make_unique<SeedGeneratorFromRegionHits>(
0031       OrderedHitsGeneratorFactory::get()->create(triplethitsfactoryName, triplethitsfactoryPSet, iC),
0032       nullptr,
0033       SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet, edm::ConsumesCollector(iC)));
0034 
0035   edm::ParameterSet MixedPSet = pset.getParameter<edm::ParameterSet>("MixedGeneratorSet");
0036   edm::ParameterSet mixedhitsfactoryPSet = MixedPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
0037   std::string mixedhitsfactoryName = mixedhitsfactoryPSet.getParameter<std::string>("ComponentName");
0038 
0039   theMixedGenerator = std::make_unique<SeedGeneratorFromRegionHits>(
0040       OrderedHitsGeneratorFactory::get()->create(mixedhitsfactoryName, mixedhitsfactoryPSet, iC),
0041       nullptr,
0042       SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet, edm::ConsumesCollector(iC)));
0043 }
0044 
0045 TSGSmart::~TSGSmart() = default;
0046 
0047 void TSGSmart::run(TrajectorySeedCollection &seeds,
0048                    const edm::Event &ev,
0049                    const edm::EventSetup &es,
0050                    const TrackingRegion &region) {
0051   if (fabs(region.direction().eta()) > theEtaBound) {
0052     theMixedGenerator->run(seeds, region, ev, es);
0053   } else {
0054     theTripletGenerator->run(seeds, region, ev, es);
0055     if (seeds.empty())
0056       thePairGenerator->run(seeds, region, ev, es);
0057   }
0058 }
0059 
0060 #include "FWCore/Framework/interface/MakerMacros.h"
0061 #include "RecoMuon/TrackerSeedGenerator/interface/TrackerSeedGeneratorFactory.h"
0062 DEFINE_EDM_PLUGIN(TrackerSeedGeneratorFactory, TSGSmart, "TSGSmart");