CbmRoot
CbmLitTrackFitterIter.cxx
Go to the documentation of this file.
1 
7 
8 #include "data/CbmLitFitNode.h"
9 #include "data/CbmLitTrack.h"
10 
11 #include <iostream>
12 
14  TrackFitterPtr smoother)
15  : fFitter(fitter)
16  , fSmoother(smoother)
17  , fNofIterations(2)
18  , fChiSqCut(15.)
19  , fMinNofHits(3) {}
20 
22 
24  for (int iter = 0; iter < fNofIterations; iter++) {
25  bool isRefit = false;
26 
27  if (fFitter->Fit(track) == kLITERROR) { return kLITERROR; }
28 
29  if (fSmoother->Fit(track) == kLITERROR) { return kLITERROR; }
30 
31  if (iter < fNofIterations - 1) {
32  for (int i = 0; i < track->GetNofHits(); i++) {
33  litfloat chiSq = track->GetFitNode(i)->GetChiSqSmoothed();
34  if (chiSq > fChiSqCut) {
35  track->RemoveHit(i);
36  isRefit = true;
37  }
38  }
39  }
40 
41  if (track->GetNofHits() < fMinNofHits) { return kLITERROR; }
42  if (!isRefit) { return kLITSUCCESS; }
43  }
44  return kLITSUCCESS;
45 }
litfloat
double litfloat
Definition: CbmLitFloat.h:15
CbmLitTrack::GetFitNode
const CbmLitFitNode * GetFitNode(Int_t index) const
Definition: CbmLitTrack.h:67
CbmLitTrackFitterIter::fFitter
TrackFitterPtr fFitter
Definition: CbmLitTrackFitterIter.h:32
CbmLitTrackFitterIter::fNofIterations
int fNofIterations
Definition: CbmLitTrackFitterIter.h:36
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmLitFitNode.h
Data class for storage of fitted track parameters, transport matrix and chi-square on each detector s...
kLITSUCCESS
@ kLITSUCCESS
Definition: CbmLitEnums.h:24
kLITERROR
@ kLITERROR
Definition: CbmLitEnums.h:25
CbmLitTrackFitterIter::fChiSqCut
litfloat fChiSqCut
Definition: CbmLitTrackFitterIter.h:38
CbmLitTrackFitterIter::Fit
virtual LitStatus Fit(CbmLitTrack *track, bool downstream=true)
Main function to be implemented for concrete track fitter algorithm.
Definition: CbmLitTrackFitterIter.cxx:23
CbmLitTrack
Base data class for track.
Definition: CbmLitTrack.h:30
TrackFitterPtr
boost::shared_ptr< CbmLitTrackFitter > TrackFitterPtr
Definition: CbmTofPtrTypes.h:24
CbmLitTrackFitterIter::CbmLitTrackFitterIter
CbmLitTrackFitterIter(TrackFitterPtr fitter, TrackFitterPtr smoother)
Definition: CbmLitTrackFitterIter.cxx:13
CbmLitTrackFitterIter::fSmoother
TrackFitterPtr fSmoother
Definition: CbmLitTrackFitterIter.h:34
CbmLitTrack.h
Base data class for track.
CbmLitFitNode::GetChiSqSmoothed
litfloat GetChiSqSmoothed() const
Definition: CbmLitFitNode.h:45
CbmLitTrackFitterIter.h
CbmLitTrackFitterIter::fMinNofHits
int fMinNofHits
Definition: CbmLitTrackFitterIter.h:40
LitStatus
LitStatus
Definition: CbmLitEnums.h:23
CbmLitTrack::RemoveHit
void RemoveHit(Int_t index)
Remove hit and corresponding fit node.
Definition: CbmLitTrack.h:106
CbmLitTrack::GetNofHits
Int_t GetNofHits() const
Definition: CbmLitTrack.h:56
CbmLitTrackFitterIter::~CbmLitTrackFitterIter
virtual ~CbmLitTrackFitterIter()
Definition: CbmLitTrackFitterIter.cxx:21