27#include "FairRootManager.h"
28#include "TClonesArray.h"
43 : FairTask(
"CbmKfFitTracksTask", iVerbose)
57 FairRootManager* ioman = FairRootManager::Instance();
60 LOG(error) <<
"CbmKfFitTracksTask::Init :: RootManager not instantiated!";
66 fGlobalTracks =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"GlobalTrack"));
69 fStsTracks =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"StsTrack"));
70 fMuchTracks =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"MuchTrack"));
71 fTrdTracks =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"TrdTrack"));
72 fTofTracks =
dynamic_cast<TClonesArray*
>(ioman->GetObject(
"TofTrack"));
75 LOG(error) <<
"CbmKfFitTracksTask::Init: Global track array not found!";
80 LOG(error) <<
"CbmKfFitTracksTask::Init: Sts track array not found!";
95 for (
int iTr = 0; iTr <
fStsTracks->GetEntriesFast(); iTr++) {
98 LOG(fatal) <<
"CbmKfFitTracksTask: null pointer to the sts track!";
103 LOG(fatal) <<
"CbmKfFitTracksTask: can not create the sts track for the fit! ";
108 const auto& parV = t.
fNodes.front().fParamUp;
115 const auto& parV = t.
fNodes.back().fParamDn;
129 for (
int iTr = 0; iTr <
fGlobalTracks->GetEntriesFast(); iTr++) {
132 LOG(fatal) <<
"CbmKfFitTracksTask: null pointer to the global track!";
137 LOG(fatal) <<
"CbmKfFitTracksTask: can not create the global track for the fit! ";
142 const auto& parV = t.
fNodes.front().fParamUp;
149 const auto& parV = t.
fNodes.back().fParamDn;
Task class for refitting global or sts tracks.
Data class for a reconstructed hit in the STS.
Data class for STS tracks.
void SetParamLast(const FairTrackParam *parLast)
void SetParamFirst(const FairTrackParam *parFirst)
virtual ~CbmKfFitTracksTask()
TClonesArray * fGlobalTracks
input data arrays
TClonesArray * fTrdTracks
trd tracks
TClonesArray * fMuchTracks
much tracks
CbmKfTrackFitter fFitter
track fitter
void Exec(Option_t *opt) override
Int_t fNeventsProcessed
number of processed events
TClonesArray * fStsTracks
sts tracks
TClonesArray * fTofTracks
tof tracks
InitStatus Init() override
CbmKfFitTracksTask(FitMode mode=FitMode::kSts, Int_t iVerbose=0)
bool CreateMvdStsTrack(Trajectory &kfTrack, int stsTrackIndex)
set the input data arrays
bool CreateGlobalTrack(Trajectory &kfTrack, int globalTrackIndex)
void FixMomentumForMs(bool fix=true)
fix the inverse momentum for the Multiple Scattering calculation
void SetDefaultMomentumForMs(double p)
set the default inverse momentum for the Multiple Scattering calculation
bool FitTrajectory(CbmKfTrackFitter::Trajectory &t)
fit the track
void SetParamFirst(const FairTrackParam *par)
void SetParamLast(const FairTrackParam *par)
void Set(const TrackParamBase< T1 > &Tb)
cbm::algo::kf::TrackParamD ConvertTrackParam(const FairTrackParam &par)
copy fair track param to Ca track param
A trajectory to be fitted.
std::vector< TrajectoryNode > fNodes
nodes on the trajectory