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