41 updator, propagatorAlong,propagatorOpposite,
42 estimator, recHitBuilder, filter)
155 throw cms::Exception(
"LogicError") <<
"Asking to create trajectories to an un-initialized CkfTrajectoryBuilder.\nYou have to call clone(const MeasurementTrackerEvent *data) and then call trajectories on it instead.\n";
179 candidates.push_back( startingTraj);
180 boost::shared_ptr<const TrajectorySeed> sharedSeed(
new TrajectorySeed(seed));
188 unsigned int nIter=1;
192 while ( !candidates.empty()) {
195 for (TempTrajectoryContainer::iterator traj=candidates.begin();
196 traj!=candidates.end(); traj++) {
197 std::vector<TM> meas;
211 std::vector<TM>::const_iterator
last;
214 if (meas.front().recHit()->isValid()) {
217 else last = meas.end();
220 for( std::vector<TM>::const_iterator itm = meas.begin();
221 itm !=
last; itm++) {
226 newCand.push_back(newTraj);
237 newCand.erase( newCand.begin()+
theMaxCand, newCand.end());
243 candidates.swap(newCand);
245 LogDebug(
"CkfPattern") <<result.size()<<
" candidates after "<<nIter++<<
" CKF iteration: \n"
247 <<
"\n "<<candidates.size()<<
" running candidates are: \n"
261 if ( hit->isValid()) {
267 traj.
push(
TM( predictedState, hit, 0, tm.
layer()));
275 std::vector<TrajectoryMeasurement> &
result)
const
278 std::pair<TSOS,std::vector<const DetLayer*> > stateAndLayers =
findStateAndLayers(traj);
279 if (stateAndLayers.second.empty())
return;
281 vector<const DetLayer*>::iterator layerBegin = stateAndLayers.second.begin();
282 vector<const DetLayer*>::iterator layerEnd = stateAndLayers.second.end();
283 LogDebug(
"CkfPattern")<<
"looping on "<< stateAndLayers.second.size()<<
" layers.";
284 for (vector<const DetLayer*>::iterator il = layerBegin;
285 il != layerEnd; il++) {
287 LogDebug(
"CkfPattern")<<
"looping on a layer in findCompatibleMeasurements.\n last layer: "<<traj.
lastLayer()<<
" current layer: "<<(*il);
289 TSOS stateToUse = stateAndLayers.first;
292 LogDebug(
"CkfPattern")<<
" self propagating in findCompatibleMeasurements.\n from: \n"<<stateToUse;
299 if (!stateToUse.
isValid())
continue;
300 LogDebug(
"CkfPattern")<<
"to: "<<stateToUse;
307 if ( result.empty()) result = tmp;
310 result.insert( result.end()-invalidHits, tmp.begin(), tmp.end());
317 if ( result.size() > 1) {
321 LogDebug(
"CkfPattern")<<
"starting from:\n"
322 <<
"x: "<<stateAndLayers.first.globalPosition()<<
"\n"
323 <<
"p: "<<stateAndLayers.first.globalMomentum()<<
"\n"
327 bool afterInvalid =
false;
328 for (vector<TM>::const_iterator
i=result.begin();
329 i!=result.end();
i++) {
330 if ( !
i->recHit().isValid()) afterInvalid =
true;
331 if (afterInvalid &&
i->recHit().isValid()) {
332 edm::LogError(
"CkfPattern") <<
"CkfTrajectoryBuilder error: valid hit after invalid!" ;
T getParameter(std::string const &) const
static std::string dumpCandidates(collection &candidates)
std::vector< Trajectory > TrajectoryContainer
bool theAlwaysUseInvalidHits
TrajectoryStateOnSurface const & predictedState() const
ConstRecHitPointer const & recHit() const
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
virtual bool analyzeMeasurementsDebugger(Trajectory &traj, const std::vector< TrajectoryMeasurement > &meas, const MeasurementTrackerEvent *theMeasurementTracker, const Propagator *theForwardPropagator, const Chi2MeasurementEstimatorBase *theEstimator, const TransientTrackingRecHitBuilder *theTTRHBuilder) const
const TrajectoryStateUpdator * theUpdator
CkfTrajectoryBuilder(const edm::ParameterSet &conf, const TrajectoryStateUpdator *updator, const Propagator *propagatorAlong, const Propagator *propagatorOpposite, const Chi2MeasurementEstimatorBase *estimator, const TransientTrackingRecHitBuilder *recHitBuilder, const TrajectoryFilter *filter)
TempTrajectory buildTrajectories(const TrajectorySeed &, TrajectoryContainer &ret, const TrajectoryFilter *) const
static std::string dumpMeasurements(const std::vector< TrajectoryMeasurement > &v)
bool qualityFilter(const TempTrajectory &traj, bool inOut=false) const
bool theIntermediateCleaning
const TransientTrackingRecHitBuilder * theTTRHBuilder
const DetLayer * layer() const
void addToResult(boost::shared_ptr< const TrajectorySeed > const &seed, TempTrajectory &traj, TrajectoryContainer &result, bool inOut=false) const
const MeasurementTracker & measurementTracker() const
void updateTrajectory(TempTrajectory &traj, const TM &tm) const
StateAndLayers findStateAndLayers(const TrajectorySeed &seed, const TempTrajectory &traj) const
const MeasurementTrackerEvent * theMeasurementTracker
virtual TrajectoryContainer trajectories(const TrajectorySeed &seed) const
trajectories building starting from a seed
std::vector< TempTrajectory > TempTrajectoryContainer
std::vector< std::vector< double > > tmp
bool toBeContinued(TempTrajectory &traj, bool inOut=false) const
virtual void findCompatibleMeasurements(const TrajectorySeed &seed, const TempTrajectory &traj, std::vector< TrajectoryMeasurement > &result) const
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
int theMaxCand
set Event for the internal MeasurementTracker data member
std::vector< Trajectory > TrajectoryContainer
const Chi2MeasurementEstimatorBase * theEstimator
TempTrajectory createStartingTrajectory(const TrajectorySeed &seed) const
void limitedCandidates(const TrajectorySeed &seed, TempTrajectory &startingTraj, TrajectoryContainer &result) const
void push(const TrajectoryMeasurement &tm)
const Propagator * theForwardPropagator