CMS 3D CMS Logo

Public Member Functions | Private Attributes

PixelTrackReconstruction Class Reference

#include <PixelTrackReconstruction.h>

List of all members.

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
QuadrupletSeedMergertheMerger_
TrackingRegionProducertheRegionProducer

Detailed Description

Definition at line 17 of file PixelTrackReconstruction.h.


Constructor & Destructor Documentation

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

Definition at line 36 of file PixelTrackReconstruction.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theConfig, and theMerger_.

  : theConfig(cfg), theFitter(0), theFilter(0), theCleaner(0), theGenerator(0), theRegionProducer(0), theMerger_(0)
{
  if ( cfg.exists("SeedMergerPSet") ) {
    edm::ParameterSet mergerPSet = theConfig.getParameter<edm::ParameterSet>( "SeedMergerPSet" );
    std::string seedmergerTTRHBuilderLabel = mergerPSet.getParameter<std::string>( "ttrhBuilderLabel" );
    std::string seedmergerLayerListName = mergerPSet.getParameter<std::string>( "layerListName" );
    bool seedmergerAddTriplets = mergerPSet.getParameter<bool>( "addRemainingTriplets" );
    bool seedmergerMergeTriplets = mergerPSet.getParameter<bool>( "mergeTriplets" );
    theMerger_ = new QuadrupletSeedMerger();
    theMerger_->setMergeTriplets( seedmergerMergeTriplets );
    theMerger_->setAddRemainingTriplets( seedmergerAddTriplets );
    theMerger_->setTTRHBuilderLabel( seedmergerTTRHBuilderLabel );
    theMerger_->setLayerListName( seedmergerLayerListName );
  }
}
PixelTrackReconstruction::~PixelTrackReconstruction ( )

Definition at line 53 of file PixelTrackReconstruction.cc.

References halt().

{
  halt();
}

Member Function Documentation

void PixelTrackReconstruction::halt ( )
void PixelTrackReconstruction::init ( const edm::EventSetup es)

Definition at line 68 of file PixelTrackReconstruction.cc.

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

Referenced by PixelTrackProducer::beginRun().

{
  ParameterSet regfactoryPSet = theConfig.getParameter<ParameterSet>("RegionFactoryPSet");
  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
  theRegionProducer = TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet);

  ParameterSet orderedPSet =
      theConfig.getParameter<ParameterSet>("OrderedHitsFactoryPSet");
  std::string orderedName = orderedPSet.getParameter<std::string>("ComponentName");
  theGenerator = OrderedHitsGeneratorFactory::get()->create( orderedName, orderedPSet);

  ParameterSet fitterPSet = theConfig.getParameter<ParameterSet>("FitterPSet");
  std::string fitterName = fitterPSet.getParameter<std::string>("ComponentName");
  theFitter = PixelFitterFactory::get()->create( fitterName, fitterPSet);

  ParameterSet filterPSet = theConfig.getParameter<ParameterSet>("FilterPSet");
  std::string  filterName = filterPSet.getParameter<std::string>("ComponentName");
  if (filterName != "none") {
    theFilter = theConfig.getParameter<bool>("useFilterWithES") ?
      PixelTrackFilterWithESFactory::get()->create( filterName, filterPSet, es) :
      PixelTrackFilterFactory::get()->create( filterName, filterPSet);
  }

  ParameterSet cleanerPSet = theConfig.getParameter<ParameterSet>("CleanerPSet");
  std::string  cleanerName = cleanerPSet.getParameter<std::string>("ComponentName");
  if (cleanerName != "none") theCleaner = PixelTrackCleanerFactory::get()->create( cleanerName, cleanerPSet);

  if ( theMerger_ !=0 ) {
    theMerger_->update( es );
  }
}
void PixelTrackReconstruction::run ( pixeltrackfitting::TracksWithTTRHs tah,
edm::Event ev,
const edm::EventSetup es 
)

Definition at line 100 of file PixelTrackReconstruction.cc.

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

Referenced by PixelTrackProducer::produce().

{
  typedef std::vector<TrackingRegion* > Regions;
  typedef Regions::const_iterator IR;
  Regions regions = theRegionProducer->regions(ev,es);

  if (theFilter) theFilter->update(ev);

  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) {
    const TrackingRegion & region = **ir;

    const OrderedSeedingHits & triplets =  theGenerator->run(region,ev,es);
    const OrderedSeedingHits &tuplets= (theMerger_==0)? triplets : theMerger_->mergeTriplets( triplets, es );

    unsigned int nTuplets = tuplets.size();
    tracks.reserve(tracks.size()+nTuplets);
    // producing tracks
    for (unsigned int iTuplet = 0; iTuplet < nTuplets; ++iTuplet) {
      const SeedingHitSet & tuplet = tuplets[iTuplet];

      std::vector<const TrackingRecHit *> hits;
      for (unsigned int iHit = 0, nHits = tuplet.size(); iHit < nHits; ++iHit) {
        hits.push_back( tuplet[iHit]->hit() );
      }

      // fitting
      reco::Track* track = theFitter->run( ev, es, hits, region);
      if (!track) continue;

      // decide if track should be skipped according to filter
      if (theFilter && !(*theFilter)(track, hits) ) {
        delete track;
        continue;
      }

      // add tracks
      tracks.push_back(TrackWithTTRHs(track, tuplet));
    }
    theGenerator->clear();
  }

  // skip ovelrapped tracks
  if (theCleaner) tracks = PixelTrackCleanerWrapper(theCleaner).clean(tracks);

  // clean memory
  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) delete (*ir);
}

Member Data Documentation

Definition at line 32 of file PixelTrackReconstruction.h.

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

Definition at line 29 of file PixelTrackReconstruction.h.

Referenced by init(), and PixelTrackReconstruction().

Definition at line 31 of file PixelTrackReconstruction.h.

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

Definition at line 30 of file PixelTrackReconstruction.h.

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

Definition at line 33 of file PixelTrackReconstruction.h.

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

Definition at line 35 of file PixelTrackReconstruction.h.

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

Definition at line 34 of file PixelTrackReconstruction.h.

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