CMS 3D CMS Logo

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