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 () 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.

◆ 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) {}
double f[11][100]

◆ 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")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~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.

References dismissSeed_, f, nano_mu_digi_cff::float, h, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, SiStripPI::max, ALPAKA_ACCELERATOR_NAMESPACE::caHitNtupletGeneratorKernels::maxScore, missingHitPenalty_, offlineSlimmedPrimaryVertices_cfi::score, and validHitBonus_.

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

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 }
double f[11][100]
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ clean() [2/2]

void FastTrajectoryCleaner::clean ( TrajectoryPointerContainer tc) const
overridevirtual

Implements TrajectoryCleaner.

Definition at line 2 of file FastTrajectoryCleaner.cc.

References cms::cuda::assert().

2  {
3  edm::LogError("FastTrajectoryCleaner") << "not implemented for Trajectory";
4  assert(false);
5 }
Log< level::Error, false > LogError
assert(be >=bs)

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().