CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
FastTrajectoryCleaner Class Referencefinal

#include <FastTrajectoryCleaner.h>

Inheritance diagram for FastTrajectoryCleaner:
TrajectoryCleaner

Public Types

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

Public Member Functions

void clean (TempTrajectoryContainer &) const override
 
void clean (TrajectoryPointerContainer &) const override
 
 FastTrajectoryCleaner ()
 
 FastTrajectoryCleaner (float bonus, float penalty, bool noSeed=true)
 
 FastTrajectoryCleaner (const edm::ParameterSet &iConfig)
 
 ~FastTrajectoryCleaner ()
 
- Public Member Functions inherited from TrajectoryCleaner
virtual void clean (TrajectoryContainer &) const
 
 TrajectoryCleaner ()
 
 TrajectoryCleaner (edm::ParameterSet &iConfig)
 
virtual ~TrajectoryCleaner ()
 

Private Attributes

bool dismissSeed_
 
float missingHitPenalty_
 
float validHitBonus_
 

Detailed Description

A concrete TrajectoryCleaner that assumes all trajectories coming from the same seed and therefore incompatible The "best" trajectory of is kept, the others are invalidated. The goodness of a track is defined in terms of Chi^2, number of reconstructed hits, and number of lost hits. As it can be used during PatternReco there is the option to not consider hits from the common seed

Definition at line 15 of file FastTrajectoryCleaner.h.

Member Typedef Documentation

Definition at line 19 of file FastTrajectoryCleaner.h.

Definition at line 18 of file FastTrajectoryCleaner.h.

Constructor & Destructor Documentation

FastTrajectoryCleaner::FastTrajectoryCleaner ( )
inline

Definition at line 21 of file FastTrajectoryCleaner.h.

21  :
22  validHitBonus_(0.5f*5.0f),
23  missingHitPenalty_(20.0f),
24  dismissSeed_(true){}
double f[11][100]
FastTrajectoryCleaner::FastTrajectoryCleaner ( float  bonus,
float  penalty,
bool  noSeed = true 
)
inline

Definition at line 27 of file FastTrajectoryCleaner.h.

27  :
28  validHitBonus_(0.5f*bonus),
29  missingHitPenalty_(penalty),
30  dismissSeed_(noSeed){}
double f[11][100]
FastTrajectoryCleaner::FastTrajectoryCleaner ( const edm::ParameterSet iConfig)
inline

Definition at line 34 of file FastTrajectoryCleaner.h.

34  :
35  validHitBonus_(0.5*iConfig.getParameter<double>("ValidHitBonus")),
36  missingHitPenalty_(iConfig.getParameter<double>("MissingHitPenalty")),
37  dismissSeed_(iConfig.getParameter<bool>("dismissSeed")){}
T getParameter(std::string const &) const
FastTrajectoryCleaner::~FastTrajectoryCleaner ( )
inline

Definition at line 39 of file FastTrajectoryCleaner.h.

References clean().

39 {}

Member Function Documentation

void FastTrajectoryCleaner::clean ( TempTrajectoryContainer tc) const
overridevirtual

Reimplemented from TrajectoryCleaner.

Definition at line 8 of file FastTrajectoryCleaner.cc.

References dismissSeed_, f, objects.autophobj::float, hpstanc_transforms::max, TempTrajectory::measurements(), missingHitPenalty_, offlineSlimmedPrimaryVertices_cfi::score, and validHitBonus_.

Referenced by GroupedCkfTrajectoryBuilder::buildTrajectories(), GroupedCkfTrajectoryBuilder::rebuildTrajectories(), and ~FastTrajectoryCleaner().

9 {
10 
11  if (tc.size() <= 1) return; // nothing to clean
12  float maxScore= -std::numeric_limits<float>::max();
13  TempTrajectory * bestTr = nullptr;
14  for (auto & it : tc) {
15  if (!it.isValid()) continue;
16  auto const & pd = it.measurements();
17  // count active degree of freedom
18  int dof=0;
19  for (auto const & im : pd) {
20  if(dismissSeed_ & (im.estimate()==0)) continue;
21  auto const & h = im.recHitR();
22  if (!h.isValid()) continue;
23  dof+=h.dimension();
24  }
25  float score = validHitBonus_*float(dof) - missingHitPenalty_*it.lostHits() - it.chiSquared();
26  if ( it.lastMeasurement().updatedState().globalMomentum().perp2() < 0.81f ) score -= 0.5f*validHitBonus_*float(dof);
27  else if (it.dPhiCacheForLoopersReconstruction()==0 &&it.foundHits()>8) score+=validHitBonus_*float(dof); // extra bonus for long tracks
28  if (score>=maxScore) {
29  bestTr = &it;
30  maxScore = score;
31  }
32  }
33 
34  for (auto & it : tc) {
35  if ((&it)!=bestTr) it.invalidate();
36  }
37 
38 
39 }
const DataContainer & measurements() const
double f[11][100]
void FastTrajectoryCleaner::clean ( TrajectoryPointerContainer tc) const
overridevirtual

Implements TrajectoryCleaner.

Definition at line 2 of file FastTrajectoryCleaner.cc.

3 {
4  edm::LogError("FastTrajectoryCleaner") << "not implemented for Trajectory";
5  assert(false);
6 }

Member Data Documentation

bool FastTrajectoryCleaner::dismissSeed_
private

Definition at line 47 of file FastTrajectoryCleaner.h.

Referenced by clean().

float FastTrajectoryCleaner::missingHitPenalty_
private

Definition at line 46 of file FastTrajectoryCleaner.h.

Referenced by clean().

float FastTrajectoryCleaner::validHitBonus_
private

Definition at line 45 of file FastTrajectoryCleaner.h.

Referenced by clean().