CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
PixelTrackReconstruction Class Reference

#include <PixelTrackReconstruction.h>

Public Member Functions

void halt ()
 
void init (const edm::EventSetup &es)
 
 PixelTrackReconstruction (const edm::ParameterSet &conf)
 
void run (pixeltrackfitting::TracksWithTTRHs &tah, edm::Event &ev, const edm::EventSetup &es)
 
 ~PixelTrackReconstruction ()
 

Private Attributes

PixelTrackCleanertheCleaner
 
edm::ParameterSet theConfig
 
PixelTrackFiltertheFilter
 
const PixelFittertheFitter
 
OrderedHitsGeneratortheGenerator
 
TrackingRegionProducertheRegionProducer
 

Detailed Description

Definition at line 14 of file PixelTrackReconstruction.h.

Constructor & Destructor Documentation

PixelTrackReconstruction::PixelTrackReconstruction ( const edm::ParameterSet conf)

Definition at line 34 of file PixelTrackReconstruction.cc.

36 { }
OrderedHitsGenerator * theGenerator
TrackingRegionProducer * theRegionProducer
PixelTrackReconstruction::~PixelTrackReconstruction ( )

Definition at line 38 of file PixelTrackReconstruction.cc.

References halt().

39 {
40  halt();
41 }

Member Function Documentation

void PixelTrackReconstruction::halt ( )

Definition at line 43 of file PixelTrackReconstruction.cc.

References theCleaner, theFilter, theFitter, theGenerator, and theRegionProducer.

Referenced by PixelTrackProducer::endRun(), and ~PixelTrackReconstruction().

44 {
45  delete theFilter; theFilter=0;
46  delete theFitter; theFitter=0;
47  delete theCleaner; theCleaner=0;
48  delete theGenerator; theGenerator=0;
50 }
OrderedHitsGenerator * theGenerator
TrackingRegionProducer * theRegionProducer
void PixelTrackReconstruction::init ( const edm::EventSetup es)

Definition at line 52 of file PixelTrackReconstruction.cc.

References reco_skim_cfg_mod::filterName, reco::get(), edm::ParameterSet::getParameter(), theCleaner, theConfig, theFilter, theFitter, theGenerator, and theRegionProducer.

Referenced by PixelTrackProducer::beginRun().

53 {
54  ParameterSet regfactoryPSet = theConfig.getParameter<ParameterSet>("RegionFactoryPSet");
55  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
56  theRegionProducer = TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet);
57 
58  ParameterSet orderedPSet =
59  theConfig.getParameter<ParameterSet>("OrderedHitsFactoryPSet");
60  std::string orderedName = orderedPSet.getParameter<std::string>("ComponentName");
61  theGenerator = OrderedHitsGeneratorFactory::get()->create( orderedName, orderedPSet);
62 
63  ParameterSet fitterPSet = theConfig.getParameter<ParameterSet>("FitterPSet");
64  std::string fitterName = fitterPSet.getParameter<std::string>("ComponentName");
65  theFitter = PixelFitterFactory::get()->create( fitterName, fitterPSet);
66 
67  ParameterSet filterPSet = theConfig.getParameter<ParameterSet>("FilterPSet");
68  std::string filterName = filterPSet.getParameter<std::string>("ComponentName");
69  if (filterName != "none") {
70  theFilter = theConfig.getParameter<bool>("useFilterWithES") ?
71  PixelTrackFilterWithESFactory::get()->create( filterName, filterPSet, es) :
72  PixelTrackFilterFactory::get()->create( filterName, filterPSet);
73  }
74 
75  ParameterSet cleanerPSet = theConfig.getParameter<ParameterSet>("CleanerPSet");
76  std::string cleanerName = cleanerPSet.getParameter<std::string>("ComponentName");
77  if (cleanerName != "none") theCleaner = PixelTrackCleanerFactory::get()->create( cleanerName, cleanerPSet);
78 
79 }
T getParameter(std::string const &) const
OrderedHitsGenerator * theGenerator
TrackingRegionProducer * theRegionProducer
T get(const Candidate &c)
Definition: component.h:56
void PixelTrackReconstruction::run ( pixeltrackfitting::TracksWithTTRHs tah,
edm::Event ev,
const edm::EventSetup es 
)

