CMS 3D CMS Logo

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