CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GroupedCkfTrajectoryBuilder.cc
Go to the documentation of this file.
1 #include <algorithm>
2 #include <array>
3 
6 
9 
13 #include "GroupedTrajCandLess.h"
25 
34 
36 
37 // only included for RecHit comparison operator:
39 
41 
42 // for looper reconstruction
46 
48 
49 // #define STAT_TSB
50 
51 namespace {
52 #ifdef STAT_TSB
53  struct StatCount {
54  long long totSeed;
55  long long totTraj;
56  long long totRebuilt;
57  long long totInvCand;
58  void zero() { totSeed = totTraj = totRebuilt = totInvCand = 0; }
59  void traj(long long t) { totTraj += t; }
60  void seed() { ++totSeed; }
61  void rebuilt(long long t) { totRebuilt += t; }
62  void invalid() { ++totInvCand; }
63  void print() const {
64  std::cout << "GroupedCkfTrajectoryBuilder stat\nSeed/Traj/Rebuilt " << totSeed << '/' << totTraj << '/'
65  << totRebuilt << std::endl;
66  }
67  StatCount() { zero(); }
68  ~StatCount() { print(); }
69  };
70  StatCount statCount;
71 
72 #else
73  struct StatCount {
74  void traj(long long) {}
75  void seed() {}
76  void rebuilt(long long) {}
77  void invalid() {}
78  };
79  CMS_THREAD_SAFE StatCount statCount;
80 #endif
81 
82 } // namespace
83 
84 using namespace std;
85 
86 //#define DBG2_GCTB
87 
88 //#define STANDARD_INTERMEDIARYCLEAN
89 
90 #ifdef STANDARD_INTERMEDIARYCLEAN
92 #endif
93 
94 /* ====== B.M. to be ported layer ===========
95 #ifdef DBG_GCTB
96 #include "RecoTracker/CkfPattern/src/ShowCand.h"
97 #endif
98 // #define DBG2_GCTB
99 #ifdef DBG2_GCTB
100 #include "RecoTracker/CkfPattern/src/SimIdPrinter.h"
101 #include "Tracker/TkDebugTools/interface/LayerFinderByDet.h"
102 #include "Tracker/TkLayout/interface/TkLayerName.h"
103 #endif
104 =================================== */
105 
106 namespace {
107 
109 
110 }
111 
114  iC,
115  BaseCkfTrajectoryBuilder::createTrajectoryFilter(
116  conf.getParameter<edm::ParameterSet>("trajectoryFilter"), iC),
117  conf.getParameter<bool>("useSameTrajFilter")
118  ? BaseCkfTrajectoryBuilder::createTrajectoryFilter(
119  conf.getParameter<edm::ParameterSet>("trajectoryFilter"), iC)
120  : BaseCkfTrajectoryBuilder::createTrajectoryFilter(
121  conf.getParameter<edm::ParameterSet>("inOutTrajectoryFilter"), iC)) {
122  // fill data members from parameters (eventually data members could be dropped)
123  //
124  theMaxCand = conf.getParameter<int>("maxCand");
125  theLostHitPenalty = conf.getParameter<double>("lostHitPenalty");
126  theFoundHitBonus = conf.getParameter<double>("foundHitBonus");
127  theIntermediateCleaning = conf.getParameter<bool>("intermediateCleaning");
128  theAlwaysUseInvalid = conf.getParameter<bool>("alwaysUseInvalidHits");
129  theLockHits = conf.getParameter<bool>("lockHits");
130  theBestHitOnly = conf.getParameter<bool>("bestHitOnly");
132  theRequireSeedHitsInRebuild = conf.getParameter<bool>("requireSeedHitsInRebuild");
133  theKeepOriginalIfRebuildFails = conf.getParameter<bool>("keepOriginalIfRebuildFails");
134  theMinNrOfHitsForRebuild = max(0, conf.getParameter<int>("minNrOfHitsForRebuild"));
135  maxPt2ForLooperReconstruction = conf.existsAs<double>("maxPtForLooperReconstruction")
136  ? conf.getParameter<double>("maxPtForLooperReconstruction")
137  : 0;
139  maxDPhiForLooperReconstruction = conf.existsAs<double>("maxDPhiForLooperReconstruction")
140  ? conf.getParameter<double>("maxDPhiForLooperReconstruction")
141  : 2.0;
142 
143  /* ======= B.M. to be ported layer ===========
144  bool setOK = thePropagator->setMaxDirectionChange(1.6);
145  if (!setOK)
146  cout << "GroupedCkfTrajectoryBuilder WARNING: "
147  << "propagator does not support setMaxDirectionChange"
148  << endl;
149  // addStopCondition(theMinPtStopCondition);
150 
151  theConfigurableCondition = createAlgo<TrajectoryFilter>(componentConfig("StopCondition"));
152  ===================================== */
153 }
154 
155 /*
156  void GroupedCkfTrajectoryBuilder::setEvent(const edm::Event& event) const
157  {
158  theMeasurementTracker->update(event);
159 }
160 */
161 
163 
165  const TrajectorySeed& seed) const {
167  ret.reserve(10);
168  unsigned int tmp;
169  buildTrajectories(seed, ret, tmp, nullptr);
170  return ret;
171 }
172 
174  const TrajectorySeed& seed, const TrackingRegion& region) const {
176  ret.reserve(10);
177  unsigned int tmp;
178  RegionalTrajectoryFilter regionalCondition(region);
179  buildTrajectories(seed, ret, tmp, &regionalCondition);
180  return ret;
181 }
182 
185  unsigned int tmp;
186  buildTrajectories(seed, ret, tmp, nullptr);
187 }
188 
191  const TrackingRegion& region) const {
192  RegionalTrajectoryFilter regionalCondition(region);
193  unsigned int tmp;
194  buildTrajectories(seed, ret, tmp, &regionalCondition);
195 }
196 
198  TempTrajectory const& startingTraj = createStartingTrajectory(seed);
199  rebuildTrajectories(startingTraj, seed, result);
200 }
201 
203  const TrajectorySeed& seed,
204  TrajectoryContainer& result) const {
206 
207  TrajectoryContainer final;
208 
209  // better the seed to be always the same...
210  std::shared_ptr<const TrajectorySeed> sharedSeed;
211  if (result.empty())
212  sharedSeed.reset(new TrajectorySeed(seed));
213  else
214  sharedSeed = result.front().sharedSeed();
215 
216  work.reserve(result.size());
217  for (auto&& traj : result)
218  if (traj.isValid())
219  work.emplace_back(std::move(traj));
220 
221  rebuildSeedingRegion(seed, startingTraj, work);
222 
223  // we clean here now
225  cleaner.clean(work);
226 
227  for (auto const& it : work)
228  if (it.isValid()) {
229  final.push_back(it.toTrajectory());
230  final.back().setSharedSeed(sharedSeed);
231  }
232 
233  result.swap(final);
234 
235  statCount.rebuilt(result.size());
236 }
237 
240  unsigned int& nCandPerSeed,
241  const TrajectoryFilter* regionalCondition) const {
242  if (theMeasurementTracker == nullptr) {
243  throw cms::Exception("LogicError")
244  << "Asking to create trajectories to an un-initialized GroupedCkfTrajectoryBuilder.\nYou have to call "
245  "clone(const MeasurementTrackerEvent *data) and then call trajectories on it instead.\n";
246  }
247 
248  statCount.seed();
249  //
250  // Build trajectory outwards from seed
251  //
252 
253  analyseSeed(seed);
254 
255  TempTrajectory const& startingTraj = createStartingTrajectory(seed);
256 
257  work_.clear();
258  const bool inOut = true;
259  nCandPerSeed = groupedLimitedCandidates(seed, startingTraj, regionalCondition, forwardPropagator(seed), inOut, work_);
260  if (work_.empty())
261  return startingTraj;
262 
263  // cleaning now done here...
265  cleaner.clean(work_);
266 
267  std::shared_ptr<const TrajectorySeed> pseed(new TrajectorySeed(seed));
268  for (auto const& it : work_)
269  if (it.isValid()) {
270  result.push_back(it.toTrajectory());
271  result.back().setSharedSeed(pseed);
272  }
273  work_.clear();
274  if (work_.capacity() > work_MaxSize_) {
275  TempTrajectoryContainer().swap(work_);
276  work_.reserve(work_MaxSize_ / 2);
277  }
278 
279  analyseResult(result);
280 
281  LogDebug("CkfPattern") << "GroupedCkfTrajectoryBuilder: returning result of size " << result.size();
282  statCount.traj(result.size());
283 
284 #ifdef VI_DEBUG
285  int kt = 0;
286  for (auto const& traj : result) {
287  int chit[7] = {};
288  for (auto const& tm : traj.measurements()) {
289  auto const& hit = tm.recHitR();
290  if (!hit.isValid())
291  ++chit[0];
292  if (hit.det() == nullptr)
293  ++chit[1];
295  continue;
296  if (hit.dimension() != 2) {
297  ++chit[2];
298  } else if (trackerHitRTTI::isFromDet(hit)) {
299  auto const& thit = static_cast<BaseTrackerRecHit const&>(hit);
300  auto const& clus = thit.firstClusterRef();
301  if (clus.isPixel())
302  ++chit[3];
303  else if (thit.isMatched()) {
304  ++chit[4];
305  } else if (thit.isProjected()) {
306  ++chit[5];
307  } else {
308  ++chit[6];
309  }
310  }
311  }
312 
313  std::cout << "ckf " << kt++ << ": ";
314  for (auto c : chit)
315  std::cout << c << '/';
316  std::cout << std::endl;
317  }
318 #endif
319 
320  return startingTraj;
321 }
322 
324  TempTrajectory const& startingTraj,
325  const TrajectoryFilter* regionalCondition,
326  const Propagator* propagator,
327  bool inOut,
329  unsigned int nIter = 1;
330  unsigned int nCands = 0; // ignore startingTraj
331  unsigned int prevNewCandSize = 0;
333  TempTrajectoryContainer newCand;
334  candidates.push_back(startingTraj);
335 
336  while (!candidates.empty()) {
337  newCand.clear();
338  for (TempTrajectoryContainer::iterator traj = candidates.begin(); traj != candidates.end(); traj++) {
339  if (!advanceOneLayer(seed, *traj, regionalCondition, propagator, inOut, newCand, result)) {
340  LogDebug("CkfPattern") << "GCTB: terminating after advanceOneLayer==false";
341  continue;
342  }
343 
344  LogDebug("CkfPattern") << "newCand(1): after advanced one layer:\n" << PrintoutHelper::dumpCandidates(newCand);
345  // account only new candidates, i.e.
346  // - 1 candidate -> 1 candidate, don't increase count
347  // - 1 candidate -> 2 candidates, increase count by 1
348  nCands += newCand.size() - prevNewCandSize;
349  prevNewCandSize = newCand.size();
350 
351  if ((int)newCand.size() > theMaxCand) {
352  //ShowCand()(newCand);
353 
354  std::nth_element(newCand.begin(),
355  newCand.begin() + theMaxCand,
356  newCand.end(),
358  newCand.erase(newCand.begin() + theMaxCand, newCand.end());
359  }
360  LogDebug("CkfPattern") << "newCand(2): after removing extra candidates.\n"
361  << PrintoutHelper::dumpCandidates(newCand);
362  }
363 
364  LogDebug("CkfPattern") << "newCand.size() at end = " << newCand.size();
365  /*
366  if (theIntermediateCleaning) {
367  candidates.clear();
368  candidates = groupedIntermediaryClean(newCand);
369  } else {
370  candidates.swap(newCand);
371  }
372 */
374 #ifdef STANDARD_INTERMEDIARYCLEAN
376 #else
377  groupedIntermediaryClean(newCand);
378 #endif
379  }
380  candidates.swap(newCand);
381 
382  LogDebug("CkfPattern") << "candidates(3): " << result.size() << " candidates after " << nIter++
383  << " groupedCKF iteration: \n"
384  << PrintoutHelper::dumpCandidates(result) << "\n " << candidates.size()
385  << " running candidates are: \n"
386  << PrintoutHelper::dumpCandidates(candidates);
387  }
388 
389  return nCands;
390 }
391 
392 #ifdef EDM_ML_DEBUG
393 std::string whatIsTheNextStep(TempTrajectory const& traj,
394  std::pair<TrajectoryStateOnSurface, std::vector<const DetLayer*> >& stateAndLayers) {
395  std::stringstream buffer;
396  vector<const DetLayer*>& nl = stateAndLayers.second;
397  // #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
398  // #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h"
399  //B.M. TkLayerName layerName;
400  //B.M. buffer << "Started from " << layerName(traj.lastLayer())
401  const BarrelDetLayer* sbdl = dynamic_cast<const BarrelDetLayer*>(traj.lastLayer());
402  const ForwardDetLayer* sfdl = dynamic_cast<const ForwardDetLayer*>(traj.lastLayer());
403  if (sbdl) {
404  buffer << "Started from " << traj.lastLayer() << " r=" << sbdl->specificSurface().radius()
405  << " phi=" << sbdl->specificSurface().phi() << endl;
406  } else if (sfdl) {
407  buffer << "Started from " << traj.lastLayer() << " z " << sfdl->specificSurface().position().z() << " phi "
408  << sfdl->specificSurface().phi() << endl;
409  }
410  buffer << "Trying to go to";
411  for (vector<const DetLayer*>::iterator il = nl.begin(); il != nl.end(); il++) {
412  //B.M. buffer << " " << layerName(*il) << " " << *il << endl;
413  const BarrelDetLayer* bdl = dynamic_cast<const BarrelDetLayer*>(*il);
414  const ForwardDetLayer* fdl = dynamic_cast<const ForwardDetLayer*>(*il);
415 
416  if (bdl)
417  buffer << " r " << bdl->specificSurface().radius() << endl;
418  if (fdl)
419  buffer << " z " << fdl->specificSurface().position().z() << endl;
420  //buffer << " " << *il << endl;
421  }
422  return buffer.str();
423 }
424 
425 std::string whatIsTheStateToUse(TrajectoryStateOnSurface& initial,
426  TrajectoryStateOnSurface& stateToUse,
427  const DetLayer* l) {
428  std::stringstream buffer;
429  buffer << "GCTB: starting from "
430  << " r / phi / z = " << stateToUse.globalPosition().perp() << " / " << stateToUse.globalPosition().phi()
431  << " / " << stateToUse.globalPosition().z()
432  << " , pt / phi / pz /charge = " << stateToUse.globalMomentum().perp() << " / "
433  << stateToUse.globalMomentum().phi() << " / " << stateToUse.globalMomentum().z() << " / "
434  << stateToUse.charge() << " for layer at " << l << endl;
435  buffer << " errors:";
436  for (int i = 0; i < 5; i++)
437  buffer << " " << sqrt(stateToUse.curvilinearError().matrix()(i, i));
438  buffer << endl;
439 
440  //buffer << "GCTB: starting from r / phi / z = " << initial.globalPosition().perp()
441  //<< " / " << initial.globalPosition().phi()
442  //<< " / " << initial.globalPosition().z() << " , pt / pz = "
443  //<< initial.globalMomentum().perp() << " / "
444  //<< initial.globalMomentum().z() << " for layer at "
445  //<< l << endl;
446  //buffer << " errors:";
447  //for ( int i=0; i<5; i++ ) buffer << " " << sqrt(initial.curvilinearError().matrix()(i,i));
448  //buffer << endl;
449  return buffer.str();
450 }
451 #endif
452 
454  TempTrajectory& traj,
455  const TrajectoryFilter* regionalCondition,
456  const Propagator* propagator,
457  bool inOut,
458  TempTrajectoryContainer& newCand,
460  std::pair<TSOS, std::vector<const DetLayer*> >&& stateAndLayers = findStateAndLayers(seed, traj);
461 
463  if (
464  //stateAndLayers.second.size()==0 &&
465  traj.lastLayer()->location() == 0) {
466  float pt2 = stateAndLayers.first.globalMomentum().perp2();
467  if (pt2 < maxPt2ForLooperReconstruction && pt2 > (0.3f * 0.3f))
468  stateAndLayers.second.push_back(traj.lastLayer());
469  }
470  }
471 
472  auto layerBegin = stateAndLayers.second.begin();
473  auto layerEnd = stateAndLayers.second.end();
474 
475  // if (nl.empty()) {
476  // addToResult(traj,result,inOut);
477  // return false;
478  // }
479 
480 #ifdef EDM_ML_DEBUG
481  LogDebug("CkfPattern") << whatIsTheNextStep(traj, stateAndLayers);
482 #endif
483 
484  bool foundSegments(false);
485  bool foundNewCandidates(false);
486  for (auto il = layerBegin; il != layerEnd; il++) {
487  TSOS stateToUse = stateAndLayers.first;
488 
489  double dPhiCacheForLoopersReconstruction(0);
490  if UNLIKELY (!traj.empty() && (*il) == traj.lastLayer()) {
492  // ------ For loopers reconstruction
493  //cout<<" self propagating in advanceOneLayer (for loopers) \n";
494  const BarrelDetLayer* sbdl = dynamic_cast<const BarrelDetLayer*>(traj.lastLayer());
495  if (sbdl) {
496  HelixBarrelCylinderCrossing cylinderCrossing(stateToUse.globalPosition(),
497  stateToUse.globalMomentum(),
498  stateToUse.transverseCurvature(),
499  propagator->propagationDirection(),
500  sbdl->specificSurface());
501  if (!cylinderCrossing.hasSolution())
502  continue;
503  GlobalPoint starting = stateToUse.globalPosition();
504  GlobalPoint target1 = cylinderCrossing.position1();
505  GlobalPoint target2 = cylinderCrossing.position2();
506 
507  GlobalPoint farther =
508  fabs(starting.phi() - target1.phi()) > fabs(starting.phi() - target2.phi()) ? target1 : target2;
509 
510  const Bounds& bounds(sbdl->specificSurface().bounds());
511  float length = 0.5f * bounds.length();
512 
513  /*
514  cout << "starting: " << starting << endl;
515  cout << "target1: " << target1 << endl;
516  cout << "target2: " << target2 << endl;
517  cout << "dphi: " << (target1.phi()-target2.phi()) << endl;
518  cout << "length: " << length << endl;
519  */
520 
521  /*
522  float deltaZ = bounds.thickness()/2.f/fabs(tan(stateToUse.globalDirection().theta()) ) ;
523  if(stateToUse.hasError())
524  deltaZ += 3*sqrt(stateToUse.cartesianError().position().czz());
525  if( fabs(farther.z()) > length + deltaZ ) continue;
526  */
527  if (fabs(farther.z()) * 0.95f > length)
528  continue;
529 
530  Geom::Phi<float> tmpDphi = target1.phi() - target2.phi();
532  continue;
533  GlobalPoint target(0.5f * (target1.basicVector() + target2.basicVector()));
534  //cout << "target: " << target << endl;
535 
537  stateToUse = extrapolator.extrapolate(stateToUse, target, *propagator);
538  if (!stateToUse.isValid())
539  continue; //SK: consider trying the original? probably not
540 
541  //dPhiCacheForLoopersReconstruction = fabs(target1.phi()-target2.phi())*2.;
542  dPhiCacheForLoopersReconstruction = std::abs(tmpDphi);
543  traj.incrementLoops();
544  } else { // not barrel
545  continue;
546  }
547  } else { // loopers not requested (why else???)
548  // ------ For cosmics reconstruction
549  LogDebug("CkfPattern") << " self propagating in advanceOneLayer.\n from: \n" << stateToUse;
550  //self navigation case
551  // go to a middle point first
553  GlobalPoint center(0, 0, 0);
554  stateToUse = middle.extrapolate(stateToUse, center, *(forwardPropagator(seed)));
555 
556  if (!stateToUse.isValid())
557  continue;
558  LogDebug("CkfPattern") << "to: " << stateToUse;
559  }
560  } // last layer...
561 
562  //unsigned int maxCandidates = theMaxCand > 21 ? theMaxCand*2 : 42; //limit the number of returned segments
563  LayerMeasurements layerMeasurements(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
564  TrajectorySegmentBuilder layerBuilder(
565  &layerMeasurements, **il, *propagator, *theUpdator, *theEstimator, theLockHits, theBestHitOnly, theMaxCand);
566 
567 #ifdef EDM_ML_DEBUG
568  LogDebug("CkfPattern") << whatIsTheStateToUse(stateAndLayers.first, stateToUse, *il);
569 #endif
570 
571  auto&& segments = layerBuilder.segments(stateToUse);
572 
573  LogDebug("CkfPattern") << "GCTB: number of segments = " << segments.size();
574 
575  if (!segments.empty())
576  foundSegments = true;
577 
578  for (auto is = segments.begin(); is != segments.end(); is++) {
579  //
580  // assume "invalid hit only" segment is last in list
581  //
582  auto const& measurements = is->measurements();
583  if (!theAlwaysUseInvalid && is != segments.begin() && measurements.size() == 1 &&
584  (measurements.front().recHit()->getType() == TrackingRecHit::missing))
585  break;
586 
587  //---- avoid to add the same hits more than once in the trajectory ----
588  bool toBeRejected(false);
589  for (auto revIt = measurements.rbegin(); revIt != measurements.rend(); --revIt) {
590  // int tmpCounter(0);
591  for (auto newTrajMeasIt = traj.measurements().rbegin(); newTrajMeasIt != traj.measurements().rend();
592  --newTrajMeasIt) {
593  //if(tmpCounter==2) break;
594  if (revIt->recHitR().geographicalId() == newTrajMeasIt->recHitR().geographicalId() &&
595  (revIt->recHitR().geographicalId() != DetId(0))) {
596  toBeRejected = true;
597  goto rejected; //break; // see http://stackoverflow.com/questions/1257744/can-i-use-break-to-exit-multiple-nested-for-loops
598  }
599  // tmpCounter++;
600  }
601  }
602 
603  rejected:; // http://xkcd.com/292/
604  if (toBeRejected) {
605 #ifdef VI_DEBUG
606  cout << "WARNING: neglect candidate because it contains the same hit twice \n";
607  cout << "-- discarded track's pt,eta,#found/lost: "
608  << traj.lastMeasurement().updatedState().globalMomentum().perp() << " , "
609  << traj.lastMeasurement().updatedState().globalMomentum().eta() << " , " << traj.foundHits() << '/'
610  << traj.lostHits() << "\n";
611 #endif
612  traj.setDPhiCacheForLoopersReconstruction(dPhiCacheForLoopersReconstruction);
613  continue; //Are we sure about this????
614  }
615  // ------------------------
616 
617  //
618  // create new candidate
619  //
620  TempTrajectory newTraj(traj);
621  traj.setDPhiCacheForLoopersReconstruction(dPhiCacheForLoopersReconstruction);
622  newTraj.join(*is);
623 
624  //std::cout << "DEBUG: newTraj after push found,lost: "
625  // << newTraj.foundHits() << " , "
626  // << newTraj.lostHits() << " , "
627  // << newTraj.measurements().size() << std::endl;
628 
629  //GIO// for ( vector<TM>::const_iterator im=measurements.begin();
630  //GIO// im!=measurements.end(); im++ ) newTraj.push(*im);
631  //if ( toBeContinued(newTraj,regionalCondition) ) { TOBE FIXED
632  if (toBeContinued(newTraj, inOut)) {
633  // Have added one more hit to track candidate
634 
635  LogDebug("CkfPattern") << "GCTB: adding updated trajectory to candidates: inOut=" << inOut
636  << " hits=" << newTraj.foundHits();
637 
639  newCand.push_back(std::move(newTraj));
640  foundNewCandidates = true;
641  } else {
642  // Have finished building this track. Check if it passes cuts.
643 
644  LogDebug("CkfPattern") << "GCTB: adding completed trajectory to results if passes cuts: inOut=" << inOut
645  << " hits=" << newTraj.foundHits();
646  moveToResult(std::move(newTraj), result, inOut);
647  }
648  } // loop over segs
649  } // loop over layers
650 
651  if (!foundSegments) {
652  LogDebug("CkfPattern") << "GCTB: adding input trajectory to result";
653  if (!stateAndLayers.second.empty())
655  addToResult(traj, result, inOut);
656  }
657  return foundNewCandidates;
658 }
659 
660 namespace {
663  struct LayersInTraj {
664  static constexpr int N = 3;
665  TempTrajectory* traj;
666  std::array<DetLayer const*, N> layers;
667  int tot;
668  void fill(TempTrajectory& t) {
669  traj = &t;
670  tot = 0;
671  const TempTrajectory::DataContainer& measurements = traj->measurements();
672 
673  auto currl = layers[tot] = measurements.back().layer();
675  --ifirst;
676  for (TempTrajectory::DataContainer::const_iterator im = ifirst; im != measurements.rend(); --im) {
677  if (im->layer() != currl) {
678  ++tot;
679  currl = im->layer();
680  if (tot < N)
681  layers[tot] = currl;
682  }
683  }
684  ++tot;
685  }
686 
687  //void verify() {
688  // for (vector<const DetLayer*>::const_iterator iter = result.begin(); iter != result.end(); iter++)
689  // if (!*iter) edm::LogWarning("CkfPattern")<< "Warning: null det layer!! ";
690  // }
691  };
692 } // namespace
693 
694 //TempTrajectoryContainer
696  //if (theTrajectories.empty()) return TrajectoryContainer();
697  //TrajectoryContainer result;
698  if (theTrajectories.empty())
699  return;
700  //RecHitEqualByChannels recHitEqualByChannels(false, false);
701  LayersInTraj layers[theTrajectories.size()];
702  int ntraj = 0;
703  for (auto& t : theTrajectories) {
704  if (t.isValid() && t.lastMeasurement().recHitR().isValid())
705  layers[ntraj++].fill(t);
706  }
707 
708  if (ntraj < 2)
709  return;
710 
711  for (int ifirst = 0; ifirst != ntraj - 1; ++ifirst) {
712  auto firstTraj = layers[ifirst].traj;
713  if (!firstTraj->isValid())
714  continue;
715  const TempTrajectory::DataContainer& firstMeasurements = firstTraj->measurements();
716 
717  int firstLayerSize = layers[ifirst].tot;
718  if (firstLayerSize < 4)
719  continue;
720  auto const& firstLayers = layers[ifirst].layers;
721 
722  for (int isecond = ifirst + 1; isecond != ntraj; ++isecond) {
723  auto secondTraj = layers[isecond].traj;
724  if (!secondTraj->isValid())
725  continue;
726 
727  const TempTrajectory::DataContainer& secondMeasurements = secondTraj->measurements();
728 
729  int secondLayerSize = layers[isecond].tot;
730  //
731  // only candidates using the same last 3 layers are compared
732  //
733  if (firstLayerSize != secondLayerSize)
734  continue; // V.I. why equal???
735  auto const& secondLayers = layers[isecond].layers;
736  if (firstLayers[0] != secondLayers[0] || firstLayers[1] != secondLayers[1] || firstLayers[2] != secondLayers[2])
737  continue;
738 
739  TempTrajectory::DataContainer::const_iterator im1 = firstMeasurements.rbegin();
740  TempTrajectory::DataContainer::const_iterator im2 = secondMeasurements.rbegin();
741  //
742  // check for identical hits in the last layer
743  //
744  bool unequal(false);
745  const DetLayer* layerPtr = firstLayers[0];
746  while (im1 != firstMeasurements.rend() && im2 != secondMeasurements.rend()) {
747  if (im1->layer() != layerPtr || im2->layer() != layerPtr)
748  break;
749  if (!(im1->recHit()->isValid()) || !(im2->recHit()->isValid()) ||
750  !im1->recHit()->hit()->sharesInput(im2->recHit()->hit(), TrackingRecHit::some)) {
752  unequal = true;
753  break;
754  }
755  --im1;
756  --im2;
757  }
758  if (im1 == firstMeasurements.rend() || im2 == secondMeasurements.rend() || im1->layer() == layerPtr ||
759  im2->layer() == layerPtr || unequal)
760  continue;
761  //
762  // check for invalid hits in the layer -2
763  // compare only candidates with invalid / valid combination
764  //
765  layerPtr = firstLayers[1];
766  bool firstValid(true);
767  while (im1 != firstMeasurements.rend() && im1->layer() == layerPtr) {
768  if (!im1->recHit()->isValid())
769  firstValid = false;
770  --im1;
771  }
772  bool secondValid(true);
773  while (im2 != secondMeasurements.rend() && im2->layer() == layerPtr) {
774  if (!im2->recHit()->isValid())
775  secondValid = false;
776  --im2;
777  }
778  if (!tkxor(firstValid, secondValid))
779  continue;
780  //
781  // ask for identical hits in layer -3
782  //
783  unequal = false;
784  layerPtr = firstLayers[2];
785  while (im1 != firstMeasurements.rend() && im2 != secondMeasurements.rend()) {
786  if (im1->layer() != layerPtr || im2->layer() != layerPtr)
787  break;
788  if (!(im1->recHit()->isValid()) || !(im2->recHit()->isValid()) ||
789  !im1->recHit()->hit()->sharesInput(im2->recHit()->hit(), TrackingRecHit::some)) {
791  unequal = true;
792  break;
793  }
794  --im1;
795  --im2;
796  }
797  if (im1 == firstMeasurements.rend() || im2 == secondMeasurements.rend() || im1->layer() == layerPtr ||
798  im2->layer() == layerPtr || unequal)
799  continue;
800 
801  if (!firstValid) {
802  firstTraj->invalidate();
803  break;
804  } else {
805  secondTraj->invalidate(); // V.I. why break?
806  break;
807  }
808  } // second
809  } // first
810  /*
811  for (TempTrajectoryContainer::const_iterator it = theTrajectories.begin();
812  it != theTrajectories.end(); it++) {
813  if(it->isValid()) result.push_back( *it);
814  }
815 
816  return result;
817 */
818  theTrajectories.erase(
819  std::remove_if(theTrajectories.begin(), theTrajectories.end(), std::not_fn(&TempTrajectory::isValid)),
820  theTrajectories.end());
821 }
822 
824  TempTrajectory const& startingTraj,
826  //
827  // Rebuilding of trajectories. Candidates are taken from result,
828  // which will be replaced with the solutions after rebuild
829  // (assume vector::swap is more efficient than building new container)
830  //
831  LogDebug("CkfPattern") << "Starting to rebuild " << result.size() << " tracks";
832  //
833  // Fitter (need to create it here since the propagation direction
834  // might change between different starting trajectories)
835  //
836  auto hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(hitBuilder())->cloner();
837  KFTrajectoryFitter fitter(backwardPropagator(seed), &updator(), &estimator(), 3, nullptr, &hitCloner);
838  //
839  std::vector<const TrackingRecHit*> seedHits;
840 
841  unsigned int nSeed = seed.nHits();
842  //seedHits.reserve(nSeed);
843  TempTrajectoryContainer rebuiltTrajectories;
844 
845  for (TempTrajectoryContainer::iterator it = result.begin(); it != result.end(); it++) {
846  // Refit - keep existing trajectory in case fit is not possible
847  // or fails
848  //
849 
850  auto&& reFitted = backwardFit(*it, nSeed, fitter, seedHits);
851  if UNLIKELY (!reFitted.isValid()) {
852  rebuiltTrajectories.push_back(std::move(*it));
853  LogDebug("CkfPattern") << "RebuildSeedingRegion skipped as backward fit failed";
854  // << "after reFitted.size() " << reFitted.size();
855  continue;
856  }
857  //LogDebug("CkfPattern")<<"after reFitted.size() " << reFitted.size();
858  //
859  // Rebuild seeding part. In case it fails: keep initial trajectory
860  // (better to drop it??)
861  //
862  int nRebuilt = rebuildSeedingRegion(seed, seedHits, reFitted, rebuiltTrajectories);
863  // Loop over the last nRebuilt trajectories and propagate back the
864  // real cause that stopped the original in-out trajectory, since
865  // that's the one we want to monitor
866  for (size_t i = rebuiltTrajectories.size() - 1; i < rebuiltTrajectories.size() - nRebuilt - 1; --i) {
867  rebuiltTrajectories[i].setStopReason(it->stopReason());
868  }
869 
870  if (nRebuilt == 0 && !theKeepOriginalIfRebuildFails)
871  it->invalidate(); // won't use original in-out track
872 
873  if (nRebuilt < 0)
874  rebuiltTrajectories.push_back(std::move(*it));
875  }
876  //
877  // Replace input trajectories with new ones
878  //
879  result.swap(rebuiltTrajectories);
880  result.erase(std::remove_if(result.begin(), result.end(), std::not_fn(&TempTrajectory::isValid)), result.end());
881 }
882 
884  const std::vector<const TrackingRecHit*>& seedHits,
885  TempTrajectory& candidate,
887  //
888  // Starting from track found by in-out tracking phase, extrapolate it inwards through
889  // the seeding region if possible in towards smaller Tracker radii, searching for additional
890  // hits.
891  // The resulting trajectories are returned in result,
892  // the count is the return value.
893  //
894  TempTrajectoryContainer rebuiltTrajectories;
895 #ifdef DBG2_GCTB
896  /* const LayerFinderByDet layerFinder;
897  if ( !seedHits.empty() && seedHits.front().isValid() ) {
898  DetLayer* seedLayer = layerFinder(seedHits.front().det());
899  cout << "Seed hit at " << seedHits.front().globalPosition()
900  << " " << seedLayer << endl;
901  cout << "Started from "
902  << candidate.lastMeasurement().updatedState().globalPosition().perp() << " "
903  << candidate.lastMeasurement().updatedState().globalPosition().z() << endl;
904  pair<bool,TrajectoryStateOnSurface> layerComp(false,TrajectoryStateOnSurface());
905  if ( seedLayer ) layerComp =
906  seedLayer->compatible(candidate.lastMeasurement().updatedState(),
907  propagator(),estimator());
908  pair<bool,TrajectoryStateOnSurface> detComp =
909  seedHits.front().det().compatible(candidate.lastMeasurement().updatedState(),
910  propagator(),estimator());
911  cout << " layer compatibility = " << layerComp.first;
912  cout << " det compatibility = " << detComp.first;
913  if ( detComp.first ) {
914  cout << " estimate = "
915  << estimator().estimate(detComp.second,seedHits.front()).second ;
916  }
917  cout << endl;
918  }*/
919  cout << "Before backward building: #measurements = " << candidate.measurements().size(); //<< endl;;
920 #endif
921  //
922  // Use standard building with standard cuts. Maybe better to use different
923  // cuts from "forward" building (e.g. no check on nr. of invalid hits)?
924  //
925  const bool inOut = false;
926  groupedLimitedCandidates(seed, candidate, nullptr, backwardPropagator(seed), inOut, rebuiltTrajectories);
927 
928  LogDebug("CkfPattern") << " After backward building: " << PrintoutHelper::dumpCandidates(rebuiltTrajectories);
929 
930  //
931  // Check & count resulting candidates
932  //
933  int nrOfTrajectories(0);
934  bool orig_ok = false;
935  //const RecHitEqualByChannels recHitEqual(false,false);
936  //vector<TM> oldMeasurements(candidate.measurements());
937  for (TempTrajectoryContainer::iterator it = rebuiltTrajectories.begin(); it != rebuiltTrajectories.end(); it++) {
938  TempTrajectory::DataContainer newMeasurements(it->measurements());
939  //
940  // Verify presence of seeding hits?
941  //
943  orig_ok = true;
944  // no hits found (and possibly some invalid hits discarded): drop track
945  if (newMeasurements.size() <= candidate.measurements().size()) {
946  LogDebug("CkfPattern") << "newMeasurements.size()<=candidate.measurements().size()";
947  continue;
948  }
949  // verify presence of hits
950  //GIO//if ( !verifyHits(newMeasurements.begin()+candidate.measurements().size(),
951  //GIO// newMeasurements.end(),seedHits) ){
952  if (!verifyHits(newMeasurements.rbegin(), newMeasurements.size() - candidate.measurements().size(), seedHits)) {
953  LogDebug("CkfPattern") << "seed hits not found in rebuild";
954  continue;
955  }
956  }
957  //
958  // construct final trajectory in the right order
959  //
960  // save & count result
961  nrOfTrajectories++;
962  result.emplace_back(seed.direction(), seed.nHits());
963  TempTrajectory& reversedTrajectory = result.back();
964  reversedTrajectory.setNLoops(it->nLoops());
965  for (TempTrajectory::DataContainer::const_iterator im = newMeasurements.rbegin(), ed = newMeasurements.rend();
966  im != ed;
967  --im) {
968  reversedTrajectory.push(*im);
969  }
970 
971  LogDebug("CkgPattern") << "New traj direction = " << reversedTrajectory.direction() << "\n"
972  << PrintoutHelper::dumpMeasurements(reversedTrajectory.measurements());
973  } // rebuiltTrajectories
974 
975  // If nrOfTrajectories = 0 and orig_ok = true, this means that a track was actually found on the
976  // out-in step (meeting those requirements) but did not have the seed hits in it.
977  // In this case when we return we will go ahead and use the original in-out track.
978 
979  // If nrOfTrajectories = 0 and orig_ok = false, this means that the out-in step failed to
980  // find any track. Two cases are a technical failure in fitting the original seed hits or
981  // because the track did not meet the out-in criteria (which may be stronger than the out-in
982  // criteria). In this case we will NOT allow the original in-out track to be used.
983 
984  if ((nrOfTrajectories == 0) && orig_ok) {
985  nrOfTrajectories = -1;
986  }
987  return nrOfTrajectories;
988 }
989 
991  unsigned int nSeed,
992  const TrajectoryFitter& fitter,
993  std::vector<const TrackingRecHit*>& remainingHits) const {
994  //
995  // clear array of non-fitted hits
996  //
997  remainingHits.clear();
998 
999  LogDebug("CkfPattern") << "nSeed " << nSeed << endl
1000  << "Old traj direction = " << candidate.direction() << endl
1002 
1003  //
1004  // backward fit trajectory.
1005  // (Will try to fit only hits outside the seeding region. However,
1006  // if there are not enough of these, it will also use the seeding hits).
1007  //
1008  // const unsigned int nHitAllMin(5);
1009  // const unsigned int nHit2dMin(2);
1010  unsigned int nHit(0); // number of valid hits after seeding region
1011  //unsigned int nHit2d(0); // number of valid hits after seeding region with 2D info
1012  // use all hits except the first n (from seed), but require minimum
1013  // specified in configuration.
1014  // Swapped over next two lines.
1015  unsigned int nHitMin = std::max(candidate.foundHits() - nSeed, theMinNrOfHitsForRebuild);
1016  // unsigned int nHitMin = oldMeasurements.size()-nSeed;
1017  // we want to rebuild only if the number of VALID measurements excluding the seed measurements is higher than the cut
1018  if UNLIKELY (nHitMin < theMinNrOfHitsForRebuild)
1019  return TempTrajectory();
1020 
1021  LogDebug("CkfPattern") /* << "nHitMin " << nHitMin*/ << "Sizes: " << candidate.measurements().size() << " / ";
1022  //
1023  // create input trajectory for backward fit
1024  //
1025  Trajectory fwdTraj(oppositeDirection(candidate.direction()));
1026  fwdTraj.setNLoops(candidate.nLoops());
1027  //const TrajectorySeed seed = TrajectorySeed(PTrajectoryStateOnDet(), TrajectorySeed::recHitContainer(), oppositeDirection(candidate.direction()));
1028  //Trajectory fwdTraj(seed, oppositeDirection(candidate.direction()));
1029 
1030  const DetLayer* bwdDetLayer[candidate.measurements().size()];
1031  int nl = 0;
1032  for (auto const& tm : candidate.measurements()) {
1033  const TrackingRecHit* hit = tm.recHitR().hit();
1034  //
1035  // add hits until required number is reached
1036  //
1037  if (nHit < nHitMin) { //|| nHit2d<theMinNrOf2dHitsForRebuild ) {
1038  fwdTraj.push(tm);
1039  bwdDetLayer[nl++] = tm.layer();
1040  //
1041  // count valid / 2D hits
1042  //
1043  if LIKELY (hit->isValid()) {
1044  nHit++;
1045  //if ( hit.isMatched() ||
1046  // hit.det().detUnits().front()->type().module()==pixel )
1047  //nHit2d++;
1048  }
1049  }
1050  //if (nHit==nHitMin) lastBwdDetLayer=im->layer();
1051  //
1052  // keep remaining (valid) hits for verification
1053  //
1054  else if (hit->isValid()) {
1055  //std::cout << "Adding a remaining hit" << std::endl;
1056  remainingHits.push_back(hit);
1057  }
1058  }
1059  //
1060  // Fit only if required number of valid hits can be used
1061  //
1062  if UNLIKELY (nHit < nHitMin)
1063  return TempTrajectory();
1064 
1065  //
1066  // Do the backward fit (important: start from scaled, not random cov. matrix!)
1067  //
1069  //cout << "firstTsos "<< firstTsos << endl;
1070  firstTsos.rescaleError(10.);
1071  //TrajectoryContainer bwdFitted(fitter.fit(fwdTraj.seed(),fwdTraj.recHits(),firstTsos));
1072  Trajectory&& bwdFitted =
1073  fitter.fitOne(TrajectorySeed({}, {}, oppositeDirection(candidate.direction())), fwdTraj.recHits(), firstTsos);
1074  if UNLIKELY (!bwdFitted.isValid())
1075  return TempTrajectory();
1076 
1077  LogDebug("CkfPattern") << "Obtained bwdFitted trajectory with measurement size " << bwdFitted.measurements().size();
1078  TempTrajectory fitted(fwdTraj.direction(), nSeed);
1079  fitted.setNLoops(fwdTraj.nLoops());
1080  vector<TM> const& tmsbf = bwdFitted.measurements();
1081  int iDetLayer = 0;
1082  //this is ugly but the TM in the fitted track do not contain the DetLayer.
1083  //So we have to cache the detLayer pointers and replug them in.
1084  //For the backward building it would be enaugh to cache the last DetLayer,
1085  //but for the intermediary cleaning we need all
1086  for (vector<TM>::const_iterator im = tmsbf.begin(); im != tmsbf.end(); im++) {
1087  fitted.emplace((*im).forwardPredictedState(),
1088  (*im).backwardPredictedState(),
1089  (*im).updatedState(),
1090  (*im).recHit(),
1091  (*im).estimate(),
1092  bwdDetLayer[iDetLayer]);
1093 
1094  LogDebug("CkfPattern") << PrintoutHelper::dumpMeasurement(*im);
1095  iDetLayer++;
1096  }
1097  /*
1098  TM lastMeas = bwdFitted.front().lastMeasurement();
1099  fitted.pop();
1100  fitted.push(TM(lastMeas.forwardPredictedState(),
1101  lastMeas.backwardPredictedState(),
1102  lastMeas.updatedState(),
1103  lastMeas.recHit(),
1104  lastMeas.estimate(),
1105  lastBwdDetLayer));
1106  */
1107 
1108  return fitted;
1109 }
1110 
1112  size_t maxDepth,
1113  const std::vector<const TrackingRecHit*>& hits) const {
1114  //
1115  // verify presence of the seeding hits
1116  //
1117  LogDebug("CkfPattern") << "Checking for " << hits.size() << " hits in " << maxDepth << " measurements" << endl;
1118 
1119  auto rend = rbegin;
1120  while (maxDepth > 0) {
1121  --maxDepth;
1122  --rend;
1123  }
1124  for (auto ir = hits.begin(); ir != hits.end(); ir++) {
1125  // assume that all seeding hits are valid!
1126  bool foundHit(false);
1127  for (auto im = rbegin; im != rend; --im) {
1128  if (im->recHit()->isValid() && (*ir)->sharesInput(im->recHit()->hit(), TrackingRecHit::some)) {
1129  foundHit = true;
1130  break;
1131  }
1132  }
1133  if (!foundHit)
1134  return false;
1135  }
1136  return true;
1137 }
PropagationDirection direction() const
void setEvent_(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
tuple propagator
const_iterator rend() const
Definition: bqueue.h:198
tuple ret
prodAgent to be discontinued
unsigned int groupedLimitedCandidates(const TrajectorySeed &seed, TempTrajectory const &startingTraj, const TrajectoryFilter *regionalCondition, const Propagator *propagator, bool inOut, TempTrajectoryContainer &result) const
static std::string dumpCandidates(collection &candidates)
const edm::EventSetup & c
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:171
virtual float length() const =0
T perp() const
Definition: PV3DBase.h:69
void join(TempTrajectory &segment)
bool empty() const
True if trajectory has no measurements.
bool isFromDet(TrackingRecHit const &hit)
virtual Location location() const =0
Which part of the detector (barrel, endcap)
static void clean(TempTrajectoryContainer &tracks)
const Propagator * forwardPropagator(const TrajectorySeed &seed) const
const CurvilinearTrajectoryError & curvilinearError() const
const DataContainer & measurements() const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
void setNLoops(signed char value)
Definition: Trajectory.h:331
void setNLoops(signed char value)
const TrajectoryStateUpdator * theUpdator
virtual void analyseSeed(const TrajectorySeed &seed) const
#define LIKELY(x)
Definition: Likely.h:20
GlobalPoint globalPosition() const
ConstRecHitContainer recHits() const
Definition: Trajectory.h:186
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
void addToResult(std::shared_ptr< const TrajectorySeed > const &seed, TempTrajectory &traj, TrajectoryContainer &result, bool inOut=false) const
int foundHits() const
static std::string dumpMeasurement(const TrajectoryMeasurement &tm)
static std::string dumpMeasurements(const std::vector< TrajectoryMeasurement > &v)
TempTrajectory buildTrajectories(const TrajectorySeed &seed, TrajectoryContainer &ret, unsigned int &nCandPerSeed, const TrajectoryFilter *) const override
common part of both public trajectory building methods
signed char nLoops() const
Definition: Trajectory.h:329
tuple result
Definition: mps_fire.py:311
const TrajectoryMeasurement & lastMeasurement() const
PropagationDirection const & direction() const
Definition: Trajectory.cc:133
PropagationDirection direction() const
void setDPhiCacheForLoopersReconstruction(float dphi)
DataContainer const & measurements() const
Definition: Trajectory.h:178
const TransientTrackingRecHitBuilder * hitBuilder() const
virtual void analyseResult(const TrajectoryContainer &result) const
static PropagationDirection oppositeDirection(PropagationDirection dir)
change of propagation direction
GroupedCkfTrajectoryBuilder(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
constructor from ParameterSet
bool verifyHits(TempTrajectory::DataContainer::const_iterator rbegin, size_t maxDepth, const std::vector< const TrackingRecHit * > &hits) const
Verifies presence of a RecHits in a range of TrajectoryMeasurements.
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
void groupedIntermediaryClean(TempTrajectoryContainer &theTrajectories) const
intermediate cleaning in the case of grouped measurements
def move
Definition: eostools.py:511
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
const Chi2MeasurementEstimatorBase & estimator() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TempTrajectory backwardFit(TempTrajectory &candidate, unsigned int nSeed, const TrajectoryFitter &fitter, std::vector< const TrackingRecHit * > &remainingHits) const
const DetLayer * layer() const
bool advanceOneLayer(const TrajectorySeed &seed, TempTrajectory &traj, const TrajectoryFilter *regionalCondition, const Propagator *propagator, bool inOut, TempTrajectoryContainer &newCand, TempTrajectoryContainer &result) const
#define CMS_THREAD_SAFE
virtual Trajectory fitOne(const Trajectory &traj, fitType type=standard) const =0
const T & back() const
Definition: bqueue.h:195
const_iterator rbegin() const
Definition: bqueue.h:197
bool isValid() const
StateAndLayers findStateAndLayers(const TrajectorySeed &seed, const TempTrajectory &traj) const
const MeasurementTrackerEvent * theMeasurementTracker
Definition: DetId.h:17
bool isValid() const
Definition: Trajectory.h:257
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:166
#define N
Definition: blowfish.cc:9
void fill(std::map< std::string, TH1 * > &h, const std::string &s, double x)
std::vector< TempTrajectory > TempTrajectoryContainer
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool isValid() const
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
ConstRecHitPointer::element_type const & recHitR() const
const TrajectoryStateUpdator & updator() const
void moveToResult(TempTrajectory &&traj, TempTrajectoryContainer &result, bool inOut=false) const
T eta() const
Definition: PV3DBase.h:73
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation with default (=geometrical) propagator
void rebuildTrajectories(TempTrajectory const &startingTraj, const TrajectorySeed &, TrajectoryContainer &result) const override
unsigned int nHits() const
const AlgebraicSymMatrix55 & matrix() const
GlobalVector globalMomentum() const
TrajectoryContainer trajectories(const TrajectorySeed &) const override
set Event for the internal MeasurementTracker data member
bool toBeContinued(TempTrajectory &traj, bool inOut=false) const
void setStopReason(StopReason s)
bool tkxor(bool a, bool b) const
virtual const BoundDisk & specificSurface() const final
bool isUndef(TrackingRecHit const &hit)
const Propagator * backwardPropagator(const TrajectorySeed &seed) const
tuple cout
Definition: gather_cfg.py:144
TrajectoryStateOnSurface const & updatedState() const
size_type size() const
Definition: bqueue.h:201
Definition: Bounds.h:18
#define UNLIKELY(x)
Definition: Likely.h:21
signed char nLoops() const
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
tmp
align.sh
Definition: createJobs.py:716
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:50
std::vector< Trajectory > TrajectoryContainer
const Chi2MeasurementEstimatorBase * theEstimator
void rebuildSeedingRegion(const TrajectorySeed &, TrajectoryContainer &result) const override
TempTrajectory createStartingTrajectory(const TrajectorySeed &seed) const
int lostHits() const
void push(const TrajectoryMeasurement &tm)
void clean(TempTrajectoryContainer &) const override
tuple firstValid
Definition: align_cfg.py:68
#define LogDebug(id)