CMS 3D CMS Logo

CkfTrackCandidateMakerBase.cc
Go to the documentation of this file.
7 
12 
14 
19 
25 
26 
31 
33 
36 
38 
39 #include<algorithm>
40 #include<functional>
41 
42 // #define VI_SORTSEED
43 // #define VI_REPRODUCIBLE
44 // #define VI_TBB
45 
46 #include <thread>
47 #ifdef VI_TBB
48 #include "tbb/parallel_for.h"
49 #endif
50 
52 
53 using namespace edm;
54 using namespace std;
55 
56 namespace {
57  BaseCkfTrajectoryBuilder *createBaseCkfTrajectoryBuilder(const edm::ParameterSet& pset, edm::ConsumesCollector& iC) {
58  return BaseCkfTrajectoryBuilderFactory::get()->create(pset.getParameter<std::string>("ComponentType"), pset, iC);
59  }
60 }
61 
62 namespace cms{
63  CkfTrackCandidateMakerBase::CkfTrackCandidateMakerBase(edm::ParameterSet const& conf, edm::ConsumesCollector && iC) :
64  theTrackCandidateOutput(true),
65  theTrajectoryOutput(false),
66  useSplitting(conf.getParameter<bool>("useHitsSplitting")),
67  doSeedingRegionRebuilding(conf.getParameter<bool>("doSeedingRegionRebuilding")),
68  cleanTrajectoryAfterInOut(conf.getParameter<bool>("cleanTrajectoryAfterInOut")),
69  reverseTrajectories(conf.existsAs<bool>("reverseTrajectories") && conf.getParameter<bool>("reverseTrajectories")),
70  theMaxNSeeds(conf.getParameter<unsigned int>("maxNSeeds")),
71  theTrajectoryBuilder(createBaseCkfTrajectoryBuilder(conf.getParameter<edm::ParameterSet>("TrajectoryBuilderPSet"), iC)),
72  theTrajectoryCleanerName(conf.getParameter<std::string>("TrajectoryCleaner")),
73  theTrajectoryCleaner(nullptr),
74  theInitialState(new TransientInitialStateEstimator(conf.getParameter<ParameterSet>("TransientInitialStateEstimatorParameters"))),
75  theMagFieldName(conf.exists("SimpleMagneticField") ? conf.getParameter<std::string>("SimpleMagneticField") : ""),
76  theNavigationSchoolName(conf.getParameter<std::string>("NavigationSchool")),
77  theNavigationSchool(nullptr),
78  theSeedCleaner(nullptr),
79  maxSeedsBeforeCleaning_(0),
80  theMTELabel(iC.consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("MeasurementTrackerEvent"))),
81  skipClusters_(false),
82  phase2skipClusters_(false)
83  {
85 #ifndef VI_REPRODUCIBLE
86  if ( conf.exists("maxSeedsBeforeCleaning") )
87  maxSeedsBeforeCleaning_=conf.getParameter<unsigned int>("maxSeedsBeforeCleaning");
88 #endif
89  if (conf.existsAs<edm::InputTag>("clustersToSkip")) {
90  skipClusters_ = true;
91  maskPixels_ = iC.consumes<PixelClusterMask>(conf.getParameter<edm::InputTag>("clustersToSkip"));
92  maskStrips_ = iC.consumes<StripClusterMask>(conf.getParameter<edm::InputTag>("clustersToSkip"));
93  }
94  //FIXME:: just temporary solution for phase2!
95  if (conf.existsAs<edm::InputTag>("phase2clustersToSkip")) {
96  phase2skipClusters_ = true;
97  maskPixels_ = iC.consumes<PixelClusterMask>(conf.getParameter<edm::InputTag>("phase2clustersToSkip"));
98  maskPhase2OTs_ = iC.consumes<Phase2OTClusterMask>(conf.getParameter<edm::InputTag>("phase2clustersToSkip"));
99  }
100 #ifndef VI_REPRODUCIBLE
101  std::string cleaner = conf.getParameter<std::string>("RedundantSeedCleaner");
102  if (cleaner == "SeedCleanerByHitPosition") {
104  } else if (cleaner == "SeedCleanerBySharedInput") {
106  } else if (cleaner == "CachingSeedCleanerByHitPosition") {
108  } else if (cleaner == "CachingSeedCleanerBySharedInput") {
109  int numHitsForSeedCleaner = conf.existsAs<int>("numHitsForSeedCleaner") ?
110  conf.getParameter<int>("numHitsForSeedCleaner") : 4;
111  int onlyPixelHits = conf.existsAs<bool>("onlyPixelHitsForSeedCleaner") ?
112  conf.getParameter<bool>("onlyPixelHitsForSeedCleaner") : false;
113  theSeedCleaner = new CachingSeedCleanerBySharedInput(numHitsForSeedCleaner,onlyPixelHits);
114  } else if (cleaner == "none") {
115  theSeedCleaner = nullptr;
116  } else {
117  throw cms::Exception("RedundantSeedCleaner not found", cleaner);
118  }
119 #endif
120 
121 #ifdef VI_REPRODUCIBLE
122  std::cout << "CkfTrackCandidateMaker in reproducible setting" << std::endl;
123  assert(nullptr==theSeedCleaner);
124  assert(0>=maxSeedsBeforeCleaning_);
125 #endif
126 
127  }
128 
129 
130  // Virtual destructor needed.
132  if (theSeedCleaner) delete theSeedCleaner;
133  }
134 
136  {
137  /* no op*/
138  }
139 
141 
142  //services
145  // edm::ESInputTag mfESInputTag(mfName);
146  // es.get<IdealMagneticFieldRecord>().get(mfESInputTag,theMagField );
147 
148  edm::ESHandle<TrajectoryCleaner> trajectoryCleanerH;
149  es.get<TrajectoryCleaner::Record>().get(theTrajectoryCleanerName, trajectoryCleanerH);
150  theTrajectoryCleaner= trajectoryCleanerH.product();
151 
152  edm::ESHandle<NavigationSchool> navigationSchoolH;
153  es.get<NavigationSchoolRecord>().get(theNavigationSchoolName, navigationSchoolH);
154  theNavigationSchool = navigationSchoolH.product();
155  theTrajectoryBuilder->setNavigationSchool(theNavigationSchool);
156  }
157 
158  // Functions that gets called by framework every event
160  {
161  // getting objects from the EventSetup
162  setEventSetup( es );
163 
164  // set the correct navigation
165  // NavigationSetter setter( *theNavigationSchool);
166 
167  // propagator
168  edm::ESHandle<Propagator> thePropagator;
169  es.get<TrackingComponentsRecord>().get("AnyDirectionAnalyticalPropagator",
170  thePropagator);
171 
172  // method for Debugging
174 
175  // Step A: set Event for the TrajectoryBuilder
177  e.getByToken(theMTELabel, data);
178 
179  std::unique_ptr<MeasurementTrackerEvent> dataWithMasks;
180  if (skipClusters_) {
182  e.getByToken(maskPixels_, pixelMask);
184  e.getByToken(maskStrips_, stripMask);
185  dataWithMasks = std::make_unique<MeasurementTrackerEvent>(*data, *stripMask, *pixelMask);
186  //std::cout << "Trajectory builder " << conf_.getParameter<std::string>("@module_label") << " created with masks " << std::endl;
187  theTrajectoryBuilder->setEvent(e, es, &*dataWithMasks);
188  } else if (phase2skipClusters_) {
189  //FIXME:just temporary solution for phase2!
191  e.getByToken(maskPixels_, pixelMask);
193  e.getByToken(maskPhase2OTs_, phase2OTMask);
194  dataWithMasks = std::make_unique<MeasurementTrackerEvent>(*data, *pixelMask, *phase2OTMask);
195  //std::cout << "Trajectory builder " << conf_.getParameter<std::string>("@module_label") << " created with phase2 masks " << std::endl;
196  theTrajectoryBuilder->setEvent(e, es, &*dataWithMasks);
197  } else {
198  //std::cout << "Trajectory builder " << conf_.getParameter<std::string>("@module_label") << " created without masks " << std::endl;
199  theTrajectoryBuilder->setEvent(e, es, &*data);
200  }
201  // TISE ES must be set here due to dependence on theTrajectoryBuilder
202  theInitialState->setEventSetup( es, static_cast<TkTransientTrackingRecHitBuilder const *>(theTrajectoryBuilder->hitBuilder())->cloner() );
203 
204  // Step B: Retrieve seeds
205 
207  e.getByToken(theSeedLabel, collseed);
208 
209  // Step C: Create empty output collection
210  auto output = std::make_unique<TrackCandidateCollection>();
211  auto outputT = std::make_unique<std::vector<Trajectory>>();
212  auto outputSeedStopInfos = std::make_unique<std::vector<SeedStopInfo> >(collseed->size());
213 
214  if ( (*collseed).size()>theMaxNSeeds ) {
215  LogError("TooManySeeds")<<"Exceeded maximum numeber of seeds! theMaxNSeeds="<<theMaxNSeeds<<" nSeed="<<(*collseed).size();
217  if (theTrajectoryOutput){e.put(std::move(outputT));}
218  e.put(std::move(outputSeedStopInfos));
219  return;
220  }
221 
222  // Step D: Invoke the building algorithm
223  if (!(*collseed).empty()){
224 
225  unsigned int lastCleanResult=0;
226  std::vector<Trajectory> rawResult;
227  rawResult.reserve(collseed->size() * 4);
228 
229  if (theSeedCleaner) theSeedCleaner->init( &rawResult );
230 
231  // method for debugging
233 
234  // the mutex
235  std::mutex theMutex;
236  using Lock = std::unique_lock<std::mutex>;
237 
238  // Loop over seeds
239  size_t collseed_size = collseed->size();
240 
241  unsigned int indeces[collseed_size]; for (auto i=0U; i< collseed_size; ++i) indeces[i]=i;
242 
243 
244 
245 
246 #ifdef VI_SORTSEED
247  // std::random_shuffle(indeces,indeces+collseed_size);
248 
249  // here only for reference: does not seems to help
250 
251  auto const & seeds = *collseed;
252 
253 
254  float val[collseed_size];
255  for (auto i=0U; i< collseed_size; ++i)
256  { val[i] = seeds[i].startingState().pt();};
257  // { val[i] = std::abs((*seeds[i].recHits().first).surface()->eta());}
258 
259  /*
260  unsigned long long val[collseed_size];
261  for (auto i=0U; i< collseed_size; ++i) {
262  if (seeds[i].nHits()<2) { val[i]=0; continue;}
263  auto h = seeds[i].recHits().first;
264  auto const & hit = static_cast<BaseTrackerRecHit const&>(*h);
265  val[i] = hit.firstClusterRef().key();
266  if (++h != seeds[i].recHits().second) {
267  auto const & hit = static_cast<BaseTrackerRecHit const&>(*h);
268  val[i] |= (unsigned long long)(hit.firstClusterRef().key())<<32;
269  }
270  }
271  */
272  std::sort(indeces,indeces+collseed_size, [&](unsigned int i, unsigned int j){return val[i]<val[j];});
273 
274 
275  // std::cout << spt(indeces[0]) << ' ' << spt(indeces[collseed_size-1]) << std::endl;
276 #endif
277 
278  std::atomic<unsigned int> ntseed(0);
279  auto theLoop = [&](size_t ii) {
280  auto j = indeces[ii];
281 
282  ntseed++;
283 
284  // to be moved inside a par section (how with tbb??)
285  std::vector<Trajectory> theTmpTrajectories;
286 
287 
288  LogDebug("CkfPattern") << "======== Begin to look for trajectories from seed " << j << " ========\n";
289 
290  { Lock lock(theMutex);
291  // Check if seed hits already used by another track
292  if (theSeedCleaner && !theSeedCleaner->good( &((*collseed)[j])) ) {
293  LogDebug("CkfTrackCandidateMakerBase")<<" Seed cleaning kills seed "<<j;
294  (*outputSeedStopInfos)[j].setStopReason(SeedStopReason::SEED_CLEANING);
295  return; // from the lambda!
296  }}
297 
298 
299  // Build trajectory from seed outwards
300  theTmpTrajectories.clear();
301  unsigned int nCandPerSeed = 0;
302  auto const & startTraj = theTrajectoryBuilder->buildTrajectories( (*collseed)[j], theTmpTrajectories, nCandPerSeed, nullptr );
303  {
304  Lock lock(theMutex);
305  (*outputSeedStopInfos)[j].setCandidatesPerSeed(nCandPerSeed);
306  if(theTmpTrajectories.empty()) {
307  (*outputSeedStopInfos)[j].setStopReason(SeedStopReason::NO_TRAJECTORY);
308  return; // from the lambda!
309  }
310  }
311 
312  LogDebug("CkfPattern") << "======== In-out trajectory building found " << theTmpTrajectories.size()
313  << " trajectories from seed " << j << " ========\n"
314  <<PrintoutHelper::dumpCandidates(theTmpTrajectories);
315 
317 
318  // Select the best trajectory from this seed (declare others invalid)
319  theTrajectoryCleaner->clean(theTmpTrajectories);
320 
321  LogDebug("CkfPattern") << "======== In-out trajectory cleaning gave the following " << theTmpTrajectories.size()
322  << " valid trajectories from seed "
323  << j << " ========\n"
324  << PrintoutHelper::dumpCandidates(theTmpTrajectories);
325  }
326 
327  // Optionally continue building trajectory back through
328  // seed and if possible further inwards.
329 
331  theTrajectoryBuilder->rebuildTrajectories(startTraj,(*collseed)[j],theTmpTrajectories);
332 
333  LogDebug("CkfPattern") << "======== Out-in trajectory building found " << theTmpTrajectories.size()
334  << " valid/invalid trajectories from seed " << j << " ========\n"
335  <<PrintoutHelper::dumpCandidates(theTmpTrajectories);
336  if(theTmpTrajectories.empty()) {
337  Lock lock(theMutex);
338  (*outputSeedStopInfos)[j].setStopReason(SeedStopReason::SEED_REGION_REBUILD);
339  return;
340  }
341  }
342 
343 
344  // Select the best trajectory from this seed (after seed region rebuilding, can be more than one)
345  theTrajectoryCleaner->clean(theTmpTrajectories);
346 
347  LogDebug("CkfPattern") << "======== Trajectory cleaning gave the following " << theTmpTrajectories.size() << " valid trajectories from seed "
348  << j << " ========\n"
349  <<PrintoutHelper::dumpCandidates(theTmpTrajectories);
350 
351  { Lock lock(theMutex);
352  for(vector<Trajectory>::iterator it=theTmpTrajectories.begin();
353  it!=theTmpTrajectories.end(); it++){
354  if( it->isValid() ) {
355  it->setSeedRef(collseed->refAt(j));
356  (*outputSeedStopInfos)[j].setStopReason(SeedStopReason::NOT_STOPPED);
357  // Store trajectory
358  rawResult.push_back(std::move(*it));
359  // Tell seed cleaner which hits this trajectory used.
360  //TO BE FIXED: this cut should be configurable via cfi file
361  if (theSeedCleaner && rawResult.back().foundHits()>3) theSeedCleaner->add( &rawResult.back() );
362  //if (theSeedCleaner ) theSeedCleaner->add( & (*it) );
363  }
364  }}
365 
366  theTmpTrajectories.clear();
367 
368  LogDebug("CkfPattern") << "rawResult trajectories found so far = " << rawResult.size();
369 
370  { Lock lock(theMutex);
371  if ( maxSeedsBeforeCleaning_ >0 && rawResult.size() > maxSeedsBeforeCleaning_+lastCleanResult) {
372  theTrajectoryCleaner->clean(rawResult);
373  rawResult.erase(std::remove_if(rawResult.begin()+lastCleanResult,rawResult.end(),
374  std::not1(std::mem_fun_ref(&Trajectory::isValid))),
375  rawResult.end());
376  lastCleanResult=rawResult.size();
377  }
378  }
379 
380  };
381  // end of loop over seeds
382 
383 
384 #ifdef VI_TBB
385  tbb::parallel_for(0UL,collseed_size,1UL,theLoop);
386 #else
387 #ifdef VI_OMP
388 #pragma omp parallel for schedule(dynamic,4)
389 #endif
390  for (size_t j = 0; j < collseed_size; j++){
391  theLoop(j);
392  }
393 #endif
394  assert(ntseed==collseed_size);
396 
397  // std::cout << "VICkfPattern " << "rawResult trajectories found = " << rawResult.size() << " in " << ntseed << " seeds " << collseed_size << std::endl;
398 
399 #ifdef VI_REPRODUCIBLE
400  // sort trajectory
401  std::sort(rawResult.begin(), rawResult.end(),[](const Trajectory & a, const Trajectory & b)
402  { return a.seedRef().key() < b.seedRef().key();});
403  //{ return a.chiSquared()*b.ndof() < b.chiSquared()*a.ndof();});
404 #endif
405 
406  // Step E: Clean the results to avoid duplicate tracks
407  // Rejected ones just flagged as invalid.
408  theTrajectoryCleaner->clean(rawResult);
409 
410  LogDebug("CkfPattern") << "======== Final cleaning of entire event found " << rawResult.size()
411  << " valid/invalid trajectories ======="<<endl
412  <<PrintoutHelper::dumpCandidates(rawResult);
413 
414  LogDebug("CkfPattern") << "removing invalid trajectories.";
415 
416  // Assuming here that theLoop() gives at most one Trajectory per seed
417  for(const auto& traj: rawResult) {
418  if(!traj.isValid()) {
419  const auto seedIndex = traj.seedRef().key();
420  if((*outputSeedStopInfos)[seedIndex].stopReason() == SeedStopReason::NOT_STOPPED) {
421  (*outputSeedStopInfos)[seedIndex].setStopReason(SeedStopReason::FINAL_CLEAN);
422  }
423  }
424  }
425 
426  vector<Trajectory> & unsmoothedResult(rawResult);
427  unsmoothedResult.erase(std::remove_if(unsmoothedResult.begin(),unsmoothedResult.end(),
428  std::not1(std::mem_fun_ref(&Trajectory::isValid))),
429  unsmoothedResult.end());
430  unsmoothedResult.shrink_to_fit();
431  // If requested, reverse the trajectories creating a new 1-hit seed on the last measurement of the track
432  if (reverseTrajectories) {
433  for (auto it = unsmoothedResult.begin(), ed = unsmoothedResult.end(); it != ed; ++it) {
434  // reverse the trajectory only if it has valid hit on the last measurement (should happen)
435  if (it->lastMeasurement().updatedState().isValid() &&
436  it->lastMeasurement().recHit().get() != nullptr &&
437  it->lastMeasurement().recHit()->isValid()) {
438  // I can't use reverse in place, because I want to change the seed
439  // 1) reverse propagation direction
440  PropagationDirection direction = it->direction();
441  if (direction == alongMomentum) direction = oppositeToMomentum;
442  else if (direction == oppositeToMomentum) direction = alongMomentum;
443  // 2) make a seed
444  TrajectoryStateOnSurface const & initState = it->lastMeasurement().updatedState();
445  auto initId = it->lastMeasurement().recHitR().rawId();
448  hits.push_back(it->lastMeasurement().recHit()->hit()->clone());
449  boost::shared_ptr<const TrajectorySeed> seed(new TrajectorySeed(state, std::move(hits), direction));
450  // 3) make a trajectory
451  Trajectory trajectory(seed, direction);
452  trajectory.setNLoops(it->nLoops());
453  trajectory.setSeedRef(it->seedRef());
454  trajectory.setStopReason(it->stopReason());
455  // 4) push states in reversed order
456  Trajectory::DataContainer &meas = it->measurements();
457  trajectory.reserve(meas.size());
458  for (auto itmeas = meas.rbegin(), endmeas = meas.rend(); itmeas != endmeas; ++itmeas) {
459  trajectory.push(std::move(*itmeas));
460  }
461  // replace
462  (*it)= std::move(trajectory);
463  } else {
464  edm::LogWarning("CkfPattern_InvalidLastMeasurement") << "Last measurement of the trajectory is invalid, cannot reverse it";
465  }
466  }
467  }
468 
469 
470  int viTotHits=0;
471 
473  // Step F: Convert to TrackCandidates
474  output->reserve(unsmoothedResult.size());
475  Traj2TrackHits t2t(theTrajectoryBuilder->hitBuilder(),true);
476 
477  for (vector<Trajectory>::const_iterator it = unsmoothedResult.begin();
478  it != unsmoothedResult.end(); ++it) {
479 
480  LogDebug("CkfPattern") << "copying "<<(useSplitting?"splitted":"un-splitted")<<" hits from trajectory";
482  if(it->direction() != alongMomentum) LogDebug("CkfPattern") << "not along momentum... " << std::endl;
483  t2t(*it,recHits,useSplitting);
484 
485  viTotHits+=recHits.size();
486 
487 
488  LogDebug("CkfPattern") << "getting initial state.";
489  Trajectory trialTrajectory = (*it);
490  std::pair<TrajectoryStateOnSurface, const GeomDet*> initState;
491  bool failed = false;
492 
493  do {
494  // Drop last hit if previous backFitter was not successful
495  if(failed) {
496  LogDebug("CkfPattern") << "removing last hit";
497  trialTrajectory.pop();
498  LogDebug("CkfPattern") << "hits remaining " << trialTrajectory.foundHits();
499  }
500 
501  // Get inner state
502  const bool doBackFit = (!doSeedingRegionRebuilding) & (!reverseTrajectories);
503  initState = theInitialState->innerState(trialTrajectory, doBackFit);
504 
505  // Check if that was successful
506  failed = (!initState.first.isValid()) || initState.second == nullptr || edm::isNotFinite(initState.first.globalPosition().x());
507  } while(failed && trialTrajectory.foundHits() > 3);
508 
509  if(failed) {
510  const auto seedIndex = it->seedRef().key();
511  (*outputSeedStopInfos)[seedIndex].setStopReason(SeedStopReason::SMOOTHING_FAILED);
512  continue;
513  }
514 
515 
516 
517  PTrajectoryStateOnDet state;
518  if(useSplitting && (initState.second != recHits.front().det()) && recHits.front().det() ){
519  LogDebug("CkfPattern") << "propagating to hit front in case of splitting.";
520  TrajectoryStateOnSurface && propagated = thePropagator->propagate(initState.first,recHits.front().det()->surface());
521  if (!propagated.isValid()) continue;
523  recHits.front().rawId());
524  }
525  else state = trajectoryStateTransform::persistentState( initState.first,
526  initState.second->geographicalId().rawId());
527  LogDebug("CkfPattern") << "pushing a TrackCandidate.";
528  output->emplace_back(recHits,it->seed(),state,it->seedRef(),it->nLoops(), (uint8_t)it->stopReason());
529  }
530  }//output trackcandidates
531 
533  es.get<TrackerDigiGeometryRecord>().get(tracker);
534  LogTrace("CkfPattern|TrackingRegressionTest") << "========== CkfTrackCandidateMaker Info =========="
535  << "number of Seed: " << collseed->size()<<'\n'
536  <<PrintoutHelper::regressionTest(*tracker,unsmoothedResult);
537 
538  assert(viTotHits>=0); // just to use it...
539  // std::cout << "VICkfPattern result " << output->size() << " " << viTotHits << std::endl;
540 
541  if (theTrajectoryOutput){ outputT->swap(unsmoothedResult);}
542 
543  }// end of ((*collseed).size()>0)
544 
545  // method for debugging
547 
548  // Step G: write output to file
550  if (theTrajectoryOutput){e.put(std::move(outputT));}
551  e.put(std::move(outputSeedStopInfos));
552  }
553 
554 }
#define LogDebug(id)
T getParameter(std::string const &) const
int foundHits() const
Definition: Trajectory.h:225
static std::string dumpCandidates(collection &candidates)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
virtual void clean(TempTrajectoryContainer &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
static boost::mutex mutex
Definition: LHEProxy.cc:11
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
edm::EDGetTokenT< StripClusterMask > maskStrips_
void setStopReason(StopReason s)
Definition: Trajectory.h:352
std::unique_ptr< TransientInitialStateEstimator > theInitialState
size_type size() const
Definition: OwnVector.h:264
void setNLoops(signed char value)
Definition: Trajectory.h:349
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
bool exists(std::string const &parameterName) const
checks if a parameter exists
#define noexcept
virtual void printHitsDebugger(edm::Event &e)
edm::ESHandle< GeometricSearchTracker > theGeomSearchTracker
PropagationDirection
virtual void done()=0
Tells the cleaner that the seeds are finished, and so it can clear any cache it has.
void reserve(unsigned int n)
Definition: Trajectory.h:150
#define nullptr
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
virtual void add(const Trajectory *traj)=0
Informs the cleaner that a new trajectory has been made, in case the cleaner keeps a local collection...
virtual bool good(const TrajectorySeed *seed)=0
Returns true if the seed is not overlapping with another trajectory.
static std::string regressionTest(const TrackerGeometry &tracker, std::vector< Trajectory > &unsmoothedResult)
void push_back(D *&d)
Definition: OwnVector.h:290
edm::EDGetTokenT< PixelClusterMask > maskPixels_
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:44
bool isNotFinite(T x)
Definition: isFinite.h:10
reverseTrajectories
reverse trajectories after pattern-reco creating new seed on last hit
const TrajectoryCleaner * theTrajectoryCleaner
const NavigationSchool * theNavigationSchool
const GeomDet * det() const
virtual void produceBase(edm::Event &e, const edm::EventSetup &es)
size_t key() const
Definition: RefToBase.h:250
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder
edm::EDGetTokenT< MeasurementTrackerEvent > theMTELabel
edm::RefToBase< TrajectorySeed > seedRef(void) const
Definition: Trajectory.h:321
edm::EDGetTokenT< Phase2OTClusterMask > maskPhase2OTs_
#define LogTrace(id)
edm::EDGetTokenT< edm::View< TrajectorySeed > > theSeedLabel
ii
Definition: cuy.py:588
bool isValid() const
Definition: Trajectory.h:279
void pop()
Definition: Trajectory.cc:29
const T & get() const
Definition: EventSetup.h:55
double b
Definition: hdecay.h:120
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
void setSeedRef(const edm::RefToBase< TrajectorySeed > &seedRef)
Definition: Trajectory.h:323
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
virtual void beginRunBase(edm::Run const &, edm::EventSetup const &es)
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double a
Definition: hdecay.h:121
numHitsForSeedCleaner
these two parameters are relevant only for the CachingSeedCleanerBySharedInput
T const * product() const
Definition: ESHandle.h:86
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:50
virtual void init(const std::vector< Trajectory > *vect)=0
Provides the cleaner a pointer to the vector where trajectories are stored, in case it does not want ...
reference front()
Definition: OwnVector.h:423
def move(src, dest)
Definition: eostools.py:510
id_type rawId() const
T get(const Candidate &c)
Definition: component.h:55
Definition: Run.h:43
edm::ESHandle< MagneticField > theMagField