diff --git a/StRoot/Sti/StiKalmanTrack.cxx b/StRoot/Sti/StiKalmanTrack.cxx index 280c4dde0ca..b1a47c6a98c 100644 --- a/StRoot/Sti/StiKalmanTrack.cxx +++ b/StRoot/Sti/StiKalmanTrack.cxx @@ -1658,42 +1658,40 @@ static int nCall=0;nCall++; StiKTNIterator source; StiKalmanTrackNode *pNode = 0,*targetNode; int iNode=0, status = 0; - bool isStarted=false,restIsWrong=false; + bool isStarted=false; sTNH.setDir(1); for (source=rbegin();source!=rend();source++) { iNode++; targetNode = &(*source); - if (restIsWrong) { targetNode->setInvalid(); continue;} if (!isStarted) { if (!targetNode->getHit()) targetNode->setInvalid(); if ( targetNode->getChi2()>1000) targetNode->setInvalid(); if (!targetNode->isValid()) continue; } - isStarted = true; sTNH.set(pNode,targetNode); status = sTNH.makeFit(0); - if (status) {restIsWrong = true; targetNode->setInvalid();} + if (status) {targetNode->setInvalid();continue;} if (!targetNode->isValid()) continue; + isStarted = true; pNode = targetNode; }//end for of nodes - pNode = 0; iNode=0;isStarted=false;restIsWrong=false; + pNode = 0; iNode=0;isStarted=false; sTNH.setDir(0); for (source=begin();source!=end();source++) { iNode++; targetNode = &(*source); - if (restIsWrong) { targetNode->setInvalid(); continue;} if (!isStarted) { if (!targetNode->getHit()) targetNode->setInvalid(); if ( targetNode->getChi2()>1000) targetNode->setInvalid(); if (!targetNode->isValid()) continue; } - isStarted = true; sTNH.set(pNode,targetNode); status = sTNH.makeFit(1); - if (status) {restIsWrong = true; targetNode->setInvalid();} + if (status) {targetNode->setInvalid();continue;} if (!targetNode->isValid()) continue; + isStarted = true; pNode = targetNode; }//end for of nodes return 0;