CMS 3D CMS Logo

List of all members | Static Public Member Functions | Private Types
IntermediateTrajectoryCleaner Class Reference

#include <IntermediateTrajectoryCleaner.h>

Static Public Member Functions

static void clean (TempTrajectoryContainer &tracks)
 

Private Types

typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
 
typedef BaseCkfTrajectoryBuilder::TempTrajectoryContainer TempTrajectoryContainer
 

Detailed Description

Definition at line 8 of file IntermediateTrajectoryCleaner.h.

Member Typedef Documentation

◆ ConstRecHitPointer

Definition at line 10 of file IntermediateTrajectoryCleaner.h.

◆ TempTrajectoryContainer

Definition at line 9 of file IntermediateTrajectoryCleaner.h.

Member Function Documentation

◆ clean()

void IntermediateTrajectoryCleaner::clean ( IntermediateTrajectoryCleaner::TempTrajectoryContainer theTrajectories)
static

Definition at line 11 of file IntermediateTrajectoryCleaner.cc.

11  {
12  if (theTrajectories.empty())
13  return;
14  if (theTrajectories[0].measurements().size() < 4)
15  return;
16 
17  for (TempTrajectoryContainer::iterator firstTraj = theTrajectories.begin(), firstEnd = theTrajectories.end() - 1;
18  firstTraj != firstEnd;
19  ++firstTraj) {
20  if ((!firstTraj->isValid()) || (!firstTraj->lastMeasurement().recHit()->isValid()))
21  continue;
22 
23  TempTrajectory::DataContainer::const_iterator itFirst = firstTraj->measurements().rbegin();
24  ConstRecHitPointer first_hit1 = itFirst->recHit();
25  --itFirst;
26  ConstRecHitPointer first_hit2 = itFirst->recHit();
27  --itFirst;
28  ConstRecHitPointer first_hit3 = itFirst->recHit();
29 
30  bool fh2Valid = first_hit2->isValid();
31 
32  for (TempTrajectoryContainer::iterator secondTraj = (firstTraj + 1), secondEnd = theTrajectories.end();
33  secondTraj != secondEnd;
34  ++secondTraj) {
35  if ((!secondTraj->isValid()) || (!secondTraj->lastMeasurement().recHit()->isValid()))
36  continue;
37 
38  TempTrajectory::DataContainer::const_iterator itSecond = secondTraj->measurements().rbegin();
39  ConstRecHitPointer second_hit1 = itSecond->recHit();
40  --itSecond;
41  ConstRecHitPointer second_hit2 = itSecond->recHit();
42  --itSecond;
43  ConstRecHitPointer second_hit3 = itSecond->recHit();
44 
45  if (&(*first_hit3) == &(*second_hit3)) {
46  if (fh2Valid ^ second_hit2->isValid()) { // ^ = XOR!
47  if (first_hit1->hit()->sharesInput(second_hit1->hit(), TrackingRecHit::all)) {
48  if (!fh2Valid) {
49  firstTraj->invalidate();
50  break;
51  }
52  // else // if (!second_hit2->isValid()) // should be always true, as we did XOR !
53  secondTraj->invalidate();
54  }
55  }
56  }
57  }
58  }
59  theTrajectories.erase(
60  std::remove_if(theTrajectories.begin(), theTrajectories.end(), std::not_fn(&TempTrajectory::isValid)),
61  theTrajectories.end());
62 }

References TrackingRecHit::all, and TempTrajectory::isValid().

Referenced by CkfTrajectoryBuilder::limitedCandidates().

ConstRecHitPointer
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
Definition: MillePedeAlignmentAlgorithm.cc:75
TempTrajectory::isValid
bool isValid() const
Definition: TempTrajectory.h:224
cmsutils::_bqueue_itr
Definition: bqueue.h:39
TrackingRecHit::all
Definition: TrackingRecHit.h:59