Belle II Software development
KLMTrackFinder Class Reference

track finding procedure More...

#include <KLMTrackFinder.h>

Public Member Functions

 KLMTrackFinder ()
 Default constructor.
 
 KLMTrackFinder (KLMTrackFitter *fitter)
 The track finder requires a track fitter.
 
 ~KLMTrackFinder ()
 Destructor.
 
void registerFitter (KLMTrackFitter *fitter)
 Register a fitter if not constructed with one.
 
bool filter (const std::list< KLMHit2d * > &seed, std::list< KLMHit2d * > &hits, std::list< KLMHit2d * > &track, int iSubdetector)
 find associated hits and do fit.
 

Protected Attributes

KLMTrackFitterm_Fitter
 pointer to the fitter
 

Detailed Description

track finding procedure

Definition at line 25 of file KLMTrackFinder.h.

Constructor & Destructor Documentation

◆ KLMTrackFinder() [1/2]

Default constructor.

Definition at line 22 of file KLMTrackFinder.cc.

23{
24}

◆ KLMTrackFinder() [2/2]

KLMTrackFinder ( KLMTrackFitter fitter)
explicit

The track finder requires a track fitter.

Definition at line 26 of file KLMTrackFinder.cc.

26 :
27 m_Fitter(fitter)
28{
29}
KLMTrackFitter * m_Fitter
pointer to the fitter

◆ ~KLMTrackFinder()

Destructor.

Definition at line 32 of file KLMTrackFinder.cc.

33{
34}

Member Function Documentation

◆ filter()

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

find associated hits and do fit.

find associated hits and do fit

Definition at line 43 of file KLMTrackFinder.cc.

47{
48
49 std::list<KLMHit2d*>::iterator i;
50
51 track = seed;
52
53 if (m_Fitter == 0) {
54 B2ERROR("KLMTrackFinder: Fitter not registered");
55 return (false);
56 }
57
58 m_Fitter->fit(track);//fit seed
59
60 //TODO: REMOVE ME AFTER TESTING B-KLMTrackFitter
61 // Will also need to think about how to generalize this
62 for (i = hits.begin(); i != hits.end(); ++i) {
63 if ((*i)->getSubdetector() != iSubdetector) //should be removed
64 continue;
65
66 // Prevent duplicate hits or hits on same layer
67 // no duplicate hit is alreday guaranteed and now we allow hits on same layer so the following is commented out
68 // bool skip = false;
69 // for (j = track.begin(); j != track.end(); ++j) {
70 // if ((*j)->getLayer() == (*i)->getLayer())
71 // skip = true;
72 // }
73 // if (skip == true)
74 // continue;
75
76 if ((*i)->isOnStaTrack() == false) {
77 double distance, error, sigma;
78 distance = m_Fitter->globalDistanceToHit(*i, error, sigma);
79 if (sigma < 5.0 && distance < 60) {
80 B2DEBUG(20, "KLMTrackFinder" << " Error: " << error << " Sigma: " << sigma << " Distance: " << distance);
81 track.push_back(*i);
82 }
83 }
84 }
85
86 if (track.size() < 3)
87 return false;
88
89 // Fit with new hits
90 double chisqr = m_Fitter->fit(track);
91 B2DEBUG(20, "KLMTrackFinder:" << "ChiSqr: " << chisqr);
92
93 // Do this the hard way to count each layer separately.
94 std::list<int> hitLayers;
95 for (i = track.begin(); i != track.end(); ++i) {
96 hitLayers.push_back((*i)->getLayer());
97 }
98 hitLayers.sort();
99 hitLayers.unique();
100
101 int layers = (*(--hitLayers.end()) - * (hitLayers.begin()));
102 int noHits = hitLayers.size();
103
104 if (noHits >= 4 && double(noHits) / double(layers) >= 0.75) {
105 return true;
106 } else {
107 return false;
108 }
109}
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.

◆ registerFitter()

void registerFitter ( KLMTrackFitter fitter)

Register a fitter if not constructed with one.

Definition at line 37 of file KLMTrackFinder.cc.

38{
39 m_Fitter = fitter;
40}

Member Data Documentation

◆ m_Fitter

KLMTrackFitter* m_Fitter
protected

pointer to the fitter

Definition at line 52 of file KLMTrackFinder.h.


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