2 #include "StiKalmanTrackFitter.h"
4 #include "StiKTNIterator.h"
7 Int_t StiKalmanTrackFitter::_debug = 0;
24 static Int_t nCall=0; nCall++;
26 if (debug() > 2) cout <<
"SKTFitter::fit() -I- Started:"<<endl;
37 Int_t status = 0,nerr =0;
39 first = track->
begin();
43 first = track->rbegin();
45 if (debug()) cout <<
"StiKalmanTrackFitter::fit direction = " << fitDirection << endl;
47 Int_t nGoodNodes = track->getNNodes(3);
48 if (nGoodNodes<3)
return kShortTrackBeforeFit;
52 Int_t iNode=0; status = 0;
53 for (source=first;source!=last;source++) {
54 if (nerr>kMaxNErr)
return nerr;
57 targetNode = &(*source);
58 targetDet = targetNode->getDetector();
59 targetHit = targetNode->getHit();
60 Double_t oldChi2 = targetNode->getChi2();
if(oldChi2){};
61 static Int_t myKount=0;myKount++;
62 if (!pNode && !targetNode->isValid())
continue;
66 targetNode->setChi2(1e51);
68 status = targetNode->
propagate(pNode,targetDet,fitDirection);
70 status = targetNode->
propagate(pNode,targetHit,fitDirection);
71 if (status) {nerr++;
continue;}
75 targetNode->ResetComment(::Form(
"%30s start refit",targetDet->
getName().c_str()));
76 targetNode->PrintpT(
"S");}
83 targetNode->setChi2(0.);
84 if (!targetHit)
break;
85 assert(targetNode->getHit()==targetHit);
87 targetNode->setChi2(1e52);
88 if (tryNode.nudge(targetHit)) {nerr++;
break;}
89 chi2 = tryNode.evaluateChi2(targetHit);
90 if ((chi2>StiKalmanTrackFitterParameters::instance()->getMaxChi2())) {nerr++;
break;}
91 status = tryNode.updateNode();
92 if (status) {nerr++;
break;}
93 tryNode.setChi2(chi2);
95 if (debug()) {cout << Form(
"%5d ",status); StiKalmanTrackNode::PrintStep();}
103 nGoodNodes = track->getNNodes(3);
104 if (nGoodNodes<3)
return kShortTrackAfterFit;
105 return (nerr>kMaxNErr)? kManyErrors:0;
int propagate(StiKalmanTrackNode *p, const StiDetector *tDet, int dir)
Propagates a track encapsulated by the given node "p" to the given detector "tDet".
Definition of Kalman Track.
Abstract definition of a Track.
Definition of Kalman Track.
const StiKTNBidirectionalIterator & end() const
StiKTNBidirectionalIterator begin() const
virtual Int_t fit(StiTrack *track, Int_t direction)
const string & getName() const
Get the name of the object.