CbmRoot
CbmRichTrackExtrapolationKF.cxx
Go to the documentation of this file.
1 
8 
9 #include "CbmStsKFTrackFitter.h"
10 
11 #include "CbmGlobalTrack.h"
12 #include "CbmStsTrack.h"
13 #include "FairRootManager.h"
14 #include "FairTrackParam.h"
15 
16 #include "TClonesArray.h"
17 #include "TMatrixFSym.h"
18 
19 #include <iostream>
20 
21 using std::cout;
22 using std::endl;
23 
25 
27 
29  FairRootManager* ioman = FairRootManager::Instance();
30  if (NULL == ioman) {
31  Fatal("CbmRichTrackExtrapolationKF::Init", "RootManager not instantised!");
32  }
33 
34  fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
35  if (NULL == fStsTracks) {
36  Fatal("CbmRichTrackExtrapolationKF::Init", "No StsTrack array!");
37  }
38 }
39 
41  TClonesArray* globalTracks,
42  TClonesArray* extrapolatedTrackParams,
43  double z) {
44  if (NULL == extrapolatedTrackParams) {
45  cout << "-E- CbmRichTrackExtrapolationKF::DoExtrapolate: TrackParamArray "
46  "missing!"
47  << endl;
48  return;
49  }
50 
51  if (NULL == globalTracks) {
52  cout
53  << "-E- CbmRichTrackExtrapolationKF::DoExtrapolate: Track Array missing!"
54  << endl;
55  return;
56  }
57 
58  TMatrixFSym covMat(5);
59  for (Int_t i = 0; i < 5; i++)
60  for (Int_t j = 0; j <= i; j++)
61  covMat(i, j) = 0;
62  covMat(0, 0) = covMat(1, 1) = covMat(2, 2) = covMat(3, 3) = covMat(4, 4) =
63  1.e-4;
64 
65  TVector3 pos, mom;
66 
67  Int_t nTracks = globalTracks->GetEntriesFast();
68  cout << "bmRichTrackExtrapolationKF nofGlobalTracks:" << nTracks << endl;
69  for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
70  CbmGlobalTrack* gTrack = (CbmGlobalTrack*) globalTracks->At(iTrack);
71  new ((*extrapolatedTrackParams)[iTrack])
72  FairTrackParam(0., 0., 0., 0., 0., 0., covMat);
73  Int_t idSTS = gTrack->GetStsTrackIndex();
74  if (idSTS < 0) continue;
75  CbmStsTrack* pSTStr = (CbmStsTrack*) fStsTracks->At(idSTS);
76  if (NULL == pSTStr) continue;
78  FairTrackParam ExTrack;
79 
80  KF.Extrapolate(pSTStr, z, &ExTrack);
81 
82  *(FairTrackParam*) (extrapolatedTrackParams->At(iTrack)) = ExTrack;
83  }
84 }
CbmStsKFTrackFitter::Extrapolate
void Extrapolate(CbmStsTrack *track, Double_t z, FairTrackParam *e_track)
Definition: CbmStsKFTrackFitter.cxx:134
CbmRichTrackExtrapolationKF::DoExtrapolation
virtual void DoExtrapolation(TClonesArray *globalTracks, TClonesArray *extrapolatedTrackParams, double z)
Inherited from CbmRichTrackExtrapolationBase.
Definition: CbmRichTrackExtrapolationKF.cxx:40
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmGlobalTrack.h
CbmStsTrack.h
Data class for STS tracks.
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmStsKFTrackFitter
Definition: CbmStsKFTrackFitter.h:14
CbmRichTrackExtrapolationKF.h
"TrackExtrapolation" from STS tracks (Kalman Fitter) It reads the track array form STS and extrapolat...
CbmRichTrackExtrapolationKF::fStsTracks
TClonesArray * fStsTracks
Definition: CbmRichTrackExtrapolationKF.h:54
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmRichTrackExtrapolationKF::Init
virtual void Init()
Inherited from CbmRichTrackExtrapolationBase.
Definition: CbmRichTrackExtrapolationKF.cxx:28
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmRichTrackExtrapolationKF::~CbmRichTrackExtrapolationKF
virtual ~CbmRichTrackExtrapolationKF()
Destructor.
Definition: CbmRichTrackExtrapolationKF.cxx:26
CbmStsKFTrackFitter.h
CbmRichTrackExtrapolationKF::CbmRichTrackExtrapolationKF
CbmRichTrackExtrapolationKF()
Default constructor.
Definition: CbmRichTrackExtrapolationKF.cxx:24