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 (const edm::ParameterSet &iConfig)
 
 FastTrajectoryCleaner (float bonus, float penalty, bool noSeed=true)
 
 ~FastTrajectoryCleaner () override
 
- 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 14 of file FastTrajectoryCleaner.h.

Member Typedef Documentation

◆ TempTrajectoryContainer

Definition at line 17 of file FastTrajectoryCleaner.h.

◆ TrajectoryPointerContainer

Definition at line 16 of file FastTrajectoryCleaner.h.

Constructor & Destructor Documentation

◆ FastTrajectoryCleaner() [1/3]

FastTrajectoryCleaner::FastTrajectoryCleaner ( )
inline

Definition at line 19 of file FastTrajectoryCleaner.h.

19 : validHitBonus_(0.5f * 5.0f), missingHitPenalty_(20.0f), dismissSeed_(true) {}

◆ FastTrajectoryCleaner() [2/3]

FastTrajectoryCleaner::FastTrajectoryCleaner ( float  bonus,
float  penalty,
bool  noSeed = true 
)
inline

Definition at line 21 of file FastTrajectoryCleaner.h.

22  : validHitBonus_(0.5f * bonus), missingHitPenalty_(penalty), dismissSeed_(noSeed) {}

◆ FastTrajectoryCleaner() [3/3]

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

Definition at line 24 of file FastTrajectoryCleaner.h.

25  : validHitBonus_(0.5 * iConfig.getParameter<double>("ValidHitBonus")),
26  missingHitPenalty_(iConfig.getParameter<double>("MissingHitPenalty")),
27  dismissSeed_(iConfig.getParameter<bool>("dismissSeed")) {}

◆ ~FastTrajectoryCleaner()

FastTrajectoryCleaner::~FastTrajectoryCleaner ( )
inlineoverride

Definition at line 29 of file FastTrajectoryCleaner.h.

29 {}

Member Function Documentation

◆ clean() [1/2]

void FastTrajectoryCleaner::clean ( TempTrajectoryContainer tc) const
overridevirtual

Reimplemented from TrajectoryCleaner.

Definition at line 7 of file FastTrajectoryCleaner.cc.

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

References dismissSeed_, f, dqmMemoryStats::float, SiStripPI::max, HGVHistoProducerAlgoBlock_cfi::maxScore, TempTrajectory::measurements(), missingHitPenalty_, offlineSlimmedPrimaryVertices_cfi::score, and validHitBonus_.

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

◆ clean() [2/2]

void FastTrajectoryCleaner::clean ( TrajectoryPointerContainer tc) const
overridevirtual

Implements TrajectoryCleaner.

Definition at line 2 of file FastTrajectoryCleaner.cc.

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

References cms::cuda::assert().

Member Data Documentation

◆ dismissSeed_

bool FastTrajectoryCleaner::dismissSeed_
private

Definition at line 37 of file FastTrajectoryCleaner.h.

Referenced by clean().

◆ missingHitPenalty_

float FastTrajectoryCleaner::missingHitPenalty_
private

Definition at line 36 of file FastTrajectoryCleaner.h.

Referenced by clean().

◆ validHitBonus_

float FastTrajectoryCleaner::validHitBonus_
private

Definition at line 35 of file FastTrajectoryCleaner.h.

Referenced by clean().

FastTrajectoryCleaner::dismissSeed_
bool dismissSeed_
Definition: FastTrajectoryCleaner.h:37
DOFs::dof
dof
Definition: AlignPCLThresholdsWriter.cc:37
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
FastTrajectoryCleaner::missingHitPenalty_
float missingHitPenalty_
Definition: FastTrajectoryCleaner.h:36
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
TempTrajectory
Definition: TempTrajectory.h:40
cms::cuda::assert
assert(be >=bs)
FastTrajectoryCleaner::validHitBonus_
float validHitBonus_
Definition: FastTrajectoryCleaner.h:35
TempTrajectory::measurements
const DataContainer & measurements() const
Definition: TempTrajectory.h:177
h
edm::LogError
Definition: MessageLogger.h:183
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HGVHistoProducerAlgoBlock_cfi.maxScore
maxScore
Definition: HGVHistoProducerAlgoBlock_cfi.py:59
offlineSlimmedPrimaryVertices_cfi.score
score
Definition: offlineSlimmedPrimaryVertices_cfi.py:6