CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions
TrajectoryCleanerBySharedSeeds Class Reference

#include <TrajectoryCleanerBySharedSeeds.h>

Inheritance diagram for TrajectoryCleanerBySharedSeeds:
TrajectoryCleaner

Public Types

typedef std::vector< Trajectory * > TrajectoryPointerContainer
 
- Public Types inherited from TrajectoryCleaner
typedef TrackingComponentsRecord Record
 
typedef std::vector< TrajectoryTrajectoryContainer
 
typedef
TrajectoryContainer::iterator 
TrajectoryIterator
 
typedef std::vector< Trajectory * > TrajectoryPointerContainer
 
typedef
TrajectoryPointerContainer::iterator 
TrajectoryPointerIterator
 

Public Member Functions

virtual void clean (TrajectoryPointerContainer &) const
 
void clean (std::vector< Trajectory > &trajs) const
 
 TrajectoryCleanerBySharedSeeds (const edm::ParameterSet &iConfig)
 
virtual ~TrajectoryCleanerBySharedSeeds ()
 
- Public Member Functions inherited from TrajectoryCleaner
virtual void clean (TrajectoryContainer &) const
 
 TrajectoryCleaner ()
 
 TrajectoryCleaner (edm::ParameterSet &iConfig)
 
virtual ~TrajectoryCleaner ()
 

Private Member Functions

bool sameSeed (const TrajectorySeed &s1, const TrajectorySeed &s2) const
 

Detailed Description

Definition at line 8 of file TrajectoryCleanerBySharedSeeds.h.

Member Typedef Documentation

Definition at line 11 of file TrajectoryCleanerBySharedSeeds.h.

Constructor & Destructor Documentation

TrajectoryCleanerBySharedSeeds::TrajectoryCleanerBySharedSeeds ( const edm::ParameterSet iConfig)
inline

Definition at line 13 of file TrajectoryCleanerBySharedSeeds.h.

13 {};
virtual TrajectoryCleanerBySharedSeeds::~TrajectoryCleanerBySharedSeeds ( )
inlinevirtual

Definition at line 14 of file TrajectoryCleanerBySharedSeeds.h.

14 {};

Member Function Documentation

void TrajectoryCleanerBySharedSeeds::clean ( TrajectoryPointerContainer ) const
virtual

Implements TrajectoryCleaner.

Definition at line 39 of file TrajectoryCleanerBySharedSeeds.cc.

40 {
41 }
void TrajectoryCleanerBySharedSeeds::clean ( std::vector< Trajectory > &  trajs) const

Definition at line 45 of file TrajectoryCleanerBySharedSeeds.cc.

References LogTrace, and fileCollector::seed.

46 {
47  if(trajs.size() == 0) return;
48 
49  // Best track
50  unsigned int best = 0;
51 
52  // Track are assumed to come in seed blocks
53  for(unsigned int actual = 1; actual < trajs.size(); actual++)
54  {
55  if(sameSeed(trajs[best].seed(), trajs[actual].seed()))
56  {
57  // Track to remove
58  unsigned int remove;
59 
60  // remove track with lower number of found hits, higher chi2
61  if(trajs[best].foundHits() != trajs[actual].foundHits())
62  {
63  if(trajs[best].foundHits() > trajs[actual].foundHits())
64  remove = actual;
65  else { remove = best; best = actual; }
66  }
67  else
68  {
69  if(trajs[best].chiSquared() < trajs[actual].chiSquared())
70  remove = actual;
71  else { remove = best; best = actual; }
72  }
73 
74  trajs[remove].invalidate();
75  }
76  }
77 
78  LogTrace("TrajectoryCleanerBySharedSeeds") << " [TrajecCleaner] cleaned trajs : 1/" << trajs.size()
79  << " (with " << trajs[best].measurements().size() << " hits)" << std::endl;
80 }
#define LogTrace(id)
bool sameSeed(const TrajectorySeed &s1, const TrajectorySeed &s2) const
bool TrajectoryCleanerBySharedSeeds::sameSeed ( const TrajectorySeed s1,
const TrajectorySeed s2 
) const
private

Definition at line 14 of file TrajectoryCleanerBySharedSeeds.cc.

References TrackingRecHit::all, TrajectorySeed::nHits(), diffTwoXMLs::r1, diffTwoXMLs::r2, and TrajectorySeed::recHits().

15 {
16  if(s1.nHits()==0 && s2.nHits()==0) return false;
17  if(s1.nHits() != s2.nHits()) return false;
18 
21 
22  TrajectorySeed::const_iterator h1 = r1.first;
23  TrajectorySeed::const_iterator h2 = r2.first;
24 
25  do
26  {
27  if(!(h1->sharesInput(&(*h2),TrackingRecHit::all)))
28  return false;
29 
30  h1++; h2++;
31  }
32  while(h1 != s1.recHits().second &&
33  h2 != s2.recHits().second);
34 
35  return true;
36 }
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
range recHits() const
unsigned int nHits() const