43 updator, propagatorAlong,propagatorOpposite,
44 estimator, recHitBuilder, measurementTracker,filter)
178 candidates.push_back( startingTraj);
179 boost::shared_ptr<const TrajectorySeed> sharedSeed(
new TrajectorySeed(seed));
187 unsigned int nIter=1;
191 while ( !candidates.empty()) {
194 for (TempTrajectoryContainer::iterator traj=candidates.begin();
195 traj!=candidates.end(); traj++) {
196 std::vector<TM> meas;
210 std::vector<TM>::const_iterator
last;
213 if (meas.front().recHit()->isValid()) {
216 else last = meas.end();
219 for( std::vector<TM>::const_iterator itm = meas.begin();
220 itm !=
last; itm++) {
225 newCand.push_back(newTraj);
236 newCand.erase( newCand.begin()+
theMaxCand, newCand.end());
242 candidates.swap(newCand);
244 LogDebug(
"CkfPattern") <<result.size()<<
" candidates after "<<nIter++<<
" CKF iteration: \n"
246 <<
"\n "<<candidates.size()<<
" running candidates are: \n"
260 if ( hit->isValid()) {
266 traj.
push(
TM( predictedState, hit, 0, tm.
layer()));
274 std::vector<TrajectoryMeasurement> &
result)
const
277 std::pair<TSOS,std::vector<const DetLayer*> > stateAndLayers =
findStateAndLayers(traj);
278 if (stateAndLayers.second.empty())
return;
280 vector<const DetLayer*>::iterator layerBegin = stateAndLayers.second.begin();
281 vector<const DetLayer*>::iterator layerEnd = stateAndLayers.second.end();
282 LogDebug(
"CkfPattern")<<
"looping on "<< stateAndLayers.second.size()<<
" layers.";
283 for (vector<const DetLayer*>::iterator il = layerBegin;
284 il != layerEnd; il++) {
286 LogDebug(
"CkfPattern")<<
"looping on a layer in findCompatibleMeasurements.\n last layer: "<<traj.
lastLayer()<<
" current layer: "<<(*il);
288 TSOS stateToUse = stateAndLayers.first;
291 LogDebug(
"CkfPattern")<<
" self propagating in findCompatibleMeasurements.\n from: \n"<<stateToUse;
298 if (!stateToUse.
isValid())
continue;
299 LogDebug(
"CkfPattern")<<
"to: "<<stateToUse;
305 if ( result.empty()) result = tmp;
308 result.insert( result.end()-invalidHits, tmp.begin(), tmp.end());
315 if ( result.size() > 1) {
319 LogDebug(
"CkfPattern")<<
"starting from:\n"
320 <<
"x: "<<stateAndLayers.first.globalPosition()<<
"\n"
321 <<
"p: "<<stateAndLayers.first.globalMomentum()<<
"\n"
325 bool afterInvalid =
false;
326 for (vector<TM>::const_iterator
i=result.begin();
327 i!=result.end();
i++) {
328 if ( !
i->recHit().isValid()) afterInvalid =
true;
329 if (afterInvalid &&
i->recHit().isValid()) {
330 edm::LogError(
"CkfPattern") <<
"CkfTrajectoryBuilder error: valid hit after invalid!" ;
T getParameter(std::string const &) const
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) 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
const TrajectoryStateUpdator * theUpdator
virtual bool analyzeMeasurementsDebugger(Trajectory &traj, const std::vector< TrajectoryMeasurement > &meas, const MeasurementTracker *theMeasurementTracker, const Propagator *theForwardPropagator, const Chi2MeasurementEstimatorBase *theEstimator, const TransientTrackingRecHitBuilder *theTTRHBuilder) const
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
const LayerMeasurements * theLayerMeasurements
bool theIntermediateCleaning
const TransientTrackingRecHitBuilder * theTTRHBuilder
CkfTrajectoryBuilder(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 DetLayer * layer() const
void addToResult(boost::shared_ptr< const TrajectorySeed > const &seed, TempTrajectory &traj, TrajectoryContainer &result, bool inOut=false) const
void updateTrajectory(TempTrajectory &traj, const TM &tm) const
StateAndLayers findStateAndLayers(const TrajectorySeed &seed, const TempTrajectory &traj) const
const MeasurementTracker * 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