CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TSGSmart.cc
Go to the documentation of this file.
2 
8 
9 
11  : theConfig(pset), thePairGenerator(0), theTripletGenerator(0), theMixedGenerator(0)
12 {
13 
14  theEtaBound = theConfig.getParameter<double>("EtaBound");
15 
16  // FIXME??
17  edm::ParameterSet creatorPSet;
18  creatorPSet.addParameter<std::string>("propagator","PropagatorWithMaterial");
19 
20  edm::ParameterSet PairPSet = theConfig.getParameter<edm::ParameterSet>("PixelPairGeneratorSet");
21  edm::ParameterSet pairhitsfactoryPSet =
22  PairPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
23  std::string pairhitsfactoryName = pairhitsfactoryPSet.getParameter<std::string>("ComponentName");
24  OrderedHitsGenerator* pairhitsGenerator =
25  OrderedHitsGeneratorFactory::get()->create( pairhitsfactoryName, pairhitsfactoryPSet, iC);
26 
27 
28  thePairGenerator = new SeedGeneratorFromRegionHits( pairhitsGenerator, 0,
29  SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet)
30  );
31 
32  edm::ParameterSet TripletPSet = theConfig.getParameter<edm::ParameterSet>("PixelTripletGeneratorSet");
33  edm::ParameterSet triplethitsfactoryPSet =
34  TripletPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
35  std::string triplethitsfactoryName = triplethitsfactoryPSet.getParameter<std::string>("ComponentName");
36  OrderedHitsGenerator* triplethitsGenerator =
37  OrderedHitsGeneratorFactory::get()->create( triplethitsfactoryName, triplethitsfactoryPSet, iC);
38  theTripletGenerator = new SeedGeneratorFromRegionHits( triplethitsGenerator, 0,
39  SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet)
40  );
41 
42  edm::ParameterSet MixedPSet = theConfig.getParameter<edm::ParameterSet>("MixedGeneratorSet");
43  edm::ParameterSet mixedhitsfactoryPSet =
44  MixedPSet.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
45  std::string mixedhitsfactoryName = mixedhitsfactoryPSet.getParameter<std::string>("ComponentName");
46  OrderedHitsGenerator* mixedhitsGenerator =
47  OrderedHitsGeneratorFactory::get()->create( mixedhitsfactoryName, mixedhitsfactoryPSet, iC);
48  theMixedGenerator = new SeedGeneratorFromRegionHits( mixedhitsGenerator, 0,
49  SeedCreatorFactory::get()->create("SeedFromConsecutiveHitsCreator", creatorPSet)
50  );
51 
52 
53 }
54 
56 {
57  delete thePairGenerator;
58  delete theTripletGenerator;
59  delete theMixedGenerator;
60 }
61 
63  const edm::Event &ev, const edm::EventSetup &es, const TrackingRegion& region)
64 {
65  if( fabs(region.direction().eta()) > theEtaBound ) {
66  theMixedGenerator->run(seeds, region, ev, es);
67  } else {
68  theTripletGenerator->run(seeds, region, ev, es);
69  if(seeds.size() < 1) thePairGenerator->run(seeds, region, ev, es);
70  }
71 }
T getParameter(std::string const &) const
TSGSmart(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
Definition: TSGSmart.cc:10
bool ev
GlobalVector const & direction() const
the direction around which region is constructed
double theEtaBound
Definition: TSGSmart.h:28
SeedGeneratorFromRegionHits * theTripletGenerator
Definition: TSGSmart.h:25
std::vector< TrajectorySeed > TrajectorySeedCollection
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:144
SeedGeneratorFromRegionHits * theMixedGenerator
Definition: TSGSmart.h:26
edm::ParameterSet theConfig
Definition: TSGSmart.h:23
virtual void run(TrajectorySeedCollection &seeds, const edm::Event &ev, const edm::EventSetup &es, const TrackingRegion &region)
Definition: TSGSmart.cc:62
void run(TrajectorySeedCollection &seedCollection, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
T eta() const
Definition: PV3DBase.h:76
virtual ~TSGSmart()
Definition: TSGSmart.cc:55
SeedGeneratorFromRegionHits * thePairGenerator
Definition: TSGSmart.h:24
T get(const Candidate &c)
Definition: component.h:55