Belle II Software  release-08-01-10
BKLMTrackFinder Class Reference

track finding procedure More...

#include <BKLMTrackFinder.h>

Collaboration diagram for BKLMTrackFinder:

Public Member Functions

 BKLMTrackFinder ()
 Default constructor.
 
 BKLMTrackFinder (BKLMTrackFitter *fitter)
 The track finder requires a track fitter.
 
 ~BKLMTrackFinder ()
 Destructor.
 
void registerFitter (BKLMTrackFitter *fitter)
 Register a fitter if not constructed with one.
 
bool filter (const std::list< KLMHit2d * > &seed, std::list< KLMHit2d * > &hits, std::list< KLMHit2d * > &track)
 find associated hits and do fit. More...
 
void setGlobalFit (bool localOrGlobal)
 set the fitting mode, local system or global system
 

Protected Attributes

BKLMTrackFitterm_Fitter
 pointer to the fitter
 
bool m_globalFit
 do fit in the local system or global system false: local sys; true: global sys.
 

Detailed Description

track finding procedure

Definition at line 25 of file BKLMTrackFinder.h.

Member Function Documentation

◆ filter()

bool filter ( const std::list< KLMHit2d * > &  seed,
std::list< KLMHit2d * > &  hits,
std::list< KLMHit2d * > &  track 
)

find associated hits and do fit.

find associated hits and do fit

Definition at line 45 of file BKLMTrackFinder.cc.

48 {
49 
50  std::list<KLMHit2d*>::iterator i;
51 
52  track = seed;
53 
54  if (m_Fitter == 0) {
55  B2ERROR("BKLMTrackFinder: Fitter not registered");
56  return (false);
57  }
58 
59  m_Fitter->fit(track);//fit seed
60 
61  for (i = hits.begin(); i != hits.end(); ++i) {
62  if ((*i)->getSubdetector() != KLMElementNumbers::c_BKLM)
63  continue;
64 
65  // Prevent duplicate hits or hits on same layer
66  // no duplicate hit is alreday guaranteed and now we allow hits on same layer so the following is commented out
67  // bool skip = false;
68  // for (j = track.begin(); j != track.end(); ++j) {
69  // if ((*j)->getLayer() == (*i)->getLayer())
70  // skip = true;
71  // }
72  // if (skip == true)
73  // continue;
74 
75  if ((*i)->isOnStaTrack() == false) {
76  double error, sigma;
77  if (m_globalFit)
78  m_Fitter->globalDistanceToHit(*i, error, sigma);
79  else m_Fitter->distanceToHit(*i, error, sigma);
80  //B2INFO("BKLMTrackFinder" << " Error: " << error << " Sigma: " << sigma);
81  if (sigma < 5.0) {
82  track.push_back(*i);
83  }
84  }
85  }
86 
87  if (track.size() < 3)
88  return false;
89 
90  // Fit with new hits
91  double chisqr = m_Fitter->fit(track);
92  B2DEBUG(20, "BKLMTrackFinder:" << "ChiSqr: " << chisqr);
93 
94  // Do this the hard way to count each layer separately.
95  std::list<int> hitLayers;
96  for (i = track.begin(); i != track.end(); ++i) {
97  hitLayers.push_back((*i)->getLayer());
98  }
99  hitLayers.sort();
100  hitLayers.unique();
101 
102  int layers = (*(--hitLayers.end()) - * (hitLayers.begin()));
103  int noHits = hitLayers.size();
104 
105  if (noHits >= 4 && double(noHits) / double(layers) >= 0.75) {
106  return true;
107  } else {
108  return false;
109  }
110 }
bool m_globalFit
do fit in the local system or global system false: local sys; true: global sys.
BKLMTrackFitter * m_Fitter
pointer to the fitter
double fit(std::list< KLMHit2d * > &listTrackPoint)
do fit and returns chi square of the fit.
double globalDistanceToHit(KLMHit2d *hit, double &error, double &sigma)
Distance from track to a hit in the global system.
double distanceToHit(KLMHit2d *hit, double &error, double &sigma)
Distance from track to a hit in the plane of the module.

The documentation for this class was generated from the following files: