10 #include <klm/bklm/modules/bklmTracking/BKLMTrackFinder.h>
13 #include <klm/dataobjects/KLMHit2d.h>
16 #include <framework/logging/Logger.h>
19 using namespace CLHEP;
46 std::list<KLMHit2d*>& hits,
47 std::list<KLMHit2d*>& track)
50 std::list<KLMHit2d*>::iterator i;
55 B2ERROR(
"BKLMTrackFinder: Fitter not registered");
61 for (i = hits.begin(); i != hits.end(); ++i) {
75 if ((*i)->isOnStaTrack() ==
false) {
92 B2DEBUG(20,
"BKLMTrackFinder:" <<
"ChiSqr: " << chisqr);
95 std::list<int> hitLayers;
96 for (i = track.begin(); i != track.end(); ++i) {
97 hitLayers.push_back((*i)->getLayer());
102 int layers = (*(--hitLayers.end()) - * (hitLayers.begin()));
103 int noHits = hitLayers.size();
105 if (noHits >= 4 &&
double(noHits) / double(layers) >= 0.75) {
bool filter(const std::list< KLMHit2d * > &seed, std::list< KLMHit2d * > &hits, std::list< KLMHit2d * > &track)
find associated hits and do fit.
void registerFitter(BKLMTrackFitter *fitter)
Register a fitter if not constructed with one.
~BKLMTrackFinder()
Destructor.
bool m_globalFit
do fit in the local system or global system false: local sys; true: global sys.
BKLMTrackFinder()
Default constructor.
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.
void setGlobalFit(bool localOrGlobal)
set the fitting mode, local system or global system
Abstract base class for different kinds of events.