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 
11 #include "GroupedTrajCandLess.h"
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 
113 
114 namespace {
115 
117 
118 }
119 
120 
123  BaseCkfTrajectoryBuilder::createTrajectoryFilter(conf.getParameter<edm::ParameterSet>("trajectoryFilter"), iC),
124  conf.getParameter<bool>("useSameTrajFilter") ?
125  BaseCkfTrajectoryBuilder::createTrajectoryFilter(conf.getParameter<edm::ParameterSet>("trajectoryFilter"), iC) :
126  BaseCkfTrajectoryBuilder::createTrajectoryFilter(conf.getParameter<edm::ParameterSet>("inOutTrajectoryFilter"), iC)
127  )
128 {
129  // fill data members from parameters (eventually data members could be dropped)
130  //
131  theMaxCand = conf.getParameter<int>("maxCand");
132 
133  theLostHitPenalty = conf.getParameter<double>("lostHitPenalty");
134  theFoundHitBonus = conf.getParameter<double>("foundHitBonus");
135  theIntermediateCleaning = conf.getParameter<bool>("intermediateCleaning");
136  theAlwaysUseInvalid = conf.getParameter<bool>("alwaysUseInvalidHits");
137  theLockHits = conf.getParameter<bool>("lockHits");
138  theBestHitOnly = conf.getParameter<bool>("bestHitOnly");
140  theRequireSeedHitsInRebuild = conf.getParameter<bool>("requireSeedHitsInRebuild");
141  theKeepOriginalIfRebuildFails = conf.getParameter<bool>("keepOriginalIfRebuildFails");
142  theMinNrOfHitsForRebuild = max(0,conf.getParameter<int>("minNrOfHitsForRebuild"));
143  maxPt2ForLooperReconstruction = conf.existsAs<double>("maxPtForLooperReconstruction") ?
144  conf.getParameter<double>("maxPtForLooperReconstruction") : 0;
146  maxDPhiForLooperReconstruction = conf.existsAs<double>("maxDPhiForLooperReconstruction") ?
147  conf.getParameter<double>("maxDPhiForLooperReconstruction") : 2.0;
148 
149 
150  /* ======= B.M. to be ported layer ===========
151  bool setOK = thePropagator->setMaxDirectionChange(1.6);
152  if (!setOK)
153  cout << "GroupedCkfTrajectoryBuilder WARNING: "
154  << "propagator does not support setMaxDirectionChange"
155  << endl;
156  // addStopCondition(theMinPtStopCondition);
157 
158  theConfigurableCondition = createAlgo<TrajectoryFilter>(componentConfig("StopCondition"));
159  ===================================== */
160 
161 }
162 
163 /*
164  void GroupedCkfTrajectoryBuilder::setEvent(const edm::Event& event) const
165  {
166  theMeasurementTracker->update(event);
167 }
168 */
169 
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(std::move(*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(seed, startingTraj, regionalCondition, forwardPropagator(seed), 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 #ifdef VI_DEBUG
302  int kt=0;
303  for (auto const & traj : result) {
304 int chit[7]={};
305 for (auto const & tm : traj.measurements()) {
306  auto const & hit = tm.recHitR();
307  if (!hit.isValid()) ++chit[0];
308  if (hit.det()==nullptr) ++chit[1];
309  if ( trackerHitRTTI::isUndef(hit) ) continue;
310  if ( hit.dimension()!=2 ) {
311  ++chit[2];
312  } else {
313  auto const & thit = static_cast<BaseTrackerRecHit const&>(hit);
314  auto const & clus = thit.firstClusterRef();
315  if (clus.isPixel()) ++chit[3];
316  else if (thit.isMatched()) {
317  ++chit[4];
318  } else if (thit.isProjected()) {
319  ++chit[5];
320  } else {
321  ++chit[6];
322  }
323  }
324  }
325 
326 std::cout << "ckf " << kt++ << ": "; for (auto c:chit) std::cout << c <<'/'; std::cout<< std::endl;
327 }
328 #endif
329 
330  return startingTraj;
331 
332 }
333 
334 
335 void
337  TempTrajectory const& startingTraj,
338  const TrajectoryFilter* regionalCondition,
339  const Propagator* propagator,
340  bool inOut,
342 {
343  unsigned int nIter=1;
345  TempTrajectoryContainer newCand;
346  candidates.push_back( startingTraj);
347 
348  while ( !candidates.empty()) {
349 
350  newCand.clear();
351  for (TempTrajectoryContainer::iterator traj=candidates.begin();
352  traj!=candidates.end(); traj++) {
353  if ( !advanceOneLayer(seed, *traj, regionalCondition, propagator, inOut, newCand, result) ) {
354  LogDebug("CkfPattern")<< "GCTB: terminating after advanceOneLayer==false";
355  continue;
356  }
357 
358  LogDebug("CkfPattern")<<"newCand(1): after advanced one layer:\n"<<PrintoutHelper::dumpCandidates(newCand);
359 
360  if ((int)newCand.size() > theMaxCand) {
361  //ShowCand()(newCand);
362 
363  sort( newCand.begin(), newCand.end(), GroupedTrajCandLess(theLostHitPenalty,theFoundHitBonus));
364  newCand.erase( newCand.begin()+theMaxCand, newCand.end());
365  }
366  LogDebug("CkfPattern")<<"newCand(2): after removing extra candidates.\n"<<PrintoutHelper::dumpCandidates(newCand);
367  }
368 
369  LogDebug("CkfPattern") << "newCand.size() at end = " << newCand.size();
370 /*
371  if (theIntermediateCleaning) {
372  candidates.clear();
373  candidates = groupedIntermediaryClean(newCand);
374  } else {
375  candidates.swap(newCand);
376  }
377 */
379 #ifdef STANDARD_INTERMEDIARYCLEAN
381 #else
382  groupedIntermediaryClean(newCand);
383 #endif
384 
385  }
386  candidates.swap(newCand);
387 
388  LogDebug("CkfPattern") <<"candidates(3): "<<result.size()<<" candidates after "<<nIter++<<" groupedCKF iteration: \n"
390  <<"\n "<<candidates.size()<<" running candidates are: \n"
391  <<PrintoutHelper::dumpCandidates(candidates);
392  }
393 }
394 
395 #ifdef EDM_ML_DEBUG
396 std::string whatIsTheNextStep(TempTrajectory const& traj , std::pair<TrajectoryStateOnSurface,std::vector<const DetLayer*> >& stateAndLayers){
397  std::stringstream buffer;
398  vector<const DetLayer*> & nl = stateAndLayers.second;
399  // #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
400  // #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h"
401  //B.M. TkLayerName layerName;
402  //B.M. buffer << "Started from " << layerName(traj.lastLayer())
403  const BarrelDetLayer* sbdl = dynamic_cast<const BarrelDetLayer*>(traj.lastLayer());
404  const ForwardDetLayer* sfdl = dynamic_cast<const ForwardDetLayer*>(traj.lastLayer());
405  if (sbdl) {
406  buffer << "Started from " << traj.lastLayer() << " r=" << sbdl->specificSurface().radius()
407  << " phi=" << sbdl->specificSurface().phi() << endl;
408  } else if (sfdl) {
409  buffer << "Started from " << traj.lastLayer() << " z " << sfdl->specificSurface().position().z()
410  << " phi " << sfdl->specificSurface().phi() << endl;
411  }
412  buffer << "Trying to go to";
413  for ( vector<const DetLayer*>::iterator il=nl.begin();
414  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) buffer << " r " << bdl->specificSurface().radius() << endl;
420  if (fdl) buffer << " z " << fdl->specificSurface().position().z() << endl;
421  //buffer << " " << *il << endl;
422  }
423  return buffer.str();
424 }
425 
426 std::string whatIsTheStateToUse(TrajectoryStateOnSurface &initial, TrajectoryStateOnSurface & stateToUse, const DetLayer * l){
427  std::stringstream buffer;
428  buffer << "GCTB: starting from "
429  << " r / phi / z = " << stateToUse.globalPosition().perp()
430  << " / " << stateToUse.globalPosition().phi()
431  << " / " << stateToUse.globalPosition().z()
432  << " , pt / phi / pz /charge = "
433  << stateToUse.globalMomentum().perp() << " / "
434  << stateToUse.globalMomentum().phi() << " / "
435  << stateToUse.globalMomentum().z() << " / "
436  << stateToUse.charge()
437  << " for layer at "<< l << endl;
438  buffer << " errors:";
439  for ( int i=0; i<5; i++ ) buffer << " " << sqrt(stateToUse.curvilinearError().matrix()(i,i));
440  buffer << endl;
441 
442  //buffer << "GCTB: starting from r / phi / z = " << initial.globalPosition().perp()
443  //<< " / " << initial.globalPosition().phi()
444  //<< " / " << initial.globalPosition().z() << " , pt / pz = "
445  //<< initial.globalMomentum().perp() << " / "
446  //<< initial.globalMomentum().z() << " for layer at "
447  //<< l << endl;
448  //buffer << " errors:";
449  //for ( int i=0; i<5; i++ ) buffer << " " << sqrt(initial.curvilinearError().matrix()(i,i));
450  //buffer << endl;
451  return buffer.str();
452 }
453 #endif
454 
455 bool
457  TempTrajectory& traj,
458  const TrajectoryFilter* regionalCondition,
459  const Propagator* propagator,
460  bool inOut,
461  TempTrajectoryContainer& newCand,
463 {
464  std::pair<TSOS,std::vector<const DetLayer*> > && stateAndLayers = findStateAndLayers(traj);
465 
466 
468  if(
469  //stateAndLayers.second.size()==0 &&
470  traj.lastLayer()->location()==0) {
471  float pt2 = stateAndLayers.first.globalMomentum().perp2();
473  pt2>(0.3f*0.3f)
474  )
475  stateAndLayers.second.push_back(traj.lastLayer());
476  }
477  }
478 
479  auto layerBegin = stateAndLayers.second.begin();
480  auto layerEnd = stateAndLayers.second.end();
481 
482  // if (nl.empty()) {
483  // addToResult(traj,result,inOut);
484  // return false;
485  // }
486 
487 #ifdef EDM_ML_DEBUG
488  LogDebug("CkfPattern")<<whatIsTheNextStep(traj, stateAndLayers);
489 #endif
490 
491  bool foundSegments(false);
492  bool foundNewCandidates(false);
493  for ( auto il=layerBegin; il!=layerEnd; il++) {
494 
495  TSOS stateToUse = stateAndLayers.first;
496 
497  double dPhiCacheForLoopersReconstruction(0);
498  if unlikely((*il)==traj.lastLayer()){
499 
501  // ------ For loopers reconstruction
502  //cout<<" self propagating in advanceOneLayer (for loopers) \n";
503  const BarrelDetLayer* sbdl = dynamic_cast<const BarrelDetLayer*>(traj.lastLayer());
504  if(sbdl){
505  HelixBarrelCylinderCrossing cylinderCrossing(stateToUse.globalPosition(),
506  stateToUse.globalMomentum(),
507  stateToUse.transverseCurvature(),
508  propagator->propagationDirection(),
509  sbdl->specificSurface());
510  if(!cylinderCrossing.hasSolution()) continue;
511  GlobalPoint starting = stateToUse.globalPosition();
512  GlobalPoint target1 = cylinderCrossing.position1();
513  GlobalPoint target2 = cylinderCrossing.position2();
514 
515  GlobalPoint farther = fabs(starting.phi()-target1.phi()) > fabs(starting.phi()-target2.phi()) ?
516  target1 : target2;
517 
518  const Bounds& bounds( sbdl->specificSurface().bounds());
519  float length = 0.5f*bounds.length();
520 
521  /*
522  cout << "starting: " << starting << endl;
523  cout << "target1: " << target1 << endl;
524  cout << "target2: " << target2 << endl;
525  cout << "dphi: " << (target1.phi()-target2.phi()) << endl;
526  cout << "length: " << length << endl;
527  */
528 
529  /*
530  float deltaZ = bounds.thickness()/2.f/fabs(tan(stateToUse.globalDirection().theta()) ) ;
531  if(stateToUse.hasError())
532  deltaZ += 3*sqrt(stateToUse.cartesianError().position().czz());
533  if( fabs(farther.z()) > length + deltaZ ) continue;
534  */
535  if(fabs(farther.z())*0.95f>length) continue;
536 
537  Geom::Phi<float> tmpDphi = target1.phi()-target2.phi();
538  if(std::abs(tmpDphi)>maxDPhiForLooperReconstruction) continue;
539  GlobalPoint target(0.5f*(target1.basicVector()+target2.basicVector()));
540  //cout << "target: " << target << endl;
541 
542 
543 
545  stateToUse = extrapolator.extrapolate(stateToUse, target, *propagator);
546  if (!stateToUse.isValid()) continue; //SK: consider trying the original? probably not
547 
548  //dPhiCacheForLoopersReconstruction = fabs(target1.phi()-target2.phi())*2.;
549  dPhiCacheForLoopersReconstruction = std::abs(tmpDphi);
550  traj.incrementLoops();
551  }else{ // not barrel
552  continue;
553  }
554  }else{ // loopers not requested (why else???)
555  // ------ For cosmics reconstruction
556  LogDebug("CkfPattern")<<" self propagating in advanceOneLayer.\n from: \n"<<stateToUse;
557  //self navigation case
558  // go to a middle point first
560  GlobalPoint center(0,0,0);
561  stateToUse = middle.extrapolate(stateToUse, center, *(forwardPropagator(seed)));
562 
563  if (!stateToUse.isValid()) 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(&layerMeasurements,
571  **il,*propagator,
574 
575 #ifdef EDM_ML_DEBUG
576  LogDebug("CkfPattern")<<whatIsTheStateToUse(stateAndLayers.first,stateToUse,*il);
577 #endif
578 
579  auto && segments= layerBuilder.segments(stateToUse);
580 
581  LogDebug("CkfPattern")<< "GCTB: number of segments = " << segments.size();
582 
583  if ( !segments.empty() ) foundSegments = true;
584 
585  for (auto is=segments.begin(); is!=segments.end(); is++ ) {
586  //
587  // assume "invalid hit only" segment is last in list
588  //
589  auto const & measurements = is->measurements();
590  if ( !theAlwaysUseInvalid && is!=segments.begin() && measurements.size()==1 &&
591  (measurements.front().recHit()->getType() == TrackingRecHit::missing) ) break;
592 
593 
594  //---- avoid to add the same hits more than once in the trajectory ----
595  bool toBeRejected(false);
596  for(auto revIt = measurements.rbegin(); revIt!=measurements.rend(); --revIt){
597  // int tmpCounter(0);
598  for(auto newTrajMeasIt = traj.measurements().rbegin();
599  newTrajMeasIt != traj.measurements().rend(); --newTrajMeasIt){
600  //if(tmpCounter==2) break;
601  if(revIt->recHitR().geographicalId()==newTrajMeasIt->recHitR().geographicalId()
602  && (revIt->recHitR().geographicalId() != DetId(0)) ){
603  toBeRejected=true;
604  goto rejected; //break; // see http://stackoverflow.com/questions/1257744/can-i-use-break-to-exit-multiple-nested-for-loops
605  }
606  // tmpCounter++;
607  }
608  }
609 
610  rejected:; // http://xkcd.com/292/
611  if(toBeRejected){
612 #ifdef VI_DEBUG
613  cout << "WARNING: neglect candidate because it contains the same hit twice \n";
614  cout << "-- discarded track's pt,eta,#found/lost: "
615  << traj.lastMeasurement().updatedState().globalMomentum().perp() << " , "
616  << traj.lastMeasurement().updatedState().globalMomentum().eta() << " , "
617  << traj.foundHits() << '/' << traj.lostHits() << "\n";
618 #endif
619  traj.setDPhiCacheForLoopersReconstruction(dPhiCacheForLoopersReconstruction);
620  continue; //Are we sure about this????
621  }
622  // ------------------------
623 
624  //
625  // create new candidate
626  //
627  TempTrajectory newTraj(traj);
628  traj.setDPhiCacheForLoopersReconstruction(dPhiCacheForLoopersReconstruction);
629  newTraj.join(*is);
630 
631  //std::cout << "DEBUG: newTraj after push found,lost: "
632  // << newTraj.foundHits() << " , "
633  // << newTraj.lostHits() << " , "
634  // << newTraj.measurements().size() << std::endl;
635 
636 
637 
638  //GIO// for ( vector<TM>::const_iterator im=measurements.begin();
639  //GIO// im!=measurements.end(); im++ ) newTraj.push(*im);
640  //if ( toBeContinued(newTraj,regionalCondition) ) { TOBE FIXED
641  if ( toBeContinued(newTraj, inOut) ) {
642  // Have added one more hit to track candidate
643 
644  LogDebug("CkfPattern")<<"GCTB: adding updated trajectory to candidates: inOut="<<inOut<<" hits="<<newTraj.foundHits();
645 
646  newCand.push_back(std::move(newTraj));
647  foundNewCandidates = true;
648  }
649  else {
650  // Have finished building this track. Check if it passes cuts.
651 
652  LogDebug("CkfPattern")<< "GCTB: adding completed trajectory to results if passes cuts: inOut="<<inOut<<" hits="<<newTraj.foundHits();
653 
654  moveToResult(std::move(newTraj), result, inOut);
655  }
656  } // loop over segs
657  } // loop over layers
658 
659  if ( !foundSegments ){
660  LogDebug("CkfPattern")<< "GCTB: adding input trajectory to result";
661  addToResult(traj, result, inOut);
662  }
663  return foundNewCandidates;
664 }
665 
666 namespace {
669  struct LayersInTraj {
670  static constexpr int N=3;
671  TempTrajectory * traj;
672  std::array<DetLayer const *,N> layers;
673  int tot;
674  void fill(TempTrajectory & t) {
675  traj = &t;
676  tot=0;
677  const TempTrajectory::DataContainer& measurements = traj->measurements();
678 
679  auto currl = layers[tot] = measurements.back().layer();
681  --ifirst;
683  im!=measurements.rend(); --im ) {
684  if ( im->layer()!=currl ) { ++tot; currl = im->layer(); if (tot<N) layers[tot] = currl;}
685  }
686  ++tot;
687  }
688 
689  //void verify() {
690  // for (vector<const DetLayer*>::const_iterator iter = result.begin(); iter != result.end(); iter++)
691  // if (!*iter) edm::LogWarning("CkfPattern")<< "Warning: null det layer!! ";
692  // }
693  };
694 }
695 
696 
697 //TempTrajectoryContainer
698 void
700 {
701  //if (theTrajectories.empty()) return TrajectoryContainer();
702  //TrajectoryContainer result;
703  if (theTrajectories.empty()) return;
704  //RecHitEqualByChannels recHitEqualByChannels(false, false);
705  LayersInTraj layers[theTrajectories.size()];
706  int ntraj=0;
707  for ( auto & t : theTrajectories) {
708  if ( t.isValid() && t.lastMeasurement().recHitR().isValid() )
709  layers[ntraj++].fill(t);
710  }
711 
712  if (ntraj<2) return;
713 
714  for (int ifirst=0; ifirst!=ntraj-1; ++ifirst) {
715  auto firstTraj = layers[ifirst].traj;
716  if (!firstTraj->isValid()) continue;
717  const TempTrajectory::DataContainer & firstMeasurements = firstTraj->measurements();
718 
719  int firstLayerSize = layers[ifirst].tot;
720  if ( firstLayerSize<4 ) continue;
721  auto const & firstLayers = layers[ifirst].layers;
722 
723  for (int isecond= ifirst+1; isecond!=ntraj; ++isecond) {
724  auto secondTraj = layers[isecond].traj;
725  if (!secondTraj->isValid()) continue;
726 
727  const TempTrajectory::DataContainer & secondMeasurements = secondTraj->measurements();
728 
729  int secondLayerSize = layers[isecond].tot;
730  //
731  // only candidates using the same last 3 layers are compared
732  //
733  if ( firstLayerSize!=secondLayerSize ) continue; // V.I. why equal???
734  auto const & secondLayers = layers[isecond].layers;
735  if ( firstLayers[0]!=secondLayers[0] ||
736  firstLayers[1]!=secondLayers[1] ||
737  firstLayers[2]!=secondLayers[2] ) continue;
738 
739  TempTrajectory::DataContainer::const_iterator im1 = firstMeasurements.rbegin();
740  TempTrajectory::DataContainer::const_iterator im2 = secondMeasurements.rbegin();
741  //
742  // check for identical hits in the last layer
743  //
744  bool unequal(false);
745  const DetLayer* layerPtr = firstLayers[0];
746  while ( im1!=firstMeasurements.rend()&&im2!=secondMeasurements.rend() ) {
747  if ( im1->layer()!=layerPtr || im2->layer()!=layerPtr ) break;
748  if ( !(im1->recHit()->isValid()) || !(im2->recHit()->isValid()) ||
749  !im1->recHit()->hit()->sharesInput(im2->recHit()->hit(), TrackingRecHit::some) ) {
751  unequal = true;
752  break;
753  }
754  --im1;
755  --im2;
756  }
757  if ( im1==firstMeasurements.rend() || im2==secondMeasurements.rend() ||
758  im1->layer()==layerPtr || im2->layer()==layerPtr || unequal ) continue;
759  //
760  // check for invalid hits in the layer -2
761  // compare only candidates with invalid / valid combination
762  //
763  layerPtr = firstLayers[1];
764  bool firstValid(true);
765  while ( im1!=firstMeasurements.rend()&&im1->layer()==layerPtr ) {
766  if ( !im1->recHit()->isValid() ) firstValid = false;
767  --im1;
768  }
769  bool secondValid(true);
770  while ( im2!=secondMeasurements.rend()&&im2->layer()==layerPtr ) {
771  if ( !im2->recHit()->isValid() ) secondValid = false;
772  --im2;
773  }
774  if ( !tkxor(firstValid,secondValid) ) continue;
775  //
776  // ask for identical hits in layer -3
777  //
778  unequal = false;
779  layerPtr = firstLayers[2];
780  while ( im1!=firstMeasurements.rend()&&im2!=secondMeasurements.rend() ) {
781  if ( im1->layer()!=layerPtr || im2->layer()!=layerPtr ) break;
782  if ( !(im1->recHit()->isValid()) || !(im2->recHit()->isValid()) ||
783  !im1->recHit()->hit()->sharesInput(im2->recHit()->hit(), TrackingRecHit::some) ) {
785  unequal = true;
786  break;
787  }
788  --im1;
789  --im2;
790  }
791  if ( im1==firstMeasurements.rend() || im2==secondMeasurements.rend() ||
792  im1->layer()==layerPtr || im2->layer()==layerPtr || unequal ) continue;
793 
794  if ( !firstValid ) {
795  firstTraj->invalidate();
796  break;
797  }
798  else {
799  secondTraj->invalidate(); // V.I. why break?
800  break;
801  }
802  } // second
803  } // first
804 /*
805  for (TempTrajectoryContainer::const_iterator it = theTrajectories.begin();
806  it != theTrajectories.end(); it++) {
807  if(it->isValid()) result.push_back( *it);
808  }
809 
810  return result;
811 */
812  theTrajectories.erase(std::remove_if( theTrajectories.begin(),theTrajectories.end(),
813  std::not1(std::mem_fun_ref(&TempTrajectory::isValid))),
814  // boost::bind(&TempTrajectory::isValid,_1)),
815  theTrajectories.end());
816 }
817 
818 
819 void
821  TempTrajectory const & startingTraj,
823 {
824  //
825  // Rebuilding of trajectories. Candidates are taken from result,
826  // which will be replaced with the solutions after rebuild
827  // (assume vector::swap is more efficient than building new container)
828  //
829  LogDebug("CkfPattern")<< "Starting to rebuild " << result.size() << " tracks";
830  //
831  // Fitter (need to create it here since the propagation direction
832  // might change between different starting trajectories)
833  //
834  auto hitCloner = static_cast<TkTransientTrackingRecHitBuilder const *>(hitBuilder())->cloner();
835  KFTrajectoryFitter fitter(backwardPropagator(seed),&updator(),&estimator(),3,nullptr,&hitCloner);
836  //
837  TrajectorySeed::range rseedHits = seed.recHits();
838  std::vector<const TrackingRecHit*> seedHits;
839  //seedHits.insert(seedHits.end(), rseedHits.first, rseedHits.second);
840  //for (TrajectorySeed::recHitContainer::const_iterator iter = rseedHits.first; iter != rseedHits.second; iter++){
841  // seedHits.push_back(&*iter);
842  //}
843 
844  //unsigned int nSeed(seedHits.size());
845  unsigned int nSeed(rseedHits.second-rseedHits.first);
846  //seedHits.reserve(nSeed);
847  TempTrajectoryContainer rebuiltTrajectories;
848 
849  for ( TempTrajectoryContainer::iterator it=result.begin();
850  it!=result.end(); it++ ) {
851  //
852  // skip candidates which are not exceeding the seed size
853  // (e.g. because no Tracker layers outside seeding region)
854  //
855 
856  if ( it->measurements().size()<=startingTraj.measurements().size() ) {
857  rebuiltTrajectories.push_back(std::move(*it));
858  LogDebug("CkfPattern")<< "RebuildSeedingRegion skipped as in-out trajectory does not exceed seed size.";
859  continue;
860  }
861  //
862  // Refit - keep existing trajectory in case fit is not possible
863  // or fails
864  //
865 
866  auto && reFitted = backwardFit(*it,nSeed,fitter,seedHits);
867  if unlikely( !reFitted.isValid() ) {
868  rebuiltTrajectories.push_back(std::move(*it));
869  LogDebug("CkfPattern")<< "RebuildSeedingRegion skipped as backward fit failed";
870  // << "after reFitted.size() " << reFitted.size();
871  continue;
872  }
873  //LogDebug("CkfPattern")<<"after reFitted.size() " << reFitted.size();
874  //
875  // Rebuild seeding part. In case it fails: keep initial trajectory
876  // (better to drop it??)
877  //
878  int nRebuilt =
879  rebuildSeedingRegion (seed, seedHits,reFitted,rebuiltTrajectories);
880 
881  if ( nRebuilt==0 && !theKeepOriginalIfRebuildFails ) it->invalidate(); // won't use original in-out track
882 
883  if ( nRebuilt<0 ) rebuiltTrajectories.push_back(std::move(*it));
884 
885  }
886  //
887  // Replace input trajectories with new ones
888  //
889  result.swap(rebuiltTrajectories);
890  result.erase(std::remove_if( result.begin(),result.end(),
891  std::not1(std::mem_fun_ref(&TempTrajectory::isValid))),
892  result.end());
893 }
894 
895 int
897  const std::vector<const TrackingRecHit*>& seedHits,
898  TempTrajectory& candidate,
900 {
901  //
902  // Starting from track found by in-out tracking phase, extrapolate it inwards through
903  // the seeding region if possible in towards smaller Tracker radii, searching for additional
904  // hits.
905  // The resulting trajectories are returned in result,
906  // the count is the return value.
907  //
908  TempTrajectoryContainer rebuiltTrajectories;
909 #ifdef DBG2_GCTB
910 /* const LayerFinderByDet layerFinder;
911  if ( !seedHits.empty() && seedHits.front().isValid() ) {
912  DetLayer* seedLayer = layerFinder(seedHits.front().det());
913  cout << "Seed hit at " << seedHits.front().globalPosition()
914  << " " << seedLayer << endl;
915  cout << "Started from "
916  << candidate.lastMeasurement().updatedState().globalPosition().perp() << " "
917  << candidate.lastMeasurement().updatedState().globalPosition().z() << endl;
918  pair<bool,TrajectoryStateOnSurface> layerComp(false,TrajectoryStateOnSurface());
919  if ( seedLayer ) layerComp =
920  seedLayer->compatible(candidate.lastMeasurement().updatedState(),
921  propagator(),estimator());
922  pair<bool,TrajectoryStateOnSurface> detComp =
923  seedHits.front().det().compatible(candidate.lastMeasurement().updatedState(),
924  propagator(),estimator());
925  cout << " layer compatibility = " << layerComp.first;
926  cout << " det compatibility = " << detComp.first;
927  if ( detComp.first ) {
928  cout << " estimate = "
929  << estimator().estimate(detComp.second,seedHits.front()).second ;
930  }
931  cout << endl;
932  }*/
933  cout << "Before backward building: #measurements = "
934  << candidate.measurements().size() ; //<< endl;;
935 #endif
936  //
937  // Use standard building with standard cuts. Maybe better to use different
938  // cuts from "forward" building (e.g. no check on nr. of invalid hits)?
939  //
940  const bool inOut = false;
941  groupedLimitedCandidates(seed, candidate, nullptr, backwardPropagator(seed), inOut, rebuiltTrajectories);
942 
943  LogDebug("CkfPattern")<<" After backward building: "<<PrintoutHelper::dumpCandidates(rebuiltTrajectories);
944 
945  //
946  // Check & count resulting candidates
947  //
948  int nrOfTrajectories(0);
949  bool orig_ok = false;
950  //const RecHitEqualByChannels recHitEqual(false,false);
951  //vector<TM> oldMeasurements(candidate.measurements());
952  for ( TempTrajectoryContainer::iterator it=rebuiltTrajectories.begin();
953  it!=rebuiltTrajectories.end(); it++ ) {
954 
955  TempTrajectory::DataContainer newMeasurements(it->measurements());
956  //
957  // Verify presence of seeding hits?
958  //
960  orig_ok = true;
961  // no hits found (and possibly some invalid hits discarded): drop track
962  if ( newMeasurements.size()<=candidate.measurements().size() ){
963  LogDebug("CkfPattern") << "newMeasurements.size()<=candidate.measurements().size()";
964  continue;
965  }
966  // verify presence of hits
967  //GIO//if ( !verifyHits(newMeasurements.begin()+candidate.measurements().size(),
968  //GIO// newMeasurements.end(),seedHits) ){
969  if ( !verifyHits(newMeasurements.rbegin(),
970  newMeasurements.size() - candidate.measurements().size(),
971  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());
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; --im ) {
986  reversedTrajectory.push(*im);
987  }
988 
989  LogDebug("CkgPattern")<<"New traj direction = " << reversedTrajectory.direction()<<"\n"
990  <<PrintoutHelper::dumpMeasurements(reversedTrajectory.measurements());
991  } // rebuiltTrajectories
992 
993  // If nrOfTrajectories = 0 and orig_ok = true, this means that a track was actually found on the
994  // out-in step (meeting those requirements) but did not have the seed hits in it.
995  // In this case when we return we will go ahead and use the original in-out track.
996 
997  // If nrOfTrajectories = 0 and orig_ok = false, this means that the out-in step failed to
998  // find any track. Two cases are a technical failure in fitting the original seed hits or
999  // because the track did not meet the out-in criteria (which may be stronger than the out-in
1000  // criteria). In this case we will NOT allow the original in-out track to be used.
1001 
1002  if ( (nrOfTrajectories == 0) && orig_ok ) {
1003  nrOfTrajectories = -1;
1004  }
1005  return nrOfTrajectories;
1006 }
1007 
1010  const TrajectoryFitter& fitter,
1011  std::vector<const TrackingRecHit*>& remainingHits) const
1012 {
1013  //
1014  // clear array of non-fitted hits
1015  //
1016  remainingHits.clear();
1017  //
1018  // skip candidates which are not exceeding the seed size
1019  // (e.g. Because no Tracker layers exist outside seeding region)
1020  //
1021  if unlikely( candidate.measurements().size()<=nSeed ) return TempTrajectory();
1022 
1023  LogDebug("CkfPattern")<<"nSeed " << nSeed << endl
1024  << "Old traj direction = " << candidate.direction() << endl
1026 
1027  //
1028  // backward fit trajectory.
1029  // (Will try to fit only hits outside the seeding region. However,
1030  // if there are not enough of these, it will also use the seeding hits).
1031  //
1032  // const unsigned int nHitAllMin(5);
1033  // const unsigned int nHit2dMin(2);
1034  unsigned int nHit(0); // number of valid hits after seeding region
1035  //unsigned int nHit2d(0); // number of valid hits after seeding region with 2D info
1036  // use all hits except the first n (from seed), but require minimum
1037  // specified in configuration.
1038  // Swapped over next two lines.
1039  unsigned int nHitMin = std::max(candidate.foundHits()-nSeed,theMinNrOfHitsForRebuild);
1040  // unsigned int nHitMin = oldMeasurements.size()-nSeed;
1041  // we want to rebuild only if the number of VALID measurements excluding the seed measurements is higher than the cut
1042  if unlikely(nHitMin<theMinNrOfHitsForRebuild) return TempTrajectory();
1043 
1044  LogDebug("CkfPattern")/* << "nHitMin " << nHitMin*/ <<"Sizes: " << candidate.measurements().size() << " / ";
1045  //
1046  // create input trajectory for backward fit
1047  //
1048  Trajectory fwdTraj(oppositeDirection(candidate.direction()));
1049  fwdTraj.setNLoops(candidate.nLoops());
1050  //const TrajectorySeed seed = TrajectorySeed(PTrajectoryStateOnDet(), TrajectorySeed::recHitContainer(), oppositeDirection(candidate.direction()));
1051  //Trajectory fwdTraj(seed, oppositeDirection(candidate.direction()));
1052 
1053  const DetLayer* bwdDetLayer[candidate.measurements().size()];
1054  int nl=0;
1055  for ( auto const & tm : candidate.measurements() ) {
1056  const TrackingRecHit* hit = tm.recHitR().hit();
1057  //
1058  // add hits until required number is reached
1059  //
1060  if ( nHit<nHitMin ){//|| nHit2d<theMinNrOf2dHitsForRebuild ) {
1061  fwdTraj.push(tm);
1062  bwdDetLayer[nl++]=tm.layer();
1063  //
1064  // count valid / 2D hits
1065  //
1066  if likely( hit->isValid() ) {
1067  nHit++;
1068  //if ( hit.isMatched() ||
1069  // hit.det().detUnits().front()->type().module()==pixel )
1070  //nHit2d++;
1071  }
1072  }
1073  //if (nHit==nHitMin) lastBwdDetLayer=im->layer();
1074  //
1075  // keep remaining (valid) hits for verification
1076  //
1077  else if ( hit->isValid() ) {
1078  //std::cout << "Adding a remaining hit" << std::endl;
1079  remainingHits.push_back(hit);
1080  }
1081  }
1082  //
1083  // Fit only if required number of valid hits can be used
1084  //
1085  if unlikely( nHit<nHitMin ) return TempTrajectory();
1086 
1087  //
1088  // Do the backward fit (important: start from scaled, not random cov. matrix!)
1089  //
1091  //cout << "firstTsos "<< firstTsos << endl;
1092  firstTsos.rescaleError(10.);
1093  //TrajectoryContainer bwdFitted(fitter.fit(fwdTraj.seed(),fwdTraj.recHits(),firstTsos));
1095  fwdTraj.recHits(),firstTsos);
1096  if unlikely(!bwdFitted.isValid()) return TempTrajectory();
1097 
1098 
1099  LogDebug("CkfPattern")<<"Obtained bwdFitted trajectory with measurement size " << bwdFitted.measurements().size();
1100  TempTrajectory fitted(fwdTraj.direction());
1101  fitted.setNLoops(fwdTraj.nLoops());
1102  vector<TM> const & tmsbf = bwdFitted.measurements();
1103  int iDetLayer=0;
1104  //this is ugly but the TM in the fitted track do not contain the DetLayer.
1105  //So we have to cache the detLayer pointers and replug them in.
1106  //For the backward building it would be enaugh to cache the last DetLayer,
1107  //but for the intermediary cleaning we need all
1108  for ( vector<TM>::const_iterator im=tmsbf.begin();im!=tmsbf.end(); im++ ) {
1109  fitted.emplace( (*im).forwardPredictedState(),
1110  (*im).backwardPredictedState(),
1111  (*im).updatedState(),
1112  (*im).recHit(),
1113  (*im).estimate(),
1114  bwdDetLayer[iDetLayer]
1115  );
1116 
1117  LogDebug("CkfPattern")<<PrintoutHelper::dumpMeasurement(*im);
1118  iDetLayer++;
1119  }
1120  /*
1121  TM lastMeas = bwdFitted.front().lastMeasurement();
1122  fitted.pop();
1123  fitted.push(TM(lastMeas.forwardPredictedState(),
1124  lastMeas.backwardPredictedState(),
1125  lastMeas.updatedState(),
1126  lastMeas.recHit(),
1127  lastMeas.estimate(),
1128  lastBwdDetLayer));
1129  */
1130 
1131 
1132  return fitted;
1133 }
1134 
1135 bool
1137  size_t maxDepth,
1138  const std::vector<const TrackingRecHit*>& hits) const
1139 {
1140  //
1141  // verify presence of the seeding hits
1142  //
1143  LogDebug("CkfPattern")<<"Checking for " << hits.size() << " hits in "
1144  << maxDepth << " measurements" << endl;
1145 
1146  auto rend = rbegin;
1147  while (maxDepth > 0) { --maxDepth; --rend; }
1148  for ( auto ir=hits.begin(); ir!=hits.end(); ir++ ) {
1149  // assume that all seeding hits are valid!
1150  bool foundHit(false);
1151  for ( auto im=rbegin; im!=rend; --im ) {
1152  if ( im->recHit()->isValid() && (*ir)->sharesInput(im->recHit()->hit(), TrackingRecHit::some) ) {
1153  foundHit = true;
1154  break;
1155  }
1156  }
1157  if ( !foundHit ) return false;
1158  }
1159  return true;
1160 }
1161 
1162 
1163 
1164 
#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:186
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:10
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
def move
Definition: eostools.py:510
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
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)