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 
223 }
224 
227 
228  TrajectoryContainer final;
229 
230  // better the seed to be always the same...
231  std::shared_ptr<const TrajectorySeed> sharedSeed;
232  if (result.empty())
233  sharedSeed.reset(new TrajectorySeed(seed));
234  else
235  sharedSeed = result.front().sharedSeed();
236 
237  work.reserve(result.size());
238  for (auto&& traj : result)
239  if (traj.isValid())
240  work.emplace_back(std::move(traj));
241 
243 
244  // we clean here now
246  cleaner.clean(work);
247 
248  for (auto const& it : work)
249  if (it.isValid()) {
250  final.push_back(it.toTrajectory());
251  final.back().setSharedSeed(sharedSeed);
252  }
253 
254  result.swap(final);
255 
256  statCount.rebuilt(result.size());
257 }
258 
261  unsigned int& nCandPerSeed,
262  const TrajectoryFilter* regionalCondition) const {
263  if (theMeasurementTracker == nullptr) {
264  throw cms::Exception("LogicError")
265  << "Asking to create trajectories to an un-initialized GroupedCkfTrajectoryBuilder.\nYou have to call "
266  "clone(const MeasurementTrackerEvent *data) and then call trajectories on it instead.\n";
267  }
268 
269  statCount.seed();
270  //
271  // Build trajectory outwards from seed
272  //
273 
274  analyseSeed(seed);
275 
276  TempTrajectory const& startingTraj = createStartingTrajectory(seed);
277 
278  work_.clear();
279  const bool inOut = true;
280  nCandPerSeed = groupedLimitedCandidates(seed, startingTraj, regionalCondition, forwardPropagator(seed), inOut, work_);
281  if (work_.empty())
282  return;
283 
284  // cleaning now done here...
286  cleaner.clean(work_);
287 
288  std::shared_ptr<const TrajectorySeed> pseed(new TrajectorySeed(seed));
289  for (auto const& it : work_)
290  if (it.isValid()) {
291  result.push_back(it.toTrajectory());
292  result.back().setSharedSeed(pseed);
293  }
294  work_.clear();
295  if (work_.capacity() > work_MaxSize_) {
296  TempTrajectoryContainer().swap(work_);
297  work_.reserve(work_MaxSize_ / 2);
298  }
299 
301 
302  LogDebug("CkfPattern") << "GroupedCkfTrajectoryBuilder: returning result of size " << result.size();
303  statCount.traj(result.size());
304 
305 #ifdef VI_DEBUG
306  int kt = 0;
307  for (auto const& traj : result) {
308  int chit[7] = {};
309  for (auto const& tm : traj.measurements()) {
310  auto const& hit = tm.recHitR();
311  if (!hit.isValid())
312  ++chit[0];
313  if (hit.det() == nullptr)
314  ++chit[1];
316  continue;
317  if (hit.dimension() != 2) {
318  ++chit[2];
319  } else if (trackerHitRTTI::isFromDet(hit)) {
320  auto const& thit = static_cast<BaseTrackerRecHit const&>(hit);
321  auto const& clus = thit.firstClusterRef();
322  if (clus.isPixel())
323  ++chit[3];
324  else if (thit.isMatched()) {
325  ++chit[4];
326  } else if (thit.isProjected()) {
327  ++chit[5];
328  } else {
329  ++chit[6];
330  }
331  }
332  }
333 
334  std::cout << "ckf " << kt++ << ": ";
335  for (auto c : chit)
336  std::cout << c << '/';
337  std::cout << std::endl;
338  }
339 #endif
340 }
341 
343  TempTrajectory const& startingTraj,
344  const TrajectoryFilter* regionalCondition,
345  const Propagator* propagator,
346  bool inOut,
348  unsigned int nIter = 1;
349  unsigned int nCands = 0; // ignore startingTraj
350  unsigned int prevNewCandSize = 0;
352  TempTrajectoryContainer newCand;
353  newCand.reserve(theMaxCand);
354  candidates.push_back(startingTraj);
355 
356  while (!candidates.empty()) {
357  newCand.clear();
358  for (TempTrajectoryContainer::iterator traj = candidates.begin(); traj != candidates.end(); traj++) {
359  if (!advanceOneLayer(seed, *traj, regionalCondition, propagator, inOut, newCand, result)) {
360  LogDebug("CkfPattern") << "GCTB: terminating after advanceOneLayer==false";
361  continue;
362  }
363 
364  LogDebug("CkfPattern") << "newCand(1): after advanced one layer:\n" << PrintoutHelper::dumpCandidates(newCand);
365  // account only new candidates, i.e.
366  // - 1 candidate -> 1 candidate, don't increase count
367  // - 1 candidate -> 2 candidates, increase count by 1
368  nCands += newCand.size() - prevNewCandSize;
369  prevNewCandSize = newCand.size();
370 
371  assert((int)newCand.size() <= theMaxCand);
372  }
373 
374  LogDebug("CkfPattern") << "newCand.size() at end = " << newCand.size();
375 
377 #ifdef STANDARD_INTERMEDIARYCLEAN
379 #else
380  groupedIntermediaryClean(newCand);
381 #endif
382  }
383  candidates.swap(newCand);
384 
385  LogDebug("CkfPattern") << "candidates(3): " << result.size() << " candidates after " << nIter++
386  << " groupedCKF iteration: \n"
387  << PrintoutHelper::dumpCandidates(result) << "\n " << candidates.size()
388  << " running candidates are: \n"
390  }
391 
392  return nCands;
393 }
394 
395 #ifdef EDM_ML_DEBUG
396 std::string whatIsTheNextStep(TempTrajectory const& traj,
397  std::pair<TrajectoryStateOnSurface, std::vector<const DetLayer*> >& stateAndLayers) {
398  std::stringstream buffer;
399  vector<const DetLayer*>& nl = stateAndLayers.second;
400  // #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
401  // #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h"
402  //B.M. TkLayerName layerName;
403  //B.M. buffer << "Started from " << layerName(traj.lastLayer())
404  const BarrelDetLayer* sbdl = dynamic_cast<const BarrelDetLayer*>(traj.lastLayer());
405  const ForwardDetLayer* sfdl = dynamic_cast<const ForwardDetLayer*>(traj.lastLayer());
406  if (sbdl) {
407  buffer << "Started from " << traj.lastLayer() << " r=" << sbdl->specificSurface().radius()
408  << " phi=" << sbdl->specificSurface().phi() << endl;
409  } else if (sfdl) {
410  buffer << "Started from " << traj.lastLayer() << " z " << sfdl->specificSurface().position().z() << " phi "
411  << sfdl->specificSurface().phi() << endl;
412  }
413  buffer << "Trying to go to";
414  for (vector<const DetLayer*>::iterator il = nl.begin(); il != nl.end(); il++) {
415  //B.M. buffer << " " << layerName(*il) << " " << *il << endl;
416  const BarrelDetLayer* bdl = dynamic_cast<const BarrelDetLayer*>(*il);
417  const ForwardDetLayer* fdl = dynamic_cast<const ForwardDetLayer*>(*il);
418 
419  if (bdl)
420  buffer << " r " << bdl->specificSurface().radius() << endl;
421  if (fdl)
422  buffer << " z " << fdl->specificSurface().position().z() << endl;
423  //buffer << " " << *il << endl;
424  }
425  return buffer.str();
426 }
427 
428 std::string whatIsTheStateToUse(TrajectoryStateOnSurface& initial,
429  TrajectoryStateOnSurface& stateToUse,
430  const DetLayer* l) {
431  std::stringstream buffer;
432  buffer << "GCTB: starting from "
433  << " r / phi / z = " << stateToUse.globalPosition().perp() << " / " << stateToUse.globalPosition().phi()
434  << " / " << stateToUse.globalPosition().z()
435  << " , pt / phi / pz /charge = " << stateToUse.globalMomentum().perp() << " / "
436  << stateToUse.globalMomentum().phi() << " / " << stateToUse.globalMomentum().z() << " / "
437  << stateToUse.charge() << " for layer at " << l << endl;
438  buffer << " errors:";
439  for (int i = 0; i < 5; i++)
440  buffer << " " << sqrt(stateToUse.curvilinearError().matrix()(i, i));
441  buffer << endl;
442 
443  //buffer << "GCTB: starting from r / phi / z = " << initial.globalPosition().perp()
444  //<< " / " << initial.globalPosition().phi()
445  //<< " / " << initial.globalPosition().z() << " , pt / pz = "
446  //<< initial.globalMomentum().perp() << " / "
447  //<< initial.globalMomentum().z() << " for layer at "
448  //<< l << endl;
449  //buffer << " errors:";
450  //for ( int i=0; i<5; i++ ) buffer << " " << sqrt(initial.curvilinearError().matrix()(i,i));
451  //buffer << endl;
452  return buffer.str();
453 }
454 #endif
455 
457  TempTrajectory& traj,
458  const TrajectoryFilter* regionalCondition,
459  const Propagator* propagator,
460  bool inOut,
461  TempTrajectoryContainer& newCand,
463  std::pair<TSOS, std::vector<const DetLayer*> >&& stateAndLayers = findStateAndLayers(seed, traj);
464 
465  bool full = (int)newCand.size() == theMaxCand;
467 
469  if (
470  //stateAndLayers.second.size()==0 &&
471  traj.lastLayer()->location() == 0) {
472  float pt2 = stateAndLayers.first.globalMomentum().perp2();
473  if (pt2 < maxPt2ForLooperReconstruction && pt2 > (0.3f * 0.3f))
474  stateAndLayers.second.push_back(traj.lastLayer());
475  }
476  }
477 
478  auto layerBegin = stateAndLayers.second.begin();
479  auto layerEnd = stateAndLayers.second.end();
480 
481  // if (nl.empty()) {
482  // addToResult(traj,result,inOut);
483  // return false;
484  // }
485 
486 #ifdef EDM_ML_DEBUG
487  LogDebug("CkfPattern") << whatIsTheNextStep(traj, stateAndLayers);
488 #endif
489 
490  bool foundSegments(false);
491  bool foundNewCandidates(false);
492  for (auto il = layerBegin; il != layerEnd; il++) {
493  TSOS stateToUse = stateAndLayers.first;
494 
495  double dPhiCacheForLoopersReconstruction(0);
496  if UNLIKELY (!traj.empty() && (*il) == traj.lastLayer()) {
498  // ------ For loopers reconstruction
499  //cout<<" self propagating in advanceOneLayer (for loopers) \n";
500  const BarrelDetLayer* sbdl = dynamic_cast<const BarrelDetLayer*>(traj.lastLayer());
501  if (sbdl) {
502  HelixBarrelCylinderCrossing cylinderCrossing(stateToUse.globalPosition(),
503  stateToUse.globalMomentum(),
504  stateToUse.transverseCurvature(),
505  propagator->propagationDirection(),
506  sbdl->specificSurface());
507  if (!cylinderCrossing.hasSolution())
508  continue;
509  GlobalPoint starting = stateToUse.globalPosition();
510  GlobalPoint target1 = cylinderCrossing.position1();
511  GlobalPoint target2 = cylinderCrossing.position2();
512 
513  GlobalPoint farther =
514  fabs(starting.phi() - target1.phi()) > fabs(starting.phi() - target2.phi()) ? target1 : target2;
515 
516  const Bounds& bounds(sbdl->specificSurface().bounds());
517  float length = 0.5f * bounds.length();
518 
519  /*
520  cout << "starting: " << starting << endl;
521  cout << "target1: " << target1 << endl;
522  cout << "target2: " << target2 << endl;
523  cout << "dphi: " << (target1.phi()-target2.phi()) << endl;
524  cout << "length: " << length << endl;
525  */
526 
527  /*
528  float deltaZ = bounds.thickness()/2.f/fabs(tan(stateToUse.globalDirection().theta()) ) ;
529  if(stateToUse.hasError())
530  deltaZ += 3*sqrt(stateToUse.cartesianError().position().czz());
531  if( fabs(farther.z()) > length + deltaZ ) continue;
532  */
533  if (fabs(farther.z()) * 0.95f > length)
534  continue;
535 
536  Geom::Phi<float> tmpDphi = target1.phi() - target2.phi();
538  continue;
539  GlobalPoint target(0.5f * (target1.basicVector() + target2.basicVector()));
540  //cout << "target: " << target << endl;
541 
543  stateToUse = extrapolator.extrapolate(stateToUse, target, *propagator);
544  if (!stateToUse.isValid())
545  continue; //SK: consider trying the original? probably not
546 
547  //dPhiCacheForLoopersReconstruction = fabs(target1.phi()-target2.phi())*2.;
548  dPhiCacheForLoopersReconstruction = std::abs(tmpDphi);
549  traj.incrementLoops();
550  } else { // not barrel
551  continue;
552  }
553  } else { // loopers not requested (why else???)
554  // ------ For cosmics reconstruction
555  LogDebug("CkfPattern") << " self propagating in advanceOneLayer.\n from: \n" << stateToUse;
556  //self navigation case
557  // go to a middle point first
559  GlobalPoint center(0, 0, 0);
560  stateToUse = middle.extrapolate(stateToUse, center, *(forwardPropagator(seed)));
561 
562  if (!stateToUse.isValid())
563  continue;
564  LogDebug("CkfPattern") << "to: " << stateToUse;
565  }
566  } // last layer...
567 
568  //unsigned int maxCandidates = theMaxCand > 21 ? theMaxCand*2 : 42; //limit the number of returned segments
569  LayerMeasurements layerMeasurements(theMeasurementTracker->measurementTracker(), *theMeasurementTracker);
570  TrajectorySegmentBuilder layerBuilder(
571  &layerMeasurements, **il, *propagator, *theUpdator, *theEstimator, theLockHits, theBestHitOnly, theMaxCand);
572 
573 #ifdef EDM_ML_DEBUG
574  LogDebug("CkfPattern") << whatIsTheStateToUse(stateAndLayers.first, stateToUse, *il);
575 #endif
576 
577  auto&& segments = layerBuilder.segments(stateToUse);
578 
579  LogDebug("CkfPattern") << "GCTB: number of segments = " << segments.size();
580 
581  if (!segments.empty())
582  foundSegments = true;
583 
584  for (auto is = segments.begin(); is != segments.end(); is++) {
585  //
586  // assume "invalid hit only" segment is last in list
587  //
588  auto const& measurements = is->measurements();
589  if (!theAlwaysUseInvalid && is != segments.begin() && measurements.size() == 1 &&
590  (measurements.front().recHit()->getType() == TrackingRecHit::missing))
591  break;
592 
593  //---- avoid to add the same hits more than once in the trajectory ----
594  bool toBeRejected(false);
595  for (auto revIt = measurements.rbegin(); revIt != measurements.rend(); --revIt) {
596  // int tmpCounter(0);
597  for (auto newTrajMeasIt = traj.measurements().rbegin(); newTrajMeasIt != traj.measurements().rend();
598  --newTrajMeasIt) {
599  //if(tmpCounter==2) break;
600  if (revIt->recHitR().geographicalId() == newTrajMeasIt->recHitR().geographicalId() &&
601  (revIt->recHitR().geographicalId() != DetId(0))) {
602  toBeRejected = true;
603  goto rejected; //break; // see http://stackoverflow.com/questions/1257744/can-i-use-break-to-exit-multiple-nested-for-loops
604  }
605  // tmpCounter++;
606  }
607  }
608 
609  rejected:; // http://xkcd.com/292/
610  if (toBeRejected) {
611 #ifdef VI_DEBUG
612  cout << "WARNING: neglect candidate because it contains the same hit twice \n";
613  cout << "-- discarded track's pt,eta,#found/lost: "
614  << traj.lastMeasurement().updatedState().globalMomentum().perp() << " , "
615  << traj.lastMeasurement().updatedState().globalMomentum().eta() << " , " << traj.foundHits() << '/'
616  << traj.lostHits() << "\n";
617 #endif
618  traj.setDPhiCacheForLoopersReconstruction(dPhiCacheForLoopersReconstruction);
619  continue; //Are we sure about this????
620  }
621  // ------------------------
622 
623  //
624  // create new candidate
625  //
626  TempTrajectory newTraj(traj);
627  traj.setDPhiCacheForLoopersReconstruction(dPhiCacheForLoopersReconstruction);
628  newTraj.join(*is);
629 
630  //std::cout << "DEBUG: newTraj after push found,lost: "
631  // << newTraj.foundHits() << " , "
632  // << newTraj.lostHits() << " , "
633  // << newTraj.measurements().size() << std::endl;
634 
635  //GIO// for ( vector<TM>::const_iterator im=measurements.begin();
636  //GIO// im!=measurements.end(); im++ ) newTraj.push(*im);
637  //if ( toBeContinued(newTraj,regionalCondition) ) { TOBE FIXED
638  if (toBeContinued(newTraj, inOut)) {
639  // Have added one more hit to track candidate
640 
641  LogDebug("CkfPattern") << "GCTB: adding updated trajectory to candidates: inOut=" << inOut
642  << " hits=" << newTraj.foundHits();
643 
645  if (full) {
646  bool better = lessTraj(newTraj, newCand.front());
647  if (better) {
648  // replace worst
649  foundNewCandidates = true;
650  std::pop_heap(newCand.begin(), newCand.end(), lessTraj);
651  newCand.back().swap(newTraj);
652  std::push_heap(newCand.begin(), newCand.end(), lessTraj);
653  } // else? no need to add it just to remove it later!
654  } else {
655  newCand.push_back(std::move(newTraj));
656  foundNewCandidates = true;
657  full = (int)newCand.size() == theMaxCand;
658  if (full)
659  std::make_heap(newCand.begin(), newCand.end(), lessTraj);
660  }
661  } else {
662  // Have finished building this track. Check if it passes cuts.
663 
664  LogDebug("CkfPattern") << "GCTB: adding completed trajectory to results if passes cuts: inOut=" << inOut
665  << " hits=" << newTraj.foundHits();
666  moveToResult(std::move(newTraj), result, inOut);
667  }
668  } // loop over segs
669  } // loop over layers
670 
671  if (!foundSegments) {
672  LogDebug("CkfPattern") << "GCTB: adding input trajectory to result";
673  if (!stateAndLayers.second.empty())
675  addToResult(traj, result, inOut);
676  }
677  return foundNewCandidates;
678 }
679 
680 namespace {
683  struct LayersInTraj {
684  static constexpr int N = 3;
685  TempTrajectory* traj;
686  std::array<DetLayer const*, N> layers;
687  int tot;
688  void fill(TempTrajectory& t) {
689  traj = &t;
690  tot = 0;
691  const TempTrajectory::DataContainer& measurements = traj->measurements();
692 
693  auto currl = layers[tot] = measurements.back().layer();
695  --ifirst;
696  for (TempTrajectory::DataContainer::const_iterator im = ifirst; im != measurements.rend(); --im) {
697  if (im->layer() != currl) {
698  ++tot;
699  currl = im->layer();
700  if (tot < N)
701  layers[tot] = currl;
702  }
703  }
704  ++tot;
705  }
706 
707  //void verify() {
708  // for (vector<const DetLayer*>::const_iterator iter = result.begin(); iter != result.end(); iter++)
709  // if (!*iter) edm::LogWarning("CkfPattern")<< "Warning: null det layer!! ";
710  // }
711  };
712 } // namespace
713 
714 //TempTrajectoryContainer
716  //if (theTrajectories.empty()) return TrajectoryContainer();
717  //TrajectoryContainer result;
718  if (theTrajectories.empty())
719  return;
720  //RecHitEqualByChannels recHitEqualByChannels(false, false);
721  LayersInTraj layers[theTrajectories.size()];
722  int ntraj = 0;
723  for (auto& t : theTrajectories) {
724  if (t.isValid() && t.lastMeasurement().recHitR().isValid())
725  layers[ntraj++].fill(t);
726  }
727 
728  if (ntraj < 2)
729  return;
730 
731  for (int ifirst = 0; ifirst != ntraj - 1; ++ifirst) {
732  auto firstTraj = layers[ifirst].traj;
733  if (!firstTraj->isValid())
734  continue;
735  const TempTrajectory::DataContainer& firstMeasurements = firstTraj->measurements();
736 
737  int firstLayerSize = layers[ifirst].tot;
738  if (firstLayerSize < 4)
739  continue;
740  auto const& firstLayers = layers[ifirst].layers;
741 
742  for (int isecond = ifirst + 1; isecond != ntraj; ++isecond) {
743  auto secondTraj = layers[isecond].traj;
744  if (!secondTraj->isValid())
745  continue;
746 
747  const TempTrajectory::DataContainer& secondMeasurements = secondTraj->measurements();
748 
749  int secondLayerSize = layers[isecond].tot;
750  //
751  // only candidates using the same last 3 layers are compared
752  //
753  if (firstLayerSize != secondLayerSize)
754  continue; // V.I. why equal???
755  auto const& secondLayers = layers[isecond].layers;
756  if (firstLayers[0] != secondLayers[0] || firstLayers[1] != secondLayers[1] || firstLayers[2] != secondLayers[2])
757  continue;
758 
759  TempTrajectory::DataContainer::const_iterator im1 = firstMeasurements.rbegin();
760  TempTrajectory::DataContainer::const_iterator im2 = secondMeasurements.rbegin();
761  //
762  // check for identical hits in the last layer
763  //
764  bool unequal(false);
765  const DetLayer* layerPtr = firstLayers[0];
766  while (im1 != firstMeasurements.rend() && im2 != secondMeasurements.rend()) {
767  if (im1->layer() != layerPtr || im2->layer() != layerPtr)
768  break;
769  if (!(im1->recHit()->isValid()) || !(im2->recHit()->isValid()) ||
770  !im1->recHit()->hit()->sharesInput(im2->recHit()->hit(), TrackingRecHit::some)) {
772  unequal = true;
773  break;
774  }
775  --im1;
776  --im2;
777  }
778  if (im1 == firstMeasurements.rend() || im2 == secondMeasurements.rend() || im1->layer() == layerPtr ||
779  im2->layer() == layerPtr || unequal)
780  continue;
781  //
782  // check for invalid hits in the layer -2
783  // compare only candidates with invalid / valid combination
784  //
785  layerPtr = firstLayers[1];
786  bool firstValid(true);
787  while (im1 != firstMeasurements.rend() && im1->layer() == layerPtr) {
788  if (!im1->recHit()->isValid())
789  firstValid = false;
790  --im1;
791  }
792  bool secondValid(true);
793  while (im2 != secondMeasurements.rend() && im2->layer() == layerPtr) {
794  if (!im2->recHit()->isValid())
795  secondValid = false;
796  --im2;
797  }
798  if (!tkxor(firstValid, secondValid))
799  continue;
800  //
801  // ask for identical hits in layer -3
802  //
803  unequal = false;
804  layerPtr = firstLayers[2];
805  while (im1 != firstMeasurements.rend() && im2 != secondMeasurements.rend()) {
806  if (im1->layer() != layerPtr || im2->layer() != layerPtr)
807  break;
808  if (!(im1->recHit()->isValid()) || !(im2->recHit()->isValid()) ||
809  !im1->recHit()->hit()->sharesInput(im2->recHit()->hit(), TrackingRecHit::some)) {
811  unequal = true;
812  break;
813  }
814  --im1;
815  --im2;
816  }
817  if (im1 == firstMeasurements.rend() || im2 == secondMeasurements.rend() || im1->layer() == layerPtr ||
818  im2->layer() == layerPtr || unequal)
819  continue;
820 
821  if (!firstValid) {
822  firstTraj->invalidate();
823  break;
824  } else {
825  secondTraj->invalidate(); // V.I. why break?
826  break;
827  }
828  } // second
829  } // first
830  /*
831  for (TempTrajectoryContainer::const_iterator it = theTrajectories.begin();
832  it != theTrajectories.end(); it++) {
833  if(it->isValid()) result.push_back( *it);
834  }
835 
836  return result;
837 */
838  theTrajectories.erase(
839  std::remove_if(theTrajectories.begin(), theTrajectories.end(), std::not_fn(&TempTrajectory::isValid)),
840  theTrajectories.end());
841 }
842 
845  //
846  // Rebuilding of trajectories. Candidates are taken from result,
847  // which will be replaced with the solutions after rebuild
848  // (assume vector::swap is more efficient than building new container)
849  //
850  LogDebug("CkfPattern") << "Starting to rebuild " << result.size() << " tracks";
851  //
852  // Fitter (need to create it here since the propagation direction
853  // might change between different starting trajectories)
854  //
855  auto hitCloner = static_cast<TkTransientTrackingRecHitBuilder const*>(hitBuilder())->cloner();
856  KFTrajectoryFitter fitter(backwardPropagator(seed), &updator(), &estimator(), 3, nullptr, &hitCloner);
857  //
858  std::vector<const TrackingRecHit*> seedHits;
859 
860  unsigned int nSeed = seed.nHits();
861  //seedHits.reserve(nSeed);
862  TempTrajectoryContainer rebuiltTrajectories;
863 
864  for (TempTrajectoryContainer::iterator it = result.begin(); it != result.end(); it++) {
865  // Refit - keep existing trajectory in case fit is not possible
866  // or fails
867  //
868  assert(it->isValid());
869  auto&& reFitted = backwardFit(*it, nSeed, fitter, seedHits);
870  if UNLIKELY (!reFitted.isValid()) {
871  rebuiltTrajectories.push_back(std::move(*it));
872  LogDebug("CkfPattern") << "RebuildSeedingRegion skipped as backward fit failed";
873  // << "after reFitted.size() " << reFitted.size();
874  continue;
875  }
876  //LogDebug("CkfPattern")<<"after reFitted.size() " << reFitted.size();
877  //
878  // Rebuild seeding part. In case it fails: keep initial trajectory
879  // (better to drop it??)
880  //
881  int nRebuilt = rebuildSeedingRegion(seed, seedHits, reFitted, rebuiltTrajectories);
882  // Loop over the last nRebuilt trajectories and propagate back the
883  // real cause that stopped the original in-out trajectory, since
884  // that's the one we want to monitor
885  for (size_t i = rebuiltTrajectories.size() - 1; i < rebuiltTrajectories.size() - nRebuilt - 1; --i) {
886  rebuiltTrajectories[i].setStopReason(it->stopReason());
887  }
888 
889  if (nRebuilt == 0 && !theKeepOriginalIfRebuildFails)
890  it->invalidate(); // won't use original in-out track
891 
892  if (nRebuilt < 0)
893  rebuiltTrajectories.push_back(std::move(*it));
894  }
895  //
896  // Replace input trajectories with new ones
897  //
898  result.swap(rebuiltTrajectories);
899  result.erase(std::remove_if(result.begin(), result.end(), std::not_fn(&TempTrajectory::isValid)), result.end());
900 }
901 
903  const std::vector<const TrackingRecHit*>& seedHits,
904  TempTrajectory& candidate,
906  //
907  // Starting from track found by in-out tracking phase, extrapolate it inwards through
908  // the seeding region if possible in towards smaller Tracker radii, searching for additional
909  // hits.
910  // The resulting trajectories are returned in result,
911  // the count is the return value.
912  //
913  TempTrajectoryContainer rebuiltTrajectories;
914 #ifdef DBG2_GCTB
915  /* const LayerFinderByDet layerFinder;
916  if ( !seedHits.empty() && seedHits.front().isValid() ) {
917  DetLayer* seedLayer = layerFinder(seedHits.front().det());
918  cout << "Seed hit at " << seedHits.front().globalPosition()
919  << " " << seedLayer << endl;
920  cout << "Started from "
921  << candidate.lastMeasurement().updatedState().globalPosition().perp() << " "
922  << candidate.lastMeasurement().updatedState().globalPosition().z() << endl;
923  pair<bool,TrajectoryStateOnSurface> layerComp(false,TrajectoryStateOnSurface());
924  if ( seedLayer ) layerComp =
925  seedLayer->compatible(candidate.lastMeasurement().updatedState(),
926  propagator(),estimator());
927  pair<bool,TrajectoryStateOnSurface> detComp =
928  seedHits.front().det().compatible(candidate.lastMeasurement().updatedState(),
929  propagator(),estimator());
930  cout << " layer compatibility = " << layerComp.first;
931  cout << " det compatibility = " << detComp.first;
932  if ( detComp.first ) {
933  cout << " estimate = "
934  << estimator().estimate(detComp.second,seedHits.front()).second ;
935  }
936  cout << endl;
937  }*/
938  cout << "Before backward building: #measurements = " << candidate.measurements().size(); //<< endl;;
939 #endif
940  //
941  // Use standard building with standard cuts. Maybe better to use different
942  // cuts from "forward" building (e.g. no check on nr. of invalid hits)?
943  //
944  const bool inOut = false;
945  groupedLimitedCandidates(seed, candidate, nullptr, backwardPropagator(seed), inOut, rebuiltTrajectories);
946 
947  LogDebug("CkfPattern") << " After backward building: " << PrintoutHelper::dumpCandidates(rebuiltTrajectories);
948 
949  //
950  // Check & count resulting candidates
951  //
952  int nrOfTrajectories(0);
953  bool orig_ok = false;
954  //const RecHitEqualByChannels recHitEqual(false,false);
955  //vector<TM> oldMeasurements(candidate.measurements());
956  for (TempTrajectoryContainer::iterator it = rebuiltTrajectories.begin(); it != rebuiltTrajectories.end(); it++) {
957  TempTrajectory::DataContainer newMeasurements(it->measurements());
958  //
959  // Verify presence of seeding hits?
960  //
962  orig_ok = true;
963  // no hits found (and possibly some invalid hits discarded): drop track
964  if (newMeasurements.size() <= candidate.measurements().size()) {
965  LogDebug("CkfPattern") << "newMeasurements.size()<=candidate.measurements().size()";
966  continue;
967  }
968  // verify presence of hits
969  //GIO//if ( !verifyHits(newMeasurements.begin()+candidate.measurements().size(),
970  //GIO// newMeasurements.end(),seedHits) ){
971  if (!verifyHits(newMeasurements.rbegin(), newMeasurements.size() - candidate.measurements().size(), seedHits)) {
972  LogDebug("CkfPattern") << "seed hits not found in rebuild";
973  continue;
974  }
975  }
976  //
977  // construct final trajectory in the right order
978  //
979  // save & count result
980  nrOfTrajectories++;
981  result.emplace_back(seed.direction(), seed.nHits());
982  TempTrajectory& reversedTrajectory = result.back();
983  reversedTrajectory.setNLoops(it->nLoops());
984  for (TempTrajectory::DataContainer::const_iterator im = newMeasurements.rbegin(), ed = newMeasurements.rend();
985  im != ed;
986  --im) {
987  reversedTrajectory.push(*im);
988  }
989 
990  LogDebug("CkgPattern") << "New traj direction = " << reversedTrajectory.direction() << "\n"
991  << PrintoutHelper::dumpMeasurements(reversedTrajectory.measurements());
992  } // rebuiltTrajectories
993 
994  // If nrOfTrajectories = 0 and orig_ok = true, this means that a track was actually found on the
995  // out-in step (meeting those requirements) but did not have the seed hits in it.
996  // In this case when we return we will go ahead and use the original in-out track.
997 
998  // If nrOfTrajectories = 0 and orig_ok = false, this means that the out-in step failed to
999  // find any track. Two cases are a technical failure in fitting the original seed hits or
1000  // because the track did not meet the out-in criteria (which may be stronger than the out-in
1001  // criteria). In this case we will NOT allow the original in-out track to be used.
1002 
1003  if ((nrOfTrajectories == 0) && orig_ok) {
1004  nrOfTrajectories = -1;
1005  }
1006  return nrOfTrajectories;
1007 }
1008 
1010  unsigned int nSeed,
1011  const TrajectoryFitter& fitter,
1012  std::vector<const TrackingRecHit*>& remainingHits) const {
1013  //
1014  // clear array of non-fitted hits
1015  //
1016  remainingHits.clear();
1017 
1018  LogDebug("CkfPattern") << "nSeed " << nSeed << endl
1019  << "Old traj direction = " << candidate.direction() << endl
1021 
1022  //
1023  // backward fit trajectory.
1024  // (Will try to fit only hits outside the seeding region. However,
1025  // if there are not enough of these, it will also use the seeding hits).
1026  //
1027  // const unsigned int nHitAllMin(5);
1028  // const unsigned int nHit2dMin(2);
1029  unsigned int nHit(0); // number of valid hits after seeding region
1030  //unsigned int nHit2d(0); // number of valid hits after seeding region with 2D info
1031  // use all hits except the first n (from seed), but require minimum
1032  // specified in configuration.
1033  // Swapped over next two lines.
1034  unsigned int nHitMin = std::max(candidate.foundHits() - nSeed, theMinNrOfHitsForRebuild);
1035  // unsigned int nHitMin = oldMeasurements.size()-nSeed;
1036  // we want to rebuild only if the number of VALID measurements excluding the seed measurements is higher than the cut
1038  return TempTrajectory();
1039 
1040  LogDebug("CkfPattern") /* << "nHitMin " << nHitMin*/ << "Sizes: " << candidate.measurements().size() << " / ";
1041  //
1042  // create input trajectory for backward fit
1043  //
1044  Trajectory fwdTraj(oppositeDirection(candidate.direction()));
1045  fwdTraj.setNLoops(candidate.nLoops());
1046  //const TrajectorySeed seed = TrajectorySeed(PTrajectoryStateOnDet(), TrajectorySeed::recHitContainer(), oppositeDirection(candidate.direction()));
1047  //Trajectory fwdTraj(seed, oppositeDirection(candidate.direction()));
1048 
1049  const DetLayer* bwdDetLayer[candidate.measurements().size()];
1050  int nl = 0;
1051  for (auto const& tm : candidate.measurements()) {
1052  const TrackingRecHit* hit = tm.recHitR().hit();
1053  //
1054  // add hits until required number is reached
1055  //
1056  if (nHit < nHitMin) { //|| nHit2d<theMinNrOf2dHitsForRebuild ) {
1057  fwdTraj.push(tm);
1058  bwdDetLayer[nl++] = tm.layer();
1059  //
1060  // count valid / 2D hits
1061  //
1062  if LIKELY (hit->isValid()) {
1063  nHit++;
1064  //if ( hit.isMatched() ||
1065  // hit.det().detUnits().front()->type().module()==pixel )
1066  //nHit2d++;
1067  }
1068  }
1069  //if (nHit==nHitMin) lastBwdDetLayer=im->layer();
1070  //
1071  // keep remaining (valid) hits for verification
1072  //
1073  else if (hit->isValid()) {
1074  //std::cout << "Adding a remaining hit" << std::endl;
1075  remainingHits.push_back(hit);
1076  }
1077  }
1078  //
1079  // Fit only if required number of valid hits can be used
1080  //
1081  if UNLIKELY (nHit < nHitMin)
1082  return TempTrajectory();
1083 
1084  //
1085  // Do the backward fit (important: start from scaled, not random cov. matrix!)
1086  //
1088  //cout << "firstTsos "<< firstTsos << endl;
1089  firstTsos.rescaleError(10.);
1090  //TrajectoryContainer bwdFitted(fitter.fit(fwdTraj.seed(),fwdTraj.recHits(),firstTsos));
1091  Trajectory&& bwdFitted =
1092  fitter.fitOne(TrajectorySeed({}, {}, oppositeDirection(candidate.direction())), fwdTraj.recHits(), firstTsos);
1093  if UNLIKELY (!bwdFitted.isValid())
1094  return TempTrajectory();
1095 
1096  LogDebug("CkfPattern") << "Obtained bwdFitted trajectory with measurement size " << bwdFitted.measurements().size();
1097  TempTrajectory fitted(fwdTraj.direction(), nSeed);
1098  fitted.setNLoops(fwdTraj.nLoops());
1099  vector<TM> const& tmsbf = bwdFitted.measurements();
1100  int iDetLayer = 0;
1101  //this is ugly but the TM in the fitted track do not contain the DetLayer.
1102  //So we have to cache the detLayer pointers and replug them in.
1103  //For the backward building it would be enaugh to cache the last DetLayer,
1104  //but for the intermediary cleaning we need all
1105  for (vector<TM>::const_iterator im = tmsbf.begin(); im != tmsbf.end(); im++) {
1106  fitted.emplace((*im).forwardPredictedState(),
1107  (*im).backwardPredictedState(),
1108  (*im).updatedState(),
1109  (*im).recHit(),
1110  (*im).estimate(),
1111  bwdDetLayer[iDetLayer]);
1112 
1113  LogDebug("CkfPattern") << PrintoutHelper::dumpMeasurement(*im);
1114  iDetLayer++;
1115  }
1116  /*
1117  TM lastMeas = bwdFitted.front().lastMeasurement();
1118  fitted.pop();
1119  fitted.push(TM(lastMeas.forwardPredictedState(),
1120  lastMeas.backwardPredictedState(),
1121  lastMeas.updatedState(),
1122  lastMeas.recHit(),
1123  lastMeas.estimate(),
1124  lastBwdDetLayer));
1125  */
1126 
1127  return fitted;
1128 }
1129 
1131  size_t maxDepth,
1132  const std::vector<const TrackingRecHit*>& hits) const {
1133  //
1134  // verify presence of the seeding hits
1135  //
1136  LogDebug("CkfPattern") << "Checking for " << hits.size() << " hits in " << maxDepth << " measurements" << endl;
1137 
1138  auto rend = rbegin;
1139  while (maxDepth > 0) {
1140  --maxDepth;
1141  --rend;
1142  }
1143  for (auto ir = hits.begin(); ir != hits.end(); ir++) {
1144  // assume that all seeding hits are valid!
1145  bool foundHit(false);
1146  for (auto im = rbegin; im != rend; --im) {
1147  if (im->recHit()->isValid() && (*ir)->sharesInput(im->recHit()->hit(), TrackingRecHit::some)) {
1148  foundHit = true;
1149  break;
1150  }
1151  }
1152  if (!foundHit)
1153  return false;
1154  }
1155  return true;
1156 }
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:307
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:198
bool isValid() const
Definition: Trajectory.h:257
void join(TempTrajectory &segment)
const T & back() const
Definition: bqueue.h:196
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
int8_t nLoops() const
Definition: Trajectory.h:329
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)
assert(be >=bs)
void setNLoops(int8_t value)
static std::string dumpMeasurements(const std::vector< TrajectoryMeasurement > &v)
DataContainer const & measurements() const
Definition: Trajectory.h:178
void setDPhiCacheForLoopersReconstruction(float dphi)
void buildTrajectories(const TrajectorySeed &seed, TrajectoryContainer &ret, unsigned int &nCandPerSeed, const TrajectoryFilter *) const override
common part of both public trajectory building methods
GlobalPoint globalPosition() const
static PropagationDirection oppositeDirection(PropagationDirection dir)
change of propagation direction
GroupedCkfTrajectoryBuilder(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
constructor from ParameterSet
void rebuildTrajectories(const TrajectorySeed &, TrajectoryContainer &result) const override
T sqrt(T t)
Definition: SSEVec.h:23
PropagationDirection const & direction() const
Definition: Trajectory.cc:133
bool isValid() const
ConstRecHitContainer recHits() const
Definition: Trajectory.h:186
Definition: GenABIO.cc:168
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:202
std::vector< TempTrajectory > TempTrajectoryContainer
const DetLayer * lastLayer() const
Redundant method, returns the layer of lastMeasurement() .
void setNLoops(int8_t value)
Definition: Trajectory.h:331
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
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:199
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)