CbmRoot
Loading...
Searching...
No Matches
CbmGlobalTrackFitterIdeal.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2012 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dmytro Kresan, Denis Bertini [committer], Florian Uhlig */
4
5// ------------------------------------------------------------------
6// ----- CbmGlobalTrackFitterIdeal -----
7// ----- Created 07/03/2006 by D.Kresan -----
8// ------------------------------------------------------------------
10
11#include "CbmGlobalTrack.h"
12#include "CbmStsTrack.h"
13#include "CbmTrdTrack.h"
14#include "FairRootManager.h"
15#include "TClonesArray.h"
16
17#include <iostream>
18
19using std::cout;
20using std::endl;
21
22//___________________________________________________________________
23//
24// CbmGlobalTrackFitterIdeal
25//
26// Concrete implementation of the global track fitting algorithm, ba-
27// sed on the MC information
28//
29
30
31// ------------------------------------------------------------------
34 , fArrayStsTrack(NULL)
35 , fArrayTrdTrack(NULL)
36{
37}
38// ------------------------------------------------------------------
39
40
41// ------------------------------------------------------------------
46// ------------------------------------------------------------------
47
48
49// ------------------------------------------------------------------
51{
52 // Initialisation
53
54 // Get pointer to the ROOT I/O manager
55 FairRootManager* rootMgr = FairRootManager::Instance();
56 if (NULL == rootMgr) {
57 cout << "-E- CbmGlobalTrackFitterIdeal::Init :"
58 << " ROOT manager is not instantiated" << endl;
59 return;
60 }
61 // Get track arrays
62 fArrayStsTrack = (TClonesArray*) rootMgr->GetObject("StsTrack");
63 if (NULL == fArrayStsTrack) {
64 cout << "-W- CbmGlobalTrackFitterIdeal::Init : "
65 << "no STS track array!" << endl;
66 }
67 fArrayTrdTrack = (TClonesArray*) rootMgr->GetObject("TrdTrack");
68 if (NULL == fArrayTrdTrack) {
69 cout << "-W- CbmGlobalTrackFitterIdeal::Init : "
70 << "no TRD track array!" << endl;
71 }
72}
73// ------------------------------------------------------------------
74
75
76// ------------------------------------------------------------------
78{
79 // Implementation of the algorithm
80 if (NULL == glbTrack) return;
81 if (NULL == fArrayStsTrack || NULL == fArrayTrdTrack) return;
82
83 if (glbTrack->GetStsTrackIndex() < 0 && glbTrack->GetTrdTrackIndex() < 0) {
84 return;
85 }
86 else if (glbTrack->GetStsTrackIndex() >= 0 && glbTrack->GetTrdTrackIndex() < 0) {
87 CbmStsTrack* stsTrack = (CbmStsTrack*) fArrayStsTrack->At(glbTrack->GetStsTrackIndex());
88 if (NULL == stsTrack) {
89 return;
90 }
91 glbTrack->SetParamFirst(stsTrack->GetParamFirst());
92 glbTrack->SetParamLast(stsTrack->GetParamLast());
93 }
94 else if (glbTrack->GetStsTrackIndex() < 0 && glbTrack->GetTrdTrackIndex() >= 0) {
95 CbmTrdTrack* trdTrack = (CbmTrdTrack*) fArrayTrdTrack->At(glbTrack->GetTrdTrackIndex());
96 if (NULL == trdTrack) {
97 return;
98 }
99 glbTrack->SetParamFirst(trdTrack->GetParamFirst());
100 glbTrack->SetParamLast(trdTrack->GetParamLast());
101 }
102 else {
103 CbmStsTrack* stsTrack = (CbmStsTrack*) fArrayStsTrack->At(glbTrack->GetStsTrackIndex());
104 if (NULL == stsTrack) {
105 return;
106 }
107 CbmTrdTrack* trdTrack = (CbmTrdTrack*) fArrayTrdTrack->At(glbTrack->GetTrdTrackIndex());
108 if (NULL == trdTrack) {
109 return;
110 }
111 glbTrack->SetParamFirst(stsTrack->GetParamFirst());
112 glbTrack->SetParamLast(trdTrack->GetParamLast());
113 }
114}
115// ------------------------------------------------------------------
116
117
static FairRootManager * rootMgr
ClassImp(CbmGlobalTrackFitterIdeal)
Data class for STS tracks.
void DoFit(CbmGlobalTrack *glbTrack)
void SetParamLast(const FairTrackParam *parLast)
int32_t GetStsTrackIndex() const
void SetParamFirst(const FairTrackParam *parFirst)
int32_t GetTrdTrackIndex() const
const FairTrackParam * GetParamLast() const
Definition CbmTrack.h:69
const FairTrackParam * GetParamFirst() const
Definition CbmTrack.h:68