CbmRoot
CbmGlobalTrackFitterIdeal.cxx
Go to the documentation of this file.
1 // ------------------------------------------------------------------
2 // ----- CbmGlobalTrackFitterIdeal -----
3 // ----- Created 07/03/2006 by D.Kresan -----
4 // ------------------------------------------------------------------
6 
7 #include "CbmGlobalTrack.h"
8 
9 #include "CbmStsTrack.h"
10 #include "CbmTrdTrack.h"
11 #include "FairRootManager.h"
12 
13 #include "TClonesArray.h"
14 
15 #include <iostream>
16 
17 using std::cout;
18 using std::endl;
19 
20 //___________________________________________________________________
21 //
22 // CbmGlobalTrackFitterIdeal
23 //
24 // Concrete implementation of the global track fitting algorithm, ba-
25 // sed on the MC information
26 //
27 
28 
29 // ------------------------------------------------------------------
31  : CbmGlobalTrackFitter(), fArrayStsTrack(NULL), fArrayTrdTrack(NULL) {}
32 // ------------------------------------------------------------------
33 
34 
35 // ------------------------------------------------------------------
37  // Destructor
38 }
39 // ------------------------------------------------------------------
40 
41 
42 // ------------------------------------------------------------------
44  // Initialisation
45 
46  // Get pointer to the ROOT I/O manager
47  FairRootManager* rootMgr = FairRootManager::Instance();
48  if (NULL == rootMgr) {
49  cout << "-E- CbmGlobalTrackFitterIdeal::Init :"
50  << " ROOT manager is not instantiated" << endl;
51  return;
52  }
53  // Get track arrays
54  fArrayStsTrack = (TClonesArray*) rootMgr->GetObject("StsTrack");
55  if (NULL == fArrayStsTrack) {
56  cout << "-W- CbmGlobalTrackFitterIdeal::Init : "
57  << "no STS track array!" << endl;
58  }
59  fArrayTrdTrack = (TClonesArray*) rootMgr->GetObject("TrdTrack");
60  if (NULL == fArrayTrdTrack) {
61  cout << "-W- CbmGlobalTrackFitterIdeal::Init : "
62  << "no TRD track array!" << endl;
63  }
64 }
65 // ------------------------------------------------------------------
66 
67 
68 // ------------------------------------------------------------------
70  // Implementation of the algorithm
71  if (NULL == glbTrack) return;
72  if (NULL == fArrayStsTrack || NULL == fArrayTrdTrack) return;
73 
74  if (glbTrack->GetStsTrackIndex() < 0 && glbTrack->GetTrdTrackIndex() < 0) {
75  return;
76  } else if (glbTrack->GetStsTrackIndex() >= 0
77  && glbTrack->GetTrdTrackIndex() < 0) {
78  CbmStsTrack* stsTrack =
79  (CbmStsTrack*) fArrayStsTrack->At(glbTrack->GetStsTrackIndex());
80  if (NULL == stsTrack) { return; }
81  glbTrack->SetParamFirst(stsTrack->GetParamFirst());
82  glbTrack->SetParamLast(stsTrack->GetParamLast());
83  } else if (glbTrack->GetStsTrackIndex() < 0
84  && glbTrack->GetTrdTrackIndex() >= 0) {
85  CbmTrdTrack* trdTrack =
86  (CbmTrdTrack*) fArrayTrdTrack->At(glbTrack->GetTrdTrackIndex());
87  if (NULL == trdTrack) { return; }
88  glbTrack->SetParamFirst(trdTrack->GetParamFirst());
89  glbTrack->SetParamLast(trdTrack->GetParamLast());
90  } else {
91  CbmStsTrack* stsTrack =
92  (CbmStsTrack*) fArrayStsTrack->At(glbTrack->GetStsTrackIndex());
93  if (NULL == stsTrack) { return; }
94  CbmTrdTrack* trdTrack =
95  (CbmTrdTrack*) fArrayTrdTrack->At(glbTrack->GetTrdTrackIndex());
96  if (NULL == trdTrack) { return; }
97  glbTrack->SetParamFirst(stsTrack->GetParamFirst());
98  glbTrack->SetParamLast(trdTrack->GetParamLast());
99  }
100 }
101 // ------------------------------------------------------------------
102 
103 
CbmGlobalTrackFitterIdeal
Definition: CbmGlobalTrackFitterIdeal.h:13
CbmTrack::GetParamLast
const FairTrackParam * GetParamLast() const
Definition: CbmTrack.h:62
CbmGlobalTrack::SetParamLast
void SetParamLast(const FairTrackParam *parLast)
Definition: CbmGlobalTrack.h:62
rootMgr
static FairRootManager * rootMgr
Definition: CbmDeviceHitBuilderTof.cxx:72
CbmGlobalTrackFitterIdeal::~CbmGlobalTrackFitterIdeal
virtual ~CbmGlobalTrackFitterIdeal()
Definition: CbmGlobalTrackFitterIdeal.cxx:36
CbmGlobalTrack.h
CbmGlobalTrackFitterIdeal::DoFit
void DoFit(CbmGlobalTrack *glbTrack)
Definition: CbmGlobalTrackFitterIdeal.cxx:69
CbmGlobalTrackFitterIdeal.h
CbmStsTrack.h
Data class for STS tracks.
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmGlobalTrackFitterIdeal::fArrayStsTrack
TClonesArray * fArrayStsTrack
Definition: CbmGlobalTrackFitterIdeal.h:16
CbmGlobalTrack::GetTrdTrackIndex
Int_t GetTrdTrackIndex() const
Definition: CbmGlobalTrack.h:39
CbmTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmTrack.h:61
CbmGlobalTrackFitterIdeal::CbmGlobalTrackFitterIdeal
CbmGlobalTrackFitterIdeal()
Definition: CbmGlobalTrackFitterIdeal.cxx:30
CbmTrdTrack
Definition: CbmTrdTrack.h:22
ClassImp
ClassImp(CbmGlobalTrackFitterIdeal)
CbmGlobalTrackFitterIdeal::Init
void Init()
Definition: CbmGlobalTrackFitterIdeal.cxx:43
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmGlobalTrack::SetParamFirst
void SetParamFirst(const FairTrackParam *parFirst)
Definition: CbmGlobalTrack.h:59
CbmGlobalTrackFitterIdeal::fArrayTrdTrack
TClonesArray * fArrayTrdTrack
Definition: CbmGlobalTrackFitterIdeal.h:17
CbmTrdTrack.h
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmGlobalTrackFitter
Definition: CbmGlobalTrackFitter.h:13