CbmRoot
Loading...
Searching...
No Matches
CbmLitTrackFitterIter.cxx
Go to the documentation of this file.
1/* Copyright (C) 2007-2012 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
11
12#include "data/CbmLitFitNode.h"
13#include "data/CbmLitTrack.h"
14
15#include <iostream>
16
18 : fFitter(fitter)
19 , fSmoother(smoother)
20 , fNofIterations(2)
21 , fChiSqCut(15.)
22 , fMinNofHits(3)
23{
24}
25
27
29{
30 for (int iter = 0; iter < fNofIterations; iter++) {
31 bool isRefit = false;
32
33 if (fFitter->Fit(track) == kLITERROR) {
34 return kLITERROR;
35 }
36
37 if (fSmoother->Fit(track) == kLITERROR) {
38 return kLITERROR;
39 }
40
41 if (iter < fNofIterations - 1) {
42 for (int i = 0; i < track->GetNofHits(); i++) {
43 litfloat chiSq = track->GetFitNode(i)->GetChiSqSmoothed();
44 if (chiSq > fChiSqCut) {
45 track->RemoveHit(i);
46 isRefit = true;
47 }
48 }
49 }
50
51 if (track->GetNofHits() < fMinNofHits) {
52 return kLITERROR;
53 }
54 if (!isRefit) {
55 return kLITSUCCESS;
56 }
57 }
58 return kLITSUCCESS;
59}
LitStatus
Definition CbmLitEnums.h:29
@ kLITERROR
Definition CbmLitEnums.h:31
@ kLITSUCCESS
Definition CbmLitEnums.h:30
Data class for storage of fitted track parameters, transport matrix and chi-square on each detector s...
double litfloat
Definition CbmLitFloat.h:19
Base data class for track.
boost::shared_ptr< CbmLitTrackFitter > TrackFitterPtr
litfloat GetChiSqSmoothed() const
CbmLitTrackFitterIter(TrackFitterPtr fitter, TrackFitterPtr smoother)
virtual LitStatus Fit(CbmLitTrack *track, bool downstream=true)
Main function to be implemented for concrete track fitter algorithm.
Base data class for track.
Definition CbmLitTrack.h:34
const CbmLitFitNode * GetFitNode(Int_t index) const
Definition CbmLitTrack.h:73
void RemoveHit(Int_t index)
Remove hit and corresponding fit node.
Int_t GetNofHits() const
Definition CbmLitTrack.h:62