CbmRoot
Loading...
Searching...
No Matches
CbmRichTrackExtrapolationKF.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Claudia Hoehne, Andrey Lebedev, Semen Lebedev, Denis Bertini [committer] */
4
12
13#include "CbmEvent.h"
14#include "CbmGlobalTrack.h"
15#include "CbmStsKFTrackFitter.h"
16#include "CbmStsTrack.h"
17#include "FairRootManager.h"
18#include "FairTrackParam.h"
19#include "TClonesArray.h"
20#include "TMatrixFSym.h"
21
22#include <Logger.h>
23
24#include <iostream>
25
26
27using std::cout;
28using std::endl;
29
31
33
35{
36 FairRootManager* manager = FairRootManager::Instance();
37 if (manager == nullptr) LOG(fatal) << "CbmRichTrackExtrapolationKF::Init(): FairRootManager is nullptr.";
38
39 fStsTracks = (TClonesArray*) manager->GetObject("StsTrack");
40 if (fStsTracks == nullptr) LOG(fatal) << "CbmRichTrackExtrapolationKF::Init(): No StsTrack array.";
41}
42
43void CbmRichTrackExtrapolationKF::DoExtrapolation(CbmEvent* event, TClonesArray* globalTracks,
44 TClonesArray* extrapolatedTrackParams, double z)
45{
46 if (extrapolatedTrackParams == nullptr) {
47 LOG(error) << "CbmRichTrackExtrapolationKF::DoExtrapolation(): extrapolatedTrackParams is nullptr.";
48 return;
49 }
50
51 if (globalTracks == nullptr) {
52 LOG(error) << "CbmRichTrackExtrapolationKF::DoExtrapolation(): globalTracks is nullptr.";
53 return;
54 }
55
56 TMatrixFSym covMat(5);
57 for (Int_t i = 0; i < 5; i++)
58 for (Int_t j = 0; j <= i; j++)
59 covMat(i, j) = 0;
60 covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) = 1.e-4;
61
62 TVector3 pos, mom;
63 Int_t nofGlobalTracks = event ? event->GetNofData(ECbmDataType::kGlobalTrack) : globalTracks->GetEntriesFast();
64 for (Int_t iT0 = 0; iT0 < nofGlobalTracks; iT0++) {
65 Int_t iT = event ? event->GetIndex(ECbmDataType::kGlobalTrack, iT0) : iT0;
66 CbmGlobalTrack* gTrack = static_cast<CbmGlobalTrack*>(globalTracks->At(iT));
67 new ((*extrapolatedTrackParams)[iT]) FairTrackParam(0., 0., 0., 0., 0., 0., covMat);
68 if (event != nullptr) event->AddData(ECbmDataType::kRichTrackParamZ, iT);
69
70 Int_t stsInd = gTrack->GetStsTrackIndex();
71 if (stsInd < 0) continue;
72 CbmStsTrack* stsTrack = static_cast<CbmStsTrack*>(fStsTracks->At(stsInd));
73 if (stsTrack == nullptr) continue;
75 FairTrackParam ExTrack;
76
77 KF.Extrapolate(stsTrack, z, &ExTrack);
78
79 *(FairTrackParam*) (extrapolatedTrackParams->At(iT)) = ExTrack;
80 }
81}
"TrackExtrapolation" from STS tracks (Kalman Fitter) It reads the track array form STS and extrapolat...
Data class for STS tracks.
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
int32_t GetStsTrackIndex() const
virtual void Init()
Inherited from CbmRichTrackExtrapolationBase.
virtual void DoExtrapolation(CbmEvent *event, TClonesArray *globalTracks, TClonesArray *extrapolatedTrackParams, double z)
Inherited from CbmRichTrackExtrapolationBase.
CbmRichTrackExtrapolationKF()
Default constructor.
void Extrapolate(CbmStsTrack *track, Double_t z, FairTrackParam *e_track)