CbmRoot
Loading...
Searching...
No Matches
CbmRichTrackExtrapolationLittrack.cxx
Go to the documentation of this file.
1/* Copyright (C) 2016-2021 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer], Semen Lebedev */
4
12
13#include "CbmEvent.h"
14#include "CbmGlobalTrack.h"
16#include "CbmLitToolFactory.h"
17#include "CbmStsTrack.h"
18#include "FairRootManager.h"
19#include "FairTrackParam.h"
20#include "TClonesArray.h"
21#include "TMatrixFSym.h"
23
24#include <Logger.h>
25
26#include <iostream>
27
28using std::cout;
29using std::endl;
30
32
34
36{
37 FairRootManager* manager = FairRootManager::Instance();
38 if (manager == nullptr) LOG(fatal) << "CbmRichTrackExtrapolationLittrack::Init(): FairRootManager is nullptr.";
39
40 fStsTracks = (TClonesArray*) manager->GetObject("StsTrack");
41 if (fStsTracks == nullptr) LOG(fatal) << "CbmRichTrackExtrapolationLittrack::Init(): No StsTrack array.";
42
44}
45
46void CbmRichTrackExtrapolationLittrack::DoExtrapolation(CbmEvent* event, TClonesArray* globalTracks,
47 TClonesArray* extrapolatedTrackParams, double z)
48{
49 if (extrapolatedTrackParams == nullptr) {
50 LOG(error) << "CbmRichTrackExtrapolationLittrack::DoExtrapolation(): extrapolatedTrackParams is nullptr.";
51 return;
52 }
53
54 if (globalTracks == nullptr) {
55 LOG(error) << "CbmRichTrackExtrapolationLittrack::DoExtrapolation(): globalTracks is nullptr.";
56 return;
57 }
58
59 TMatrixFSym covMat(5);
60 for (Int_t i = 0; i < 5; i++)
61 for (Int_t j = 0; j <= i; j++)
62 covMat(i, j) = 0;
63 covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) = 1.e-4;
64
65 Int_t nofGlobalTracks = event ? event->GetNofData(ECbmDataType::kGlobalTrack) : globalTracks->GetEntriesFast();
66 for (Int_t iT0 = 0; iT0 < nofGlobalTracks; iT0++) {
67 Int_t iT = event ? event->GetIndex(ECbmDataType::kGlobalTrack, iT0) : iT0;
68 CbmGlobalTrack* gTrack = static_cast<CbmGlobalTrack*>(globalTracks->At(iT));
69 new ((*extrapolatedTrackParams)[iT]) FairTrackParam(0., 0., 0., 0., 0., 0., covMat);
70 if (event != nullptr) event->AddData(ECbmDataType::kRichTrackParamZ, iT);
71
72 Int_t stsInd = gTrack->GetStsTrackIndex();
73 if (stsInd < 0) continue;
74 CbmStsTrack* stsTrack = static_cast<CbmStsTrack*>(fStsTracks->At(stsInd));
75 if (stsTrack == nullptr) continue;
76
77 CbmLitTrackParam litInParam, litOutParam;
79 std::vector<litfloat> F(36, 0.);
80 litfloat length = 0;
81
82 fLitPropagator->Propagate(&litInParam, &litOutParam, z, 11, &F, &length);
83
84 FairTrackParam outParam(0., 0., 0., 0., 0., 0., covMat);
86
87 *(FairTrackParam*) (extrapolatedTrackParams->At(iT)) = outParam;
88 }
89}
double litfloat
Definition CbmLitFloat.h:19
Tool factory for creation of littrack algorithms.
"TrackExtrapolation" from STS tracks based on Littrack. It reads the track array form STS and extrapo...
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
static void FairTrackParamToCbmLitTrackParam(const FairTrackParam *par, CbmLitTrackParam *litPar)
static void CbmLitTrackParamToFairTrackParam(const CbmLitTrackParam *litPar, FairTrackParam *par)
static TrackPropagatorPtr CreateTrackPropagator(const string &name)
Create track propagation tool by name.
Data class for track parameters.
virtual void Init()
Inherited from CbmRichTrackExtrapolationBase.
virtual void DoExtrapolation(CbmEvent *event, TClonesArray *globalTracks, TClonesArray *extrapolatedTrackParams, double z)
Inherited from CbmRichTrackExtrapolationBase.
const FairTrackParam * GetParamLast() const
Definition CbmTrack.h:69