#include <BaseCkfTrajectoryBuilder.h>
The component of track reconstruction that, strating from a seed, reconstructs all possible trajectories. The resulting trajectories may be mutually exclusive and require cleaning by a TrajectoryCleaner. The Trajectories are normally not smoothed.
Definition at line 43 of file BaseCkfTrajectoryBuilder.h.
typedef FreeTrajectoryState BaseCkfTrajectoryBuilder::FTS [protected] |
Definition at line 46 of file BaseCkfTrajectoryBuilder.h.
typedef std::pair<TSOS,std::vector<const DetLayer*> > BaseCkfTrajectoryBuilder::StateAndLayers [protected] |
Definition at line 49 of file BaseCkfTrajectoryBuilder.h.
typedef std::vector<TempTrajectory> BaseCkfTrajectoryBuilder::TempTrajectoryContainer |
Reimplemented in HICTrajectoryBuilder, and CkfTrajectoryBuilder.
Definition at line 54 of file BaseCkfTrajectoryBuilder.h.
typedef TrajectoryMeasurement BaseCkfTrajectoryBuilder::TM [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 48 of file BaseCkfTrajectoryBuilder.h.
typedef std::vector<Trajectory> BaseCkfTrajectoryBuilder::TrajectoryContainer |
Reimplemented from TrajectoryBuilder.
Reimplemented in HICTrajectoryBuilder, and CkfTrajectoryBuilder.
Definition at line 53 of file BaseCkfTrajectoryBuilder.h.
typedef TrajectoryContainer::iterator BaseCkfTrajectoryBuilder::TrajectoryIterator |
Reimplemented from TrajectoryBuilder.
Definition at line 55 of file BaseCkfTrajectoryBuilder.h.
typedef TrajectoryStateOnSurface BaseCkfTrajectoryBuilder::TSOS [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 47 of file BaseCkfTrajectoryBuilder.h.
BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder | ( | const edm::ParameterSet & | conf, |
const TrajectoryStateUpdator * | updator, | ||
const Propagator * | propagatorAlong, | ||
const Propagator * | propagatorOpposite, | ||
const Chi2MeasurementEstimatorBase * | estimator, | ||
const TransientTrackingRecHitBuilder * | RecHitBuilder, | ||
const MeasurementTracker * | measurementTracker, | ||
const TrajectoryFilter * | filter, | ||
const TrajectoryFilter * | inOutFilter = 0 |
||
) |
Definition at line 24 of file BaseCkfTrajectoryBuilder.cc.
References clustersToSkip_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and skipClusters_.
: theUpdator(updator), thePropagatorAlong(propagatorAlong),thePropagatorOpposite(propagatorOpposite), theEstimator(estimator),theTTRHBuilder(recHitBuilder), theMeasurementTracker(measurementTracker), theLayerMeasurements(new LayerMeasurements(theMeasurementTracker)), theForwardPropagator(0),theBackwardPropagator(0), theFilter(filter), theInOutFilter(inOutFilter) { if (conf.exists("clustersToSkip")){ skipClusters_=true; clustersToSkip_=conf.getParameter<edm::InputTag>("clustersToSkip"); } else skipClusters_=false; }
BaseCkfTrajectoryBuilder::~BaseCkfTrajectoryBuilder | ( | ) | [virtual] |
Definition at line 50 of file BaseCkfTrajectoryBuilder.cc.
References theLayerMeasurements.
{ delete theLayerMeasurements; }
void BaseCkfTrajectoryBuilder::addToResult | ( | TempTrajectory & | traj, |
TrajectoryContainer & | result, | ||
bool | inOut = false |
||
) | const [protected] |
Definition at line 166 of file BaseCkfTrajectoryBuilder.cc.
References Trajectory::empty(), Trajectory::foundHits(), Trajectory::lastMeasurement(), LogDebug, Trajectory::lostHits(), TempTrajectory::measurements(), Trajectory::measurements(), Trajectory::pop(), qualityFilter(), TrajectoryMeasurement::recHit(), and TempTrajectory::toTrajectory().
Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), and CkfTrajectoryBuilder::limitedCandidates().
{ // quality check if ( !qualityFilter(tmptraj, inOut) ) return; Trajectory traj = tmptraj.toTrajectory(); // discard latest dummy measurements while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid()) traj.pop(); LogDebug("CkfPattern")<<inOut<<"=inOut option. pushing a Trajectory with: "<<traj.foundHits()<<" found hits. "<<traj.lostHits() <<" lost hits. Popped :"<<(tmptraj.measurements().size())-(traj.measurements().size())<<" hits."; result.push_back( traj); }
void BaseCkfTrajectoryBuilder::addToResult | ( | TempTrajectory & | traj, |
TempTrajectoryContainer & | result, | ||
bool | inOut = false |
||
) | const [protected] |
Definition at line 180 of file BaseCkfTrajectoryBuilder.cc.
References TempTrajectory::empty(), TempTrajectory::foundHits(), TempTrajectory::lastMeasurement(), LogDebug, TempTrajectory::lostHits(), TempTrajectory::measurements(), TempTrajectory::pop(), qualityFilter(), and TrajectoryMeasurement::recHit().
{ // quality check if ( !qualityFilter(tmptraj, inOut) ) return; // discard latest dummy measurements TempTrajectory traj = tmptraj; while (!traj.empty() && !traj.lastMeasurement().recHit()->isValid()) traj.pop(); LogDebug("CkfPattern")<<inOut<<"=inOut option. pushing a TempTrajectory with: "<<traj.foundHits()<<" found hits. "<<traj.lostHits() <<" lost hits. Popped :"<<(tmptraj.measurements().size())-(traj.measurements().size())<<" hits."; result.push_back( traj ); }
virtual bool BaseCkfTrajectoryBuilder::analyzeMeasurementsDebugger | ( | Trajectory & | traj, |
std::vector< TrajectoryMeasurement > | meas, | ||
const MeasurementTracker * | theMeasurementTracker, | ||
const Propagator * | theForwardPropagator, | ||
const Chi2MeasurementEstimatorBase * | theEstimator, | ||
const TransientTrackingRecHitBuilder * | theTTRHBuilder | ||
) | const [inline, protected, virtual] |
Maximum number of lost hits per trajectory candidate. Maximum number of consecutive lost hits per trajectory candidate.
Reimplemented in CkfDebugTrajectoryBuilder.
Definition at line 84 of file BaseCkfTrajectoryBuilder.h.
Referenced by CkfTrajectoryBuilder::limitedCandidates().
{return true;}
virtual bool BaseCkfTrajectoryBuilder::analyzeMeasurementsDebugger | ( | TempTrajectory & | traj, |
std::vector< TrajectoryMeasurement > | meas, | ||
const MeasurementTracker * | theMeasurementTracker, | ||
const Propagator * | theForwardPropagator, | ||
const Chi2MeasurementEstimatorBase * | theEstimator, | ||
const TransientTrackingRecHitBuilder * | theTTRHBuilder | ||
) | const [inline, protected, virtual] |
Reimplemented in CkfDebugTrajectoryBuilder.
Definition at line 89 of file BaseCkfTrajectoryBuilder.h.
{return true;}
TempTrajectory BaseCkfTrajectoryBuilder::createStartingTrajectory | ( | const TrajectorySeed & | seed | ) | const [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 106 of file BaseCkfTrajectoryBuilder.cc.
References alongMomentum, TrajectorySeed::direction(), PrintoutHelper::dumpCandidate(), i, LogDebug, query::result, seedMeasurements(), theBackwardPropagator, and theForwardPropagator.
Referenced by GroupedCkfTrajectoryBuilder::buildTrajectories(), GroupedCkfTrajectoryBuilder::rebuildSeedingRegion(), and CkfTrajectoryBuilder::trajectories().
{ TempTrajectory result( seed, seed.direction()); if ( seed.direction() == alongMomentum) { theForwardPropagator = &(*thePropagatorAlong); theBackwardPropagator = &(*thePropagatorOpposite); } else { theForwardPropagator = &(*thePropagatorOpposite); theBackwardPropagator = &(*thePropagatorAlong); } std::vector<TM> seedMeas; seedMeasurements(seed, seedMeas); for (std::vector<TM>::const_iterator i=seedMeas.begin(); i!=seedMeas.end(); i++) result.push(*i); LogDebug("CkfPattern") <<" initial trajectory from the seed: "<<PrintoutHelper::dumpCandidate(result,true); return result; }
virtual void BaseCkfTrajectoryBuilder::fillSeedHistoDebugger | ( | std::vector< TrajectoryMeasurement >::iterator | begin, |
std::vector< TrajectoryMeasurement >::iterator | end | ||
) | const [inline, protected, virtual] |
Reimplemented in CkfDebugTrajectoryBuilder.
Definition at line 94 of file BaseCkfTrajectoryBuilder.h.
Referenced by seedMeasurements().
{;}
BaseCkfTrajectoryBuilder::StateAndLayers BaseCkfTrajectoryBuilder::findStateAndLayers | ( | const TempTrajectory & | traj | ) | const [protected] |
Definition at line 197 of file BaseCkfTrajectoryBuilder.cc.
References PTrajectoryStateOnDet::detId(), GeometricSearchTracker::detLayer(), TempTrajectory::direction(), TempTrajectory::empty(), TrajectoryStateOnSurface::freeState(), g, MeasurementTracker::geometricSearchTracker(), MeasurementTracker::geomTracker(), TrackingGeometry::idToDet(), TempTrajectory::lastLayer(), TempTrajectory::lastMeasurement(), Propagator::magneticField(), DetLayer::nextLayers(), TempTrajectory::seed(), TrajectorySeed::startingState(), theForwardPropagator, theMeasurementTracker, TrajectoryStateTransform::transientState(), and TrajectoryMeasurement::updatedState().
Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), and CkfTrajectoryBuilder::findCompatibleMeasurements().
{ if (traj.empty()) { //set the currentState to be the one from the trajectory seed starting point PTrajectoryStateOnDet ptod = traj.seed().startingState(); DetId id(ptod.detId()); const GeomDet * g = theMeasurementTracker->geomTracker()->idToDet(id); const Surface * surface=&g->surface(); TrajectoryStateTransform tsTransform; TSOS currentState = TrajectoryStateOnSurface(tsTransform.transientState(ptod,surface,theForwardPropagator->magneticField())); const DetLayer* lastLayer = theMeasurementTracker->geometricSearchTracker()->detLayer(id); return StateAndLayers(currentState,lastLayer->nextLayers( *currentState.freeState(), traj.direction()) ); } else { TSOS currentState = traj.lastMeasurement().updatedState(); return StateAndLayers(currentState,traj.lastLayer()->nextLayers( *currentState.freeState(), traj.direction()) ); } }
bool BaseCkfTrajectoryBuilder::qualityFilter | ( | const TempTrajectory & | traj, |
bool | inOut = false |
||
) | const [protected] |
Called at end of track building, to see if track should be kept
Definition at line 152 of file BaseCkfTrajectoryBuilder.cc.
References TrajectoryFilter::qualityFilter(), theFilter, and theInOutFilter.
Referenced by addToResult(), and CkfTrajectoryBuilder::limitedCandidates().
{ // Called after building a trajectory is completed, to see if it is good enough // to keep. if (inOut) { if (theInOutFilter == 0) edm::LogError("CkfPattern") << "CkfTrajectoryBuilder error: trying to use dedicated filter for in-out tracking phase, when none specified"; return theInOutFilter->qualityFilter(traj); } else { return theFilter->qualityFilter(traj); } }
void BaseCkfTrajectoryBuilder::seedMeasurements | ( | const TrajectorySeed & | seed, |
std::vector< TrajectoryMeasurement > & | result | ||
) | const [private] |
Definition at line 56 of file BaseCkfTrajectoryBuilder.cc.
References TransientTrackingRecHitBuilder::build(), GeometricSearchTracker::detLayer(), fillSeedHistoDebugger(), MeasurementTracker::geometricSearchTracker(), MeasurementTracker::geomTracker(), TrackingGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), Propagator::magneticField(), Propagator::propagate(), TrajectorySeed::recHits(), TrajectorySeed::startingState(), GeomDet::surface(), theBackwardPropagator, theForwardPropagator, theMeasurementTracker, theTTRHBuilder, theUpdator, TrajectoryStateTransform::transientState(), and TrajectoryStateUpdator::update().
Referenced by createStartingTrajectory().
{ TrajectoryStateTransform tsTransform; TrajectorySeed::range hitRange = seed.recHits(); for (TrajectorySeed::const_iterator ihit = hitRange.first; ihit != hitRange.second; ihit++) { TransientTrackingRecHit::RecHitPointer recHit = theTTRHBuilder->build(&(*ihit)); const GeomDet* hitGeomDet = theMeasurementTracker->geomTracker()->idToDet( ihit->geographicalId()); const DetLayer* hitLayer = theMeasurementTracker->geometricSearchTracker()->detLayer(ihit->geographicalId()); TSOS invalidState( new BasicSingleTrajectoryState( hitGeomDet->surface())); if (ihit == hitRange.second - 1) { // the seed trajectory state should correspond to this hit PTrajectoryStateOnDet pState( seed.startingState()); const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet( DetId(pState.detId())); if (&gdet->surface() != &hitGeomDet->surface()) { edm::LogError("CkfPattern") << "CkfTrajectoryBuilder error: the seed state is not on the surface of the detector of the last seed hit"; return; // FIXME: should throw exception } TSOS updatedState = tsTransform.transientState( pState, &(gdet->surface()), theForwardPropagator->magneticField()); result.push_back(TM( invalidState, updatedState, recHit, 0, hitLayer)); } else { PTrajectoryStateOnDet pState( seed.startingState()); TSOS outerState = tsTransform.transientState(pState, &((theMeasurementTracker->geomTracker()->idToDet( (hitRange.second - 1)->geographicalId()))->surface()), theForwardPropagator->magneticField()); TSOS innerState = theBackwardPropagator->propagate(outerState,hitGeomDet->surface()); if(innerState.isValid()) { TSOS innerUpdated = theUpdator->update(innerState,*recHit); result.push_back(TM( invalidState, innerUpdated, recHit, 0, hitLayer)); } } } // method for debugging fillSeedHistoDebugger(result.begin(),result.end()); }
virtual void BaseCkfTrajectoryBuilder::setDebugger | ( | CkfDebugger * | dbg | ) | const [inline, virtual] |
Reimplemented in CkfDebugTrajectoryBuilder.
Definition at line 74 of file BaseCkfTrajectoryBuilder.h.
{;}
void BaseCkfTrajectoryBuilder::setEvent | ( | const edm::Event & | event | ) | const [virtual] |
Implements TrajectoryBuilder.
Reimplemented in HICTrajectoryBuilder.
Definition at line 219 of file BaseCkfTrajectoryBuilder.cc.
References clustersToSkip_, MeasurementTracker::setClusterToSkip(), skipClusters_, theMeasurementTracker, and MeasurementTracker::update().
{ theMeasurementTracker->update(event); if (skipClusters_) theMeasurementTracker->setClusterToSkip(clustersToSkip_,event); }
bool BaseCkfTrajectoryBuilder::toBeContinued | ( | TempTrajectory & | traj, |
bool | inOut = false |
||
) | const [protected] |
Called after each new hit is added to the trajectory, to see if building this track should be continued
Definition at line 130 of file BaseCkfTrajectoryBuilder.cc.
References TempTrajectory::foundHits(), TempTrajectory::lastLayer(), TempTrajectory::lastMeasurement(), LogTrace, TempTrajectory::lostHits(), TempTrajectory::measurements(), TrajectoryMeasurement::predictedState(), DetLayer::subDetector(), theFilter, theInOutFilter, and TrajectoryFilter::toBeContinued().
Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), and CkfTrajectoryBuilder::limitedCandidates().
{ if (traj.measurements().size() > 400) { edm::LogError("BaseCkfTrajectoryBuilder_InfiniteLoop"); LogTrace("BaseCkfTrajectoryBuilder_InfiniteLoop") << "Cropping Track After 400 Measurements:\n" << " Last predicted state: " << traj.lastMeasurement().predictedState() << "\n" << " Last layer subdetector: " << (traj.lastLayer() ? traj.lastLayer()->subDetector() : -1) << "\n" << " Found hits: " << traj.foundHits() << ", lost hits: " << traj.lostHits() << "\n\n"; return false; } // Called after each new hit is added to the trajectory, to see if it is // worth continuing to build this track candidate. if (inOut) { if (theInOutFilter == 0) edm::LogError("CkfPattern") << "CkfTrajectoryBuilder error: trying to use dedicated filter for in-out tracking phase, when none specified"; return theInOutFilter->toBeContinued(traj); } else { return theFilter->toBeContinued(traj); } }
virtual TrajectoryContainer BaseCkfTrajectoryBuilder::trajectories | ( | const TrajectorySeed & | ) | const [pure virtual] |
Implements TrajectoryBuilder.
Implemented in HICTrajectoryBuilder, CkfTrajectoryBuilder, and GroupedCkfTrajectoryBuilder.
void BaseCkfTrajectoryBuilder::unset | ( | ) | const [virtual] |
Reimplemented from TrajectoryBuilder.
Definition at line 226 of file BaseCkfTrajectoryBuilder.cc.
References skipClusters_, theMeasurementTracker, and MeasurementTracker::unsetClusterToSkip().
{ if (skipClusters_) theMeasurementTracker->unsetClusterToSkip(); }
Definition at line 145 of file BaseCkfTrajectoryBuilder.h.
Referenced by BaseCkfTrajectoryBuilder(), and setEvent().
bool BaseCkfTrajectoryBuilder::skipClusters_ [private] |
Filter used at end of in-out tracking
Definition at line 144 of file BaseCkfTrajectoryBuilder.h.
Referenced by BaseCkfTrajectoryBuilder(), setEvent(), and unset().
const Propagator* BaseCkfTrajectoryBuilder::theBackwardPropagator [mutable, protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 130 of file BaseCkfTrajectoryBuilder.h.
Referenced by createStartingTrajectory(), GroupedCkfTrajectoryBuilder::rebuildSeedingRegion(), and seedMeasurements().
const Chi2MeasurementEstimatorBase* BaseCkfTrajectoryBuilder::theEstimator [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 123 of file BaseCkfTrajectoryBuilder.h.
Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), CkfDebugTrajectoryBuilder::analyzeMeasurementsDebugger(), MuonCkfTrajectoryBuilder::collectMeasurement(), GroupedCkfTrajectoryBuilder::estimator(), CkfTrajectoryBuilder::findCompatibleMeasurements(), CkfTrajectoryBuilder::limitedCandidates(), and MuonCkfTrajectoryBuilder::MuonCkfTrajectoryBuilder().
const TrajectoryFilter* BaseCkfTrajectoryBuilder::theFilter [private] |
Definition at line 141 of file BaseCkfTrajectoryBuilder.h.
Referenced by qualityFilter(), and toBeContinued().
const Propagator* BaseCkfTrajectoryBuilder::theForwardPropagator [mutable, protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 129 of file BaseCkfTrajectoryBuilder.h.
Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), CkfDebugTrajectoryBuilder::analyzeMeasurementsDebugger(), GroupedCkfTrajectoryBuilder::buildTrajectories(), createStartingTrajectory(), MuonCkfTrajectoryBuilder::findCompatibleMeasurements(), CkfTrajectoryBuilder::findCompatibleMeasurements(), findStateAndLayers(), CkfTrajectoryBuilder::limitedCandidates(), and seedMeasurements().
const TrajectoryFilter* BaseCkfTrajectoryBuilder::theInOutFilter [private] |
Filter used at end of complete tracking
Definition at line 142 of file BaseCkfTrajectoryBuilder.h.
Referenced by qualityFilter(), and toBeContinued().
const LayerMeasurements* BaseCkfTrajectoryBuilder::theLayerMeasurements [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 126 of file BaseCkfTrajectoryBuilder.h.
Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), MuonCkfTrajectoryBuilder::collectMeasurement(), CkfTrajectoryBuilder::findCompatibleMeasurements(), and ~BaseCkfTrajectoryBuilder().
const MeasurementTracker* BaseCkfTrajectoryBuilder::theMeasurementTracker [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 125 of file BaseCkfTrajectoryBuilder.h.
Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), CkfDebugTrajectoryBuilder::analyzeMeasurementsDebugger(), MuonCkfTrajectoryBuilder::findCompatibleMeasurements(), findStateAndLayers(), CkfTrajectoryBuilder::limitedCandidates(), seedMeasurements(), setEvent(), and unset().
const Propagator* BaseCkfTrajectoryBuilder::thePropagatorAlong [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 121 of file BaseCkfTrajectoryBuilder.h.
const Propagator* BaseCkfTrajectoryBuilder::thePropagatorOpposite [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 122 of file BaseCkfTrajectoryBuilder.h.
const TransientTrackingRecHitBuilder* BaseCkfTrajectoryBuilder::theTTRHBuilder [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 124 of file BaseCkfTrajectoryBuilder.h.
Referenced by CkfDebugTrajectoryBuilder::analyzeMeasurementsDebugger(), CkfTrajectoryBuilder::limitedCandidates(), and seedMeasurements().
const TrajectoryStateUpdator* BaseCkfTrajectoryBuilder::theUpdator [protected] |
Reimplemented in HICTrajectoryBuilder.
Definition at line 120 of file BaseCkfTrajectoryBuilder.h.
Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), seedMeasurements(), CkfTrajectoryBuilder::updateTrajectory(), and GroupedCkfTrajectoryBuilder::updator().