Definition at line 81 of file PixelTrackReconstruction.cc.

References PixelTrackCleanerWrapper::clean(), OrderedHitsGenerator::clear(), TrackingRegionProducer::regions(), OrderedHitsGenerator::run(), PixelFitter::run(), OrderedSeedingHits::size(), SeedingHitSet::size(), theCleaner, theFilter, theFitter, theGenerator, theRegionProducer, and PixelTrackFilter::update().

Referenced by PixelTrackProducer::produce().

82 {
83  typedef std::vector<TrackingRegion* > Regions;
84  typedef Regions::const_iterator IR;
85  Regions regions = theRegionProducer->regions(ev,es);
86 
87  if (theFilter) theFilter->update(ev);
88 
89  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) {
90  const TrackingRegion & region = **ir;
91 
92  const OrderedSeedingHits & triplets = theGenerator->run(region,ev,es);
93  unsigned int nTriplets = triplets.size();
94 
95  // producing tracks
96  for (unsigned int iTriplet = 0; iTriplet < nTriplets; ++iTriplet) {
97  const SeedingHitSet & triplet = triplets[iTriplet];
98 
99  std::vector<const TrackingRecHit *> hits;
100  for (unsigned int iHit = 0, nHits = triplet.size(); iHit < nHits; ++iHit) {
101  hits.push_back( triplet[iHit]->hit() );
102  }
103 
104  // fitting
105  reco::Track* track = theFitter->run( ev, es, hits, region);
106  if (!track) continue;
107 
108  // decide if track should be skipped according to filter
109  if (theFilter && !(*theFilter)(track, hits) ) {
110  delete track;
111  continue;
112  }
113 
114  // add tracks
115  tracks.push_back(TrackWithTTRHs(track, triplet));
116  }
117  theGenerator->clear();
118  }
119 
120  // skip ovelrapped tracks
122 
123  // clean memory
124  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) delete (*ir);
125 }
std::pair< reco::Track *, SeedingHitSet > TrackWithTTRHs
virtual reco::Track * run(const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
Definition: PixelFitter.h:17
virtual unsigned int size() const =0
OrderedHitsGenerator * theGenerator
TrackingRegionProducer * theRegionProducer
pixeltrackfitting::TracksWithTTRHs clean(const pixeltrackfitting::TracksWithTTRHs &initialT_TTRHs)
virtual const OrderedSeedingHits & run(const TrackingRegion &reg, const edm::Event &ev, const edm::EventSetup &es)=0
virtual void update(edm::Event &ev)
tuple tracks
Definition: testEve_cfg.py:39
unsigned int size() const
Definition: SeedingHitSet.h:31
virtual std::vector< TrackingRegion * > regions(const edm::Event &ev, const edm::EventSetup &es) const =0

Member Data Documentation

PixelTrackCleaner* PixelTrackReconstruction::theCleaner
private

Definition at line 29 of file PixelTrackReconstruction.h.

Referenced by halt(), init(), and run().

edm::ParameterSet PixelTrackReconstruction::theConfig
private

Definition at line 26 of file PixelTrackReconstruction.h.

Referenced by init().

PixelTrackFilter* PixelTrackReconstruction::theFilter
private

Definition at line 28 of file PixelTrackReconstruction.h.

Referenced by halt(), init(), and run().

const PixelFitter* PixelTrackReconstruction::theFitter
private

Definition at line 27 of file PixelTrackReconstruction.h.

Referenced by halt(), init(), and run().

OrderedHitsGenerator* PixelTrackReconstruction::theGenerator
private

Definition at line 30 of file PixelTrackReconstruction.h.

Referenced by halt(), init(), and run().

TrackingRegionProducer* PixelTrackReconstruction::theRegionProducer
private

Definition at line 31 of file PixelTrackReconstruction.h.

Referenced by halt(), init(), and run().